Skip to content

macOS kernel "Add to Program" doesn't fix decompiler output #8472

@nmggithub

Description

@nmggithub

Describe the bug
See steps.

To Reproduce
Steps to reproduce the behavior:

  1. Load a macOS kext using a kernelcache as a filesystem.
  2. Use the "Add to program" flow to add another file from that filesystem to the Program.
  3. Observe the function names appearing in the disassembly, but not the decompilation.

Expected behavior
The function names should appear in both the disassembly and the decompilation.

Screenshots

Disassembly of a strcmp call Decompilation of a strcmp call

Environment (please complete the following information):
Note: This is mostly copied from one of my most recent issues. To the best of my knowledge, it is still accurate.

  • OS: macOS 26.0 beta 8 (25A5349a)
  • Java Version: openjdk version "23.0.2" 2025-01-21
  • Ghidra Version: Commit 7482131bcc0800401cd5564393d771eea7f72d6f with 0464fc981f5d8c1bf481b72b4b5ba6f12d8bd2ef cherry-picked on top
  • Ghidra Origin: locally built

Additional context
It's possible I'm used to the user space pattern where functions are calls to thunks instead of directly to other functions like is the case here with the macOS kernel. In user space, the thunk functions are fully decompiled (as they are only a few instructions long). That might be what makes them appear in the decompilation, but I could be wrong. I'd rather not have to decompile a function in order to show named references to it in the decompilation output.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions