about summary refs log tree commit diff stats
path: root/example/disasm/full.py
diff options
context:
space:
mode:
Diffstat (limited to 'example/disasm/full.py')
-rw-r--r--example/disasm/full.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/example/disasm/full.py b/example/disasm/full.py
index 7ff60d3b..f15b59eb 100644
--- a/example/disasm/full.py
+++ b/example/disasm/full.py
@@ -50,6 +50,8 @@ parser.add_argument('-a', "--try-disasm-all", action="store_true",
                     help="Try to disassemble the whole binary")
 parser.add_argument('-i', "--image", action="store_true",
                     help="Display image representation of disasm")
+parser.add_argument('-c', "--rawbinary", default=False, action="store_true",
+                    help="Don't interpret input as ELF/PE/...")
 
 args = parser.parse_args()
 
@@ -57,8 +59,13 @@ if args.verbose:
     log_asmbloc.setLevel(logging.DEBUG)
 
 log.info('Load binary')
-with open(args.filename) as fdesc:
-    cont = Container.from_stream(fdesc, addr=args.shiftoffset)
+if args.rawbinary:
+    shift = args.shiftoffset if args.shiftoffset is not None else 0
+    cont = Container.fallback_container(open(args.filename).read(),
+                                        None, addr=shift)
+else:
+    with open(args.filename) as fdesc:
+        cont = Container.from_stream(fdesc, addr=args.shiftoffset)
 
 default_addr = cont.entry_point
 bs = cont.bin_stream