I asked GPT to describe the main rootkit code. The high level view made it a little easier to find my way around.
https://chat.openai.com/share/d5f0f002-6739-4b0f-ad50-d71207...
SetFastIoDispatch(): This function sets up the Fast I/O dispatch table for the driver. Fast I/O operations are a more efficient way to handle certain I/O operations in the Windows kernel.
HookingFileSystems(): Hooks into the file systems (NTFS, FastFAT, CDFS) to intercept file system operations. It modifies system behavior by redirecting calls to these file systems.
HookOne(): Hooks a single file system. It references a file system object by name and then attaches to it.
DriverNotificationRoutine(): A notification routine called when the driver's status changes, such as when a device is attached or detached.
AttachDevice(): Attaches the rootkit's device object to a target device in the system, allowing the rootkit to intercept calls to this device.
IsAllreadyAttached(): Checks if the rootkit is already attached to a target device.
CreateDevice(): Creates a device object for the rootkit, enabling it to interact with the system as a device driver.
IsMyDevice(): Checks if a given device object belongs to the rootkit.
SettingFlags(): Sets various flags for a device object to define its characteristics and behavior.
AttachToStack(): Attaches the rootkit's device object to the device stack of the target device.
OnFileSystemControl() and OnDirectoryControl(): These functions handle specific file system control and directory control operations, respectively. They are likely points where the rootkit intercepts and manipulates file system requests.
SetCompletionFileControl() and SetCompletionDirControl(): Set up completion routines for file and directory control operations, allowing the rootkit to execute additional code when these operations complete.
FileControlCompletionRoutine() and DirectoryCompletionRoutine(): Completion routines for file and directory control operations. They are invoked when file system and directory operations are completed, allowing the rootkit to intervene at this stage.
FreeMdl(), AllocateMdl(), CreateWorkRoutine(), WorkerRoutine(): These functions manage memory descriptors (MDLs) and work items, which are kernel objects used for deferred or asynchronous work.
GetOffsets(), FileCheck(), StrCheck(), TMPCheck(): These functions are involved in analyzing and potentially modifying file information during directory listings. They seem to be designed to hide or manipulate certain files or directories from being listed or accessed in a specific way.
CallDriver(), IRPDispatchRoutine(), SetZero(): Helper functions for handling IRP (I/O Request Packet) processing and manipulating device extension structures.
DriverEntry(): The entry point for the driver, setting up the rootkit when it is loaded into the system.