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.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/example/ida/symbol_exec.py b/example/ida/symbol_exec.py
index 70e1cfc1..7599dde7 100644
--- a/example/ida/symbol_exec.py
+++ b/example/ida/symbol_exec.py
@@ -84,7 +84,7 @@ def symbolic_exec():
     machine = guess_machine()
 
     mdis = machine.dis_engine(bs)
-    start, end = SelStart(), SelEnd()
+    start, end = idc.SelStart(), idc.SelEnd()
 
     mdis.dont_dis = [end]
     blocks = mdis.dis_multibloc(start)
@@ -115,10 +115,11 @@ def symbolic_exec():
 
     view.Show()
 
-idaapi.CompileLine('static key_F3() { RunPythonStatement("symbolic_exec()"); }')
-idc.AddHotkey("F3", "key_F3")
+if __name__ == "__main__":
+    idaapi.CompileLine('static key_F3() { RunPythonStatement("symbolic_exec()"); }')
+    idc.AddHotkey("F3", "key_F3")
 
-print "=" * 50
-print """Available commands:
-    symbolic_exec() - F3: Symbolic execution of current selection
-"""
+    print "=" * 50
+    print """Available commands:
+        symbolic_exec() - F3: Symbolic execution of current selection
+    """