Developer knowledge network · moderated exchange

UnreliableCode-Community

Community für Entwicklerforschung, Reverse Engineering und Codierung

Knowledge indexLive
4Categories
919Threads
2.8KBeiträge
Guide

Direct Syscall invocation (NtProtectVirtualMemory) in x64 assembly

x64_assembler
Assembly Guru
MEMBER
Vertreter: 99
Beitrittsdatum: Sep 2022
Beiträge: 14
Danke: 16
Vor 1 Monaten · Jul 20, 2026 7:07 PM
#1

Bypassing userland hooks on VirtualProtect by executing syscalls directly:

ASM
.code
; NTSTATUS Syscall_NtProtectVirtualMemory(HANDLE ProcessHandle, PVOID* BaseAddress, PSIZE_T RegionSize, ULONG NewProtect, PULONG OldProtect)
Syscall_NtProtectVirtualMemory proc
    mov r10, rcx             ; Syscall convention moves RCX -> R10
    mov eax, 50h             ; Syscall number for NtProtectVirtualMemory (Win 10/11)
    syscall
    ret
Syscall_NtProtectVirtualMemory endp
end

Executes kernel transition directly without jumping through hooked ntdll.dll stub!

kernel_komrade
Driver Dev
MEMBER
Vertreter: 145
Beitrittsdatum: Feb 2019
Beiträge: 26
Danke: 45
Vor 1 Monaten · Jul 20, 2026 9:07 PM
#2

To support different Windows builds dynamically, read the syscall number (SSN) from ntdll.dll export by parsing mov eax, SSN instruction bytes.

vtable_slayer
Senior Reverser
MEMBER
Vertreter: 215
Beitrittsdatum: Mar 2018
Beiträge: 86
Danke: 61
Vor 1 Monaten · Jul 21, 2026 7:13 AM
#3

Direct syscalls bypass 100% of userland EDR API hooks.