Maurice Heumann 6b6423d4bf Add new tests and some syscall fixes (#234)
This PR aims to:
- [Add new
tests](9d0de32cde),
specifically tests for the new registry features were added, as well as
a check for the GetSystemDirectory (this breaks if the SharedSection is
incorrectly configured). This already helped me [fix a
bug](0474eef373)
in the `WOW6432Node` redirection under Linux!
- [Handle TokenGroups in
NtQueryInformationToken](7fef4ebc24),
[Stub SystemFirmwareTableInformation in
NtQuerySystemInformation](3b918f2d5c).
These two changes allow executables protected with Themida to reach
their OEP while running on the emulator.
- [Add c_437.nls to
create-root.bat](21af0de2c8),
because looks like 850 was my system's code page but the playground
emulator uses 437.
2025-04-24 16:07:15 +02:00
2025-04-22 20:54:30 +02:00
2025-04-23 10:41:40 +02:00
2025-01-10 21:13:15 +01:00
2025-04-23 10:41:40 +02:00
2025-04-23 19:38:19 -03:00
2025-03-18 20:58:26 +01:00
2025-04-21 18:26:26 +02:00
2025-04-17 19:40:20 +02:00
2025-04-18 16:59:04 +02:00
2024-08-15 19:00:01 +02:00
2024-10-23 19:10:13 +02:00
2025-04-22 11:21:24 +02:00

Sogen

Sogen is a high-performance Windows user space emulator that operates at syscall level, providing full control over process execution through comprehensive hooking capabilities.

Perfect for security research, malware analysis, and DRM research where fine-grained control over process execution is required.

Built in C++ and powered by the Unicorn Engine (or the icicle-emu 🆕).

Try it out: sogen.dev

Key Features

  • 🔄 Syscall-Level Emulation
    • Instead of reimplementing Windows APIs, the emulator operates at the syscall level, allowing it to leverage existing system DLLs
  • 📝 Advanced Memory Management
    • Supports Windows-specific memory types including reserved, committed, built on top of Unicorn's memory management
  • 📦 Complete PE Loading
    • Handles executable and DLL loading with proper memory mapping, relocations, and TLS
  • Exception Handling
    • Implements Windows structured exception handling (SEH) with proper exception dispatcher and unwinding support
  • 🧵 Threading Support
    • Provides a scheduled (round-robin) threading model
  • 💾 State Management
    • Supports both full state serialization and fast in-memory snapshots (currently broken 😕)
  • 💻 Debugging Interface
    • Implements GDB serial protocol for integration with common debugging tools (IDA Pro, GDB, LLDB, VS Code, ...)

Note

The project is still in a very early, prototypical state. The code still needs a lot of cleanup and many features and syscalls need to be implemented. However, constant progress is being made :)

Preview

Preview

YouTube Overview

YouTube video

Click here for the slides.

Quick Start (Windows + Visual Studio)

Tip

Checkout the Wiki for more details on how to build & run the emulator on Windows, Linux, macOS, ...

1. Checkout the code:

git clone --recurse-submodules https://github.com/momo5502/sogen.git

2. Run the following command in an x64 Development Command Prompt in the cloned directory:

cmake --preset=vs2022

3. Build the solution that was generated at build/vs2022/emulator.sln

4. Create a registry dump by running the grab-registry.bat as administrator and place it in the artifacts folder next to the analyzer.exe

5. Run the program of your choice:

analyzer.exe C:\example.exe
Description
Languages
C++ 85.1%
TypeScript 9.9%
Rust 2.6%
CMake 1.5%
CSS 0.3%
Other 0.5%