elf-patcher
Installation
SKILL.md
ELF Patcher with C
Patch ELF binaries using C code and GNU linker features instead of raw assembly.
Quick Start
- Copy templates from
assets/directory - Customize
patch_at,patch_size, and external symbols in linkerscript - Write patch logic in C using
SECTION(".patch.code.*")attribute - Compile:
gcc -c binpatch.c -o binpatch.o -fno-pic -fno-pie -nostdlib - Link:
ld -T binpatch.ld binpatch.o -o patch.bin -nostdlib --oformat binary - Apply:
dd if=patch.bin of=target bs=1 seek=0xADDR conv=notrunc
Core Technique
This method leverages two GNU Linker features: