about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2020-05-31 02:04:37 +0200
committerGitHub <noreply@github.com>2020-05-31 02:04:37 +0200
commitc24fb02f83464d4ebb7fe1c2570f7b6c23c9b46f (patch)
tree776ad8a03a10651d540c1c7091065356f78253f4
parente6580f5390ad3856079b73685eef56013644f72f (diff)
parent0af3b614112d7199dc077ed9d76c33f97be9709a (diff)
downloadmiasm-c24fb02f83464d4ebb7fe1c2570f7b6c23c9b46f.tar.gz
miasm-c24fb02f83464d4ebb7fe1c2570f7b6c23c9b46f.zip
Merge pull request #1245 from Frky/patch-5
Fix bug in WideCharToMultiByte
-rw-r--r--miasm/os_dep/win_api_x86_32.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/miasm/os_dep/win_api_x86_32.py b/miasm/os_dep/win_api_x86_32.py
index d73b2c08..e83a3993 100644
--- a/miasm/os_dep/win_api_x86_32.py
+++ b/miasm/os_dep/win_api_x86_32.py
@@ -1722,7 +1722,7 @@ def kernel32_WideCharToMultiByte(jitter):
       ])
     if args.CodePage != CP_ACP and args.CodePage != CP_1252:
         raise NotImplementedError
-    src = jitter.vm.get_mem(args.lpWideCharStr, args.cchWideChar)
+    src = jitter.vm.get_mem(args.lpWideCharStr, args.cchWideChar * 2)
     dst = src.decode("utf-16le").encode("cp1252", errors="replace")
     if args.cbMultiByte > 0:
         # return value is the number of bytes written