how to infer data type in ghidra decompilation result for /usr/bin/ls ?
1 Answer
Kevin,
As I answered on your last question:
open ghidra gui, analyse the binary, click on file -> export program -> and export as a C/C++ file.
In this file, ghidra constructs possible typedefs for you.
For e.g. typedef unsigned char undefined1;
So, you'll know the possible type of this object. In your particular case, it constructs (assuming a stripped binary):
typedef unsigned long undefined8;
But, note that these types are just estimates and could be different than the original source code (in case of user defined functions).
-
-
-
What do you man by "unsolved" ? This decompilation result has so many undefined8– kevinMay 20, 2020 at 7:54
-
1i.e. correct type recovery from stripped binaries is not fully possible yet. If you get undefineds then it is possible that the decompiler is not able to detect correct types and marked it as a custom type– R4444May 20, 2020 at 13:17