about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm/tools/to_c_helper.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/miasm/tools/to_c_helper.py b/miasm/tools/to_c_helper.py
index 37bf5324..901e3179 100644
--- a/miasm/tools/to_c_helper.py
+++ b/miasm/tools/to_c_helper.py
@@ -1211,8 +1211,12 @@ def load_pe_in_vm(fname_in, options, all_imp_dll = None, **kargs):
     win_api.winobjs.module_path = seh_helper.main_pe_name+"\x00"
     win_api.winobjs.hcurmodule = e.NThdr.ImageBase
 
+    stack_size = 0x10000
+    if 'stack_size' in kargs:
+        stack_size = kargs['stack_size']
+
     stack_base_ad = kargs.get('stack_base_ad', 0x1230000)
-    stack_size = kargs.get('stack_size', 0x10000)
+    stack_size = kargs.get('stack_size', stack_size)
     vm_add_memory_page(stack_base_ad,
                                    codenat.PAGE_READ|codenat.PAGE_WRITE,
                                    "\x00"*stack_size)