Developer knowledge network · moderated exchange

UnreliableCode Topluluğu

Geliştirici Araştırması, Tersine Mühendislik ve Kodlama Topluluğu

Knowledge indexCanlı
4Categories
919Threads
2.8KGönderiler
Guide

Direct Syscall invocation (NtProtectVirtualMemory) in x64 assembly

x64_assembler
Assembly Guru
MEMBER
Temsilci: 99
Katılım Tarihi: Sep 2022
Gönderiler: 14
Teşekkürler: 16
1 ay önce · 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
Temsilci: 145
Katılım Tarihi: Feb 2019
Gönderiler: 26
Teşekkürler: 45
1 ay önce · 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
Temsilci: 215
Katılım Tarihi: Mar 2018
Gönderiler: 86
Teşekkürler: 61
1 ay önce · Jul 21, 2026 7:13 AM
#3

Direct syscalls bypass 100% of userland EDR API hooks.