diff options
Diffstat (limited to 'example')
| -rw-r--r-- | example/disasm/full.py | 4 | ||||
| -rwxr-xr-x | example/jitter/msp430.py | 2 | ||||
| -rw-r--r-- | example/jitter/sandbox_call.py | 2 | ||||
| -rw-r--r-- | example/symbol_exec/depgraph.py | 2 | ||||
| -rw-r--r-- | example/symbol_exec/dse_crackme.py | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/example/disasm/full.py b/example/disasm/full.py index ad85f7dc..84c856e1 100644 --- a/example/disasm/full.py +++ b/example/disasm/full.py @@ -61,10 +61,10 @@ if args.verbose: log.info('Load binary') if args.rawbinary: shift = args.shiftoffset if args.shiftoffset is not None else 0 - cont = Container.fallback_container(open(args.filename).read(), + cont = Container.fallback_container(open(args.filename, "rb").read(), None, addr=shift) else: - with open(args.filename) as fdesc: + with open(args.filename, "rb") as fdesc: cont = Container.from_stream(fdesc, addr=args.shiftoffset) default_addr = cont.entry_point diff --git a/example/jitter/msp430.py b/example/jitter/msp430.py index b69f91c6..6dd67542 100755 --- a/example/jitter/msp430.py +++ b/example/jitter/msp430.py @@ -40,7 +40,7 @@ def jit_msp430_binary(args): myjit.jit.log_mn = args.log_mn myjit.jit.log_newbloc = args.log_newbloc - myjit.vm.add_memory_page(0, PAGE_READ | PAGE_WRITE, open(filepath).read()) + myjit.vm.add_memory_page(0, PAGE_READ | PAGE_WRITE, open(filepath, "rb").read()) myjit.add_breakpoint(0x1337, lambda _: exit(0)) diff --git a/example/jitter/sandbox_call.py b/example/jitter/sandbox_call.py index 49365004..dc64af15 100644 --- a/example/jitter/sandbox_call.py +++ b/example/jitter/sandbox_call.py @@ -13,7 +13,7 @@ options = parser.parse_args() sb = Sandbox_Linux_arml(options.filename, options, globals()) -with open(options.filename) as fdesc: +with open(options.filename, "rb") as fdesc: cont = Container.from_stream(fdesc) addr_to_call = cont.symbol_pool.getby_name("md5_starts").offset diff --git a/example/symbol_exec/depgraph.py b/example/symbol_exec/depgraph.py index 4d518cb3..c1d6174d 100644 --- a/example/symbol_exec/depgraph.py +++ b/example/symbol_exec/depgraph.py @@ -31,7 +31,7 @@ parser.add_argument("--json", args = parser.parse_args() # Get architecture -with open(args.filename) as fstream: +with open(args.filename, "rb") as fstream: cont = Container.from_stream(fstream) arch = args.architecture if args.architecture else cont.arch diff --git a/example/symbol_exec/dse_crackme.py b/example/symbol_exec/dse_crackme.py index 9ac4d6d1..303447a4 100644 --- a/example/symbol_exec/dse_crackme.py +++ b/example/symbol_exec/dse_crackme.py @@ -31,7 +31,7 @@ def xxx_fopen(jitter): global my_FILE_ptr ret_addr, args = jitter.func_args_systemv(['path', 'mode']) fname = jitter.get_str_ansi(args.path) - FILE_to_info[my_FILE_ptr] = FInfo(fname, open(fname)) + FILE_to_info[my_FILE_ptr] = FInfo(fname, open(fname, "rb")) my_FILE_ptr += 1 return jitter.func_ret_stdcall(ret_addr, my_FILE_ptr - 1) |