Advertisement
captmicro

Unknown

Oct 20th, 2010
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. void remote_listmodules(HANDLE proc, void *_peb)
  2. {
  3.     void *peb;
  4.     if (_peb == NULL) return;
  5.     else peb = _peb;
  6.  
  7.     void *ldr = *((void**)((unsigned char*)peb + 0x0C));
  8.     void *flink = *((void**)((unsigned char*)ldr + 0x14));
  9.     void *cmod = flink;
  10.     void *_BaseAddress = 0;
  11.     void *_BaseDllName = 0;
  12.     void *modulebase = 0;
  13.     do
  14.     {
  15.         _BaseAddress = *((void**)((unsigned char*)cmod + 0x10));
  16.         _BaseDllName = *((void**)((unsigned char*)cmod + 0x28));
  17.         if (_BaseAddress != 0)
  18.             wprintf(L"%s @ 0x%X\n", (WCHAR*)_BaseDllName, (ULONG)_BaseAddress);
  19.         cmod = *((void**)cmod);
  20.     } while (flink != cmod);
  21.  
  22.     return;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement