From a1fc2a4ee56eb5bd50ffdfe5ab20a237564e9210 Mon Sep 17 00:00:00 2001 From: cryptobarbossa <42328224+cryptobarbossa@users.noreply.github.com> Date: Wed, 5 Dec 2018 14:02:52 +0000 Subject: [PATCH] Enable creation bytecode option (#787) * Enable creation bytecode option * Additional fix * Update mythril/interfaces/cli.py Co-Authored-By: cryptobarbossa <42328224+cryptobarbossa@users.noreply.github.com> * Update mythril/interfaces/cli.py Co-Authored-By: cryptobarbossa <42328224+cryptobarbossa@users.noreply.github.com> * Solution cleanup * Output additions --- mythril/ethereum/evmcontract.py | 4 ++++ mythril/interfaces/cli.py | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mythril/ethereum/evmcontract.py b/mythril/ethereum/evmcontract.py index de0b7ae7..b0914a8f 100644 --- a/mythril/ethereum/evmcontract.py +++ b/mythril/ethereum/evmcontract.py @@ -37,6 +37,10 @@ class EVMContract(persistent.Persistent): return self.disassembly.get_easm() + def get_creation_easm(self): + + return self.creation_disassembly.get_easm() + def matches_expression(self, expression): str_eval = "" diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index 8e4867de..27a4725a 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -364,10 +364,12 @@ def main(): print(storage) elif args.disassemble: - easm_text = mythril.contracts[ - 0 - ].get_easm() # or mythril.disassemble(mythril.contracts[0]) - sys.stdout.write(easm_text) + # or mythril.disassemble(mythril.contracts[0]) + + if mythril.contracts[0].code: + print("Runtime Disassembly: \n" + mythril.contracts[0].get_easm()) + if mythril.contracts[0].creation_code: + print("Disassembly: \n" + mythril.contracts[0].get_creation_easm()) elif args.graph or args.fire_lasers: if not mythril.contracts: