change your first script into that except putting it at page 3
ah DAMMM!
cant get it to work!!!
my code :
Code:int main() { DWORD pId; while(1) { HWND hWnd = FindWindowA(0, "mhtest"); if(!hWnd) { cout << "Cannot find the window..." << endl; system("cls"); } else { GetWindowThreadProcessId(hWnd, &pId); if(pId != 0) { DWORD mAddress; MODULEENTRY32 mEntry32; HANDLE hSnapMods = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pId); if(Module32First(hSnapMods, &mEntry32) == TRUE) { do { if(strcmp((char *)mEntry32.szModule, "ME Test.exe") == 0) { mAddress = (DWORD)mEntry32.modBaseAddr; cout << mAddress << endl; system("cls"); break; } else { cout << "Can not find the fucking address.." << endl; system("cls"); } } while(Module32Next(hSnapMods, &mEntry32) == TRUE); } } } } return 0; }
A TCHAR is a char... at least with his build it is.
Why are you looping every single process search, module search. etc?
Light travels faster than sound. That's why most people seem bright until you hear them speak.
Vou dizer em portugues porque em ingles nao consigo explicar muito bem =/
Eu usei o while porque antes eu estava a manter o valor do address continuamente..Agora coloquei isso para verificar continuamente se a janela continua aberta ou nao etc...
Mas de qualquer forma, nao consigo mesmo pegar o address base, porque o adress que eu quero mudar é 0x19138 , mas precisa ser o adress do programa + 19138 por exemplo: ME Test.exe + 19138, Mas ja tentei e nao consegui pegar adress do ME Test, se eu conseguir isso, vou conseguir editar os adressos sem ter sempre q ir no cheat engine buscar pelo adress correto...
Se pudesses escrever um simples codigo para isso agradecia, só mesmo para o aderesso do programa porque dps sei junta-los...
Obrigado..
When all else fails code your own libraries.
[highlight=cpp]HMODULE hMainModule;
DWORD cb;
#ifdef _M_IX86
EnumProcessModules(pA, hMainModule, 1, &cb);
#else
EnumProcessModulesEx(pA, hMainModule, 1, &cb, LIST_MODULES_ALL);
#endif[/highlight]
The handle is the base address. This works because the first result is always the main module.
Edit:
Actually, this is better for 32 bit on WOW64/64 bit interoperability.
[highlight=cpp]int main()
{
HWND hWnd = FindWindow(0, _T("mhtest"));
if (hWnd == NULL)
{
std::cout << "Cannot find window..." << std::endl;
}
else
{
DWORD pID, dwAddress;
GetWindowThreadProcessId(hWnd, &pID);
if (pID)
{
MODULEENTRY32 m32;
HANDLE hSnapshot;
hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);
if (Module32First(hSnapshot, &m32)
{
dwAddress = reinterpret_cast<DWORD>(m32.modBaseAddr); // or m32.hModule, same thing.
std::cout << std::hex << dwAddress;
}
CloseHandle(hSnapshot);
}
}
return 0;
}[/highlight]
On a side note, use of system() is discouraged.
Last edited by Fovea; 05-19-2011 at 09:01 PM.
Hell_Demon (05-20-2011),Lyoto Machida (05-20-2011),[MPGH]master131 (05-20-2011),Melodia (05-19-2011),Void (05-20-2011)