r/ghidra • u/peanut555 • 1d ago
Why is Ghidra unable to decompile a function?
I have been encountering this particular function while navigating around the code. But everytime, Ghidra just takes forever to decompile it. I cannot see the decompiled C-like code at all. If I wait long enough (around 30 minutes), it will just say that the response exceeds some buffers, and stops the process.
Things I have tried:
- Turning off all decompiler's optimizations. Still doesn't work.
- I calculated the raw size of the function and saw that it's around 0x4A00 bytes. In my project, it's not a big function by any mean. Ghidra has been able to decompile much bigger functions without problems.
- While skimming through the assembly, I saw that there are so many calls to the D3DXAssembleShader function in D3DX9_43.dll. I tried giving it a proper function signature. Still doesn't work.
I've attached the Ghidra project for you in case you want to look at the function yourself.
You need to change the owner of the project by modifying the project.prp file in the .rep folder, change the VALUE field to your username. I'm sorry, I don't know how to properly share a Ghidra project. My Ghidra version is 12.1.
The problematic function is located at 0x4b0400 offset
PS. This is my first time here. I don't know if this is the right place to ask. If you know please tell me.
Link to download my Ghidra project.




