Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get the process's DLL module address?

How to get the process's DLL module address?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SetHookCurrent
    wrote on last edited by
    #1

    How to get the process's DLL module address? And How to get process imagebase?

    L S G 3 Replies Last reply
    0
    • S SetHookCurrent

      How to get the process's DLL module address? And How to get process imagebase?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It's not clear exactly what your problem is but you may want to start with GetModuleHandleEx()[^].

      Use the best guess

      1 Reply Last reply
      0
      • S SetHookCurrent

        How to get the process's DLL module address? And How to get process imagebase?

        S Offline
        S Offline
        Santhosh G_
        wrote on last edited by
        #3

        Enumerating all modules in a process can be done by EnumProcessModules(). Here is an example of enumerating all modules in a process and displaying its names. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682621(v=vs.85).aspx Load address of each modules can be retrieved by calling GetModuleInformation() for each modules. lpBaseOfDll of MODULEINFO holds the load address of the corresponding module. BOOL WINAPI GetModuleInformation( __in HANDLE hProcess, __in HMODULE hModule, __out LPMODULEINFO lpmodinfo, __in DWORD cb );

        1 Reply Last reply
        0
        • S SetHookCurrent

          How to get the process's DLL module address? And How to get process imagebase?

          G Offline
          G Offline
          Ghosuwa Wogomon
          wrote on last edited by
          #4

          HMODULE hMod = LoadLibrary("mydll.dll"); // load library
          if (hMod) {
          void (*)() myfn = (void (*)())GetProcAddress(hMod, "myfn"); // initialize pointer to myfn function inside dll
          if (myfn) myfn(); // call it if it exists
          FreeLibrary(hMod); // free the library
          }

          EDIT: Wasn't exactly sure what you're asking...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups