about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2011-11-08 15:47:52 +0100
committerserpilliere <devnull@localhost>2011-11-08 15:47:52 +0100
commit5a76891aa9ccdfb80564deca836b038917efff06 (patch)
tree5208878645ef04f5578aa0d8afb154d84843f4ff
parent42be5a492ee4b694e31a05eb7f5e3d984dd34ed4 (diff)
downloadmiasm-5a76891aa9ccdfb80564deca836b038917efff06.tar.gz
miasm-5a76891aa9ccdfb80564deca836b038917efff06.zip
ok, real fix for import2addr....
-rwxr-xr-xexample/disas_and_graph.py8
-rw-r--r--miasm/tools/pe_helper.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py
index 9ca32c23..f7b0fa60 100755
--- a/example/disas_and_graph.py
+++ b/example/disas_and_graph.py
@@ -151,9 +151,11 @@ from miasm.graph.graph_qt import graph_blocs
 
 
 #test symbols from ida
-for (n,f), ad in dll_dyn_funcs.items():
-    l  = symbol_pool.getby_name_create("%s_%s"%(n, f))
-    l.offset = ad
+for (n,f), ads in dll_dyn_funcs.items():
+    for ad in ads:
+        l  = symbol_pool.getby_name_create("%s_%s"%(n, f))
+        l.offset = ad
+        symbol_pool.s_offset[l.offset] = l
 
 
 def my_disasm_callback(ad):
diff --git a/miasm/tools/pe_helper.py b/miasm/tools/pe_helper.py
index d979ee07..a43d15c1 100644
--- a/miasm/tools/pe_helper.py
+++ b/miasm/tools/pe_helper.py
@@ -154,12 +154,12 @@ def get_import_address(e):
 
 
 def get_import_address_elf(e):
-    import2addr = {}
+    import2addr = defaultdict(set)
     for sh in e.sh:
         if not hasattr(sh, 'rel'):
             continue
         for k, v in sh.rel.items():
-            import2addr[('xxx', k)] = v.offset
+            import2addr[('xxx', k)].add(v.offset)
     return import2addr