rizinorg / rz-ghidra

Deep ghidra decompiler and sleigh disassembler integration for rizin
GNU Lesser General Public License v3.0
802 stars 87 forks source link

Bad decompilation, many irrelevant casts #218

Open VimperSky opened 3 years ago

VimperSky commented 3 years ago

Hello, I wanted to reverse engineer old game to try to fix some bugs there. For this reason, I opened a dll file, opened random function and compared results between IDA Pro Decompiler and Cutter built-in Ghidra decompiler (So, I guess, its this plugin) Here is differences between them: image image

You can see first if and compare it: In cutter its: if ((uint16_t)((uint16_t)(0.0 < param_2) << 8 | (uint16_t)(param_2 == 0.0) << 0xe) == 0) { param_2 = 0.0; } and in IDA PRO: if (a2 < 0.0) a2 = 0.0

absolutly unreadable in Cutter and readable in IDA Pro. Why not to optimize it like it did IDA Pro? Or this is relevant to Ghidra itself but not the plugin?

Environment: Windows 10, Cutter 2.0, opened file with advanced analysis (all checkboxes are checked in)

Reproduce: WXPMod.txt Rename extension to dll (for some reason, Github doesn't allow me to upload dll files)

iamavu commented 2 years ago

@VimperSky Any updates on this?