AIMachDec
June 25, 2025 ยท View on GitHub
AIMachDec is an IDA plugin for Apple AARCH64/ARM64 binaries that utilizes LLMs to translate assembly functions into readable pseudo-code in C, Objective-C, or Swift. It:
- Detects language context (C, Objective-C, Swift) or allows manual selection.
- Uses the selected LLM to generate pseudo-code from ARM64 functions.
- Presents output in a clean, interactive viewer window ("AI Pseudocode-A/B/..."), similar to IDA's native decompiler.
This plugin is specifically designed for analyzing Apple Mach-O binaries, including iOS apps, kernelcaches, and dyld_shared_cache libraries.
Built using model prompts and structure from the ipsw AI Decompiler from blacktop.
Supported models:
- OpenAI GPT-4
- Claude 3 Opus
- Ollama LLaMA 3
- Perplexity Sonar
- OpenRouter DeepCoder 14B (free)
Installation
Requirements
- IDA Pro version 8.4+
- Python 3.x with
requestslibrary
Setup
- Install
requestsin a normal Python environment. - Copy these folders from
site-packages/intoLib/site-packages/into IDA\python\3\folder. - Copy
AIMachDec.pyinto your IDA plugins directory. - Restart IDA.
Usage
- Open a binary and navigate to the target function.
- Set your API key as an environment variable in IDA's Python console. If not set, the plugin will print this instruction in the console. E.g.:
[AIMachDec] Missing API key: OPENROUTER_API_KEY [AIMachDec] Set it in the IDA python console like this: import os os.environ["OPENROUTER_API_KEY"] = "<api_key>" - Use
Ctrl+Shift+AorEdit > Plugins > AIMachDec. - Select an AI model and target language (or auto-detect).
- View the decompiled result in a new AI Pseudocode window.
The plugin extracts the function's disassembly, constructs a prompt, and queries the selected LLM.
Screenshots




Compatibility
- IDA Pro: >=8.4
- Platforms: Windows, Linux, macOS
- File Types: Focused on Mach-O (Apple ARM64), partial support elsewhere
TODO
- Add syntax highlighting to output viewer
- Support more LLM providers
- Implement local caching and context preservation per function