Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Using vtable structs in class datatypes #63

Answered by astrelsky
kevinhartman asked this question in Q&A
Discussion options

You must be logged in to vote

In reality the _vptr would point to the DerivedDerived vtable. Union support in the decompiler was added in 10.2_Dev and I have begun using them in the dev branch. With unions I am currently modeling it as follows:

struct Base {

    struct {
        void (*A)();
    } *_vptr;

    int a = 0;
};

struct Derived {

    union {
        struct {
            void (*A)(); // I think Derived's vtable would have it too.
            void (*B)();
        } *_vptr;
        Base Base;
    } super;
    int b = 0;
};


struct DerivedDerived {

    union {
        struct {
            void (*A)();
            void (*B)();
            void (*C)();
        } *_vptr;
        Derived Derived;
    } super;
…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kevinhartman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants