
Kernel-mode syscall wrapper with Zydis-based dynamic pattern finding for Windows 10/11
Updated fork of btbd/access with Zydis-based dynamic pattern finding for Windows 10/11 compatibility
A kernel-mode syscall wrapper that enables privileged process operations without requiring handles. Uses xKdEnumerateDebuggingDevices pointer hooking for kernel-usermode communication.
PROCESS_ALL_ACCESS operations without creating real handles.data section hook, no inline patchesThis fork modernizes the original driver with:
[singular-access] prefixThe driver uses Zydis to disassemble kernel functions and extract:
| Target | Method | Offset/Address |
|---|---|---|
| KTHREAD.PreviousMode | Disassemble ExGetPreviousMode | 0x232 (all versions) |
| PsResumeThread | Disassemble PsRegisterPicoProvider | RIP-relative LEA at +0x40 |
| PsSuspendThread | Disassemble PsRegisterPicoProvider | RIP-relative LEA at +0x50 |
| xKdEnumerateDebuggingDevices | Pattern scan .text section | Version-specific patterns |
User Mode (DLL)
↓ syscall with SYSCALL_UNIQUE
Kernel Hook (xKdEnumerateDebuggingDevices pointer)
↓ validates & dispatches
Kernel Syscall Handler
↓ performs privileged operation
Return to User Mode
cd Driver
msbuild Driver.vcxproj /p:Configuration=Release /p:Platform=x64
link_driver.bat
Output: Driver\x64\Release\Driver.sys
Option 1: kdmapper (recommended for testing)
kdmapper.exe Driver.sys
Option 2: Service
sc create singular_access type= kernel binPath= C:\path\to\Driver.sys
sc start singular_access
[singular-access] Initializing driver...
[singular-access] Windows build: 26200
[singular-access] ntoskrnl.exe base: FFFFF80000000000
[singular-access] [*] Searching for PsResumeThread in PsRegisterPicoProvider...
[singular-access] [+] Found PsResumeThread at FFFFF803AAE331C0
[singular-access] [*] Searching for PsSuspendThread in PsRegisterPicoProvider...
[singular-access] [+] Found PsSuspendThread at FFFFF803AADFA1A0
[singular-access] [+] Found PreviousMode offset: 0x232
[singular-access] Searching for xKdEnumerateDebuggingDevices pointer...
[singular-access] xKdEnumerateDebuggingDevices pointer: FFFFF803AB200B68
[singular-access] Installing hook...
[singular-access] Driver initialized successfully
The driver intercepts and handles:
Process Operations
NtOpenProcessNtSuspendProcess / NtResumeProcessNtQueryInformationProcess / NtSetInformationProcessNtQuerySystemInformationExNtFlushInstructionCacheMemory Operations
NtAllocateVirtualMemory / NtFreeVirtualMemoryNtReadVirtualMemory / NtWriteVirtualMemoryNtProtectVirtualMemoryNtQueryVirtualMemoryNtLockVirtualMemory / NtUnlockVirtualMemoryNtFlushVirtualMemoryThread Operations
NtOpenThreadNtSuspendThread / NtResumeThreadNtGetContextThread / NtSetContextThreadNtQueryInformationThread / NtSetInformationThreadSynchronization
NtWaitForSingleObjectTested and confirmed working:
| OS Version | Build | Status |
|---|---|---|
| Windows 10 1607 | 14393 | ✅ |
| Windows 10 1709 | 16299 | ✅ |
| Windows 10 1809 | 17763 | ✅ |
| Windows 10 2004 | 19041 | ✅ |
| Windows 11 21H2 | 22000 | ✅ |
| Windows 11 22H2 | 22621 | ✅ |
| Windows 11 24H2 | 26100-26200 | ✅ |
Finding PsResumeThread:
lea rcx, PsResumeThread ; Load function address
mov [rdx+40h], rcx ; Store in PICO provider table
Finding xKdEnumerateDebuggingDevices (Win11 24H2):
mov rax, cs:off_140E00B68 ; Pattern: 48 8B 05 ? ? ? ? 74 ? E8
; Resolve RIP-relative pointer
Extracting PreviousMode offset:
mov rax, gs:188h ; Get KTHREAD
movzx eax, byte ptr [rax+232h] ; Extract PreviousMode
ret
Driver/
├── main.c # Entry point, initialization, hook installation
├── core.c # Syscall handlers
├── util.c # Pattern scanning, memory utilities
├── zydis_util.c # Zydis-based pattern finders
├── zydis_util.h # Zydis function declarations
├── syscall.h # Syscall definitions
├── stdafx.h # Precompiled header
└── Zydis/ # Zydis disassembler library
Driver fails to load:
bcdedit /set testsigning onPattern not found:
Linker errors:
ZYDIS_STATIC_BUILD and ZYCORE_STATIC_BUILD are definedlink_driver.bat is using correct WDK lib pathssyscall.hcore.c using HANDLE_SYSCALL macroxKdEnumerateDebuggingDevices pointerfind_kd_enum_debug_devices_ptr() in main.cThis project maintains the same license as the original btbd/access repository.
This software is for educational and research purposes only. Use responsibly and only on systems you own or have explicit permission to test on.