$ show endrazine/wcc
The Witchcraft Compiler Collection (WCC) is a binary analysis and modification toolkit focused on ELF executables. It provides three primary tools: wld converts executables to shared libraries, wcc 'unlinks' binaries into relocatable objects, and wsh offers an interactive Lua-scriptable shell for runtime binary inspection and modification. The architecture is modular with shared utilities, leveraging BFD for binary format abstraction, Capstone for disassembly, and Lua/JIT for extensibility. Key capabilities include section/header manipulation, symbol table management, relocation processing, and cross-architecture analysis via Qemu user-mode emulation. WCC demonstrates strong craftsmanship in its Lua-C API extension patterns, sophisticated ELF handling, and modular tool design. The wsh tool's Lua integration exposes binary analysis functions (memory access, symbol lookup, section iteration) through a clean C extension interface. The wld tool implements robust ELF section/header manipulation and relocation processing with careful attention to binary format details. The disassembler wrapper in disasm.c provides multi-architecture support while maintaining integration with WCC's data structures. These components show non-obvious skill in binary manipulation and language embedding. The project shows active maintenance with commits up to 2026 and updated copyright notices. Technical drift is low due to recent updates and compatibility with modern dependencies (Lua 5.3, Capstone). While focused on Linux/ELF and primarily x86_64, the code maintains portability through conditional compilation and abstracted binary handling. The build system uses Makefiles with git submodules for dependency management, and the MIT-licensed codebase includes comprehensive documentation and demonstration materials for security research use cases.
The LLM identified 3 files worth highlighting for reuse:
Defines the Lua extension interface for WCC, exposing binary analysis functions (memory read/write, symbol lookup, section iteration) to Lua scripts. Demonstrates a clean pattern for extending Lua with domain-specific functionality via C functions, enabling complex binary analysis scripting with minimal coupling to core logic.
Core ELF binary transformation engine handling loading, section/symbol parsing, relocation processing, and binary modification to produce shared libraries. Shows advanced ELF manipulation skills including section header rewriting, symbol table management, and relocation adjustment, reusable for binary transformation tasks with clear separation of concerns.
Multi-architecture disassembler wrapper using Capstone framework with integration into WCC's data structures and Lua interface. Demonstrates a reusable pattern for adding disassembly capabilities to binary analysis tools while maintaining architecture detection and instruction formatting consistency.