Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1.     for(int i=0; i<sizeof(pe_byte); i++){
  2.     pe_byte[i] =  pe_byte[i]^(int)XOR_KEY[i%XOR_KEY_SIZE];
  3.   }
  4.   // printf("%c%c\n", pe_byte[0], pe_byte[1]);
  5.   PIMAGE_DOS_HEADER raw_image_base = (PIMAGE_DOS_HEADER)(LPVOID)pe_byte;
  6.   printf("raw_image_base = %X\n", raw_image_base);
  7.   if (IMAGE_DOS_SIGNATURE != raw_image_base->e_magic)
  8.     return 0;
  9.  
  10.   PIMAGE_NT_HEADERS nt_header = (PIMAGE_NT_HEADERS)(raw_image_base->e_lfanew + (LPBYTE)raw_image_base);
  11.   if (IMAGE_NT_SIGNATURE != nt_header->Signature)
  12.             return 0;
  13. printf("nNumberOfSections = %d\n", nt_header->FileHeader.NumberOfSections);
  14. PIMAGE_SECTION_HEADER section_header = (PIMAGE_SECTION_HEADER)(raw_image_base->e_lfanew + sizeof(*nt_header) + (UINT_PTR)raw_image_base);
  15.     for (int i = 0; i < nt_header->FileHeader.NumberOfSections; i++, section_header++) {
  16.         printf("[%s:%d] section_header->VirtualAddress = %X\n", __FILE__, __LINE__, (section_header->VirtualAddress));
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement