Overview
This guide will help you get Sogen up and running quickly. We’ll build the emulator, set up the required registry files, and run your first emulated program.This quick start focuses on Windows with Visual Studio. For other platforms, see the Installation guide.
Prerequisites
- Windows operating system
- Visual Studio 2022 (with C++ development tools)
- Git
- Administrator privileges (for registry dump)
Step 1: Clone the Repository
First, clone Sogen with all its submodules:Step 2: Generate the Visual Studio Solution
Open an x64 Development Command Prompt and run:build/vs2022/emulator.sln.
The preset
vs2022 is configured for Visual Studio 2022. The build system will automatically download and configure dependencies.Step 3: Build the Project
You can build either from the command line or Visual Studio:build/vs2022/artifacts/ (or build/release/artifacts/ for command line builds).
Step 4: Create Registry Dump
Sogen needs access to Windows registry data to emulate programs correctly.Execute Registry Dump Script
registry folder with the following files:SYSTEMSECURITYSOFTWAREHARDWARESAMNTUSER.DAT
Step 5: Run Your First Program
Now you’re ready to emulate a Windows program!Using the Test Sample
Sogen includes a test sample that validates the emulator:Running Your Own Program
To emulate your own Windows executable:With Arguments
Pass arguments to the emulated program:Common Options
Here are some useful command-line options:Understanding the Output
By default, Sogen displays:- Emulator backend: Which CPU emulation engine is being used (Unicorn or Icicle)
- Execution logs: System calls, API calls, and other notable events
- Exit status: The program’s exit code (0 = success)
Example Output Analysis
- The emulator backend in use
- Which modules (EXE and DLLs) were loaded and their base addresses
- Thread creation
- Successful termination (status 0)
Debugging with GDB
Sogen supports the GDB remote protocol, enabling debugging with popular tools:What’s Emulated?
Sogen emulates a comprehensive Windows environment including:- File System: Virtual file system with path mapping
- Registry: Full registry access from dumped hives
- Threading: Multi-threading with synchronization primitives
- Exceptions: SEH (Structured Exception Handling)
- Memory: Virtual memory allocation and protection
- Networking: Socket operations (UDP/TCP)
- Time: System time and timers
- User Interface: Basic window messaging (HWND_MESSAGE)
Next Steps
Installation Guide
Learn how to build Sogen on Linux, macOS, and other platforms
Advanced Usage
Explore advanced features like state snapshots, Tenet tracing, and custom hooks
Troubleshooting
”Registry not found” Error
Make sure theregistry folder is in the same directory as analyzer.exe, or specify its path: