Skip to content

meltedinhex/analyst-ai-pack / skills/dumping-and-rebuilding-a-pe-from-memory

dumping-and-rebuilding-a-pe-from-memory

Verified

Rebuilds a usable PE file from a memory dump by fixing the section alignment (virtual-to-raw), correcting the entry point, and preparing for import table reconstruction. Activates for requests to rebuild a dumped PE, fix a memory-dumped executable, or convert a process dump into an analyzable file.

FileKindSize
LICENSEother340 B
SKILL.mdskill md2.8 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript3.2 KB

references/api-reference.md

View on GitHub
# API Reference: Dumping and Rebuilding a PE From Memory

## Overview

`scripts/analyst.py` inspects a memory-dumped PE's section alignment and entry point, and realigns
section raw pointers/sizes to the virtual layout used by files reconstructed from memory,
optionally setting a new OEP. It operates on file bytes only and executes nothing. Import table
reconstruction is delegated to a dedicated tool (Scylla/ImpRec).

## Dependencies

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

## Core functions

### `inspect(path)`
Reports entry point RVA, whether the dump is memory-aligned (raw==virtual), and the section table.

### `fix(path, oep, out)`
Rewrites PointerToRawData/SizeOfRawData to the virtual layout and sets AddressOfEntryPoint to `oep`.

## Usage

```bash
python scripts/analyst.py inspect dump.bin
python scripts/analyst.py fix dump.bin --oep 0x1234 -o rebuilt.bin
```

## Sources

- PE Format (AddressOfEntryPoint, section headers) — https://learn.microsoft.com/windows/win32/debug/pe-format
- MITRE ATT&CK T1620 Reflective Code Loading — https://attack.mitre.org/techniques/T1620/
- Memory-dump raw==virtual alignment convention from public unpacking tooling (Scylla)
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: 198kUpdated 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