meltedinhex/analyst-ai-pack / skills/analyzing-compiled-python-malware
analyzing-compiled-python-malware
UnverifiedAnalyzes Python-based malware packaged as PyInstaller/py2exe executables by detecting the packer, locating the embedded archive, and identifying bundled .pyc modules for extraction and decompilation. Activates for requests to analyze compiled Python malware, unpack a PyInstaller binary, or extract pyc modules from a frozen Python executable.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.9 KB |
| references/api-reference.md | markdown | 1.1 KB |
| scripts/analyst.py | script | 2.1 KB |
references/api-reference.md
View on GitHub# API Reference: Analyzing Compiled Python Malware
## Overview
`scripts/analyst.py` detects frozen-Python packers (PyInstaller, py2exe, cx_Freeze) by their markers,
locates the PyInstaller CArchive magic cookie, and extracts embedded Python version strings. It
reads bytes statically and executes nothing.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | regex, JSON, file IO |
## Core functions
### `detect(path)`
Returns the detected packer, PyInstaller cookie offset, and Python version strings, plus the
recommended next step.
## Markers
- PyInstaller: `_MEIPASS`, `PYZ-00.pyz`, `pyiboot01_bootstrap`, CArchive cookie `MEI\\014\\013\\012\\013\\016`.
- py2exe: `PYTHONSCRIPT`.
- cx_Freeze: `cx_Freeze` strings.
## Usage
```bash
python scripts/analyst.py detect sample.exe
```
## Sources
- PyInstaller archive format (CArchive/PKG, MEI cookie) — https://pyinstaller.org/en/stable/advanced-topics.html
- Python bytecode / .pyc magic (dis module) — https://docs.python.org/3/library/dis.html
- pyinstxtractor extraction workflow (public PyInstaller-unpacking tooling)
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 |