12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- ## ELF Header
- 7F 45 4C 46 ## e_ident[EI_MAG0-3] ELF's magic number
- 02 ## e_ident[EI_CLASS] Indicating 64 bit
- 01 ## e_ident[EI_DATA] Indicating little endianness
- 01 ## e_ident[EI_VERSION] Indicating original elf
- 00 ## e_ident[EI_OSABI] Set at 0 because none cares
- 00 ## e_ident[EI_ABIVERSION] See above
- 00 00 00 00 00 00 00 ## e_ident[EI_PAD]
- 02 00 ## e_type Indicating Executable
- 3E 00 ## e_machine Indicating AMD64
- 01 00 00 00 ## e_version Indicating original elf
- 78 00 60 00 00 00 00 00 ## e_entry Address of the entry point
- 40 00 00 00 00 00 00 00 ## e_phoff Address of program header table
- 00 00 00 00 00 00 00 00 ## e_shoff Address of section header table
- 00 00 00 00 ## e_flags
- 40 00 ## e_ehsize Indicating our 64 Byte header
- 38 00 ## e_phentsize size of a program header table
- 01 00 ## e_phnum number of entries in program table
- 00 00 ## e_shentsize size of a section header table
- 00 00 ## e_shnum number of entries in section table
- 00 00 ## e_shstrndx index of the section names
- ## Program Header table
- 01 00 00 00 ## p_type
- 06 00 00 00 ## Flags
- 00 00 00 00 00 00 00 00 ## p_offset
- 00 00 60 00 00 00 00 00 ## p_vaddr
- 00 00 60 00 00 00 00 00 ## Undefined
- 08 10 00 00 00 00 00 00 ## p_filesz
- 08 10 00 00 00 00 00 00 ## p_memsz
- 00 00 20 00 00 00 00 00 ## Required alignment
- :_start
- e8 *getchar # call 600096 <getchar>
- 48 83 f8 ff # cmp rax,0xffffffffffffffff
- 74 ._start.done # je 60008a <_start.done>
- e8 *putchar # call 6000d0 <putchar>
- eb ._start # jmp 600078 <_start>
- :_start.done
- 48 89 c7 # mov rdi,rax
- 48 c7 c0 3c 00 00 00 # mov rax,0x3c
- 0f 05 # syscall
- :getchar
- 48 c7 c0 00 00 00 00 # mov rax,0x0
- 48 c7 c7 00 00 00 00 # mov rdi,0x0
- 48 8d 35 *buf # lea rsi,[rip+0x4a] # 6000f5 <buf>
- 48 c7 c2 01 00 00 00 # mov rdx,0x1
- 0f 05 # syscall
- 48 83 f8 01 # cmp rax,0x1
- 75 .getchar.getchar_fail # jne 6000c8 <getchar.getchar_fail>
- 48 c7 c0 00 00 00 00 # mov rax,0x0
- 8a 05 *buf # mov al,BYTE PTR [rip+0x2e] # 6000f5 <buf>
- c3 # ret
- :getchar.getchar_fail
- 48 c7 c0 ff ff ff ff # mov rax,0xffffffffffffffff
- c3 # ret
- :putchar
- 88 05 *buf # mov BYTE PTR [rip+0x1f],al # 6000f5 <buf>
- 48 c7 c0 01 00 00 00 # mov rax,0x1
- 48 c7 c7 01 00 00 00 # mov rdi,0x1
- 48 8d 35 *buf # lea rsi,[rip+0xa] # 6000f5 <buf>
- 48 c7 c2 01 00 00 00 # mov rdx,0x1
- 0f 05 # syscall
- c3 # ret
- :buf
- 00 00 00 00 00 00 00 00
|