Source Code HackProcess.h for CSGO supports server.dll

  • CSGO recently moved logic from 'client_panorama.dll' to 'client.dll', you must update all code that uses 'client_panorama.dll' and replace it with 'client.dll' or the code will not work.
Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

fdsasdf

Newbie
Mar 1, 2014
1
102
0
Here is a version of HackProcess.h modified so that works for CS:GO. It supports server.dll, which seems to be where the static address for the number of players in the game is located in.

HackProcess.h :
C++:
#pragma once

#include <Windows.h>
#include <TlHelp32.h>

//THIS FILE SIMPLY DOES MOST OF THE BACKEND WORK FOR US, 
//FROM FINDING THE PROCESS TO SETTING UP CORRECT ACCESS FOR US 
//TO EDIT MEMORY 
//IN MOST GAMES, A SIMPLER VERSION OF THIS CAN BE USED, or if you're injecting then its often not necessary
//This file has been online for quite a while so credits should be shared but im using this from NubTIK
//So Credits to him and thanks

class CHackProcess
{
public:

	PROCESSENTRY32 __gameProcess;
	HANDLE __HandleProcess;
	HWND __HWNDCsgo; 
	DWORD __dwordClient;
	DWORD __dwordEngine;
	DWORD __dwordOverlay;
	DWORD __dwordVGui;
	DWORD __dwordServer;
	DWORD __dwordLibCef;
	DWORD __dwordSteam; 
	DWORD FindProcessName(const char *__ProcessName, PROCESSENTRY32 *pEntry)
	{	 
		PROCESSENTRY32 __ProcessEntry;
		__ProcessEntry.dwSize = sizeof(PROCESSENTRY32);
		HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
		if (hSnapshot == INVALID_HANDLE_VALUE) return 0;        if (!Process32First(hSnapshot, &__ProcessEntry))
		{
			CloseHandle(hSnapshot);
			return 0;
		}
		do{if (!_strcmpi(__ProcessEntry.szExeFile, __ProcessName))
		{
			memcpy((void *)pEntry, (void *)&__ProcessEntry, sizeof(PROCESSENTRY32));
			CloseHandle(hSnapshot);
			return __ProcessEntry.th32ProcessID;
		}} while (Process32Next(hSnapshot, &__ProcessEntry));
		CloseHandle(hSnapshot);
        return 0;
	}

	DWORD getThreadByProcess(DWORD __DwordProcess)
	{	 
			THREADENTRY32 __ThreadEntry;
			__ThreadEntry.dwSize = sizeof(THREADENTRY32);
			HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
			if (hSnapshot == INVALID_HANDLE_VALUE) return 0;

			if (!Thread32First(hSnapshot, &__ThreadEntry)) {CloseHandle(hSnapshot); return 0; }

			do {if (__ThreadEntry.th32OwnerProcessID == __DwordProcess)
			{
				CloseHandle(hSnapshot);
				return __ThreadEntry.th32ThreadID;
			}} while (Thread32Next(hSnapshot, &__ThreadEntry)); 
			CloseHandle(hSnapshot);       
			return 0;
	}

	DWORD GetModuleNamePointer(LPSTR LPSTRModuleName, DWORD __DwordProcessId)
	{ 
			MODULEENTRY32 lpModuleEntry = {0};
			HANDLE hSnapShot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, __DwordProcessId);
			if(!hSnapShot)
				return NULL;  
			lpModuleEntry.dwSize = sizeof(lpModuleEntry);
			BOOL __RunModule = Module32First( hSnapShot, &lpModuleEntry );
			while(__RunModule)
			{
				if(!strcmp(lpModuleEntry.szModule, LPSTRModuleName ) )
				{CloseHandle( hSnapShot );
				return (DWORD)lpModuleEntry.modBaseAddr;
				}
				__RunModule = Module32Next( hSnapShot, &lpModuleEntry );
			}
			CloseHandle( hSnapShot );
			return NULL;
	}

	void runSetDebugPrivs() 
	{
		HANDLE __HandleProcess=GetCurrentProcess(), __HandleToken;
		TOKEN_PRIVILEGES priv;
		LUID __LUID; 
		OpenProcessToken(__HandleProcess, TOKEN_ADJUST_PRIVILEGES, &__HandleToken);
		LookupPrivilegeValue(0, "seDebugPrivilege", &__LUID);
		priv.PrivilegeCount = 1;
		priv.Privileges[0].Luid = __LUID;
		priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
		AdjustTokenPrivileges(__HandleToken, false, &priv, 0, 0, 0);
		CloseHandle(__HandleToken);
		CloseHandle(__HandleProcess);
	}
	
	void RunProcess()
	{
		//commented lines are for non steam versions of the game
		runSetDebugPrivs();
		while (!FindProcessName("csgo.exe", &__gameProcess)) Sleep(12);
		while (!(getThreadByProcess(__gameProcess.th32ProcessID))) Sleep(12);
		__HandleProcess = OpenProcess(PROCESS_ALL_ACCESS, false, __gameProcess.th32ProcessID); 
		while(__dwordClient == 0x0) __dwordClient = GetModuleNamePointer("client.dll", __gameProcess.th32ProcessID);
		while(__dwordEngine == 0x0) __dwordEngine = GetModuleNamePointer("engine.dll", __gameProcess.th32ProcessID);
		while(__dwordVGui == 0x0) __dwordVGui = GetModuleNamePointer("vguimatsurface.dll", __gameProcess.th32ProcessID);
		while(__dwordServer == 0x0)__dwordServer = GetModuleNamePointer("server.dll", __gameProcess.th32ProcessID);
		__HWNDCsgo = FindWindow(NULL, "Counter-Strike: Global Offensive"); 
	}
};

