Sogen Windows user-space emulator bindings
Project description
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 backend of your choice:
Try it out: sogen.dev
[!WARNING]
Caution is advised when analyzing malware in Sogen, as host isolation might not be perfect.
To mitigate potential risk, use the web version to benefit from the additional safety provided by your browser's sandbox.
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
- 💻 Debugging Interface
- Implements GDB serial protocol for integration with common debugging tools (IDA Pro, GDB, LLDB, VS Code, ...)
Preview
YouTube Overview
Click here for the slides.
Python Bindings
Install with:
pip install sogen
Python bindings require an emulation root. You can download a ready-made root here, or create your own by following the instructions in the wiki.
Example:
import sogen
emu = sogen.create_application("c:/test-sample.exe", None, emulation_root="./root")
def on_module_load(module):
if module.name.lower() == "test-sample.exe":
emu.hooks.memory_execution_at(module.entry_point, lambda address: print(f"hit entry point: 0x{address:x}"))
emu.callbacks.on_module_load = on_module_load
emu.start()
print(emu.process.exit_status)
See examples/python/README.md for setup details and a larger example.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sogen-0.0.1.dev3488.tar.gz.
File metadata
- Download URL: sogen-0.0.1.dev3488.tar.gz
- Upload date:
- Size: 21.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
748d5005087f8d72d9829d0b95fd99abdef0db7a804c87159c6b9c4f2c6bdceb
|
|
| MD5 |
b0128760530ee6e872144d0f50511fce
|
|
| BLAKE2b-256 |
254c9bbeb59106f19985dcd163bf9a39fc98448d144d375e60a28044300baf9b
|
Provenance
The following attestation bundles were made for sogen-0.0.1.dev3488.tar.gz:
Publisher:
build-push.yml on momo5502/sogen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sogen-0.0.1.dev3488.tar.gz -
Subject digest:
748d5005087f8d72d9829d0b95fd99abdef0db7a804c87159c6b9c4f2c6bdceb - Sigstore transparency entry: 1558722436
- Sigstore integration time:
-
Permalink:
momo5502/sogen@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/momo5502
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-push.yml@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Trigger Event:
push
-
Statement type:
File details
Details for the file sogen-0.0.1.dev3488-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: sogen-0.0.1.dev3488-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b067bff63717f17078c6639c464edfd17d33c2caaf1ad6bad2d7d6cdade92d5a
|
|
| MD5 |
1bc60390f59684d4009f842be8431bfa
|
|
| BLAKE2b-256 |
067ed1f762b3a41b3487ff18c07e8ea702676b56772ba35cea9c8e59ead0b360
|
Provenance
The following attestation bundles were made for sogen-0.0.1.dev3488-cp39-cp39-win_amd64.whl:
Publisher:
build-push.yml on momo5502/sogen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sogen-0.0.1.dev3488-cp39-cp39-win_amd64.whl -
Subject digest:
b067bff63717f17078c6639c464edfd17d33c2caaf1ad6bad2d7d6cdade92d5a - Sigstore transparency entry: 1558724464
- Sigstore integration time:
-
Permalink:
momo5502/sogen@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/momo5502
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-push.yml@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Trigger Event:
push
-
Statement type:
File details
Details for the file sogen-0.0.1.dev3488-cp39-cp39-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: sogen-0.0.1.dev3488-cp39-cp39-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 6.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9629a3f74a1a82820c2cc6c36d9b9639ef5024d50d8e7226089ebe466f979304
|
|
| MD5 |
0ad150157a2baca65dd1972704d1ed12
|
|
| BLAKE2b-256 |
2f5f94a89ccff69be4398be1889fe62aa423786f933b9c38aabe68623a516abf
|
Provenance
The following attestation bundles were made for sogen-0.0.1.dev3488-cp39-cp39-manylinux_2_39_x86_64.whl:
Publisher:
build-push.yml on momo5502/sogen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sogen-0.0.1.dev3488-cp39-cp39-manylinux_2_39_x86_64.whl -
Subject digest:
9629a3f74a1a82820c2cc6c36d9b9639ef5024d50d8e7226089ebe466f979304 - Sigstore transparency entry: 1558723178
- Sigstore integration time:
-
Permalink:
momo5502/sogen@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/momo5502
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-push.yml@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Trigger Event:
push
-
Statement type:
File details
Details for the file sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_x86_64.whl.
File metadata
- Download URL: sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_x86_64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.9, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d98f3cf11c76d6a3e04d307e6895b43aa5fba248df2c935b0e62e8fd2ddc06f
|
|
| MD5 |
406bcb4cd805e5f0ad3e60155a3f6229
|
|
| BLAKE2b-256 |
b3495f7d5e5a20c1bd767a138ea2b7d445dc8b02b03a097305128c4126fa0a17
|
Provenance
The following attestation bundles were made for sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_x86_64.whl:
Publisher:
build-push.yml on momo5502/sogen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_x86_64.whl -
Subject digest:
6d98f3cf11c76d6a3e04d307e6895b43aa5fba248df2c935b0e62e8fd2ddc06f - Sigstore transparency entry: 1558723809
- Sigstore integration time:
-
Permalink:
momo5502/sogen@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/momo5502
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-push.yml@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Trigger Event:
push
-
Statement type:
File details
Details for the file sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_arm64.whl.
File metadata
- Download URL: sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_arm64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.9, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fed345134705165f5014082e64419eb719303e60af0de48578106f3ade37f8a7
|
|
| MD5 |
e9002d6c23702a65c816e35397259268
|
|
| BLAKE2b-256 |
9f6ccb6c80d28b429e5e4da9799e671e1248a4aed299c83bd4b339720ce9edb4
|
Provenance
The following attestation bundles were made for sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_arm64.whl:
Publisher:
build-push.yml on momo5502/sogen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sogen-0.0.1.dev3488-cp39-cp39-macosx_15_0_arm64.whl -
Subject digest:
fed345134705165f5014082e64419eb719303e60af0de48578106f3ade37f8a7 - Sigstore transparency entry: 1558724984
- Sigstore integration time:
-
Permalink:
momo5502/sogen@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/momo5502
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-push.yml@b0251745d6bc4f92dea693e0c87c0e70db570ebc -
Trigger Event:
push
-
Statement type: