How ru0qian/cpwn works
cpwn is a command-line ELF patching tool for selecting a glibc version and setting an executable’s interpreter and rpath. The main workflow identifies the ELF architecture, uses a matching local glibc or prompts for a catalog match and invokes a configured download script, then runs patchelf/ldd and repairs debug symbols. README capabilities include i386/amd64 support and old-version fallback. The implementation is concentrated in main.go; download scripts and glibc files are supplied externally, so their internal behavior is not shown.
Main entry points: main.go CLI workflow
Components 12
CLI and config
- CLI workflow
main.go - Base path config
glibc selection
- ELF architecture
main.go - Version catalogs
- Version selection
main.go - Download scripts
- glibc files
ELF patching
- Patch and verify
main.go - Debug symbol repair
main.go
Other components
- User
- patchelf
- ldd
Connections 13
- User → CLI workflow: invokes
- CLI workflow → Base path config: reads or writes
- CLI workflow → ELF architecture: identifies
- CLI workflow → Version selection: selects version
- CLI workflow → glibc files: looks up
- Version selection → Version catalogs: reads
- Version selection → Download scripts: runs selected
- Download scripts → glibc files: provides files
- CLI workflow → Patch and verify: requests patch
- Patch and verify → patchelf: sets interpreter and rpath
- Patch and verify → ldd: verifies dependencies
- CLI workflow → Debug symbol repair: repairs symbols
- Debug symbol repair → glibc files: reads debug files