re-format-elf

re-format-elf is a skill for Claude Code from dslsdzc/rev-skills. It costs 45 tokens per session (3,810 once invoked), scanned A, original, Apache-2.0.

A guide to reading ELF files, the executable and shared-library format commonly used on Linux. It covers headers, program and section tables, dynamic linking areas, and symbols.

In plain words
What is it for?
Use it to inspect executables or shared libraries, examine GOT and PLT linking data, review initialization code, recover symbols, and assess binary properties.
Why use it?
It helps you understand how a Linux binary is loaded and linked without manually piecing together several low-level tables and command-line tools.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to inspect executables or shared libraries, examine GOT and PLT linking data, review initialization code, recover symbols, and assess binary properties.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dslsdzc/rev-skills/re-format-elf
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-elf
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-elf

README.md
[![agentmods](https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-elf/github.svg)](https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-elf)
Your own site
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-elf"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-elf/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-elf

Your own site · 80×15
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-elf"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-elf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,810 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.00045 $0.03810
Opus 5.5 $0.00018 $0.01524
Sonnet 5.5 $0.00009 $0.00762
Haiku 4.5 $0.00005 $0.00381

Measured 1mo ago against content hash 3fd19308e87d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

re-format-elf 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 1mo 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-elf/SKILL.md · 139 lines

How it starts

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

ELF 格式解析

何时使用 / 何时不用

  • 用:目标是 Linux ELF 可执行文件或 .so 共享库,需要理解结构、看 .init_array、GOT/PLT 与符号、评估安全属性
  • 不用:PE(走 [[re-format-pe]])、Mach-O(走 [[re-format-macho]]);裸二进制固件(非标准 ELF,走 [[re-firmware]] 域)
  • 不用:只需函数逻辑(直接反编译技能)

工具准备

参考 [[re-analyze/platform-tips]]——ELF 目标多为 Linux 本地分析;跨架构(ARM/MIPS 固件 ELF)可用 QEMU 用户态仿真,静态分析无需沙箱。

readelf(binutils)

  • Linux: apt install binutils / dnf install binutils / pacman -S binutils
  • macOS: brew install binutils(greadelf)
  • WSL: Linux 版
  • 验证: readelf --version

objdump(binutils)

  • 同上(macOS 为 gobjdump)
  • 验证: objdump -V

elfutils(eu-* 工具族)

  • Linux: apt install elfutils / dnf install elfutils / pacman -S elfutils
  • macOS: brew install elfutils(eu-readelf 等)
  • 验证: eu-readelf -h /bin/ls

patchelf(修改 ELF 头/加载器)

  • Linux: apt install patchelf / dnf install patchelf / pacman -S patchelf
  • macOS: brew install patchelf
  • 验证: patchelf --version
  • 用途: 分析辅助(改 RPATH/解释器)与修复,分析时先只读

操作步骤

  1. readelf 三表(ehdr/phdr/shdr):

    readelf -h sample        # ELF 头: Class/Machine/Entry/Type
    readelf -l sample        # program headers(段→装载偏移,动态加载与 GNU_STACK 在这里)
    readelf -S sample        # section headers(节→地址/大小/标志)
    

    三表对照: -h 给入口点,-l 给运行时内存布局,-S 给静态节视图。

  2. 结构速览(ehdr/phdr/shdr 布局):ELF 文件 = 头 + 程序头表 + 节区 + 节头表;64 位下 ehdr 64 字节、phdr 56 字节/条、shdr 64 字节/条。ehdr 关键字段与偏移:

    0x00  e_ident[16]  magic(7F 45 4C 46)+class(0x04:1=32位/2=64位)+data(0x05)+OSABI(0x07)
    0x10  e_type        1=REL 2=EXEC 3=DYN(PIE/so) 4=CORE
    0x12  e_machine     62=x86-64 3=i386 183=AArch64 243=RISC-V 8=MIPS
    0x18  e_entry       入口点
    0x20  e_phoff       程序头表偏移
    0x28  e_shoff       节头表偏移
    0x34  e_ehsize      64(32 位为 52)
    0x38  e_phnum | 0x3A e_shentsize | 0x3C e_shnum | 0x3E e_shstrndx
    

    三表关系: readelf -h 输出的每个字段都能在文件前 64 字节里手工核对(xxd -l 64);程序头描述"哪些文件区段按什么权限/对齐映射到内存",节头描述"文件里的符号/字符串/代码等命名区段"。字段全表与布局图见 [[layout]]。

  3. 初始化与终止回调(.init_array / .fini_array):

    readelf -S sample | grep -iE 'init_array|fini_array'
    readelf -a sample | grep -A5 -i 'init_array'
    objdump -s -j .init_array sample     # .init_array 是函数指针数组(数据节),用 -s 打印内容;-d 只反汇编代码节,实际不输出
    # 取到指针后逐个 `objdump -d --start-address=<ptr> --stop-address=<ptr+len> sample` 看回调函数
    

    两者的执行时机不同,别混为一谈:.init_array 中的函数指针在启动初始化阶段(main 之前)按数组正序执行——初始化/反调试/解密常藏在这里,必须最先查;.fini_array 中的指针在退出/dlclose 清理阶段执行、按数组逆序,不紧跟 main(详见坑项)。

Read the full file on GitHub · 139 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago Changed 3fd19308e87d
  2. 2mo ago Changed · +1 lines f31305aaf32d
  3. 3mo ago First seen · 138 lines · 45 tokens per session scan A 080b529a3427

Subscribe to this mod's changes

re-format-elf is a skill published in the GitHub repository dslsdzc/rev-skills (275 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 45 tokens to every session and 3,810 once invoked, about $0.0002 per session on Opus 5.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

re-format-elf compared with skills from other repositories

re-format-elf next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
re-format-elfdslsdzc/rev-skillsSkill2751mo agoApache-2.0A45Claude Code
deobfuscating-powershell-obfuscated-malwareYoungmaidainon/Agent-Level-UpSkill43mo agoMITA90Claude Code, Codex
conducting-malware-incident-responseYoungmaidainon/Agent-Level-UpSkill43mo agoMITA78Claude Code, Codex
analyzing-golang-malware-with-ghidraMikaru0Mystic/sectinelSkill135mo agoApache-2.0A40Claude Code
analyzing-golang-malware-with-ghidraYoungmaidainon/Agent-Level-UpSkill43mo agoMITA95Claude Code, Codex
analyzing-network-covert-channels-in-malwareYoungmaidainon/Agent-Level-UpSkill43mo agoMITA90Claude Code, Codex
analyzing-heap-spray-exploitationYoungmaidainon/Agent-Level-UpSkill43mo agoMITA46Claude Code, Codex