about summary refs log tree commit diff stats
path: root/example/ida/depgraph.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2018-06-18 09:27:45 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2018-06-19 16:42:46 +0200
commitf1b32ba2b8db22a5f92a2734af55e9a5dba2271e (patch)
tree92facadca71fc07d7760c60d2ca877774c73579b /example/ida/depgraph.py
parent8f5ca332780cf9e08761060e9903bc085dbc8430 (diff)
downloadmiasm-f1b32ba2b8db22a5f92a2734af55e9a5dba2271e.tar.gz
miasm-f1b32ba2b8db22a5f92a2734af55e9a5dba2271e.zip
Example/ida: use addr to guess arch
Some arch like ARM depends on address in order to determine which
attributes have to be used during analysis
Diffstat (limited to 'example/ida/depgraph.py')
-rw-r--r--example/ida/depgraph.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/example/ida/depgraph.py b/example/ida/depgraph.py
index 825d7b90..4320be8d 100644
--- a/example/ida/depgraph.py
+++ b/example/ida/depgraph.py
@@ -198,8 +198,12 @@ def next_element():
 
 def launch_depgraph():
     global graphs, comments, sol_nb, settings, addr, ir_arch
+    # Get the current function
+    addr = idc.ScreenEA()
+    func = ida_funcs.get_func(addr)
+
     # Init
-    machine = guess_machine()
+    machine = guess_machine(addr=func.startEA)
     mn, dis_engine, ira = machine.mn, machine.dis_engine, machine.ira
 
     bs = bin_stream_ida()
@@ -212,9 +216,6 @@ def launch_depgraph():
             continue
         mdis.symbol_pool.add_location(name, ad)
 
-    # Get the current function
-    addr = idc.ScreenEA()
-    func = ida_funcs.get_func(addr)
     asmcfg = mdis.dis_multiblock(func.startEA)
 
     # Generate IR