Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void remote_listmodules(HANDLE proc, void *_peb)
- {
- void *peb;
- if (_peb == NULL) return;
- else peb = _peb;
- DWORD bytesRead = 0;
- void *ldr = NULL;
- ReadProcessMemory(proc, (void*)((ULONG)peb + 0x0C), ldr, sizeof(ldr), &bytesRead);
- void *flink = NULL;
- ReadProcessMemory(proc, (void*)((ULONG)ldr + 0x14), flink, sizeof(flink), &bytesRead);
- void *cmod = flink;
- void *_BaseAddress = 0;
- void *_BaseDllName = 0;
- void *modulebase = 0;
- do
- {
- ReadProcessMemory(proc, (void*)((ULONG)cmod + 0x10), _BaseAddress, sizeof(_BaseAddress), &bytesRead);
- ReadProcessMemory(proc, (void*)((ULONG)cmod + 0x28), _BaseDllName, sizeof(_BaseDllName), &bytesRead);
- if (_BaseAddress != 0)
- wprintf(L"%s @ 0x%X\n", (WCHAR*)_BaseDllName, (ULONG)_BaseAddress);
- cmod = *((void**)cmod);
- } while (flink != cmod);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement