Skip to content

Instantly share code, notes, and snippets.

@xophiix
Created March 11, 2013 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xophiix/5131322 to your computer and use it in GitHub Desktop.
Save xophiix/5131322 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <windows.h>
#include <Tlhelp32.h.>
using namespace std;
int main()
{
HANDLE h= CreateToolhelp32Snapshot(8, 780);
MODULEENTRY32 me;
int ret = Module32First(h, &me);
while (ret)
{
printf("%p\t\%s\n", me.modBaseAddr, me.szModule);
ret = Module32Next(h, &me);
}
CloseHandle(h);
return 0;
}
@vcorp
Copy link

vcorp commented Sep 15, 2014

Hello i'm using your code with some modification and work well.
how can we get the dll loaded from a process.exe modbaseaddr?

@divinity76
Copy link

warning, you should do me.dwSize = sizeof(MODULEENTRY32);

and on my system, if i don't do it, Module32First will just return false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment