Skip to content

meltedinhex/analyst-ai-pack / skills/analyzing-rust-malware-internals

analyzing-rust-malware-internals

Verified

Analyzes Rust-compiled malware by detecting the Rust toolchain signature, demangling Rust v0/legacy symbol names, and identifying crate dependencies from embedded paths. Activates for requests to analyze Rust malware, demangle Rust symbols, or identify a Rust binary build and its crates.

FileKindSize
LICENSEother340 B
SKILL.mdskill md2.6 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript2.7 KB

references/api-reference.md

View on GitHub
# API Reference: Analyzing Rust Malware Internals

## Overview

`scripts/analyst.py` confirms a Rust build (rustc/cargo markers, `/rustc/<hash>/library/` paths,
panic strings), heuristically demangles legacy `_ZN...E` symbols, detects v0 `_R` symbols, and
extracts crate name/version pairs from `.cargo/registry` paths, mapping notable crates to
capabilities. It reads bytes statically and executes nothing.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | regex, JSON, file IO |

## Core functions

### `info(path)`
Returns Rust detection, legacy-demangled names, v0 symbols present, crates, and capabilities.

### `_demangle_legacy(sym)`
Decodes the length-prefixed segments of a legacy `_ZN...17h<hash>E` symbol into `a::b::c`.

## Notes

- v0 (`_R`) symbols are detected; full v0 demangling is delegated to a dedicated tool
  (e.g., `rustfilt`).

## Usage

```bash
python scripts/analyst.py info sample.bin
```

## Sources

- Rust symbol mangling v0 (RFC 2603) — https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html
- Legacy `_ZN`/Itanium-style length-prefixed mangling (public Rust ABI docs)
- Cargo registry path layout (`registry/src/<index>/<crate>-<ver>`) from Cargo documentation
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: 197kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall