Developer knowledge network ยท moderated exchange

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Knowledge indexLive
4Categories
919Threads
2.8KPosts
Tutorial

Invoking Direct x64 System Calls (NtProtectVirtualMemory) via Inline Assembly Stubs [v2.4 Technical Discussion]

x64_assembler
Assembly Guru
MEMBER
Rep: 99
Join Date: Sep 2022
Posts: 14
Thanks: 16
1 months ago ยท Jul 21, 2026 10:09 PM
#1

How to bypass userland DLL hooks by issuing direct syscall opcodes:

ASM
; x64 Assembly Syscall Stub (NtProtectVirtualMemory SSN = 0x50 on Win11 23H2)
.code
SysNtProtectVirtualMemory PROC
    mov r10, rcx
    mov eax, 50h ; System Service Number
    syscall
    ret
SysNtProtectVirtualMemory ENDP
END

Userland hooks placed by security modules on ntdll.dll are completely bypassed because execution never traverses ntdll!

vtable_slayer
Senior Reverser
MEMBER
Rep: 215
Join Date: Mar 2018
Posts: 86
Thanks: 61
1 months ago ยท Jul 22, 2026 12:24 AM
#2

Direct syscalls are the cornerstone of bypassing userland API surveillance.

kernel_komrade
Driver Dev
MEMBER
Rep: 145
Join Date: Feb 2019
Posts: 26
Thanks: 45
1 months ago ยท Jul 22, 2026 8:30 AM
#3

Make sure you dynamically parse SSNs from ntdll export directory so Windows updates don't change numbers.