Skip to content

Conversation

@aidan-wallace-j12
Copy link

This is the first draft of a solution to #8586. There are almost certainly some improvements that need to be made to code organization (first time contributor), but it solves most cases of global arrays with 1-indexing.

Some improvements can be made to recognized arrays within structs, and further levels of nesting, but this was a massive improvement on my current project. Cross-refs work correctly and drastically improves decompile as shown in #8586.

@aidan-wallace-j12 aidan-wallace-j12 force-pushed the oneOffset branch 2 times, most recently from 141df0c to 3c7af07 Compare October 23, 2025 21:44
/// \param multiplier will hold the biggest constant multiplier or 0, if no multiplier is present
/// \param maxLevel is the maximum depth to search in the tree
/// \return the sum of all constants in the additive expression
int8 ActionConstantPtr::getConstOffsetBack(Varnode *vn,int8 &multiplier,int4 maxLevel)
Copy link
Author

Choose a reason for hiding this comment

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

This is a direct copy and paste from RulePtrsubUndo. I'm not versed enough with the codebase to know where the function should get moved to in order to be shared between the two, and didn't want to introduce a dependency from one to the other where it shouldn't be

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.

3 participants