re-format-elf

Parse ELF headers, GOT/PLT, init_array, and dynamic symbols for Linux binary analysis.

64|9|Updated Aug 17, 2026
One-click install
npx skills add https://github.com/dslsdzc/rev-skills --skill re-format-elf-dslsdzc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: re-format-elf
Source: https://github.com/dslsdzc/rev-skills/tree/main/.claude/skills/re-format-elf
Command: npx skills add https://github.com/dslsdzc/rev-skills --skill re-format-elf-dslsdzc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Reverse engineers need to understand the internal structure of Linux ELF executables and shared libraries before deeper analysis, but manually decoding headers, dynamic sections, and relocation tables is error-prone and time-consuming. This Skill provides a structured workflow for parsing ELF files with readelf, objdump, and manual byte-level verification. ## Core Features & Use Cases - Three-table parsing: Read and cross-check the ELF header, program headers, and section headers with readelf, including field-by-field offset maps for 32/64-bit and endianness handling. - Dynamic linking analysis: Inspect GOT/PLT, .dynsym/.dynstr, relocation types (JUMP_SLOT, GLOB_DAT, RELATIVE), and DT_* tags to understand symbol resolution and import behavior. - Security property checks: Determine NX stack, RELRO level (partial vs full via GNU_RELRO + BIND_NOW), and stack canary presence to assess exploitation surface. - Anti-analysis handling: Recover symbols from stripped binaries, detect forged headers that break readelf, unpack gzexe-wrapped files, and find hidden logic in .preinit_array/.init_array. - Use Case: Given a suspicious Linux .so from a firmware image, run the workflow to map its segments, list imported functions, check whether the GOT is writable, and disassemble constructor functions that run before main. ## Quick Start Analyze the ELF structure of the attached sample.so file, including its headers, dynamic symbols, GOT/PLT, init_array callbacks, and security properties like RELRO and NX.

Frequently Asked Questions about re-format-elf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse ELF headers with readelf?▼

Run readelf -h for the ELF header, -l for program headers, and -S for section headers. The header gives the entry point and table offsets, program headers describe runtime memory layout, and section headers give the static view of named sections.

How to find functions that run before main in an ELF binary?▼

Check .preinit_array and .init_array sections with readelf -S and objdump -s -j .init_array, since these function pointer arrays execute before main. Disassemble each pointer target to inspect initialization, anti-debug, or decryption logic.

How do I check if an ELF binary has full RELRO protection?▼

Full RELRO requires both a PT_GNU_RELRO segment and BIND_NOW in the dynamic flags. Run readelf -l to find GNU_RELRO and readelf -d to check for BIND_NOW; having only one of them means partial RELRO with a writable GOT.

Why does readelf fail or report errors on some ELF files?▼

Obfuscated samples often forge header fields like e_shentsize, e_shnum, or e_phnum to break parsers. Verify the real values manually with xxd against the documented ehdr offsets, correct them, and re-parse instead of discarding the file as corrupt.

Can I analyze ARM or MIPS ELF files on an x86 machine?▼

Yes, readelf -h/-l/-S works on cross-architecture ELF files natively since parsing is architecture-independent. Only disassembly requires a cross toolchain or QEMU user-mode emulation when objdump reports unknown format.

How do I recover symbols from a stripped ELF binary?▼

Stripped binaries retain only .dynsym, so recovery relies on string cross-references and signature matching. Extract strings with offsets, locate their references in Ghidra or radare2, and apply FLIRT or rizin signatures to identify common library functions.