about summary refs log tree commit diff stats
path: root/example/disasm/full.py
diff options
context:
space:
mode:
authorw4kfu <gw4kfu@gmail.com>2017-06-22 14:01:40 -0400
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2018-01-16 12:56:14 +0100
commitd147d92892b294b31f1703685a3cf67b80cadb94 (patch)
treeccfce65718aa802f8e240a9dbbdf89b9b6a9518b /example/disasm/full.py
parent3e2364edcb6c4259782e251c236bad1090c8c9e0 (diff)
downloadfocaccia-miasm-d147d92892b294b31f1703685a3cf67b80cadb94.tar.gz
focaccia-miasm-d147d92892b294b31f1703685a3cf67b80cadb94.zip
append b to the opens mode ; Python on Windows makes a distinction between text and binary files
Diffstat (limited to 'example/disasm/full.py')
-rw-r--r--example/disasm/full.py4
1 files changed, 2 insertions, 2 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