- IPC Uses PID to identify the process

- Exception code now shows in hex capitals
- Fixed version checking and bumped the version support
- Added process blacklist for already injected game detection
- Used std::all_of instead of std::string::find for digit checks
This commit is contained in:
Anonymous275
2022-07-25 17:09:42 +03:00
parent d7d1a550cb
commit 8f53052356
9 changed files with 74 additions and 49 deletions

View File

@@ -11,8 +11,7 @@
#include <tlhelp32.h>
#include <psapi.h>
uint32_t Memory::GetBeamNGPID() {
uint32_t Memory::GetBeamNGPID(const std::vector<uint32_t>& BL) {
SetLastError(0);
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(PROCESSENTRY32);
@@ -20,7 +19,11 @@ uint32_t Memory::GetBeamNGPID() {
if(Process32First(Snapshot, &pe32)) {
do{
if(std::string("BeamNG.drive.x64.exe") == pe32.szExeFile)break;
if(std::string("BeamNG.drive.x64.exe") == pe32.szExeFile &&
std::find(BL.begin(), BL.end(), pe32.th32ProcessID) == BL.end() &&
std::find(BL.begin(), BL.end(), pe32.th32ParentProcessID) == BL.end()) {
break;
}
}while(Process32Next(Snapshot, &pe32));
}