NtEnumerateDriverEntries
Returns a packed list of every registered EFI_DRIVER_ENTRY — the UEFI Driver#### variables dispatched before the boot manager.
Prototype
NTSTATUS NtEnumerateDriverEntries( PVOID Buffer, PULONG BufferLength );
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| Buffer | PVOID | out | Caller-allocated buffer that receives a packed sequence of EFI_DRIVER_ENTRY_LIST records (NextEntryOffset + inline EFI_DRIVER_ENTRY). May be NULL to query required size. |
| BufferLength | PULONG | in/out | On input: size of Buffer in bytes. On output: bytes written, or required size when STATUS_BUFFER_TOO_SMALL is returned. |
Syscall IDs by Windows version
| Windows version | Syscall ID | Build |
|---|---|---|
| Win10 1507 | 0xD0 | win10-1507 |
| Win10 1607 | 0xD3 | win10-1607 |
| Win10 1703 | 0xD6 | win10-1703 |
| Win10 1709 | 0xD7 | win10-1709 |
| Win10 1803 | 0xD8 | win10-1803 |
| Win10 1809 | 0xD9 | win10-1809 |
| Win10 1903 | 0xDA | win10-1903 |
| Win10 1909 | 0xDA | win10-1909 |
| Win10 2004 | 0xDF | win10-2004 |
| Win10 20H2 | 0xDF | win10-20h2 |
| Win10 21H1 | 0xDF | win10-21h1 |
| Win10 21H2 | 0xE0 | win10-21h2 |
| Win10 22H2 | 0xE0 | win10-22h2 |
| Win11 21H2 | 0xE5 | win11-21h2 |
| Win11 22H2 | 0xE6 | win11-22h2 |
| Win11 23H2 | 0xE6 | win11-23h2 |
| Win11 24H2 | 0xE8 | win11-24h2 |
| Server 2016 | 0xD3 | winserver-2016 |
| Server 2019 | 0xD9 | winserver-2019 |
| Server 2022 | 0xE4 | winserver-2022 |
| Server 2025 | 0xE8 | winserver-2025 |
Kernel module
Related APIs
Syscall stub
4C 8B D1 mov r10, rcx B8 E8 00 00 00 mov eax, 0xE8 F6 04 25 08 03 FE 7F 01 test byte ptr [0x7FFE0308], 1 75 03 jne short +3 0F 05 syscall C3 ret CD 2E int 2Eh C3 ret
Undocumented notes
Same two-call enumeration pattern as NtEnumerateBootEntries — call once with `Buffer = NULL` to learn the required size, then again with the allocation. Walks the linked list via `EFI_DRIVER_ENTRY_LIST.NextEntryOffset`. SeSystemEnvironmentPrivilege is required even for read. On UEFI it indirectly reads the `DriverOrder` global variable plus each referenced `Driver####`.
Common malware usage
Used both offensively and defensively. Offensively: APT recon to fingerprint the firmware before deciding which DRIVER_ENTRY hijack is viable — MosaicRegressor's installer enumerates DriverOrder to find a stable slot held by a vulnerable OEM driver before patching it. Defensively: incident-response and proactive forensics call it (or `bcdedit /enum FIRMWARE`) to dump the current driver list and compare against a clean-room baseline of the same hardware model — the easiest reliable way to spot LoJax/MosaicRegressor-class implants short of full SPI dump.
Detection opportunities
Enumeration alone is benign — defenders run it constantly. The interesting signal is **enumeration by an unexpected process**: a non-OEM, non-Microsoft, non-EDR userland process that opens a token with SeSystemEnvironmentPrivilege and reads the driver list is a strong staging indicator. Pair the call site (Event ID 4673) with the process command line via Sysmon Event ID 1. The most reliable defense remains Secure Boot with an updated DBX and Measured Boot + remote attestation extending PCR[2] on every dispatched DXE driver.
Direct syscall examples
asmx64 direct stub (Win11 24H2, SSN 0xE8)
NtEnumerateDriverEntries PROC
mov r10, rcx ; PVOID Buffer
mov eax, 0E8h ; Win11 24H2
syscall
ret
NtEnumerateDriverEntries ENDPcDefensive: dump every DXE entry path + hash
// Walk DriverOrder, print FriendlyName + DriverFilePath of each registered DXE entry.
extern NTSTATUS NTAPI NtEnumerateDriverEntries(PVOID, PULONG);
void dump_drivers(void) {
ULONG size = 0;
NtEnumerateDriverEntries(NULL, &size);
if (!size) return;
PBYTE buf = (PBYTE)HeapAlloc(GetProcessHeap(), 0, size);
if (NT_SUCCESS(NtEnumerateDriverEntries(buf, &size))) {
PBYTE p = buf;
while (p < buf + size) {
PEFI_DRIVER_ENTRY_LIST list = (PEFI_DRIVER_ENTRY_LIST)p;
PEFI_DRIVER_ENTRY de = &list->DriverEntry;
wprintf(L"id=%08X name=%s\n", de->Id,
(LPCWSTR)((PBYTE)de + de->FriendlyNameOffset));
if (!list->NextEntryOffset) break;
p += list->NextEntryOffset;
}
}
HeapFree(GetProcessHeap(), 0, buf);
}rustNaked stub
use std::arch::asm;
#[unsafe(naked)]
unsafe extern "system" fn nt_enumerate_driver_entries(_buf: *mut u8, _len: *mut u32) -> i32 {
asm!(
"mov r10, rcx",
"mov eax, 0xE8", // Win11 24H2
"syscall",
"ret",
options(noreturn),
);
}MITRE ATT&CK mappings
Last verified: 2026-05-20