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;
}