Detect and ignore swarm hash at end of bytecode

pull/33/head
Bernhard Mueller 7 years ago
parent aa9ff9a75f
commit fccdc757a0
  1. 13
      mythril/ether/asm.py

@ -86,12 +86,21 @@ def find_opcode_sequence(pattern, instruction_list):
return match_indexes
def disassemble(bytecode):
instruction_list = []
addr = 0
while addr < len(bytecode):
length = len(bytecode)
if "bzzr" in str(bytecode[-43:]):
# ignore swarm hash
length -= 43
while addr < length:
instruction = {}
@ -117,8 +126,10 @@ def disassemble(bytecode):
if m:
argument = bytecode[addr+1:addr+1+int(m.group(1))]
instruction['argument'] = "0x" + argument.hex()
addr += int(m.group(1))
instruction_list.append(instruction)
addr += 1

Loading…
Cancel
Save