about summary refs log tree commit diff stats
path: root/miasm/jitter/loader/pe.py
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2019-08-17 16:59:37 +0200
committerGitHub <noreply@github.com>2019-08-17 16:59:37 +0200
commitee77b1bfbd6a4a69049359b188e124d85104bca5 (patch)
treecbf14c979612c976d2ee60fd47ee72e68c2967db /miasm/jitter/loader/pe.py
parentcda19f9330b45256e7415f287b59674b9143a8ef (diff)
parent85e5d4686abbe64a4ee750c53cec05b209944a93 (diff)
downloadfocaccia-miasm-ee77b1bfbd6a4a69049359b188e124d85104bca5.tar.gz
focaccia-miasm-ee77b1bfbd6a4a69049359b188e124d85104bca5.zip
Merge pull request #1057 from carolineLe/byte_str_error
Fix str/bytes handling in pe loader
Diffstat (limited to 'miasm/jitter/loader/pe.py')
-rw-r--r--miasm/jitter/loader/pe.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/miasm/jitter/loader/pe.py b/miasm/jitter/loader/pe.py
index 63a56d38..fc3fdb13 100644
--- a/miasm/jitter/loader/pe.py
+++ b/miasm/jitter/loader/pe.py
@@ -88,11 +88,11 @@ def is_redirected_export(pe_obj, addr):
     addr_end = pe_obj.virt.find(b'\x00', addr)
     data = pe_obj.virt.get(addr, addr_end)
 
-    dllname, func_info = data.split('.', 1)
+    dllname, func_info = data.split(b'.', 1)
     dllname = dllname.lower()
 
     # Test if function is forwarded using ordinal
-    if func_info.startswith('#'):
+    if func_info.startswith(b'#'):
         func_info = int(func_info[1:])
     return dllname, func_info
 
@@ -401,7 +401,7 @@ class libimp_pe(libimp):
                 ret = is_redirected_export(e, ad)
                 if ret:
                     exp_dname, exp_fname = ret
-                    exp_dname = exp_dname + '.dll'
+                    exp_dname = exp_dname + b'.dll'
                     exp_dname = exp_dname.lower()
                     # if dll auto refes in redirection
                     if exp_dname == name: