mirror of
https://github.com/brain-hackers/lab
synced 2026-03-12 06:04:18 +09:00
Add x1 C example / improve extract.py to extract all sections after .text
This commit is contained in:
@@ -19,9 +19,11 @@ def extract(elf):
|
||||
print('Input ELF has no .text section', file=sys.stderr)
|
||||
|
||||
with open(sys.argv[2], 'wb') as f:
|
||||
f.write(text.data())
|
||||
elf.stream.seek(0)
|
||||
elf.stream.read(text.header.sh_offset)
|
||||
f.write(elf.stream.read())
|
||||
|
||||
print(f'Successfully extracted the .text section to "{sys.argv[2]}"')
|
||||
print(f'Successfully extracted the necessary sections to "{sys.argv[2]}"')
|
||||
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user