-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
AnnotateVariable() method doesn't find the correct reference offset for global variables #323
Comments
@thestr4ng3r what do you think? is it intentional? |
Might indeed be a bug that there are false positives in the "global variable" recognition. But it should be checked with a concrete test case. |
I've tested this repeatedly over the past few days, and it looks like the check for AddrSpace* space = varnode->getSpace();
AddrSpace* codeSpace = space->getTrans()->getDefaultCodeSpace();
annotation.reference.offset = (space != codeSpace) ? varnode->getTiedVarnode()->getOffset() : varnode->getOffset(); Note that I use the latest fork of ghidra, but that doesn't seem to be the issue. |
I've come to a conclusion that this happens when a global variable get assign a value, something like this: uRam_deadbeef = *(uint64_t*)(iVar8 + 0x123); In this case, And the fix |
Hi, have you had a chance to do that? Also, is there any test case? Minified example would work best. |
I'm implementing my own ghidra decompiler and researching your source as a reference, while trying to make the xml parser I noticed that some global variable token has a varnode that is in the "register" or "unique" space.
I've checked on my end and it doesn't look like i parsed the xml incorrectly. Since your source doesn't handle this case, isn't this a bug?
The text was updated successfully, but these errors were encountered: