Skip to content
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

inconsistent function signature between r2ghidra and radare2 #119

Closed
Zzorz opened this issue Jun 17, 2020 · 1 comment
Closed

inconsistent function signature between r2ghidra and radare2 #119

Zzorz opened this issue Jun 17, 2020 · 1 comment

Comments

@Zzorz
Copy link

Zzorz commented Jun 17, 2020

The r2ghidra seems to have some problem when dealing with function signature, especially when it comes to the imported functions.

To reproduce this problem, just need a simple C code:

#include <stdlib.h>

int main(){
        return atoi("\x0");
}

image

In this condition, the decompiler just think that atoi return void, instead of a int type.
But in ghidra, the function signature is correct:
image
image

@Zzorz Zzorz closed this as completed Aug 21, 2020
@ITAYC0HEN
Copy link
Member

Indeed this is probably because Ghidra knows the signature for atoi, or because it understood it from the context.

In radare2, it is treated as an imported function which doesn't have an hard-coded signature in the program. Moreover, analysis performed by ghidra can't be compared to the analysis by r2ghidra as there will always be differences. It need to be compared to the analysis of radare2 itself (regardless of the decompiler)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants