Skip to main content
command CX Codex

loader_generate — Claude Code command: what it does, how to install

loader_generate spawns an agent to assemble and compile C, C++, or Rust shellcode loaders from a techniques knowledge base.

MIT ★ 336 updated 2026-04-09

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/loader_generate.md
Open on GitHub

What loader_generate does

The command triggers the loadergen-agent subagent, which pulls techniques from loader_techniques.json, filters out duplicates using scenarios.json, and generates source files. It combines components across storage, memory allocation, copying, and execution.

Output files are written to output/loader_<id>.c, .cpp, or .rs, then built into an executable via MinGW or Cargo. By default, the workflow targets samples/calc.bin, but a custom payload can be supplied with --shellcode.

Working compilers are required upfront: MinGW for C/C++ or Cargo for Rust. Generated executables must never be executed on the machine, as compilation success is the final check.

What it helps with

  • Generate C, C++, or Rust shellcode loaders with specific execution methods
  • Batch-generate multiple loaders with different memory allocators
  • Verify loader compilation with custom shellcode payloads without running them

Example prompts for the agent

  • /loader_generate --language rust
  • /loader_generate 3 --shellcode custom.bin
  • /loader_generate --executor callback --shellcode my.bin

How to install loader_generate

Manually: put the files in place

.claude/commands/loader_generate.md

Call it with /loader_generate. For all projects use ~/.claude/commands/

Questions about loader_generate

How to install loader_generate in Claude Code?

Save the command file to .claude/commands/loader_generate.md.

What does the loader_generate command do?

It launches the loadergen-agent subagent to generate C, C++, or Rust source code from modular techniques and builds an executable.

Is it safe to run generated loaders?

No, running generated executables is forbidden. The command uses samples/calc.bin by default, and successful compilation is the only target.

Source text

loader_generate.md · MIT
---
description: Generate shellcode loaders by combining components from knowledge base. Creates working C/C++/Rust loaders using documented techniques. Triggers on "generate loader", "create loader", "shellcode loader", "生成loader".
argument-hint: Optional: count (e.g., "5" for batch), shellcode file (e.g., "path/to/shellcode.bin"), or filters (e.g., "--executor callback --shellcode my.bin")
---

# Loader Generate Command

Launch the loadergen-agent to generate shellcode loaders from the knowledge base.

## Usage

```bash
/loader_generate                                # Single random loader (uses samples/calc.bin)
/loader_generate 5                              # Batch generate 5 loaders
/loader_generate --shellcode path/to/sc.bin     # Use custom shellcode file
/loader_generate my.bin                         # Shorthand: use my.bin as shellcode
/loader_generate --executor callback            # Specific executor
/loader_generate --allocator NtAllocateVirtualMemory
/loader_generate --complexity medium            # Filter by complexity
/loader_generate --language rust                # Rust loader
/loader_generate 3 --shellcode custom.bin       # Batch with custom shellcode
```

## What This Command Does

1. **Queries components** from `loader_techniques.json`
2. **Checks duplicates** in `scenarios.json`
3. **Generates code** combining random/specified components
4. **Compiles** with MinGW (C/C++) or Cargo (Rust)
5. **Records result** in knowledge base

## Components

| Category | Options |
|----------|---------|
| Storage | embedded, resource, remote_url, encrypted_resource |
| Allocator | VirtualAlloc, HeapCreate, NtAllocateVirtualMemory |
| Copier | memcpy, RtlMoveMemory, loop_copy |
| Executor | function_pointer, CreateThread, callback, APC, Fiber |

## Output

- Generated source: `output/loader_<id>.c` (or `.cpp`, `.rs`)
- Compiled executable: `output/loader_<id>.exe`
- Knowledge base scenario ID

## Shellcode File

| Option | Description |
|--------|-------------|
| `--shellcode <path>` | Specify custom shellcode bin file |
| No flag | Uses default `samples/calc.bin` |
| Shorthand | `<file.bin>` treated as `--shellcode <file.bin>` |

Examples:
```bash
/loader_generate --shellcode ./payloads/custom.bin
/loader_generate 5 --shellcode my.bin
/loader_generate my.bin --executor callback
```

## Security

- Default shellcode: `samples/calc.bin` (for safe testing)
- Custom shellcode: user-provided bin files allowed
- **NEVER** run generated executables
- Compilation success is sufficient

## Agent

Spawns `loadergen-agent` subagent for code generation.

See `loader_generate` skill for detailed templates and workflow.

© JDArmy · MIT · JDArmy/Evasion-SubAgents

Similar slash commands

All slash commands for Security →

From the same set22

The whole set →
loadergen-agent loadergen-agent builds shellcode loaders in C, C++ or Rust from knowledge base components and compiles with MinGW. For evasion technique research and security tool testing. CX Codex ★ 336repo stars evasion_integrate evasion_integrate adds evasion techniques to a shellcode loader you already have: it edits the source, checks which tricks fit and builds the binary. CX Codex +1 ★ 336repo stars tool_profile tool_profile is a Claude Code rule about SharpHound, the data collector used by BloodHound. It applies to questions about Active Directory collection, the tool’s build, and detection. CX Codex +1 ★ 336repo stars c2_evasion c2_evasion examines C2 framework source code, locates detection rules (YARA, Sigma), and suggests modifications to bypass signatures. Takes a path to the source as an argument. CX Codex +1 ★ 336repo stars rule_inventory The rule_inventory rule catalogues YARA indicators for Stowaway, including binary names, strings, paths, command-line patterns, and hashes. Use it when checking samples for those indicators. CX Codex +1 ★ 336repo stars tool_profile tool_profile — a Claude rule that profiles Stowaway: what the Go multi-hop proxy is built from, how it compiles, and which traces it leaves on a host. CX Codex +1 ★ 336repo stars rule_mapping rule_mapping is a Claude Code rule that analyzes YARA and Sigma signatures for AdaptixC2. It helps assess which signatures are outdated during detection rule reviews. CX Codex +1 ★ 336repo stars tools_evasion The tools_evasion command examines a penetration-testing tool, gathers detection rules, then changes its source code to avoid those rules. It is intended for authorized security work. CX Codex +1 ★ 336repo stars

Project sponsors

Companies that keep this analytics open