Click to See Complete Forum and Search --> : GetModuleHandle? ... or somehing?


Zinefer
May 2nd, 2009, 03:04 PM
I have some pointer addresses given to me by CheatEngine, but they look like this:

Game.dll+Offset

I tried using a code like this to get the handle of the dll, and apply the offset...


#include "stdafx.h"
#include <windows.h>
#include <stdio.h>

int main()
{
HMODULE module_handle;
module_handle = GetModuleHandle(_T("Game.dll"));
printf("handle = %d", module_handle);

return 0;
}

But it just returns 0... I know i am doing something stupid wrong, but could someone please help me out? Thanks.

golanshahar
May 3rd, 2009, 11:39 PM
Thats becasue you are using different process, read the msdn:


This function returns a module handle for the specified module if the file is mapped into the address space of the calling process


Cheers

carl666
May 5th, 2009, 04:09 AM
Don't use GetModuleHandle(), but the other one...