about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/jitter/arch/JitCore_x86.c17
-rw-r--r--miasm2/os_dep/win_api_x86_32.py6
2 files changed, 22 insertions, 1 deletions
diff --git a/miasm2/jitter/arch/JitCore_x86.c b/miasm2/jitter/arch/JitCore_x86.c
index f54cb1d3..eda6e6e5 100644
--- a/miasm2/jitter/arch/JitCore_x86.c
+++ b/miasm2/jitter/arch/JitCore_x86.c
@@ -55,6 +55,23 @@ reg_dict gpreg_dict[] = { {.name = "RAX", .offset = offsetof(vm_cpu_t, RAX)},
 			  {.name = "MM6", .offset = offsetof(vm_cpu_t, MM6)},
 			  {.name = "MM7", .offset = offsetof(vm_cpu_t, MM7)},
 
+			  {.name = "XMM0", .offset = offsetof(vm_cpu_t, XMM0)},
+			  {.name = "XMM1", .offset = offsetof(vm_cpu_t, XMM1)},
+			  {.name = "XMM2", .offset = offsetof(vm_cpu_t, XMM2)},
+			  {.name = "XMM3", .offset = offsetof(vm_cpu_t, XMM3)},
+			  {.name = "XMM4", .offset = offsetof(vm_cpu_t, XMM4)},
+			  {.name = "XMM5", .offset = offsetof(vm_cpu_t, XMM5)},
+			  {.name = "XMM6", .offset = offsetof(vm_cpu_t, XMM6)},
+			  {.name = "XMM7", .offset = offsetof(vm_cpu_t, XMM7)},
+			  {.name = "XMM8", .offset = offsetof(vm_cpu_t, XMM8)},
+			  {.name = "XMM9", .offset = offsetof(vm_cpu_t, XMM9)},
+			  {.name = "XMM10", .offset = offsetof(vm_cpu_t, XMM10)},
+			  {.name = "XMM11", .offset = offsetof(vm_cpu_t, XMM11)},
+			  {.name = "XMM12", .offset = offsetof(vm_cpu_t, XMM12)},
+			  {.name = "XMM13", .offset = offsetof(vm_cpu_t, XMM13)},
+			  {.name = "XMM14", .offset = offsetof(vm_cpu_t, XMM14)},
+			  {.name = "XMM15", .offset = offsetof(vm_cpu_t, XMM15)},
+
 			  {.name = "tsc1", .offset = offsetof(vm_cpu_t, tsc1)},
 			  {.name = "tsc2", .offset = offsetof(vm_cpu_t, tsc2)},
 
diff --git a/miasm2/os_dep/win_api_x86_32.py b/miasm2/os_dep/win_api_x86_32.py
index a88f4a8a..0101152a 100644
--- a/miasm2/os_dep/win_api_x86_32.py
+++ b/miasm2/os_dep/win_api_x86_32.py
@@ -734,12 +734,16 @@ def kernel32_VirtualProtect(jitter):
     flnewprotect = args.flnewprotect & 0xFFF
     if not flnewprotect in ACCESS_DICT:
         raise ValueError('unknown access dw!')
-    jitter.vm.set_mem_access(args.lpvoid, ACCESS_DICT[flnewprotect])
 
     if args.lpfloldprotect:
         old = jitter.vm.get_mem_access(args.lpvoid)
         jitter.vm.set_mem(args.lpfloldprotect, pck32(ACCESS_DICT_INV[old]))
 
+    for addr in jitter.vm.get_all_memory():
+        # Multi-page
+        if args.lpvoid <= addr < args.lpvoid + args.dwsize:
+            jitter.vm.set_mem_access(addr, ACCESS_DICT[flnewprotect])
+
     jitter.func_ret_stdcall(ret_ad, 1)