Exposing Hidden Interfaces: LLM-Guided Type Inference for Reverse Engineering macOS Private Frameworks
Arina Kharlamova, Youcheng Sun, Ting Yu
TL;DR
This work tackles the challenge of undocumented private macOS frameworks by introducing MOTIF, a hybrid framework that couples tool-augmented analysis with a specialized Objective-C type-inference LLM. The system comprises MOTIF-agent (LLM-guided reverse engineering with a constraint-based linter and tool suite), MOTIF-bench (a reproducible Mach-O type-inference benchmark), and MOTIF-model (a lightweight, locally deployable tool-aware LLM). On MOTIF-Bench, signature recovery improves from 15% to 86% relative to static baselines, and private-framework case studies show reconstructed headers that compile and enable security analysis. The framework provides a scalable foundation for auditing macOS internals while maintaining privacy and reproducibility, with potential extension to other binary formats and operating systems.
Abstract
Private macOS frameworks underpin critical services and daemons but remain undocumented and distributed only as stripped binaries, complicating security analysis. We present MOTIF, an agentic framework that integrates tool-augmented analysis with a finetuned large language model specialized for Objective-C type inference. The agent manages runtime metadata extraction, binary inspection, and constraint checking, while the model generates candidate method signatures that are validated and refined into compilable headers. On MOTIF-Bench, a benchmark built from public frameworks with groundtruth headers, MOTIF improves signature recovery from 15% to 86% compared to baseline static analysis tooling, with consistent gains in tool-use correctness and inference stability. Case studies on private frameworks show that reconstructed headers compile, link, and facilitate downstream security research and vulnerability studies. By transforming opaque binaries into analyzable interfaces, MOTIF establishes a scalable foundation for systematic auditing of macOS internals.
