diff options
Diffstat (limited to 'example/disasm')
| -rw-r--r-- | example/disasm/file.py | 2 | ||||
| -rw-r--r-- | example/disasm/full.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/example/disasm/file.py b/example/disasm/file.py index 3555ab18..1a22dfe7 100644 --- a/example/disasm/file.py +++ b/example/disasm/file.py @@ -9,7 +9,7 @@ if len(sys.argv) != 3: print "%s samples/box_upx.exe 0x407570" % sys.argv[0] sys.exit(0) -addr = int(sys.argv[2], 16) +addr = int(sys.argv[2], 0) cont = Container.from_stream(open(sys.argv[1])) mdis = dis_x86_32(cont.bin_stream) # Inform the engine to avoid disassembling null instructions diff --git a/example/disasm/full.py b/example/disasm/full.py index b813e4fa..db12c45b 100644 --- a/example/disasm/full.py +++ b/example/disasm/full.py @@ -43,7 +43,8 @@ parser.add_argument('-l', "--dontdis-retcall", action="store_true", help="If set, disassemble only call destinations") parser.add_argument('-s', "--simplify", action="store_true", help="Use the liveness analysis pass") -parser.add_argument('-o', "--shiftoffset", default=None, type=int, +parser.add_argument('-o', "--shiftoffset", default=None, + type=lambda x: int(x, 0), help="Shift input binary by an offset") parser.add_argument('-a', "--try-disasm-all", action="store_true", help="Try to disassemble the whole binary") @@ -85,7 +86,7 @@ mdis.dont_dis_nulstart_bloc = not args.dis_nulstart_block mdis.follow_call = args.followcall todo = [] -addrs = [int(a, 16) for a in args.address] +addrs = [int(a, 0) for a in args.address] if len(addrs) == 0 and default_addr is not None: addrs.append(default_addr) |