Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions evm-cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def notify_ana(self, insn):
try:
instruction = EVMAsm.disassemble_one(bytecode)
except Exception as e:
print e
print(e)
return

insn.size = instruction.size
Expand All @@ -887,7 +887,7 @@ def notify_ana(self, insn):
for i in prev_insns:
#print i.get_canon_mnem(),
if i.ea == ida_idaapi.BADADDR:
print 'ERROR'
print('ERROR')

if (prev_insns[0].get_canon_mnem().startswith("PUSH2") and
prev_insns[1].get_canon_mnem().startswith("EQ") and
Expand Down Expand Up @@ -923,7 +923,7 @@ def notify_assemble(self, ea, cs, ip, use32, line):
try:
asm = EVMAsm.assemble_one(line, 0)
except Exception as e:
print "Error trying to assemble '%s': %s" %(line, e)
print("Error trying to assemble '%s': %s" %(line, e))
return None

return asm.bytes
Expand Down
6 changes: 3 additions & 3 deletions evm-loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ def load_file(li, neflags, format):
return 0

if buf[0:2] == '0x':
print "Detected hex"
print("Detected hex")
new_buf = buf[2:].strip().rstrip()
buf_set = set()
for c in new_buf:
buf_set.update(c)
hex_set = set(list('0123456789abcdef'))
if buf_set <= hex_set: # subset
print "Replacing original buffer with hex decoded version"
print("Replacing original buffer with hex decoded version")
buf = new_buf.decode('hex')

# Load all shellcode into different segments
Expand All @@ -52,7 +52,7 @@ def load_file(li, neflags, format):
# check for swarm hash and make it data instead of code
swarm_hash_address = buf.find('ebzzr0')
if swarm_hash_address != -1:
print "Swarm hash detected, making it data"
print("Swarm hash detected, making it data")
for i in range(swarm_hash_address-1, swarm_hash_address+42):
MakeByte(i)
ida_bytes.set_cmt(swarm_hash_address-1, "swarm hash", True)
Expand Down