galyarderlabs/galyarder-framework / integrations/antigravity/reverse-engineering-malware-with-ghidra
reverse-engineering-malware-with-ghidra
VerifiedReverse engineers malware binaries using NSA's Ghidra disassembler and decompiler to understand internal logic, cryptographic routines, C2 protocols, and evasion techniques at the assembly and pseudo-C level. Activates for requests involving malware reverse engineering, disassembly analysis, decompilation, binary analysis, or understanding malware internals.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 14.3 KB |
| references/api-reference.md | markdown | 2.6 KB |
| scripts/agent.py | script | 8.2 KB |
references/api-reference.md
View on GitHub# API Reference: Malware Reverse Engineering with Ghidra Agent
## Overview
Combines Ghidra headless analysis with r2pipe (radare2) for automated malware binary analysis: function enumeration, import classification, section entropy, cryptographic constant detection, and network indicator extraction.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| r2pipe | >= 1.8 | Radare2 scripting interface for binary analysis |
| hashlib | stdlib | File hash computation |
## External Tools
| Tool | Purpose |
|------|---------|
| Ghidra (analyzeHeadless) | Automated disassembly and decompilation |
| radare2 | Binary analysis, function detection, string extraction |
## Core Functions
### `run_ghidra_headless(ghidra_path, project_dir, project_name, binary_path, script)`
Executes Ghidra in headless mode with optional post-analysis script.
- **Timeout**: 600 seconds
- **Returns**: `dict` with command, returncode, stdout/stderr
### `export_functions_ghidra(...)`
Generates and runs a Ghidra script to export function list as JSON.
- **Exports**: name, address, size, calling convention, is_thunk
### `analyze_with_radare2(filepath)`
Full r2pipe analysis: binary info, functions, imports, strings, sections, entry points.
- **Classifies imports**: injection, network, evasion, crypto, persistence
- **Extracts**: network indicators (URLs, IPs) from strings
- **Returns**: `dict` with info, function_count, suspicious_imports, sections, etc.
### `extract_crypto_constants(filepath)`
Searches binary for known cryptographic constants: AES S-box, RC4 init table, SHA-256 init vector, RSA magic bytes.
- **Returns**: `list[dict]` with constant name and file offset
### `analyze_malware(filepath, ghidra_path, output_dir)`
Full pipeline: hashes -> crypto constants -> radare2 analysis -> Ghidra headless.
## Suspicious Import Categories
| Category | Example Functions |
|----------|-------------------|
| injection | VirtualAllocEx, WriteProcessMemory, CreateRemoteThread |
| network | InternetOpenA, WSAStartup, URLDownloadToFileA |
| evasion | IsDebuggerPresent, NtQueryInformationProcess |
| crypto | CryptEncrypt, CryptDecrypt |
| persistence | RegSetValueExA, CreateServiceA |
## Radare2 Commands Used
| Command | Purpose |
|---------|---------|
| `aaa` | Full auto-analysis |
| `ij` | Binary info as JSON |
| `aflj` | Function list as JSON |
| `iij` | Import list as JSON |
| `izj` | String list as JSON |
| `iSj` | Section list as JSON |
| `iej` | Entry points as JSON |
## Usage
```bash
# With radare2 only
python agent.py malware.exe
# With Ghidra headless analysis
python agent.py malware.exe /opt/ghidra
```
---
2026 Galyarder Labs. Galyarder Framework.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |