Skip to content

How to get stack args to be properly recognized by decompiler? #5782

Closed Answered by marcushall42
marcushall42 asked this question in Q&A
Discussion options

You must be logged in to vote

I did discover that the PcodeOps generated for the entry instruction was poorly crafted. Instead of just subtracting a constant from the stack pointer, it was shifting the bitfield from the instruction and zero extending that, then subtracting the result. So, it seems that the stack analysis didn't fold constants together (unsurprising) and gave up trying to determine what the current stack offset was, so it couldn't determine when a stack reference was really accessing a register.
I have improved my sleigh so that now the "entry" instruction produces PcodeOp to directly subtract a constant from the stack pointer and now the decompiler understands the stack argument references.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marcushall42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #5780 on September 15, 2023 18:08.