extern CHackProcess fProcess;
I hope you guys enjoyed this HackProcess.h file :)
 

VitexHD

Newbie
Full Member
Nobleman
Aug 23, 2017
93
478
2
There's a good reason I'm starting to dislike C++. The reason being is this: argument of type "const char*" is incompatible with parameter of type "LPSTR".

Honestly though, there is no reason for this. I've tried all the character sets. Any reason for this and how to fix this issue? Thanks.
 

Kinvaras

Full Member
Nobleman
Dec 18, 2017
99
528
10
There's a good reason I'm starting to dislike C++. The reason being is this: argument of type "const char*" is incompatible with parameter of type "LPSTR".

Honestly though, there is no reason for this. I've tried all the character sets. Any reason for this and how to fix this issue? Thanks.
While starting my hacking in c++ new hobby, i also came across that error.

I have to say, there IS a good reason for it. c++ gives you freedom to do whatever the fuck you want, but that comes at a price.
While c# hands you his hand and takes you across the road, c++ will blind fold you, turn you around 10 times and then say "cross the street now, i dare you!".

Now, that error is because of your project settings, you probably have it in non unicode, and are trying to pass a non unicode string to a unicode method (or the other way around).

What i do is, set my project to unicode, and when c++ complains about "mystringhere", i just replace it with L"mystringhere".
 

VitexHD

Newbie
Full Member
Nobleman
Aug 23, 2017
93
478
2
While starting my hacking in c++ new hobby, i also came across that error.

I have to say, there IS a good reason for it. c++ gives you freedom to do whatever the fuck you want, but that comes at a price.
While c# hands you his hand and takes you across the road, c++ will blind fold you, turn you around 10 times and then say "cross the street now, i dare you!".

Now, that error is because of your project settings, you probably have it in non unicode, and are trying to pass a non unicode string to a unicode method (or the other way around).

What i do is, set my project to unicode, and when c++ complains about "mystringhere", i just replace it with L"mystringhere".
Yea, I used '_T(x)' but it's the same thing. There's also the '__ProcessEntry.szExeFile' which returns the error also. Not sure how to fix that one.
Before that, I only got the errors with the 'GetModuleNamePointer('name.dll', x)' until I changed the 'Conformance Mode' in 'Project Properties -> C/C++ -> Language' to 'No'. But then I got the error for 'FindWindow(x, y);

I wish things were simpler :> I might try FindWindowA but still, it shouldn't be this difficult.
 

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
There's a good reason I'm starting to dislike C++. The reason being is this: argument of type "const char*" is incompatible with parameter of type "LPSTR".

Honestly though, there is no reason for this. I've tried all the character sets. Any reason for this and how to fix this issue? Thanks.
const char vs. non-const char. There're very good reasons for why you can't pass a const char * as a non const char *. If you could the const keyword would be pointless. This has nothing to do with UNICODE/ANSI.
 

Kinvaras

Full Member
Nobleman
Dec 18, 2017
99
528
10
If it has nothing to do with unicode/ansi, then c++ turned me around 15 times instead of 10 xD

c++ is funny, we get all these weird errors, that give "no information" about how to solve it. but then i google my error and find a guy saying "oh, that's because in line 1023 of your main class, your doing this and that wrong". haha

apparently the info is there, i just cant read it.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,153
78,998
2,396
Anyone else notice before VS2017 you could send non-const strings but with VS2017 more strictly following C++ standards you are now forced to do it correctly? or am I crazy? There's a bunch more strict string stuff set as default in the project properties than before...
 
Mar 24, 2018
1
4
0
While starting my hacking in c++ new hobby, i also came across that error.

I have to say, there IS a good reason for it. c++ gives you freedom to do whatever the fuck you want, but that comes at a price.
While c# hands you his hand and takes you across the road, c++ will blind fold you, turn you around 10 times and then say "cross the street now, i dare you!".

Now, that error is because of your project settings, you probably have it in non unicode, and are trying to pass a non unicode string to a unicode method (or the other way around).

What i do is, set my project to unicode, and when c++ complains about "mystringhere", i just replace it with L"mystringhere".
I set my project to unicode but it give me error
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,153
78,998
2,396
I set my project to unicode but it give me error
All of fleeps source code was for multi byte char set, not Unicode. If you wanna use Unicode, you must change the code and put L in front of string literals like L"string".

Also in vs2017 they started setting stricter c++ conformance standards as the default option, you can disable them if you must. More reading @ VS 2017 Doesn't Implicitly Convert const char* to char*
 

HACKEDHACKER

Mambda
Fleep Tier Donator
Nobleman
Mar 5, 2014
83
2,208
6
const vs non-const actually have 0 difference when you compile it. It is just a flag that stop you from editing a const variable. Hence if you want to pass it, just cast it. Make no difference. Not a great practice, but hey - you don't even know why you can't pass a non-const to a const param.
 
Sep 2, 2018
4
14
0
Can i ask something, and this is related to c++ in general. Why are the function bodies in the header file and not in a separate .cpp file? Cause as far as i know, header files only contain variable definitions and function titles. Thanks in advance.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,153
78,998
2,396
because this was coded a long time ago by someone that was still learning to code correctly, and maybe he only wanted people to need 1 file
 

Lukor

ded
Meme Tier VIP
Fleep Tier Donator
Dec 13, 2013
492
5,353
25
EDIT: OMG, why does this get revived?
 
Last edited:
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods