about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCaroline Leman <CarolineLe@users.noreply.github.com>2020-05-14 13:44:10 +0200
committerCaroline Leman <CarolineLe@users.noreply.github.com>2020-05-14 13:44:46 +0200
commita33a55cd20d123ed0c5e5ce163c7a9d8053b2d72 (patch)
treef050f6d232eb90aec06fc22a9045bbb6ca6aa694
parent76cd244e4cf7ef411c50668423edac8750340a25 (diff)
downloadmiasm-a33a55cd20d123ed0c5e5ce163c7a9d8053b2d72.tar.gz
miasm-a33a55cd20d123ed0c5e5ce163c7a9d8053b2d72.zip
Win_api: remove quotes around commandline
Diffstat (limited to '')
-rw-r--r--miasm/os_dep/win_api_x86_32.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/miasm/os_dep/win_api_x86_32.py b/miasm/os_dep/win_api_x86_32.py
index 7472ae79..6e9bd8d9 100644
--- a/miasm/os_dep/win_api_x86_32.py
+++ b/miasm/os_dep/win_api_x86_32.py
@@ -606,7 +606,7 @@ def kernel32_CreateFile(jitter, funcname, get_str):
                         h = open(sb_fname, 'r+b')
                         ret = winobjs.handle_pool.add(sb_fname, h)
                 else:
-                    log.warning("FILE %r DOES NOT EXIST!", fname)
+                    log.warning("FILE %r (%s) DOES NOT EXIST!", fname, sb_fname)
             elif args.dwcreationdisposition == 1:
                 # create new
                 if os.access(sb_fname, os.R_OK):
@@ -1114,6 +1114,8 @@ def kernel32_GetCommandLineW(jitter):
 def shell32_CommandLineToArgvW(jitter):
     ret_ad, args = jitter.func_args_stdcall(["pcmd", "pnumargs"])
     cmd = get_win_str_w(jitter, args.pcmd)
+    if cmd.startswith('"') and cmd.endswith('"'):
+        cmd = cmd[1:-1]
     log.info("CommandLineToArgv %r", cmd)
     tks = cmd.split(' ')
     addr = winobjs.heap.alloc(jitter, len(cmd) * 2 + 4 * len(tks))
@@ -1128,7 +1130,6 @@ def shell32_CommandLineToArgvW(jitter):
     jitter.vm.set_u32(args.pnumargs, len(tks))
     jitter.func_ret_stdcall(ret_ad, addr_ret)
 
-
 def cryptdll_MD5Init(jitter):
     ret_ad, args = jitter.func_args_stdcall(["ad_ctx"])
     index = len(winobjs.cryptdll_md5_h)