What is Stardust?
Stardust is a modern and easy-to-use 32/64-bit position-independent shellcode template framework for Windows. It provides a robust foundation for developing advanced shellcode with modern C++ features, eliminating the complexity of manual assembly while maintaining full control over code generation. Built with security researchers and red team operators in mind, Stardust bridges the gap between high-level development convenience and low-level shellcode requirements.Key Features
Position Independent Code (PIC)
Stardust generates fully position-independent shellcode that can execute from any memory location without relocation. The framework handles all address calculations transparently through custom linker scripts and runtime resolution.src/main.cc
Compile-Time Hashing with FNV-1a
All API and module names are hashed at compile-time using the FNV-1a algorithm, eliminating plaintext strings from the final binary. This provides operational security while maintaining clean, readable source code.Dynamic API Resolution
Stardust resolves Windows API functions at runtime by walking the Process Environment Block (PEB) and parsing module export tables. This avoids Import Address Table (IAT) dependencies.include/resolve.h
C++20 Modern Features
- Consteval functions:
expr::hash_stringperforms hashing at compile-time - Template metaprogramming: Type-safe API resolution with automatic casting
- Raw string support: The
symbol<T>()function handles string literals in PIC context - Structured design: Clean class-based architecture with the
instancepattern
src/main.cc
Debug Capabilities
When compiled in debug mode, Stardust providesDbgPrint integration for kernel-level debugging through DebugView.
Use Cases
Security Research
Study Windows internals, PEB/TEB structures, and module loading behavior in controlled environments.
Red Team Operations
Develop custom post-exploitation payloads with minimal footprint and evasion-friendly characteristics.
Exploit Development
Create reliable position-independent payloads for memory corruption vulnerabilities.
Malware Analysis
Understand shellcode patterns and techniques used in modern offensive tooling.
Architecture Overview
Stardust’s architecture consists of several key components:1. Entry Point (ASM)
Native assembly stubs (entry.x64.asm, entry.x86.asm) handle stack alignment and initial execution flow before transferring control to C++ code.
src/asm/entry.x64.asm
2. Instance Initialization
Theinstance class constructor resolves critical modules (ntdll.dll, kernel32.dll) and their exported functions using compile-time hashes.
3. Runtime Resolution
Theresolve::module() and resolve::api() functions parse in-memory structures to locate modules and functions without using the IAT.
4. Payload Execution
Theinstance::start() method contains your custom shellcode logic, with full access to resolved Windows APIs.
5. Linker Script Magic
Custom linker script (scripts/linker.ld) ensures proper section ordering for position independence:
scripts/linker.ld
Project Structure
Next Steps
Quickstart
Get Stardust running in under 5 minutes
Building
Learn about build modes and compiler options
API Reference
Explore the complete API documentation
Examples
See real-world shellcode implementations
