extract.py: exit on error

This commit is contained in:
Takumi Sueda 2021-03-04 14:49:51 +09:00
parent 6001ad21cf
commit 1559a0e69b
1 changed files with 1 additions and 0 deletions

View File

@ -17,6 +17,7 @@ def extract(elf):
text = elf.get_section_by_name('.text')
if text is None:
print('Input ELF has no .text section', file=sys.stderr)
sys.exit(1)
with open(sys.argv[2], 'wb') as f:
elf.stream.seek(0)