Code:
// Credits to DarkstaR
DWORD GetModuleBase(DWORD processID)
{
MODULEENTRY32 moduleEntry = {0};
HANDLE snapShot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processID);
DWORD base = 0;
if(!snapShot)
return 0;
moduleEntry.dwSize = sizeof(moduleEntry);
BOOL currentModule = Module32First(snapShot, &moduleEntry);
if(currentModule)
{
static char hold[1000];
memcpy(hold, moduleEntry.szModule, strlen(moduleEntry.szModule) + 1);
if(std::string(hold).find(".exe") == std::string(hold).size() - 4)
base = (DWORD)moduleEntry.modBaseAddr;
}
CloseHandle(snapShot);
return base;
}
DWORD AlignAddress(DWORD processID, DWORD address)
{
static int base = (int)GetModuleBase(processID);
static int XPBase = 0x400000;
address += (base - XPBase);
return address;
}
Also I'm tired cuz peoples like u...
By the way, I'm 100% sure, that you'll back here, cuz you'll get compiler error
Regards, Czepek!