Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse LC_DYLD_CHAINED_FIXUPS and LC_DYLD_EXPORTS_TRIE in the macho module #301

Closed
PetoStr opened this issue Feb 5, 2025 · 4 comments · Fixed by #305
Closed

Parse LC_DYLD_CHAINED_FIXUPS and LC_DYLD_EXPORTS_TRIE in the macho module #301

PetoStr opened this issue Feb 5, 2025 · 4 comments · Fixed by #305

Comments

@PetoStr
Copy link

PetoStr commented Feb 5, 2025

Currently, yara-x retrieves the imports and exports of a Mach-O binary only by parsing the LC_DYLD_INFO_ONLY and LC_DYLD_INFO commands. However, the Mach-O binary may contain newer commands, LC_DYLD_CHAINED_FIXUPS and LC_DYLD_EXPORTS_TRIE, instead of the former two.

For example, the binary with SHA-256 3c7879d0b6419b39f9a3ea6372576c25152d9bbc9edafe4953e3eb8ee3a89bad has these commands, but a rule containing macho.has_export("_MsoABTerm") will never match on it despite having the export.

More info: https://github.com/qyang-nj/llios/blob/main/dynamic_linking/chained_fixups.md

@plusvic
Copy link
Member

plusvic commented Feb 5, 2025

@latonis FYI, in case you have bandwith for taking at look at this.

@latonis
Copy link
Contributor

latonis commented Feb 5, 2025

will take a look today :)

@latonis
Copy link
Contributor

latonis commented Feb 5, 2025

#303 parses the exports_trie load command 😄

@latonis
Copy link
Contributor

latonis commented Feb 5, 2025

Working on the imports, needs a bit of a rework

#305 parses the fixups

plusvic pushed a commit that referenced this issue Feb 6, 2025
Implements the parsing required for exports defined via `LC_DYLD_EXPORTS_TRIE` as described in #301.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants