rizinorg / rz-ghidra

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

Fix shared return jump to relocs #347

Closed Crabtux closed 7 months ago

Crabtux commented 8 months ago

Ghidra uses some scripts written in Java to fixup some analysis corner cases (see Ghidra/Features/Base/ghidra_scripts), but currently rz-ghidra is not able to use them, which causes some decompiling issues. This PR makes an attempt to fixup one of the corner cases. Details about the issue can be found in #202.

I try to solve the issue by adding a hook before decompiling action, but after the initialization of the RizinArchitecture. The hook function uses rizin to analyse shared return calls to relocs, and fixup the P-Code using setFlowOverride() API provided by Ghidra.

Expected to fix #202.

XVilka commented 8 months ago

The red CI should be fixed once https://github.com/rizinorg/cutter/pull/3319 is merged

thestr4ng3r commented 7 months ago

Thanks! The test case is also very useful.