From 9d01a6107a9fa7ff93d959e5d3cd35b47a3164e6 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 2 Jul 2018 22:31:20 +0530 Subject: [PATCH] Use bytecode as CODESIZE --- mythril/disassembler/disassembly.py | 1 + mythril/laser/ethereum/svm.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mythril/disassembler/disassembly.py b/mythril/disassembler/disassembly.py index 8a21d11a..787f297f 100644 --- a/mythril/disassembler/disassembly.py +++ b/mythril/disassembler/disassembly.py @@ -11,6 +11,7 @@ class Disassembly: self.xrefs = [] self.func_to_addr = {} self.addr_to_func = {} + self.bytecode = code try: mythril_dir = os.environ['MYTHRIL_DIR'] diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 1c24eeaf..b6d722c9 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -635,7 +635,7 @@ class LaserEVM: state.stack.append(environment.sender) elif op == 'CODESIZE': - state.stack.append(len(disassembly.instruction_list)) + state.stack.append(len(disassembly.bytecode) // 2) if op == 'SHA3': op0, op1 = state.stack.pop(), state.stack.pop()