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

Decompiler: Add support for INT_REM in jumptable recovery. #6070

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LukeSerne
Copy link
Contributor

This commit adds INT_REM handling to the JumpBasic class, which allows switch statements depending on expressions like x % 10 to be properly recovered. Previously, a warning was emitted about there being "too many branches". This slightly improves the third problem mentioned in #2628 (comment).

Screenshots
These screenshots show the main function of the switch example from GhidraDocs/GhidraClass/Advanced/Examples after auto-analysis.

Before applying the patch
image

After applying the patch
image

This commit adds INT_REM handling to JumpBasic, which allows switch statements
depending on expressions like "x % 10" to be properly recovered. Previously, a
warning was emitted about there being "too many branches".
@LukeSerne LukeSerne force-pushed the decomp-jumptable-recovery-add-int-rem branch from 7da9f4f to 1cae319 Compare December 31, 2023 17:32
@ryanmkurtz ryanmkurtz added Feature: Decompiler Status: Triage Information is being gathered labels Jan 2, 2024
@Nemoumbra
Copy link

image

This won't help with my case... sniff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Decompiler Status: Triage Information is being gathered
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants