Skip to content

meltedinhex/analyst-ai-pack / skills/analyzing-pe-imports-and-exports

analyzing-pe-imports-and-exports

Verified

Analyzes a PE file's import and export tables to infer capability: mapping imported APIs to behaviors (networking, crypto, injection, persistence), spotting dynamic-resolution stubs, and reading exports of malicious DLLs. Activates for requests to analyze PE imports, inspect the IAT/exports, or infer capability from API usage.

FileKindSize
LICENSEother340 B
SKILL.mdskill md3.1 KB
references/api-reference.mdmarkdown1.1 KB
scripts/analyst.pyscript3.0 KB

references/api-reference.md

View on GitHub
# API Reference: Analyzing PE Imports and Exports

## Overview

`scripts/analyst.py` parses a PE's import and export tables with `pefile`, buckets imported APIs
into behavior categories (networking, injection, crypto, persistence, anti-analysis,
dynamic-resolution), and flags a thin IAT. It parses statically and never executes the sample.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| pefile | >= 2023.2.7 | PE import/export directory parsing |

## Core functions

### `analyze(path)`
Returns imported DLLs/functions, exports, capability buckets, and a `thin_iat` flag.

### `_bucketize(funcs)`
Maps API names to behavior categories via substring matching.

## Usage

```bash
pip install pefile
python scripts/analyst.py imports sample.exe
```

## Sources

- Microsoft PE/COFF specification (import/export directories) —
  https://learn.microsoft.com/windows/win32/debug/pe-format
- pefile library — https://github.com/erocarrera/pefile
- API-to-behavior mapping (e.g., VirtualAllocEx+WriteProcessMemory+CreateRemoteThread =
  injection), established static-analysis practice
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 implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall