CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    7

    GetModuleHandle? ... or somehing?

    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...

    Code:
    #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.

  2. #2
    Join Date
    May 2005
    Posts
    4,954

    Re: GetModuleHandle? ... or somehing?

    Thats becasue you are using different process, read the msdn:

    Quote Originally Posted by 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
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  3. #3
    Join Date
    Dec 2008
    Posts
    114

    Re: GetModuleHandle? ... or somehing?

    Don't use GetModuleHandle(), but the other one...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured