-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
"Split out as new variable" support for stack variables #2573
Comments
This feature is desperately needed |
You can see how reassignment works for uniques (those which labeled as |
I've found the correct usage for such feature, it's described here #1510. For now it would be better to just copy by parts the decompilation to some separate text file before you change the stack frame and after you remap locals for other part of function. Maybe it's possible to make more tables for stack frame but currently we don't even know how to handle such copies in stack frame editor. |
Is it possible to add a We also need to be able to create our own block as I've discovered stack reuse in monolithic functions, efectively in the same block! |
We don't have such concept as "block id" as we reassign each register or unique by just one address instead. The reason is in the complexity of operating on these data and user input if necessary (one address is easier than bunch of ids and depths). Exactly the same thing would apply to the stack frames if multiple copies are allowed. Also not sure what stack hierarchy would look like. |
Okay, how about using two addresses (I'm assuming here that the address used is the one associated with either the I've not delved far into the class |
Will this be placed on anyone's radar soon??? |
Sorry for the spam, but I was looking into it and I can't believe I have to do some custom union types just to clean up the decompilation, especially when working with custom layered |
Any news on this ? @Swyter How do you use your workaround. |
I've successfully updated my assembly to change the offset for the instructions in the area I wish to isolate of the form |
This only works when the change required fits into the size of |
Hi @caheckman, please don't take this the wrong way, but as this has been around for a while now, is there a window for this to be looked into soon? |
@caheckman I'm getting more and more functions I need to decompile that are making use of the same stack reference for different variable types (especially the creation and destruction of what amounts to temporary C++ objects) within C++ code blocks like within |
Have you tried using unions of structs which in turn represent locals for each frame separately? Like |
@Danil6969 thanks for this great suggestion. It works well for different structures using the exact same location, however, and here's the rub, most of the datatypes are overlapping stack locations! To combat that, you end up with deeply nested |
@caheckman as OO languages allow the creation/destruction of local (hence stack) objects within code blocks (ie within an |
If the current process is defined as:
Could'nt we add another layer of indirection such that it would be:
The Unfortunately I don't have enough detailed knowledge of Ghidra's internals to complete this myself! This would also assist in solving #5769 (comment). |
Describe the solution you'd like
A clear and concise description of what you want to happen.
Right now, this feature only works with registers. (it works well!) When it comes to stack vars, the option isn't even there. It's a very useful feature when it comes to use different names and types for the same var.
The text was updated successfully, but these errors were encountered: