Merge pull request 'Add section headers for better debugging' (#2) from tbsliver/return-42-improvement into main
Reviewed-on: #2
This commit is contained in:
commit
a299345d4c
5 changed files with 94 additions and 4 deletions
|
|
@ -48,8 +48,8 @@
|
|||
40 00 00 00 00 00 00 00
|
||||
|
||||
# Section Header Table Offset - e_shoff
|
||||
# We dont have one! no offset
|
||||
00 00 00 00 00 00 00 00
|
||||
# 64 + 56 + 16 + 16
|
||||
98 00 00 00 00 00 00 00
|
||||
|
||||
# Processor Flags - e_flags - No flags set
|
||||
00 00 00 00
|
||||
|
|
@ -68,9 +68,9 @@
|
|||
|
||||
# Section Header Count - e_shnum
|
||||
# Set to 3 based on example
|
||||
00 00
|
||||
03 00
|
||||
|
||||
##Section Header String Table Index - e_shstrndx
|
||||
# Set to 2 based on example
|
||||
00 00
|
||||
02 00
|
||||
|
||||
|
|
|
|||
3
programs/return-42/03_string_table.txt
Normal file
3
programs/return-42/03_string_table.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# String table. ".shstrab\0.text\0" -- 16 bytes
|
||||
2e 73 68 73 74 72 74 61 62 00 2e 74 65 78 74 00
|
||||
|
||||
29
programs/return-42/04_section_header_null.txt
Normal file
29
programs/return-42/04_section_header_null.txt
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Section header table, section 0 -- null -- 64 bytes
|
||||
|
||||
# 0x0A = offset to the name of the section in the string table
|
||||
00 00 00 00
|
||||
|
||||
# 1 = type: null
|
||||
00 00 00 00
|
||||
|
||||
# flags = executable | occupies memory
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# address in virtual memory of this section
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# offset in the file of this section (start of program code)
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# size of this section in the file: 16 bytes
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# sh_link -- not used for this section
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# 0x01 = alignment code: default??
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# sh_entsize: not used
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
29
programs/return-42/05_section_header_program.txt
Normal file
29
programs/return-42/05_section_header_program.txt
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Section header table, section 1 -- program text -- 64 bytes
|
||||
|
||||
# 0x0A = offset to the name of the section in the string table
|
||||
0a 00 00 00
|
||||
|
||||
# 1 = type: program data
|
||||
01 00 00 00
|
||||
|
||||
# flags = executable | occupies memory
|
||||
06 00 00 00 00 00 00 00
|
||||
|
||||
# address in virtual memory of this section
|
||||
78 00 40 00 00 00 00 00
|
||||
|
||||
# offset in the file of this section (start of program code)
|
||||
78 00 00 00 00 00 00 00
|
||||
|
||||
# size of this section in the file: 16 bytes
|
||||
10 00 00 00 00 00 00 00
|
||||
|
||||
# sh_link -- not used for this section
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# 0x01 = alignment code: default??
|
||||
01 00 00 00 00 00 00 00
|
||||
|
||||
# sh_entsize: not used
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
29
programs/return-42/06_section_header_string_table.txt
Normal file
29
programs/return-42/06_section_header_string_table.txt
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Section header table, section 2 -- string table
|
||||
|
||||
# 0x0 = offset to the name of the section in the string table
|
||||
00 00 00 00
|
||||
|
||||
# 3 = type: string table
|
||||
03 00 00 00
|
||||
|
||||
# 0x0 = flags
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# 0x0 = address in virtual memory (not used)
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# 0xB0 = offset in the file of this section (start of string table)
|
||||
b0 00 00 00 00 00 00 00
|
||||
|
||||
# 0x10 = size of this section in the file: 16 bytes
|
||||
10 00 00 00 00 00 00 00
|
||||
|
||||
# sh_link -- not used for this section
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
# 0x01 = alignment code: default??
|
||||
01 00 00 00 00 00 00 00
|
||||
|
||||
# sh_entsize: not used
|
||||
00 00 00 00 00 00 00 00
|
||||
|
||||
Loading…
Add table
Reference in a new issue