Hi guys it's me again.
I know how to access pointers from a DLL. But from a trainer this is a first to me. In DLL I use the "GetModuleHandle" function to get the client offset, so I'm trying to do the same here, just differently with the use of the "GetModuleHandleEx" function. But I get an error "Couldn't find module", therefore I need your help.
Code:
void mainP()
{
HWND hWnd = FindWindow(NULL, "Alliance of Valiant Arms");
if (!hWnd)
{
MessageBox(NULL, "Couldn't find AVA window.", "Error", MB_OK | MB_ICONERROR);
return;
}
unsigned long pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION, false, pId);
if (!hProc)
{
MessageBox(NULL, "Couldn't open the process.", "Error", MB_OK | MB_ICONERROR);
return;
}
HMODULE module;
if (GetModuleHandleEx(0, "AVA.exe", &module) == NULL)
ShowErr();
unsigned long dwPointer;
ReadProcessMemory( hProc, (PVOID)0x01BFC478, &dwPointer, 4, 0 );
MessageBox(NULL, "point " + (unsigned long)dwPointer, "Error", MB_OK | MB_ICONERROR);
CloseHandle(hProc);
}