re-format-pe

re-format-pe is a skill for Claude Code from dslsdzc/rev-skills. It costs 68 tokens per session (4,193 once invoked), scanned A, original, Apache-2.0.

A guide to the PE file format used by Windows programs and libraries such as EXE, DLL and SYS files. It explains how to inspect headers, sections, imports, exports, TLS callbacks and related metadata.

In plain words
What is it for?
Parsing PE files, mapping file positions to memory addresses, checking imports and exports, finding TLS callbacks, identifying packing clues, and examining signatures or legacy program details.
Why use it?
It provides the right tools and structure for understanding Windows binaries and locating entry points or unusual file features.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Parsing PE files, mapping file positions to memory addresses, checking imports and exports, finding TLS callbacks, identifying packing clues, and examining signatures or legacy program details.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dslsdzc/rev-skills/re-format-pe
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dslsdzc/rev-skills --skill re-format-pe
Clone the repo
git clone --depth 1 https://github.com/dslsdzc/rev-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for re-format-pe

README.md
[![agentmods](https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-pe/github.svg)](https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-pe)
Your own site
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-pe"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-pe/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for re-format-pe

Your own site · 80×15
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-pe"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-pe.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,193 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.04193
Opus 5 $0.00034 $0.02096
Sonnet 5 $0.00014 $0.00839
Haiku 4.5 $0.00007 $0.00419

Measured 10d ago against content hash e0738312af87, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

re-format-pe scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/re-format-pe/SKILL.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PE 格式解析

何时使用 / 何时不用

  • 用:目标是 Windows PE 文件(.exe/.dll/.sys),需要理解结构、找壳特征、定位入口/TLS 回调、映射 RVA 与文件偏移
  • 不用:ELF(走 [[re-format-elf]])、Mach-O(走 [[re-format-macho]]);只需函数逻辑(直接反编译技能)
  • 不用:只需快速结论(初勘走 [[re-triage]])

工具准备

参考 [[platform-tips]] 平台分支——Windows 目标可静态分析免沙箱,动态执行一律沙箱。

objdump(binutils)

  • Linux: apt install binutils / dnf install binutils / pacman -S binutils
  • macOS: brew install binutilsgobjdump
  • Windows/WSL: WSL 内 Linux 版
  • 验证: objdump -V
  • 注意: 对 PE 用 objdump -p / objdump -x(readelf 不解析 PE,属非直接工具——只用于对照 ELF 侧知识)

pefile(Python,推荐主力)

  • 全平台: pip install pefile(Linux/macOS/Windows/WSL 均可)
  • 验证: python3 -c "import pefile; print(pefile.__version__)"

CFF Explorer(Windows GUI)

  • Windows: choco install cff-explorer(或从 NTCore 官网下载 Explorer Suite)
  • 验证: 启动 CFF Explorer 打开样本,能正常显示 Dos Header/Sections 面板

操作步骤

  1. e_lfanew 定位 PE 头

    objdump -p sample.exe | head -40   # 看 Magic: 0x10b (PE32) / 0x20b (PE32+) 与入口点
    
    import pefile
    pe = pefile.PE('sample.exe')
    print("e_lfanew offset:", hex(pe.DOS_HEADER.e_lfanew))
    print("PE32" if pe.OPTIONAL_HEADER.Magic == 0x10b else "PE32+")
    print("EntryPoint RVA:", hex(pe.OPTIONAL_HEADER.AddressOfEntryPoint))
    
  2. 节表与 RVA/文件偏移映射

    objdump -h sample.exe        # 节名/VMA/文件偏移/大小
    
    import pefile
    pe = pefile.PE('sample.exe')
    for s in pe.sections:
        print(s.Name, "VA:", hex(s.VirtualAddress), "raw:", hex(s.PointerToRawData),
              hex(s.SizeOfRawData), "chars:", hex(s.Characteristics))
    print("RVA->offset:", hex(pe.get_offset_from_rva(0x1000)))   # RVA 转文件偏移
    

    记住: 节内存中的 VirtualAddress 是 RVA,需加 ImageBase 才是 VA;文件偏移由 PointerToRawData 给出。

  3. 导入表(IAT 大小异常 = 壳特征)

    objdump -p sample.exe | grep -A3 -i 'DLL Name'
    
    import pefile
    pe = pefile.PE('sample.exe')
    for entry in pe.DIRECTORY_ENTRY_IMPORT:
        names = [i.name for i in entry.imports if i.name]
        print(entry.dll, "imports:", len(names), names[:5])
    
    • 正常程序导入函数较多;仅 1-2 个 DLL、函数极少(如只有 kernel32 的几个)→ 强烈提示加壳/动态解析

Read the full file on GitHub · 184 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 184 lines · 68 tokens per session scan A e0738312af87

Subscribe to this mod's changes

re-format-pe is a skill published in the GitHub repository dslsdzc/rev-skills (50 stars, last pushed 11d ago), licensed Apache-2.0. It adds 68 tokens to every session and 4,193 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware in Ghidra by parsing Go buildinfo and pclntab structures, recovering stripped/obfuscated function names (e.g. via GoResolver), and extracting embedded module/dependency strings and types from Go binaries. Use when analyzing a Go-language malware sample, deobfuscating a…

Youngmaidainon/Agent-Level-Up · 95 tokens

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware in Ghidra by parsing Go buildinfo and pclntab structures, recovering stripped/obfuscated function names (e.g. via GoResolver), and extracting embedded module/dependency strings and types from Go binaries. Use when analyzing a Go-language malware sample, deobfuscating a…

mukul975/Anthropic-Cybersecurity-Skills · 95 tokens

Reverse Engineering & Binary Analysis

Binary analysis, assembly interpretation, disassembly, decompilation, firmware RE, and protocol reverse engineering.

Masriyan/Claude-Code-CyberSecurity-Skill · 26 tokens

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware using Ghidra with specialized scripts for function recovery, string extraction, and type reconstruction in stripped Go binaries.

plurigrid/asi · 40 tokens

reverse-engineering-arm-binaries

Reverse engineers ARM/AArch64 malware by identifying the architecture and instruction set state (ARM/Thumb), parsing ELF/Mach-O ARM headers, and orienting analysis around the ARM calling convention. Activates for requests to reverse ARM binaries, analyze AArch64 malware, or handle ARM/Thumb instruction-set decoding.

meltedinhex/analyst-ai-pack · 69 tokens

reverse-engineering-binaries-with-ghidra

Uses Ghidra to disassemble and decompile a binary, navigate to key routines via imports and strings, annotate decompiled code, and run headless scripts to automate extraction of C2, crypto, and config. Activates for requests to reverse engineer with Ghidra, decompile a binary, or script Ghidra headless analysis.

meltedinhex/analyst-ai-pack · 80 tokens