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
Missing code references in MIPS #1531
Comments
What does the function definition for malloc look like? The results here lead me to believe it hasn't been properly defined. |
Hi @astrelsky ,
|
Yes, I meant how it was defined in the ghidra project. Regardless I misunderstood the problem. I see that there is no reference to malloc in the disassembly view. You can add the references through the listing by right clicking the t9->references->add/edit references or through the api with the ReferenceManager. There is a getter for the manager in the Program interface. As long as the reference is set as primary it should appear in both the disassembler and decompiler. |
Thanks for your advice. I add the references to |
This is a fairly easy fix / oversight with the OR operation. The OR operation is being using to assign S8 from SP. It could be fixed with by splitting the OR operation into OR and MOV where one of the operands is 0. I don't like splitting instructions, as it causes re-disassembly upgrade issues. I'll make the fix in constant propagation in patch and master. Unfortunately 9.1.2 is coming out soon, so this change won't make that version. |
@emteere I 100% guarentee it won't make it https://github.com/NationalSecurityAgency/ghidra/releases/tag/Ghidra_9.1.2_build Nice that it's a simple fix though. |
The 9.1.2 has a few high priority fixes, especially JDK 11.0.6 support. |
@emteere Thank you for your explanation. I'm looking forward to the new version to solve this problem. |
Describe the bug
Hi, I'm trying to use Ghidra's API to automatically recover the parameters of the specified function(e.g.,
malloc
). But it seems that some code references are missing when I tried to do this in MIPS.In the following picture, the first
t9
is recognized, but the second one and the third one are not recognized. But in the decompile view, those functions are recognized asmalloc
.And when I tried to search references to
malloc
, I only got the following results. But in the source program, there are fourteen calls tomalloc
. It seems like in the listing view, the disasm codes whose comment has "=>malloc" are recognized asmalloc
's references.Expected behavior
Ghidra can provide all code references to the target function.
I'm new to both Ghidra and RE. Thanks for any help!
Attachments
An binary example and its source code.
mallocexample.zip
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: