Changelog: bv.write and bv.insert require a bytes object in python3 Architecture.assemble outputs a bytes object in python3, a str in python2 Architecture.assemble will throw a value error if it cannot assemble the given instruction API install script should be run in the version of python you want it installed in Fundamental python changes to be aware of: Unicode-type strings are now just str, consequently anything that came out as a unicode string before (annotations) are now just str. Longs no longer exist. They're just ints.
| -rw-r--r-- | python/examples/jump_table.py | 8 |
diff --git a/python/examples/jump_table.py b/python/examples/jump_table.py index 419cc188..4ed8dda2 100644 --- a/python/examples/jump_table.py +++ b/python/examples/jump_table.py @@ -43,16 +43,16 @@ def find_jump_table(bv, addr): break jump_addr += info.length if jump_addr >= block.end: - print "Unable to find jump after instruction 0x%x" % addr + print("Unable to find jump after instruction 0x%x" % addr) continue - print "Jump at 0x%x" % jump_addr + print("Jump at 0x%x" % jump_addr) # Collect the branch targets for any tables referenced by the clicked instruction branches = [] for token in tokens: if InstructionTextTokenType(token.type) == InstructionTextTokenType.PossibleAddressToken: # Table addresses will be a "possible address" token tbl = token.value - print "Found possible table at 0x%x" % tbl + print("Found possible table at 0x%x" % tbl) i = 0 while True: # Read the next pointer from the table @@ -66,7 +66,7 @@ def find_jump_table(bv, addr): # If the pointer is within the binary, add it as a destination and continue # to the next entry if (ptr >= bv.start) and (ptr < bv.end): - print "Found destination 0x%x" % ptr + print("Found destination 0x%x" % ptr) branches.append((arch, ptr)) else: # Once a value that is not a pointer is encountered, the jump table is ended |