Git Product home page Git Product logo

Comments (9)

sei-ccohen avatar sei-ccohen commented on August 13, 2024

Actually, I confirmed recently that this does work in at least some circumstances. In the case that caused me to investigate, it was because we had deemed the RTTI information invalid during initial analysis resulting in it being discarded entirely. Can you investigate a little more and confirm that this is not happening? The restrictions on "valid" RTTI are currently too tight I think.

Alternatively, a small subset of the facts that demonstrate the problem in Prolog would be helpful. Now that there's improved logging in the Prolog phase, hopefully you'll be able to narrow the problem down to a Prolog based test case. If that's not convenient, another godbolt example to demonstrate the problem should be sufficient for us to investigate.

from pharos.

Trass3r avatar Trass3r commented on August 13, 2024

I'll check. Also discovered it incorrectly merged an abstract base class (interface) with one of its descendants because it concluded the subclass had no base.

from pharos.

sei-ccohen avatar sei-ccohen commented on August 13, 2024

Determining conclusively whether a class has a base class or not is nearly impossible. It's one of the primary "facts" that the Prolog phase is required to "guess" in order to be able to reason forward soundly about other facts. RTTI information can imply the lack of base class based on the reasoning that it would have been listed in the RTTI structures if it had existed, and this is a significant benefit from having RTTI. Point is: this kind of failure is among the most difficult to prevent in OOAnalyzer. If you have suggestions on how you would have concluded that there was a base class, we'd like to hear about it. :-)

from pharos.

Trass3r avatar Trass3r commented on August 13, 2024

Alternatively, a small subset of the facts that demonstrate the problem in Prolog would be helpful. Now that there's improved logging in the Prolog phase, hopefully you'll be able to narrow the problem down to a Prolog based test case. If that's not convenient, another godbolt example to demonstrate the problem should be sufficient for us to investigate.

Tried to create a small test case but it's not all that good I guess:
https://godbolt.org/z/mOcOpa
It does read the RTTI data but I don't see it being used.
Here are the original prolog facts, rtti entry 0x6be400.

from pharos.

edmcman avatar edmcman commented on August 13, 2024

@sei-ccohen It looks like we aren't detecting the inheritance through RTTI because of the following check in rTTIInheritsDirectlyFrom:

rTTIBaseClassDescriptor(BCDA, AncestorTDA, _NumBases, M, P, V, 0x40, _ECHDA),

I can't find any documentation for the attributes field, which you are checking is 0x40. None of the entries in this example have the attributes value 0x40. Is there a particular reason or meaning for 0x40?

from pharos.

edmcman avatar edmcman commented on August 13, 2024

I think I found the meaning of 0x40: https://www.unknowncheats.me/forum/938170-post9.html

If BCD_HASPCHD, then the BaseClassDescriptor has an extra pointer(32 bit/64 bit respectively) trailing the structure which is a pointer to the ClassHiearchyDescriptor.

It's still unclear why we would need this...

from pharos.

sei-ccohen avatar sei-ccohen commented on August 13, 2024

After fixing several issues (internally) in RTTI validation and reporting, I've tracked the problem back to some missing RTTITypeDescriptor facts at addresses 0x69f0c0 and 0x6bcc28. Because our RTTI fact exporting is currently based on VFTable detection, I suspect that something has gone wrong while detecting VFTables. Unfortunately, it's difficult to debug fact exporting from the exported facts. ;-)

Can you please provide the executable as well, so that we can continue to investigate? The solution might require a change in how we approach RTTI facts (hard) or a minor fix to VFTable detection (easy).

from pharos.

Trass3r avatar Trass3r commented on August 13, 2024

I tested this executable to see how it works when RTTI data is available.

from pharos.

sei-eschwartz avatar sei-eschwartz commented on August 13, 2024

I believe this is fixed in 90f9011. Reopen if not.

from pharos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.