Commit 153077b2 authored by dmknght's avatar dmknght

add parse other headers

parent 89044c6e
Pipeline #1402 failed with stages
......@@ -329,8 +329,14 @@ if elfResult == 1:
e32_sect_header = ELF_SECTION_HEADER_32()
pHeader = newFileStream(path, fmRead)
pHeader.read(e32_file_header)
pHeader.setPosition(cast[int](e32_file_header.phoff))
pHeader.read(e32_proc_header)
pHeader.setPosition(cast[int](e32_file_header.shoff))
pHeader.read(e32_sect_header)
pHeader.close()
stdout.write "Entry: 0x", toHex(e32_file_header.entry), "\n"
stdout.write "Program Header: 0x", toHex(e32_file_header.phoff), "\n"
stdout.write "Section Header: 0x", toHex(e32_file_header.shoff), "\n"
elif elfResult == 2:
# TODO map ELF as 64 bit
var
......@@ -339,7 +345,13 @@ elif elfResult == 2:
e64_sect_header = ELF_SECTION_HEADER_64()
pHeader = newFileStream(path, fmRead)
pHeader.read(e64_file_header)
pHeader.setPosition(cast[int](e64_file_header.phoff))
pHeader.read(e64_proc_header)
pHeader.setPosition(cast[int](e64_file_header.shoff))
pHeader.read(e64_sect_header)
pHeader.close()
stdout.write "Entry: 0x", toHex(e64_file_header.entry), "\n"
stdout.write "Program Header: 0x", toHex(e64_file_header.phoff), "\n"
stdout.write "Section Header: 0x", toHex(e64_file_header.shoff), "\n"
else:
discard
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment