about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2020-05-19 09:47:08 +0200
committerGitHub <noreply@github.com>2020-05-19 09:47:08 +0200
commitb7fe29fbd90a22c7604db2554f839691efe100dc (patch)
tree29cb7e5e01472b52fc4e2359b9a2aaf0277b4166
parentb449b5d20f1ecd4781b4e6b890de281e6d719207 (diff)
parent8eaba0bd8accc4965d6f0a50747453edd4a9300c (diff)
downloadmiasm-b7fe29fbd90a22c7604db2554f839691efe100dc.tar.gz
miasm-b7fe29fbd90a22c7604db2554f839691efe100dc.zip
Merge pull request #1230 from carolineLe/win_api_MBTWC
Win_api: fix kernel32_MultiByteToWideChar
-rw-r--r--miasm/os_dep/win_api_x86_32.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/miasm/os_dep/win_api_x86_32.py b/miasm/os_dep/win_api_x86_32.py
index 60588b59..9d86e833 100644
--- a/miasm/os_dep/win_api_x86_32.py
+++ b/miasm/os_dep/win_api_x86_32.py
@@ -1677,7 +1677,8 @@ def kernel32_MultiByteToWideChar(jitter):
                                              "cchwidechar"])
     src = get_win_str_a(jitter, args.lpmultibytestr)
     l = len(src) + 1
-    set_win_str_w(jitter, args.lpwidecharstr, src)
+    if args.cchwidechar != 0:
+        set_win_str_w(jitter, args.lpwidecharstr, src)
     jitter.func_ret_stdcall(ret_ad, l)