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

Fix shared return jump to relocs #347

Merged
merged 8 commits into from
Apr 30, 2024
Merged

Conversation

Crabtux
Copy link
Contributor

@Crabtux Crabtux commented Mar 15, 2024

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.

@Crabtux Crabtux marked this pull request as ready for review March 15, 2024 10:57
@XVilka
Copy link
Member

XVilka commented Mar 18, 2024

The red CI should be fixed once rizinorg/cutter#3319 is merged

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thestr4ng3r take a look please

@thestr4ng3r thestr4ng3r merged commit 071198a into rizinorg:dev Apr 30, 2024
7 checks passed
@thestr4ng3r
Copy link
Member

Thanks! The test case is also very useful.

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

Successfully merging this pull request may close these issues.

Mishandled tailjump with reloc inside the jump instruction
4 participants