$ show x43x61x69/otx
This repository contains otx, a Mach-O disassembler for macOS that provides both a graphical user interface and a command-line tool. It specializes in disassembling Mach-O executables (supporting x86_64 and arm64 architectures) and enhancing the output with semantic information such as Objective-C method names, demangled C++ and Swift symbols, and annotations for literal pools and data references. The application also detects and repairs obfuscated NOP sequences (an anti-disassembly technique) for x86_64 binaries. The architecture features a modular processor hierarchy where a base `ExeProcessor` class is extended for specific architectures (e.g., `X8664Processor`, `ARM64Processor`), with functionality added via Objective-C categories (such as `Searchers64` for binary search and `List64Utils` for linked list operations). The GUI is built with Cocoa/AppKit and follows an MVC pattern, with `AppController` managing the user interface and workflow. The CLI shares the same core processing logic but uses a separate controller for argument parsing. Preferences are managed via a synchronized system of user default keys between Objective-C and Swift components. Key reusable components include a custom endianness swap utility (`MachOSwap.h`) that replaces deprecated Apple functions, a smooth view animation helper (`SmoothViewAnimation`) for polished UI transitions, a drag-and-drop file handler (`DropBox`), and utility categories for linked list operations and binary search. The project demonstrates solid engineering practices but shows signs of technical drift through conditional compilation for obsolete macOS versions (Tiger, Leopard, Snow Leopard), though modern builds target macOS 12+.
The LLM identified 4 files worth highlighting for reuse:
Provides static inline functions for endianness swapping that replace deprecated Apple OSSwap* functions. This utility is isolated, has no external dependencies beyond system headers, and can be reused in any project requiring binary data parsing.
Implements custom view animations for smooth transitions in the macOS GUI. It encapsulates the complexity of chaining animations, handling completion, and managing animation state, making it a reusable component for any Cocoa application needing polished UI effects.
A reusable drag-and-drop acceptor for files in macOS applications. It handles file type validation, copying, and delegate callbacks, allowing easy integration into any view to support file dropping without boilerplate code.
Provides a binary search utility implemented as an Objective-C category, enabling efficient lookup in sorted arrays. It is self-contained, depends only on the array and search key, and can be extracted for use in any project requiring sorted data searches.