indicogniBuild a VMM

Lab

ELF inspector

Used in chapter 13, the elf primer.

Decode an ELF file's header and program headers byte by byte, see what a loader copies into guest RAM, and find which check catches a broken byte.

Runs in browser
ELF inspector: the hello guest from the elf primer The 844,736-byte file holds the ELF header and four program headers in its first 0x120 bytes. Segment 0 (read, execute) copies 0x29f0 bytes from file offset 0x10000 to 0x4008_0000. Segment 1 (read) copies 0x36a bytes from 0x129f0 to 0x4008_29f0. Segment 2 (read, write) takes no bytes from the file and is 0x80020 bytes of zeros at 0x4008_2d60. The rest of the file, debug information, symbols and section headers, is not loaded. The device-tree slot fills 0x4000_0000 to 0x4008_0000. All checks pass; the guest spans 535,936 bytes of RAM, and the flat binary is 11,610 bytes. file (844,736 bytes) guest RAM 0x0 headers (not copied) 0x10000 code 0x29f0 0x129f0 rodata 0x36a 0x12d5a debug info, symbols, section headers (not loaded) 0x4000_0000 device-tree slot 0x4008_0000 code R X 0x4008_29f0 rodata R 0x4008_2d60 BSS RW 0x80020 bytes zero-filled, none of them in the file copy copy zero All checks pass. Entry 0x4008_0000 is in segment 0 (executable). Three sizes: file 844,736 · flat binary 11,610 · guest RAM 535,936 bytes. Patch e_phnum (offset 0x38) to ff ff: "ELF has 65535 program headers (at most 64)".

All labs