nt!_LDR_DATA_TABLE_ENTRY [AKA: "_LDR_MODULE"]
+0x000 InLoadOrderLinks : _LIST_ENTRY
+0x008 InMemoryOrderLinks : _LIST_ENTRY
+0x010 InInitializationOrderLinks : _LIST_ENTRY ← So EAX was pointing here…
+0x018 DllBase : Ptr32 Void -------------┐ MOV EAX, [EAX+0x8]
[etc.] │
│
┌--------------------------------------------------------┘ MOV EBX, EAX
↓
nt!_IMAGE_DOS_HEADER EBX points here, and is used for all Virtual Address offsets
+0x000 e_magic : Uint2B (usually "MZ")
+0x002 e_cblp : Uint2B
+0x004 e_cp : Uint2B
+0x006 e_crlc : Uint2B
+0x008 e_cparhdr : Uint2B
+0x00a e_minalloc : Uint2B
+0x00c e_maxalloc : Uint2B
+0x00e e_ss : Uint2B
+0x010 e_sp : Uint2B
+0x012 e_csum : Uint2B
+0x014 e_ip : Uint2B
+0x016 e_cs : Uint2B
+0x018 e_lfarlc : Uint2B
+0x01a e_ovno : Uint2B
+0x01c e_res : [4] Uint2B
+0x024 e_oemid : Uint2B
+0x026 e_oeminfo : Uint2B
+0x028 e_res2 : [10] Uint2B
+0x03c e_lfanew : Int4B -------┐ MOV ESI, [EBX+0x3C]
│
┌----------------------------┘
ESI↓
nt!_image_nt_headers
+0x000 Signature : Uint4B (usually "PE\0\0") --┐
+0x004 FileHeader : _IMAGE_FILE_HEADER │
+0x000 Machine : Uint2B │
+0x002 NumberOfSections : Uint2B │
+0x004 TimeDateStamp : Uint4B │
+0x008 PointerToSymbolTable : Uint4B │
+0x00c NumberOfSymbols : Uint4B │
+0x010 SizeOfOptionalHeader : Uint2B │
+0x012 Characteristics : Uint2B │ This distance is
+0x018 OptionalHeader : _IMAGE_OPTIONAL_HEADER │ 0x78 bytes long
+0x000 Magic : Uint2B │
+0x002 MajorLinkerVersion : UChar │
+0x003 MinorLinkerVersion : UChar │
+0x004 SizeOfCode : Uint4B │ (That's 0x18+0x60 bytes
+0x008 SizeOfInitializedData : Uint4B │ from the PE header to the
+0x00c SizeOfUninitializedData : Uint4B │ _IMAGE_DATA_DIRECTORY)
+0x010 AddressOfEntryPoint : Uint4B │
+0x014 BaseOfCode : Uint4B │
+0x018 BaseOfData : Uint4B │
+0x01c ImageBase : Uint4B │
+0x020 SectionAlignment : Uint4B │
+0x024 FileAlignment : Uint4B │
+0x028 MajorOperatingSystemVersion : Uint2B │
+0x02a MinorOperatingSystemVersion : Uint2B │
+0x02c MajorImageVersion : Uint2B │
+0x02e MinorImageVersion : Uint2B │
+0x030 MajorSubsystemVersion : Uint2B │
+0x032 MinorSubsystemVersion : Uint2B │
+0x034 Win32VersionValue : Uint4B │
+0x038 SizeOfImage : Uint4B │
+0x03c SizeOfHeaders : Uint4B │
+0x040 CheckSum : Uint4B │
+0x044 Subsystem : Uint2B │
+0x046 DllCharacteristics : Uint2B │
+0x048 SizeOfStackReserve : Uint4B │
+0x04c SizeOfStackCommit : Uint4B │
+0x050 SizeOfHeapReserve : Uint4B │
+0x054 SizeOfHeapCommit : Uint4B │
+0x058 LoaderFlags : Uint4B │
+0x05c NumberOfRvaAndSizes : Uint4B │
+0x060 DataDirectory : [16] _IMAGE_DATA_DIRECTORY -┘ MOV ESI, [ESI+EBX+0x78]; ADD ESI, EBX
│
/
/ (This isn't exactly kd output, I've fabricated it.)
/
↓
nt!_IMAGE_DATA_DIRECTORY Export Table
+0x060 +0x000 VirtualAddress : Uint4B RVA of the table - Relative to Base Address (EBX)
+0x064 +0x004 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Import Table
+0x068 +0x008 VirtualAddress : Uint4B
[etc.] +0x00c Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Resource Table
+0x010 VirtualAddress : Uint4B
+0x014 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Exception Table
+0x018 VirtualAddress : Uint4B
+0x01c Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Certificate Table
+0x020 VirtualAddress : Uint4B
+0x024 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Base Relocation Table
+0x028 VirtualAddress : Uint4B
+0x02c Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Debug
+0x030 VirtualAddress : Uint4B
+0x034 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Architecture
+0x038 VirtualAddress : Uint4B
+0x03c Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Global Ptr
+0x040 VirtualAddress : Uint4B
+0x044 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY TLS Table
+0x048 VirtualAddress : Uint4B
+0x04c Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Load Config Table
+0x050 VirtualAddress : Uint4B
+0x054 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Bound Import
+0x058 VirtualAddress : Uint4B
+0x05c Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY IAT
+0x060 VirtualAddress : Uint4B
+0x064 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Delay Import Descriptor
+0x068 VirtualAddress : Uint4B
+0x06c Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY CLR Runtime Header
+0x070 VirtualAddress : Uint4B
+0x074 Size : Uint4B
nt!_IMAGE_DATA_DIRECTORY Reserved
+0x078 VirtualAddress : Uint4B