Advertisement
captmicro

Unknown

Oct 8th, 2010
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. DWORD _declspec(naked) PEB_kernel32base()
  2. {
  3.     __asm
  4.     {
  5.         push ESI
  6.         MOV ESI, [FS:0x30] //PEB base
  7.         MOV ESI, [ESI + 0x0C] //PEB->Ldr
  8.         MOV ESI, [ESI + 0x1C] //PEB->Ldr.InInitOrder
  9. _kernel32base_next_module:
  10.         CMP [ESI + 0x20 + 0x18], 0 //module_name[12] == 0? (unicode)
  11.         JE _kernel32base_found_module
  12.         MOV ESI, [ESI] //InInitOrder.flink (next module)
  13.         JMP _kernel32base_next_module
  14. _kernel32base_found_module:
  15.         MOV EAX, [ESI + 0x08] //InInitOrder.base_address
  16.         pop ESI
  17.         RET
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement