Книга: Practical Malware Analysis: The Hands-On Guide to Dissecting Malicious Software
Назад: Kernel Debugging in Practice
Дальше: Loading Drivers

that kernel code is only accessible from user space via the SYSCALL, SYSENTER, or INT 0x2E instructions. Modern versions of Windows use the SYSENTER instruction, which gets instructions from a function code stored in register EAX. shows the code from ntdll.dll, which implements the NtCreateFile function and must handle the transitions from user space to kernel space that happen every time NtCreateFile is called.

, the stack pointer is saved in EDX, and then the sysenter instruction is called. The value in EAX is the function number for NtCreateFile, which will be used as an index into the SSDT when the code enters the kernel. Specifically, the address at offset 0x25 in the SSDT will be called in kernel mode. shows a few entries in the SSDT with the entry for NtCreateFile shown at offset 25.

is a shortened version of the SSDT.

. In the kernel, the modules listed are all drivers. We find the driver that contains the address 0xf7ad94a4, and we see that it is within the driver called Rootkit.