What's new

Welcome to HvH Forum!

SignUp Now! Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, And More!


SignUp Now!

Source Code simple game version check (for external hacks)

t.me/s1legendirl
Forum Contributor
User ID
20083
Messages
97
Reactions
3,363
Level
39
C++:
std::string processPath;
wchar_t buffer[MAX_PATH];
DWORD size = MAX_PATH;
if (QueryFullProcessImageName(/*cs2 process handle*/, 0, buffer, &size))   
    processPath = WStringToString(buffer);   
else // failed to get process path
    return;

int pos = processPath.rfind("bin");
if (pos != std::string::npos)
    processPath = processPath.substr(0, pos + 3) + "\\built_from_cl.txt";
else // failed to find version file
    return;


std::ifstream file(processPath);
if (file.is_open())
{
    std::string gameVersion;
    std::getline(file, gameVersion);
    file.close();

    if (gameVersion != /*something*/)           
        return;   
}
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Top