payloads
R4t includes a deterministic, recipe-based payload build and resolution system. Rather than maintaining a static folder of pre-compiled binaries, R4t treats payloads as build recipes that produce artifacts on demand — compiled, transformed, cached, and resolved automatically.Why Recipe-Based
A static payload repository breaks down once the operator needs per-target configuration, multiple transports, staged vs stageless outputs, in-memory execution, or artifacts in different formats (EXE, DLL, shellcode, PIC, BOF, scripts). A recipe-based model solves this by treating builds as deterministic results of a build specification.Architecture Overview
Core Concepts
Templates
A template is the source definition of something that can be built. It declares:- Where the source lives
- Which build environment is required (Go, MinGW, .NET, BOF, PowerShell, Clang/LLVM)
- Build commands and output conventions
Payloads
A payload is the operator-facing logical object — a named record tied to a template with optional defaults. Payloads are not files; they are named concepts:corp-http-agentsmb-loaderpic-execldap-helper
Builds
A build is a fully specified recipe describing every parameter needed to produce output:
Builds are uniquely identified by a recipe hash — a SHA-256 of the canonicalized build specification.
Artifacts
An artifact is the actual output file produced from a build:
Artifacts are stored in a content-addressed store by SHA-256 hash:
Transformations
Transformations convert one output type into another in an ordered pipeline:Capabilities
Capabilities are queryable traits attached to builds and artifacts. Modules request capabilities instead of specific files:Resolution Model
Modules never ask forsomefile.exe. They describe what they need, and the resolver handles the rest.
Capability Request Flow
Example Resolution
A module requests a Windows x64 PIC-capable in-memory artifact with SMB delivery:- Module constructs target profile: OS=Windows, Arch=x64, AllowsInjection=true, AllowsDisk=false
- Module sends capability request:
inmemory=true,pic=true,smb=supported - Resolver checks existing completed builds
- No match found — computes recipe hash for: template=
smb-loader, OS=windows, arch=x64, stage=stageless, transport=smb, format=dll, transforms=[srdi,pic-wrap] - Build manager acquires build lock via database row
- Builder compiles the source template
- Transformation pipeline converts output to reflective DLL and PIC forms
- Artifacts stored, capabilities indexed
- Resolver returns PIC artifact bytes to the module
Build Identity and Hashing
Recipe Hash
Every build is uniquely identified by a SHA-256 hash of its canonicalized recipe:Artifact Hash
Each artifact is independently hashed (SHA-256 of its bytes) for content-addressed storage, deduplication, and integrity verification.Concurrency and Build Locking
Multiple modules can request builds simultaneously. The build system uses the database build row as a lock:Build States
Multi-Language Compilation
Each template declares its required builder environment. The Go application orchestrates builds without being the toolchain itself:
Builder environments are containerized or isolated for deterministic toolchain versions and reproducible builds.

