meltedinhex/analyst-ai-pack / skills/writing-yara-rules-from-reversed-code
writing-yara-rules-from-reversed-code
VerifiedTurns reverse-engineering findings into durable YARA detections: selecting stable code constructs and constants over volatile strings, extracting opcode/byte patterns with wildcards, and validating rules for low false positives. Activates for requests to write a YARA rule from reversed code, create a detection signature, or convert RE findings into hunting rules.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 3.3 KB |
| references/api-reference.md | markdown | 1.2 KB |
| scripts/analyst.py | script | 2.1 KB |
references/api-reference.md
View on GitHub# API Reference: Writing YARA Rules from Reversed Code
## Overview
`scripts/analyst.py` scaffolds a structured YARA rule with `meta`, placeholder byte-pattern
strings, an optional API-hash constant (emitted little-endian), and a multi-anchor condition
with a PE prefilter. It emits text only and scans nothing.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | text generation |
## External tools
| Tool | Purpose |
|------|---------|
| yara | Compile and test rules against the corpus |
| yara-python | Programmatic testing/automation |
## Core functions
### `scaffold(name, api_hash, author)`
Returns a YARA rule skeleton; if `api_hash` is given, adds a little-endian byte-pattern string
and includes it in the condition.
## Usage
```bash
python scripts/analyst.py scaffold --name family_xyz --hash 0xABCDEF12
yara -r rules/family_xyz.yar ./corpus
```
## Sources
- YARA documentation — https://yara.readthedocs.io/
- YARA style guide (writing maintainable, low-FP rules) —
https://github.com/Neo23x0/YARA-Style-Guide
- Preference for code/constant anchors over volatile strings, established RE detection practice
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: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | 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: 322k | Updated | Claude CodeCodex | Verified | 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: 322k | Updated | Claude CodeCodex | Verified | Install |