hex0b1.hex0 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ## ELF Header
  2. 7F 45 4C 46 ## e_ident[EI_MAG0-3] ELF's magic number
  3. 02 ## e_ident[EI_CLASS] Indicating 64 bit
  4. 01 ## e_ident[EI_DATA] Indicating little endianness
  5. 01 ## e_ident[EI_VERSION] Indicating original elf
  6. 00 ## e_ident[EI_OSABI] Set at 0 because none cares
  7. 00 ## e_ident[EI_ABIVERSION] See above
  8. 00 00 00 00 00 00 00 ## e_ident[EI_PAD]
  9. 02 00 ## e_type Indicating Executable
  10. 3E 00 ## e_machine Indicating AMD64
  11. 01 00 00 00 ## e_version Indicating original elf
  12. 78 00 60 00 00 00 00 00 ## e_entry Address of the entry point
  13. 40 00 00 00 00 00 00 00 ## e_phoff Address of program header table
  14. 00 00 00 00 00 00 00 00 ## e_shoff Address of section header table
  15. 00 00 00 00 ## e_flags
  16. 40 00 ## e_ehsize Indicating our 64 Byte header
  17. 38 00 ## e_phentsize size of a program header table
  18. 01 00 ## e_phnum number of entries in program table
  19. 00 00 ## e_shentsize size of a section header table
  20. 00 00 ## e_shnum number of entries in section table
  21. 00 00 ## e_shstrndx index of the section names
  22. ## Program Header table
  23. 01 00 00 00 ## p_type
  24. 06 00 00 00 ## Flags
  25. 00 00 00 00 00 00 00 00 ## p_offset
  26. 00 00 60 00 00 00 00 00 ## p_vaddr
  27. 00 00 60 00 00 00 00 00 ## Undefined
  28. 08 10 00 00 00 00 00 00 ## p_filesz
  29. 08 10 00 00 00 00 00 00 ## p_memsz
  30. 00 00 20 00 00 00 00 00 ## Required alignment
  31. #_start
  32. e8 b3 00 00 00 # callq 600130 <getchar>
  33. 48 83 f8 ff # cmp $0xffffffffffffffff,%rax
  34. 74 47 # je 6000ca <_start.done>
  35. 48 83 f8 20 # cmp $0x20,%rax
  36. 74 ef # je 600078 <_start>
  37. 48 83 f8 09 # cmp $0x9,%rax
  38. 74 e9 # je 600078 <_start>
  39. 48 83 f8 0a # cmp $0xa,%rax
  40. 74 e3 # je 600078 <_start>
  41. 48 83 f8 23 # cmp $0x23,%rax
  42. 74 3f # je 6000da <skip_comment>
  43. e8 4d 00 00 00 # callq 6000ed <hex_digit>
  44. 48 c1 e0 04 # shl $0x4,%rax
  45. 48 89 05 ec 00 00 00 # mov %rax,0xec(%rip) # 600197 <oct>
  46. e8 80 00 00 00 # callq 600130 <getchar>
  47. e8 38 00 00 00 # callq 6000ed <hex_digit>
  48. 48 09 05 db 00 00 00 # or %rax,0xdb(%rip) # 600197 <oct>
  49. 48 8b 05 d4 00 00 00 # mov 0xd4(%rip),%rax # 600197 <oct>
  50. e8 a2 00 00 00 # callq 60016a <putchar>
  51. eb ae # jmp 600078 <_start>
  52. #_start.done
  53. 48 c7 c0 3c 00 00 00 # mov $0x3c,%rax
  54. 48 c7 c7 00 00 00 00 # mov $0x0,%rdi
  55. 0f 05 # syscall
  56. #skip_comment
  57. e8 51 00 00 00 # callq 600130 <getchar>
  58. 48 83 f8 ff # cmp $0xffffffffffffffff,%rax
  59. 74 3b # je 600120 <die>
  60. 48 83 f8 0a # cmp $0xa,%rax
  61. 74 8d # je 600078 <_start>
  62. eb ed # jmp 6000da <skip_comment>
  63. #hex_digit
  64. 48 83 f8 30 # cmp $0x30,%rax
  65. 7c 0b # jl 6000fe <hex_digit.next1>
  66. 48 83 f8 39 # cmp $0x39,%rax
  67. 7f 05 # jg 6000fe <hex_digit.next1>
  68. 48 83 e8 30 # sub $0x30,%rax
  69. c3 # retq
  70. #hex_digit.next1
  71. 48 83 f8 61 # cmp $0x61,%rax
  72. 7c 0b # jl 60010f <hex_digit.next2>
  73. 48 83 f8 66 # cmp $0x66,%rax
  74. 7f 05 # jg 60010f <hex_digit.next2>
  75. 48 83 e8 57 # sub $0x57,%rax
  76. c3 # retq
  77. #hex_digit.next2
  78. 48 83 f8 41 # cmp $0x41,%rax
  79. 7c 0b # jl 600120 <die>
  80. 48 83 f8 46 # cmp $0x46,%rax
  81. 7f 05 # jg 600120 <die>
  82. 48 83 e8 37 # sub $0x37,%rax
  83. c3 # retq
  84. #die
  85. 48 c7 c0 3c 00 00 00 # mov $0x3c,%rax
  86. 48 c7 c7 01 00 00 00 # mov $0x1,%rdi
  87. 0f 05 # syscall
  88. #getchar
  89. 48 c7 c0 00 00 00 00 # mov $0x0,%rax
  90. 48 c7 c7 00 00 00 00 # mov $0x0,%rdi
  91. 48 8d 35 4a 00 00 00 # lea 0x4a(%rip),%rsi # 60018f <buf>
  92. 48 c7 c2 01 00 00 00 # mov $0x1,%rdx
  93. 0f 05 # syscall
  94. 48 83 f8 01 # cmp $0x1,%rax
  95. 75 0e # jne 600162 <getchar.getchar_fail>
  96. 48 c7 c0 00 00 00 00 # mov $0x0,%rax
  97. 8a 05 2e 00 00 00 # mov 0x2e(%rip),%al # 60018f <buf>
  98. c3 # retq
  99. #getchar.getchar_fail
  100. 48 c7 c0 ff ff ff ff # mov $0xffffffffffffffff,%rax
  101. c3 # retq
  102. #putchar
  103. 88 05 1f 00 00 00 # mov %al,0x1f(%rip) # 60018f <buf>
  104. 48 c7 c0 01 00 00 00 # mov $0x1,%rax
  105. 48 c7 c7 01 00 00 00 # mov $0x1,%rdi
  106. 48 8d 35 0a 00 00 00 # lea 0xa(%rip),%rsi # 60018f <buf>
  107. 48 c7 c2 01 00 00 00 # mov $0x1,%rdx
  108. 0f 05 # syscall
  109. c3 # retq
  110. #buf
  111. 00 00 00 00 00 00 00 00
  112. #oct
  113. 00 00 00 00 00 00 00 00