$ show paradiseduo/inject
This is a Swift-based command-line tool and library (Injection framework) for manipulating Mach-O binaries. It can inject, remove, or alter load commands (LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, etc.) into executables, dylibs, and IPA archives. The tool also supports stripping code signatures, disabling ASLR, converting binaries for iOS simulator, and handling fat binaries. The code directly parses Mach-O headers and performs byte-level binary patching. It is built with the Swift Argument Parser and is available as both a CLI and a framework for integration into other macOS/iOS projects. The code demonstrates solid understanding of the Mach-O format and low-level binary manipulation, though there is some code duplication between the CLI and framework targets.
The LLM identified 1 files worth highlighting for reuse:
Provides a generic Data.extract<T>(_ type: T.Type, offset: Int) method that allows type-safe extraction of any struct from Data at a given offset. This is a reusable utility for any binary parsing project, supporting arbitrary offsets without manual pointer manipulation. Also includes a String initializer for parsing load command strings and a static FileManager.open method for safely reading files with optional backup.