Skip to content

Commit 0151892

Browse files
authored
guard breakpoint() fix with x86 check for ARM64 Windows support
2 parents a343d7c + 0b22a2c commit 0151892

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/vmaware.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11797,7 +11797,7 @@ struct VM {
1179711797
[[nodiscard]] static bool msr() {
1179811798
#if (!x86)
1179911799
return false;
11800-
#endif
11800+
#else
1180111801
constexpr u32 random_msr = 0xDEADBEEFu;
1180211802

1180311803
auto try_read = [](u32 msr_index) -> bool {
@@ -11849,6 +11849,7 @@ struct VM {
1184911849
}
1185011850

1185111851
return false;
11852+
#endif
1185211853
}
1185311854

1185411855

@@ -11861,7 +11862,7 @@ struct VM {
1186111862
[[nodiscard]] static bool kvm_interception() {
1186211863
#if (!x86)
1186311864
return false;
11864-
#endif
11865+
#else
1186511866
using nt_allocate_virtual_memory_t = NTSTATUS(__stdcall*)(HANDLE, PVOID*, ULONG_PTR, PSIZE_T, ULONG, ULONG);
1186611867
using nt_protect_virtual_memory_t = NTSTATUS(__stdcall*)(HANDLE, PVOID*, PSIZE_T, ULONG, PULONG);
1186711868
using nt_free_virtual_memory_t = NTSTATUS(__stdcall*)(HANDLE, PVOID*, PSIZE_T, ULONG);
@@ -11947,6 +11948,7 @@ struct VM {
1194711948
}
1194811949

1194911950
return false;
11951+
#endif
1195011952
}
1195111953

1195211954

@@ -11956,6 +11958,9 @@ struct VM {
1195611958
* @implements VM::BREAKPOINT
1195711959
*/
1195811960
[[nodiscard]] static bool breakpoint() {
11961+
#if (!x86)
11962+
return false;
11963+
#else
1195911964
const HMODULE ntdll = util::get_ntdll();
1196011965
if (!ntdll) return false;
1196111966

@@ -12069,6 +12074,7 @@ struct VM {
1206912074
nt_free_virtual_memory(current_process, &dst_page, &free_size, MEM_RELEASE);
1207012075

1207112076
return !ermsb_trap_detected;
12077+
#endif
1207212078
}
1207312079
// ADD NEW TECHNIQUE FUNCTION HERE
1207412080
#endif

0 commit comments

Comments
 (0)