about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-10-22 09:51:06 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-10-22 14:23:37 +0200
commitf1bd6c0caad44acd41286b1c8876302a90bc6e2f (patch)
tree395ba00aad1dcccb914d7de418f0856c98b874ae
parentc30513eefd5bfb1b9e8e16b4a7aee5fbd55f3e20 (diff)
downloadmiasm-f1bd6c0caad44acd41286b1c8876302a90bc6e2f.tar.gz
miasm-f1bd6c0caad44acd41286b1c8876302a90bc6e2f.zip
Loader/pe: fix iat rebuild
-rw-r--r--miasm2/jitter/loader/pe.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/miasm2/jitter/loader/pe.py b/miasm2/jitter/loader/pe.py
index 3233cd4b..8cda2c99 100644
--- a/miasm2/jitter/loader/pe.py
+++ b/miasm2/jitter/loader/pe.py
@@ -391,7 +391,8 @@ class libimp_pe(libimp):
                 # Find libname's Import Address Table
                 othunk = all_ads[0]
                 i = 0
-                while i + 1 < len(all_ads) and all_ads[i] + 4 == all_ads[i + 1]:
+                while (i + 1 < len(all_ads) and
+                       all_ads[i] + target_pe._wsize / 8 == all_ads[i + 1]):
                     i += 1
                 # 'i + 1' is IAT's length