Skip to main content
Dr.Semu monitors filesystem-related system calls to track file operations performed by the analyzed binary. All file paths are redirected to a virtual filesystem to ensure safe analysis.

File Operations

NtWriteFile

Writes data to a file.
FileHandle
HANDLE
Handle to the file to write to
Event
HANDLE
Optional event to signal when operation completes
Buffer
PVOID
Pointer to the buffer containing data to write
Length
ULONG
Number of bytes to write
Logged Information:
  • File path
  • Operation success status

NtCreateFile

Creates or opens a file.
FileHandle
PHANDLE
Receives a handle to the file
DesiredAccess
ACCESS_MASK
Access rights requested for the file
ObjectAttributes
POBJECT_ATTRIBUTES
Attributes of the file to create/open
CreateDisposition
ULONG
Action to take if the file exists or does not exist
CreateOptions
ULONG
Options for creating the file
Logged Information:
  • File path
  • Desired access flags
  • File attributes
  • Create disposition
  • Create options
  • Share access
  • Operation success status

NtOpenFile

Opens an existing file.
FileHandle
PHANDLE
Receives a handle to the file
DesiredAccess
ACCESS_MASK
Access rights requested for the file
ObjectAttributes
POBJECT_ATTRIBUTES
Attributes of the file to open
ShareAccess
ULONG
Type of share access
OpenOptions
ULONG
Options for opening the file
Logged Information:
  • File path
  • Desired access flags
  • Share access
  • Operation success status

NtDeleteFile

Deletes a file.
ObjectAttributes
POBJECT_ATTRIBUTES
Attributes of the file to delete
Logged Information:
  • File path
  • Operation success status

NtClose

Closes a handle to a file or other object.
Handle
HANDLE
Handle to close

File Information

NtQueryInformationFile

Retrieves information about a file.
FileHandle
HANDLE
Handle to the file
FileInformationClass
FILE_INFORMATION_CLASS
Type of information to retrieve
Logged Information:
  • File handle
  • Information class
  • File path
  • Operation success status

NtSetInformationFile

Sets information for a file, including renaming operations.
FileHandle
HANDLE
Handle to the file
FileInformation
PVOID
Buffer containing the information to set
FileInformationClass
FILE_INFORMATION_CLASS
Type of information to set
Special Handling:
  • File rename operations are tracked separately
  • Logs both old and new paths for rename operations

NtQueryAttributesFile

Retrieves basic attributes of a file.
ObjectAttributes
POBJECT_ATTRIBUTES
Attributes identifying the file
FileInformation
PFILE_BASIC_INFORMATION
Receives the file attributes

NtQueryFullAttributesFile

Retrieves extended attributes of a file.
ObjectAttributes
POBJECT_ATTRIBUTES
Attributes identifying the file
FileInformation
PFILE_NETWORK_OPEN_INFORMATION
Receives the extended file attributes
Logged Information:
  • File path
  • Operation success status

Directory Operations

NtQueryDirectoryFile

Enumerates files in a directory.
FileHandle
HANDLE
Handle to the directory
FileInformationClass
FILE_INFORMATION_CLASS
Type of information to return for each file
FileName
PUNICODE_STRING
Optional filter pattern
Special Handling:
  • Virtual filesystem directories are hidden from enumeration results

NtQueryDirectoryFileEx

Extended version of NtQueryDirectoryFile.
FileHandle
HANDLE
Handle to the directory
FileInformationClass
FILE_INFORMATION_CLASS
Type of information to return
QueryFlags
ULONG
Flags controlling the query

NtCreateDirectoryObject

Creates or opens a directory object.
DirectoryHandle
PHANDLE
Receives a handle to the directory object
DesiredAccess
ACCESS_MASK
Access rights for the directory
ObjectAttributes
POBJECT_ATTRIBUTES
Attributes of the directory object

Section Objects

NtCreateSection

Creates a section object (memory-mapped file).
SectionHandle
PHANDLE
Receives a handle to the section
DesiredAccess
ACCESS_MASK
Desired access to the section
FileHandle
HANDLE
Optional handle to file to map
SectionPageProtection
ULONG
Memory protection for the section

NtMapViewOfSection

Maps a view of a section into the virtual address space.
SectionHandle
HANDLE
Handle to the section object
ProcessHandle
HANDLE
Handle to the process
BaseAddress
PVOID*
Pointer to receive the base address

Other File Operations

NtFlushBuffersFile

Flushes buffered data to disk.
FileHandle
HANDLE
Handle to the file

NtCreateSymbolicLinkObject

Creates a symbolic link object.
Receives a handle to the symbolic link
DesiredAccess
ACCESS_MASK
Desired access rights
ObjectAttributes
POBJECT_ATTRIBUTES
Attributes of the symbolic link
Target of the symbolic link

NtCreatePagingFile

Creates a paging file. Access Control: This operation is denied with STATUS_PRIVILEGE_NOT_HELD as it requires elevated privileges.

NtCreateIoCompletion

Creates an I/O completion object.
IoCompletionHandle
PHANDLE
Receives a handle to the I/O completion object
DesiredAccess
ACCESS_MASK
Desired access rights
ObjectAttributes
POBJECT_ATTRIBUTES
Optional object attributes

Build docs developers (and LLMs) love