about summary refs log tree commit diff stats
path: root/example/ida/symbol_exec.py
diff options
context:
space:
mode:
Diffstat (limited to 'example/ida/symbol_exec.py')
-rw-r--r--example/ida/symbol_exec.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/example/ida/symbol_exec.py b/example/ida/symbol_exec.py
index 63014ece..0d8c63c2 100644
--- a/example/ida/symbol_exec.py
+++ b/example/ida/symbol_exec.py
@@ -128,11 +128,16 @@ def symbolic_exec():
 
     from utils import guess_machine
 
+    start, end = idc.SelStart(), idc.SelEnd()
+
     bs = bin_stream_ida()
-    machine = guess_machine()
+    machine = guess_machine(addr=start)
 
     mdis = machine.dis_engine(bs)
-    start, end = idc.SelStart(), idc.SelEnd()
+
+    if start == idc.BADADDR and end == idc.BADADDR:
+        start = idc.ScreenEA()
+        end = idc.next_head(start) # Get next instruction address
 
     mdis.dont_dis = [end]
     asmcfg = mdis.dis_multiblock(start)
@@ -151,7 +156,8 @@ def symbolic_exec():
     view = symbolicexec_t()
     all_views.append(view)
     if not view.Create(modified, machine, mdis.symbol_pool,
-                       "Symbolic Execution - 0x%x to 0x%x" % (start, end)):
+                       "Symbolic Execution - 0x%x to 0x%x"
+                       % (start, idc.prev_head(end))):
         return
 
     view.Show()