about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2011-08-23 14:30:16 +0200
committerserpilliere <devnull@localhost>2011-08-23 14:30:16 +0200
commit3011360930f8fe6c060fd2992d1d5fd0676461af (patch)
tree8ef12e816f7ee1089600a44c53b324db1b493a74
parenta8d847d88286351b50c35510241ddac03d0994d5 (diff)
downloadmiasm-3011360930f8fe6c060fd2992d1d5fd0676461af.tar.gz
miasm-3011360930f8fe6c060fd2992d1d5fd0676461af.zip
fix elf rel parsing
-rw-r--r--miasm/tools/pe_helper.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/miasm/tools/pe_helper.py b/miasm/tools/pe_helper.py
index b85e7085..9a9d188d 100644
--- a/miasm/tools/pe_helper.py
+++ b/miasm/tools/pe_helper.py
@@ -156,8 +156,11 @@ def get_import_address(e):
 
 def get_import_address_elf(e):
     import2addr = {}
-    for k, v in e.sh.rel_plt.rel.items():
-        import2addr[('xxx', k)] = v.offset
+    for sh in e.sh:
+        if not hasattr(sh, 'rel'):
+            continue
+        for k, v in sh.rel.items():
+            import2addr[('xxx', k)] = v.offset
     return import2addr