Basic usage
Dr.Semu analyzes executables by running them in an isolated environment and monitoring their behavior.Ensure you have completed the installation steps before proceeding.
Analyze a single file
To analyze a suspicious executable:- Launch the executable in an isolated environment
- Monitor all system calls and behavior
- Generate a JSON report with behavioral data
- Run detection rules to determine if the file is malicious
- Display the verdict
Analyze multiple files
You can also analyze an entire directory of executables:.exe file in the directory sequentially.
Command-line options
Available options
From the source code inLauncherCLI/LauncherCLI.cpp:
--targetor-t: Path to executable or directory containing executables (required)--cmd_lineor-c: Command-line arguments to pass to the target executable--time_limitor-l: Time limit in seconds for the target process (default: 120 seconds)
Understanding the output
During analysis
While Dr.Semu analyzes the executable, you’ll see:Virtual environment setup
Dr.Semu creates an isolated filesystem and registry environment using ProjFS.
Analysis reports
Dr.Semu generates JSON reports in a temporary directory. Each report includes:- Intercepted system calls: Filesystem, registry, process, and network operations
- Static file information: Hash, architecture, and PE metadata
- Process hierarchy: Parent-child relationships and PIDs
DrSemu.cpp:
Final verdict
After analysis completes, Dr.Semu displays:dr_rules directory.
Example workflow
Monitor execution
Watch the console output as Dr.Semu:
- Sets up the virtual environment
- Launches the process under DynamoRIO
- Tracks all spawned processes
How Dr.Semu works internally
Isolation mechanism
From the source code, Dr.Semu isolates malware through:- Filesystem redirection: ProjFS creates a virtual filesystem at
%TEMP%\dr_semu_{vm_index} - Registry redirection: Clones all Registry hives to a new location and redirects accesses
- Process isolation: Tracks and isolates child processes
- Object isolation: Separates mutexes, events, and other kernel objects
System call monitoring
Dr.Semu uses DynamoRIO to intercept system calls including:- Filesystem:
NtCreateFile,NtWriteFile,NtDeleteFile - Registry:
NtOpenKey,NtSetValueKey,NtDeleteKey - Process:
NtCreateUserProcess,NtWriteVirtualMemory,NtProtectVirtualMemory - Network:
WSAStartup,gethostbyname,URLDownloadToFileW - Objects:
NtCreateMutant,NtCreateEvent,NtWaitForSingleObject
The interception happens at the user-kernel boundary before system calls execute, allowing Dr.Semu to monitor and modify behavior without kernel hooks.
Advanced usage
Passing arguments to malware
Some malware requires command-line arguments:Adjusting time limits
For malware with delayed execution:Batch analysis
Analyze multiple samples efficiently:Troubleshooting
Common issues
Virtual FS/REG connection fails Ensure ProjFS is enabled:dynamorio directory exists in your Dr.Semu folder with the correct structure:
Next steps
Detection rules
Write custom rules to detect specific malware families
Source code
Explore the Dr.Semu implementation on GitHub