about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2012-06-05 11:09:50 +0200
committerserpilliere <devnull@localhost>2012-06-05 11:09:50 +0200
commit429e85146c19c86c2d3a6d67e599369af0d1bfef (patch)
tree92327baedd048adea7df784fc42bfda9f6d9a7f7
parent2ec2401129c315c45ea8c22f46b29f1f9ea69547 (diff)
downloadmiasm-429e85146c19c86c2d3a6d67e599369af0d1bfef.tar.gz
miasm-429e85146c19c86c2d3a6d67e599369af0d1bfef.zip
fix load without fix PE align
-rw-r--r--miasm/tools/pe_helper.py2
-rw-r--r--miasm/tools/to_c_helper.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/miasm/tools/pe_helper.py b/miasm/tools/pe_helper.py
index 6c31ad6d..497aff13 100644
--- a/miasm/tools/pe_helper.py
+++ b/miasm/tools/pe_helper.py
@@ -559,7 +559,7 @@ def vm_load_pe(e, align_s = True, load_hdr = True):
             data = str(s.data)
             data += "\x00"*(s.size-len(data))
             to_c_helper.vm_add_memory_page(e.rva2virt(s.addr), to_c_helper.PAGE_READ|to_c_helper.PAGE_WRITE, data)
-            s.offset = s.addr
+            #s.offset = s.addr
         return
 
     #not aligned
diff --git a/miasm/tools/to_c_helper.py b/miasm/tools/to_c_helper.py
index 646aafbe..508c57d7 100644
--- a/miasm/tools/to_c_helper.py
+++ b/miasm/tools/to_c_helper.py
@@ -1149,7 +1149,7 @@ def load_pe_in_vm(fname_in, options, all_imp_dll = None, **kargs):
     codenat_tcc_init()
     runtime_dll = pe_helper.libimp(kargs.get('runtime_basead', 0x71111000))
 
-    pe_helper.vm_load_pe(e, load_hdr = options.loadhdr)
+    pe_helper.vm_load_pe(e, align_s = False, load_hdr = options.loadhdr)
 
     if all_imp_dll == None:
         if options.loadbasedll:
@@ -1174,7 +1174,7 @@ def load_pe_in_vm(fname_in, options, all_imp_dll = None, **kargs):
     for n in mod_list:
         fname = os.path.join('win_dll', n)
         ee = pe_init.PE(open(fname, 'rb').read())
-        pe_helper.vm_load_pe(ee)
+        pe_helper.vm_load_pe(ee, align_s = False)
         runtime_dll.add_export_lib(ee, n)
         exp_funcs = pe_helper.get_export_name_addr_list(ee)
         exp_func[n] = exp_funcs