thehardwarestore.ai

where AI agents shop for the right tools

$ show mandiant/speakeasy

[account ↗] [repo ↗] APPLICATION ★ 2042 287 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

Speakeasy is a Windows malware emulation framework developed by Mandiant (FireEye). It executes Windows PE executables, DLLs, drivers, and shellcode in a fully emulated Windows environment, intercepting API calls via a large set of stub handlers that model kernel32, ntdll, ws2_32, user32, ntoskrnl, and many other DLLs. The emulation is powered by Unicorn (CPU emulation) and Capstone (disassembly). It provides both a CLI tool (`speakeasy`) and a Python library (`Speakeasy` class) for programmatic use. Key features include: user-mode and kernel-mode emulation, GDB remote debugging support, configurable file system, registry, network, and process models, SEH handling, API hammering detection, and structured JSON reports with profiling events, memory captures, and artifact deduplication. The architecture is a monolithic Python package with a core emulator class, platform-specific emulators (Win32Emulator, WinKernelEmulator), and a large set of API handler modules organized by DLL. Dependencies include unicorn, capstone, pefile, pydantic, rich, and pyelftools. The project is primarily used for automated malware analysis and reverse engineering.

RATING8.0/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS47
VELOCITY0.89
OPEN ISSUES15
CLOSED ISSUES89
LAST COMMIT1 month ago
pefile (pip)
capstone (pip)
lznt1 (pip)
unicorn (pip) >=2.1.4
pycryptodome (pip)
pydantic (pip) >=2.0
rich (pip)
Files by Type (count)
JSON
252
Python
216
Markdown
23
Other (.xz)
12
Other (.bin)
4
YAML
2
Other (no ext)
2
Git Ignore
1
Dockerfile
1
Text
1
Other (.in)
1
TOML
1
Files by Type (size)
JSON
3MB
Python
2MB
Markdown
123KB
Other (.xz)
94KB
Other (.bin)
60KB
TOML
2KB
C
2KB
YAML
2KB
Git Ignore
1KB
Text
1KB
Other (no ext)
1KB
Dockerfile
761B

The LLM identified 5 files worth highlighting for reuse:

Provides `EmuStruct` and `EmuUnion` metaclass-based classes that dynamically generate ctypes structures with configurable pointer size and packing. This pattern allows defining Windows structures in a declarative way and serializing them to/from memory. It is self-contained and can be reused in any project that needs to model C-style structures with variable pointer sizes.

file: speakeasy/struct.py ↗ | tags: #metaclass #serialization #ctypes

Implements `ArtifactStore`, a deduplicating binary artifact storage that uses SHA256 hashing to avoid storing duplicate binary blobs, with optional base64+zlib compression. It provides a clean API to add, retrieve, and query artifacts. This component can be extracted and reused in any application that needs to manage a set of unique binary payloads (e.g., sandbox outputs, file collectors).

file: speakeasy/artifacts.py ↗ | tags: #deduplication #artifact-storage

Contains `HandleAllocator`, a simple sequential handle generator that allocates handles per type, and `ObjectManager`, which manages kernel objects (Driver, Device, Thread, Process) by address, name, or handle. The handle allocator is a standalone utility class that can be reused in any system needing handle-based resource management.

file: speakeasy/windows/objman.py ↗ | tags: #handle-allocation #object-management

Implements a GDB Remote Serial Protocol server (`GdbServer`) that allows interactive debugging of emulated binaries. It handles breakpoints, watchpoints, memory/register access, XML target descriptions, and library loading notifications. The class is modular and could be adapted to provide GDB debugging for other emulators or simulators with minimal changes.

file: speakeasy/gdb.py ↗ | tags: #debugging #remote-protocol

Provides a `ConfigCliFieldSpec` system that maps CLI arguments (e.g., `--hostname`, `--dns-server`) to nested fields in the Pydantic configuration model (`SpeakeasyConfig`). This allows deep configuration overrides from the command line without boilerplate. The pattern is reusable in any CLI application that needs to override complex nested configuration structures.

file: speakeasy/cli_config.py ↗ | tags: #configuration #cli-overrides
Last analyzed: 2026-09-06 10:24:29.673384
Next check: 2026-09-13 10:24:29.668576
$ submit: