Skip to content

meltedinhex/analyst-ai-pack / skills/diffing-malware-samples-to-find-changes

diffing-malware-samples-to-find-changes

Verified

Compares two related malware samples to surface what changed between variants using section-level hashing, import-set differences, and fuzzy similarity scoring. Activates for requests to diff two samples, compare malware variants, or measure similarity between two binaries for variant tracking.

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

references/api-reference.md

View on GitHub
# API Reference: Diffing Malware Samples to Find Changes

## Overview

`scripts/analyst.py` structurally diffs two PE samples: per-section SHA-256 and entropy, import name
set differences, and a byte-level similarity ratio, optionally adding an ssdeep comparison score.
It reads bytes statically and executes nothing. Function-level diffing (BinDiff/Diaphora) is out of
scope.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| pefile | latest | import table parsing (optional) |
| ssdeep | latest | fuzzy-hash similarity (optional) |
| (stdlib) | — | difflib, hashlib, struct, math, JSON |

## Core functions

### `diff(path_a, path_b)`
Returns added/removed/changed sections, added/removed imports, byte similarity ratio, and (if
available) ssdeep score.

### `_sections(data)`
Per-section SHA-256 and entropy keyed by section name.

### `_imports(data)`
Imported symbol name set via pefile (empty if unavailable).

## Usage

```bash
python scripts/analyst.py diff a.bin b.bin
```

## Sources

- PE Format (section table, import directory) — https://learn.microsoft.com/windows/win32/debug/pe-format
- ssdeep context-triggered piecewise hashing — https://ssdeep-project.github.io/ssdeep/
- Structural variant-diffing approach (section/import deltas) from public triage practice
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