meltedinhex/analyst-ai-pack / skills/reverse-engineering-shellcode
reverse-engineering-shellcode
UnverifiedAnalyzes position-independent shellcode: disassembling raw bytes at the right architecture, recognizing PEB-walk API resolution and egg hunters, and emulating execution to recover behavior and payloads. Activates for requests to analyze shellcode, disassemble raw position-independent code, or emulate a shellcode blob.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 3.4 KB |
| references/api-reference.md | markdown | 1.2 KB |
| scripts/analyst.py | script | 3.2 KB |
references/api-reference.md
View on GitHub# API Reference: Reverse Engineering Shellcode
## Overview
`scripts/analyst.py` disassembles raw shellcode with Capstone and emulates it with Unicorn under
a bounded instruction count, capturing executed addresses. Both operate inside the
disassembler/emulator; the shellcode never runs as a real process.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| capstone | >= 5.0 | Linear disassembly of x86/x64 bytes |
| unicorn | >= 2.0 | CPU emulation for self-decoding stubs |
## Core functions
### `disasm(data, arch, base, limit)`
Returns disassembled instructions (address, mnemonic, operands) at the chosen architecture.
### `emulate(data, arch, base, max_insns)`
Maps memory, writes the blob, hooks each instruction, and runs with a bounded count; returns
executed-instruction stats and the stop address.
## Usage
```bash
pip install capstone unicorn
python scripts/analyst.py disasm shellcode.bin --arch x64 --base 0x140000000
python scripts/analyst.py emulate shellcode.bin --arch x64
```
## Sources
- Capstone disassembly framework — https://www.capstone-engine.org/
- Unicorn CPU emulator — https://www.unicorn-engine.org/
- PEB-walk API resolution in Windows shellcode (kernel32 export hashing), standard technique
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |