Item

Exposing Hidden Interfaces: Agentic Reverse Engineering as Constraint Satisfaction in macOS Private Frameworks

Kharlamova, Arina
Citations
Altmetric:
Department
Computer Science
Embargo End Date
Type
Thesis
Date
2026
License
Language
English
Collections
Research Projects
Organizational Units
Journal Issue
Abstract
macOS private frameworks ship as stripped ARM64 binaries with no headers or documentation, yet they implement privileged operations (XPC services, disk management, USB host control) that are a recurring attack surface for privilege escalation and sandbox escape. Auditing these interfaces requires knowing the type of every method parameter, but the Objective-C ABI erases all object types to a uniform \texttt{id} in the binary metadata. Existing type-recovery systems target C/C++ and depend on register-level type diversity that Objective-C's dynamic dispatch eliminates. We present MOTIF} (Mach-O Type Inference Framework), which treats signature recovery as iterative constraint satisfaction. An LLM-based agent executes a ReAct loop over six binary-analysis tools (disassembler, decompiler, symbol resolver, header reader, header scanner, and a commitment operator) to propose candidate signatures. A semantic linter partitions constraints into hard (syntactic validity, selector match) and soft (idiomatic conformance, generic specialisation), returning structured diagnostics that drive re-inference within a budget of $K{=}10$ iterations. MOTIF-Bench, the first benchmark for this task, pairs dyld-shared-cache binaries with Xcode SDK headers stratified by framework category and size. MOTIF-Model, an 8B-parameter Qwen3 model fine-tuned on ${\sim}$3{,}000 filtered agentic dialogues via QLoRA, runs locally in Apple's MLX format. On MOTIF-Bench, static extraction scores below 2\% Exact Match Accuracy (EMA); one-shot GPT-4o reaches 23.1\%; the full system achieves \textbf{67.5\% EMA} and \textbf{86.9\% Inference Stability}. Ablation shows the feedback loop contributes +22.8~pp EMA over tools alone, with gains concentrated where binary metadata carries no type signal: delegate protocols (+26.4~pp), collection generics (+15.7~pp), and block signatures (+12.7~pp), versus +0.2~pp for scalars. MOTIF-Model reaches 64.7\% EMA (within 4.2~pp of GPT-4o) at one-eighth the parameter count, entirely on-device. MOTIF is the first system and benchmark for recovering Objective-C method types from stripped macOS frameworks, providing the typed headers required for XPC message crafting, structure-aware fuzzing, and entitlement auditing of private interfaces.
Citation
Kharlamova, Arina, "Exposing Hidden Interfaces: Agentic Reverse Engineering as Constraint Satisfaction in macOS Private Frameworks," M.S. Thesis, Computer Science, MBZUAI, 2026.
Source
Conference
Keywords
Agent, macOS, Reverse
Subjects
Source
Publisher
DOI
Full-text link