gavzik

Untitled

Oct 23rd, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Windows.h>
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. char* ImageBase = (char*)GetModuleHandleA(NULL);
  6. DWORD ImageSize = ((PIMAGE_NT_HEADERS)((DWORD64)ImageBase + ((PIMAGE_DOS_HEADER)ImageBase)->e_lfanew))->OptionalHeader.SizeOfImage;
  7.  
  8. for (DWORD i = 0; i < ImageSize; i +=8 ) {
  9. printf("0x%p\t%p\t", ((INT_PTR)ImageBase + i), *(INT_PTR*)((INT_PTR)ImageBase + i));
  10. for (int j = 0; j < 8; j++) {
  11. printf("%c", ImageBase[i+j]);
  12. }
  13. printf("\n");
  14. Sleep(10);
  15. }
  16. return 0;
  17. }
Add Comment
Please, Sign In to add comment