about summary refs log tree commit diff stats
path: root/example/ida/depgraph.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2018-06-19 17:53:45 +0200
committerGitHub <noreply@github.com>2018-06-19 17:53:45 +0200
commit0adddb12a7410c4bbdd6ee79252e9bf05ca22818 (patch)
tree92facadca71fc07d7760c60d2ca877774c73579b /example/ida/depgraph.py
parent8f5ca332780cf9e08761060e9903bc085dbc8430 (diff)
parentf1b32ba2b8db22a5f92a2734af55e9a5dba2271e (diff)
downloadmiasm-0adddb12a7410c4bbdd6ee79252e9bf05ca22818.tar.gz
miasm-0adddb12a7410c4bbdd6ee79252e9bf05ca22818.zip
Merge pull request #770 from serpilliere/ida_guess_machine_addr
Example/ida: use addr to guess arch
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