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

Topic: types for variables, flags, and function signatures #55

Open
thymol0 opened this issue Nov 15, 2021 · 0 comments
Open

Topic: types for variables, flags, and function signatures #55

thymol0 opened this issue Nov 15, 2021 · 0 comments

Comments

@thymol0
Copy link

thymol0 commented Nov 15, 2021

Types are more useful in the decompiler than in disassembly because the decompiler attempts to recover code as higher level as possible, that means that the result of the decompiler usually needs to be cleaned manually; In the case of ghidra, the process is to rename variables (there is also splitting a variable into two separate variables which is something specific to ghidra decompiler), to change variable types, change calling conventions, and change function signatures (ghidra supports automatically applying functions signatures from signature databases or type database), ghidra also has type deduction, an untyped variable automatically picks a type if assigned a value of a known type, this can be a function return value, or if a variable is passed as an argument in a call to a function with known parameter types.

radare does have a type system, but I would describe it as incomplete and incorrect, for instance, it doesn't do alignment, also it doesn't handle properly configuration specific sizes such as the size of a pointer. But is radare really pressed about types? Is the type feature in radare really used by people? I am thinking that ghidra plugin should have its own full featured type system because it makes a significant difference in ghidra while not that much in radare. I have experimented locally with the type system of radare, as well as exporting the variables that ghidra finds back to radare and I came to the conclusion of making ghidra plugin independent, especially that for the latter I found that ghidra has a special kind of variables that are neither a register variable nor a stack variable, they only exist in the intermediate representation so they can't be exported to radare, though ghidra does give them a type and a name. I concluded that mapping features of ghidra to radare one to one may not be feasible nor interesting. Also if ghidra specific code is in the plugin, it wouldn't be deleted from radare because it is "dead code that is not used in radare".

@thymol0 thymol0 changed the title Topic: types for variables, flags, and functions signatures Topic: types for variables, flags, and function signatures Nov 15, 2021
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

1 participant