about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2019-11-21 17:54:24 +0100
committerGitHub <noreply@github.com>2019-11-21 17:54:24 +0100
commit568a6207e4f4c82df98564a7463a12119f367bf5 (patch)
tree0838a41a19e203a05a856934d86c66d47e10f1a7
parent4bad55762c243e9aab421e7235524ac5b8442852 (diff)
parent6f07abbfb6372ea563d0539fbb1638903b6638e8 (diff)
downloadmiasm-568a6207e4f4c82df98564a7463a12119f367bf5.tar.gz
miasm-568a6207e4f4c82df98564a7463a12119f367bf5.zip
Merge pull request #1098 from serpilliere/fix_win_api
Win_API: Temporary fix for ids in 64 bits
-rw-r--r--miasm/os_dep/win_api_x86_32.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/miasm/os_dep/win_api_x86_32.py b/miasm/os_dep/win_api_x86_32.py
index 051cedb5..7abd03b7 100644
--- a/miasm/os_dep/win_api_x86_32.py
+++ b/miasm/os_dep/win_api_x86_32.py
@@ -868,14 +868,14 @@ def kernel32_CreateMutex(jitter, funcname, get_str):
             raise NotImplementedError("Untested case")
             # ret = 0
         else:
-            winobjs.mutex[name] = id(name)
+            winobjs.mutex[name] = id(name) & 0xFFFFFFFF
             ret = winobjs.mutex[name]
     else:
         if name in winobjs.mutex:
             raise NotImplementedError("Untested case")
             # ret = 0
         else:
-            winobjs.mutex[name] = id(name)
+            winobjs.mutex[name] = id(name) & 0xFFFFFFFF
             ret = winobjs.mutex[name]
     jitter.func_ret_stdcall(ret_ad, ret)
 
@@ -1670,7 +1670,7 @@ def my_CreateEvent(jitter, funcname, get_str):
         winobjs.events_pool[s] = (args.bmanualreset, args.binitialstate)
     else:
         log.warning('WARNING: known event')
-    jitter.func_ret_stdcall(ret_ad, id(s))
+    jitter.func_ret_stdcall(ret_ad, id(s) & 0xFFFFFFFF)
 
 
 def kernel32_CreateEventA(jitter):