Vector35 / Vector35/binaryninja-api

MIG support for macOS/iOS binaries

Open
#7,677 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Effort: Low File Format: Mach-O File Format: SharedCache Impact: Low
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

What is the feature you'd like to have?
It would be nice if BN would support Apple's MIG structures, namely NDR records, which are stored in the Mach-O header. These are well defined structures defined in:
https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/osfmk/mach/ndr.h#L4

It would allow recognizing MIG function calls, and BN could name them accordingly if no other symbol information is available. Also the NDR structure could be displayed nicely

Is your feature request related to a problem?
If applicable, please provide a clear and concise description of what the problem is.

Are any alternative solutions acceptable?
I can use a script/plugin, but out-of-the-box support would be nice.

Scott Knight made a script for Hopper:
https://github.com/knightsc/hopper/blob/master/scripts/MIG%20Detect.py

and I redone it for BN (attached), although it's not perfect, sometimes it doesn't find structures and sometimes it finds those that are not there. Still working on it.

bn_find_mig.py

Additional Information:
N/A

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Apple's osfmk/mach/ndr.h and compare the attached bn_find_mig.py with Scott Knight's MIG Detect.py. Define support for recognizing MIG function calls and displaying NDR structures, then validate it against macOS/iOS Mach-O binaries, including cases where the script currently misses or falsely detects structures.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios, macos
Domain
operating-systems, reverse-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.