Vector35 / Vector35/binaryninja-api
Binary ninja fails to find Global Pointer (gp) whereas Ghidra doesn't [RISCV 32]
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Description
Version and Platform (required):
- Binary Ninja Version: 5.1.8104
- Edition: Non-Commercial
- OS: NixOs
- OS Version: 25.11
- CPU Architecture: x64
Bug Description:
When opening the attached file for analysis BN fails to find the global pointer which leads to a worse decomp of the main/entry function.
When opening the same binary in Ghidra for de compilation it successfully finds the GPs value.
The binary itself is a small sample meant for decompilation and given in the context of a university course, it consist of a main function and a function that generates Fibonacci numbers the main function fills an array, compares it to some pre computed numbers and exists successfully if they match and with -1 otherwise
Steps To Reproduce:
Please provide all steps required to reproduce the behavior:
- Open elf file
- run analysis
- GP value couldn't be determined
Expected/Desired Behavior:
GP should be found, Ghidra found it so it's safe to assume it's possible.
Screenshots/Video Recording:
Binary:
If applicable, please provide us with the binary to help us work with the issue faster. Here are a few options:
Binary phrase below:
special octant heals watchfully
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the RISC-V 32 ELF described in the report and confirm the global-pointer analysis failure during ELF analysis. The issue names no source file, test, or entry point beyond the main/entry function, and the supplied binary is not available in the payload. Done means the global pointer is identified and the resulting decompilation improves without regressing other analysis.
Written by the indexing model from the issue text.
Assessment
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100