binaryninja-api
binaryninja-api copied to clipboard
[RV32] Very bad decompilation of simple getchar function
Version and Platform (required):
- Binary Ninja Version: 5.2.8614
- Edition: Non-Commercial
- OS: NixOs
- OS Version: 25.11
- CPU Architecture: x64
Bug Description:
I have the simple function getchar(char* c) with the following reasonably simple assembly code:
That:
- saves the incoming buffer from a0 into a5
- sets a0 to the getchar syscall
- returns immediately if the syscall gave a non 0 exit status
- saves the char into the buffer and exits otherwise
However the HLIL and pseudo C de-compilations are very confusing:
HLIL:
Pseudo C:
Expected Behavior: Binany ninja should understand that a0 is the only incoming register in this function and that it therefore only takes one Argument.
Screenshots/Video Recording: The screenshots are placed in their appropriate place in the issue description.
Binary:
glow circle serves neatly base offset is 0x20000000