about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-11-21 13:36:13 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-11-21 13:36:13 +0100
commit6f07abbfb6372ea563d0539fbb1638903b6638e8 (patch)
tree0838a41a19e203a05a856934d86c66d47e10f1a7
parent4bad55762c243e9aab421e7235524ac5b8442852 (diff)
downloadmiasm-6f07abbfb6372ea563d0539fbb1638903b6638e8.tar.gz
miasm-6f07abbfb6372ea563d0539fbb1638903b6638e8.zip
Win_API: Temporary fix for ids in 64 bits
Id(xxx) is actually used to generated handles on windows os_dep A future
patch will add handles generation / management for windows environement.
-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):