Add exception handling for disassembler

pull/2/head
Bernhard Mueller 7 years ago
parent 322426028f
commit 974c04ba27
  1. 5
      mythril/mythril

@ -77,7 +77,10 @@ if (args.disassemble):
else:
exitWithError("Disassembler: Provide the input bytecode via -c BYTECODE or --id ID")
disassembly = asm.disassemble(util.safe_decode(encoded_bytecode))
try:
disassembly = asm.disassemble(util.safe_decode(encoded_bytecode))
except binascii.Error:
exitWithError("Disassembler: Invalid code string.")
easm_text = asm.disassembly_to_easm(disassembly)

Loading…
Cancel
Save