$ show rampageX/firmware-mod-kit
The Firmware Modification Kit (FMK) is a CLI-based application toolkit designed for the extraction, analysis, and rebuilding of embedded Linux firmware images, primarily for routers and IoT devices. It functions as a monolithic suite of shell scripts, C/C++ binaries, and Python utilities that orchestrate a workflow: ingest a firmware binary, extract its filesystems (SquashFS, CramFS, YAFFS2), allow modification of contents or web UIs, and rebuild the image. The architecture relies heavily on bundled legacy versions of open-source tools, specifically Binwalk 2.1.1, multiple versions of SquashFS tools (2.0 through 4.2), and the 7-Zip/LZMA SDK. While functionally effective for its niche in embedded security and reverse engineering, the codebase exhibits significant technical debt due to massive code duplication across versioned forks of the same libraries and reliance on outdated dependencies (Python 2, legacy Windows API calls).
The LLM identified 3 files worth highlighting for reuse:
Contains the core plugin system for Binwalk, allowing dynamic extension of firmware analysis capabilities. Plugins like `lzmamod.py` and `gzipextract.py` demonstrate a reusable pattern for validating signatures and extracting compressed data from binary streams. This architecture is safely reusable for other firmware analysis projects, provided the Python 2/3 compatibility layer is updated.
Implements the core logic for creating SquashFS filesystem images, including integration with LZMA compression. While duplicated across multiple version directories (2.0, 3.0, 4.0), the implementation of the compression wrapper (`compressor.c`) and inode handling (`sort.c`) represents a solid, reusable pattern for embedded filesystem engineering, despite the maintenance overhead of the duplication.
Serves as the primary entry point for the extraction workflow. It orchestrates the calling of Binwalk, SquashFS tools, and cleanup scripts. The script demonstrates a reusable pattern for automating complex binary analysis pipelines, though it relies on hardcoded paths and legacy tool versions that limit portability.