-
Notifications
You must be signed in to change notification settings - Fork 192
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
Handle "logical this adjustments” #187
Comments
|
The vftable in question is installed by 0x548110 and 0x548200, at different offsets. I think the oustanding question at this point is are these on the same class? |
From comparing this to the PS2 version with symbols it seems that:
|
So does it seem like 0x5f5d60 is legitimately installed at two different offsets in radSoundHalListener? Can you get an object layout for radSoundHalListener from the PS2 version? |
Here is the class hierarchy courtesy of RTTI:
@sei-ccohen are a bit confused: Because of the negative offset accessed in 0x548110, we believed there was a virtual base involved. But according to the above, there is no virtual base on radSoundHalListener. The key to understanding what is going on is understanding why 0x548110 thinks it is ok to reference the object at a negative offset. Most likely whatever is causing the offset difference is also causing us to get confused about the vftable being installed in two different offsets. |
We are still experimenting, but we were able to generate a negative offset in a virtual function. https://www.godbolt.org/z/feoKPMajx Basically, this happens when a virtual function is only accessed from the second (or later?) base class, and the function accesses a member in the first base class. This needs a bit more thought, but it means that the object pointer for a virtual function in a derived class may not always be pointing at the start of the derived class! |
Seems like this is happening here:
Sounds like the problem encountered here was identified? |
Yes, I think that is what is happening there. We are thinking about the best way to fix it. By the way, in the meantime, you should be able to manually remove the problematic vftables from the .results file to get the export to work. |
Great news! And thanks for the tip. I was able to export by removing
What tool was used to create this? Is that an IDA thing? |
Glad to hear you were able to get the JSON export to work. Yes, the class hierarchy is an IDA feature I recently discovered by accident. It adds the hierarchy as a comment above the RTTI Type Descriptors. I haven't used it, but I think https://github.com/astrelsky/Ghidra-Cpp-Class-Analyzer is a similar capability for Ghidra. |
I recently found that Jan Gray talked about this:
|
One thing I noticed recently is that there are actually stubs for logical this adjustments that we should be able to detect. Here's an example for experimentation: https://godbolt.org/z/qs55rzaj6 |
When analyzing the Simpsons: Hit & Run demo JSON generation fails.
Executable, ApiDB, facts and results uploaded here, please let me know if you need any of the other files.
The error is
ERROR: Duplicate key: '0x5f5d60'
:The text was updated successfully, but these errors were encountered: