GithubHelp home page GithubHelp logo

xobse_types_c's Introduction

This is a translation of the xOBSE header files in to C so they can be parsed by Ghidra.

General Structure

Each class has 3 structs:

struct CLASSNAME_vtbl{
    //this contains the virtual methods for the class
}
struct _CLASSNAME{
    //_BASECLASS
    //this contains the data members of the class
    int data0;
    int data1;
}
struct CLASSNAME{
    //wrapper object to construct the final class structure
    CLASSNAME_vtbl* _vtbl;
    _CLASSNAME _data;
}

If used in ghidra, you will see a lot of _data._base._base._base.xxxx. ignore all the _data and _base, that's just traversing the inheritance tree.

This structure is used so inheritance works. A class inherits all the elements of its base class, EXCEPT the vtable. So we have to have the vtable be a separate element that is only included in the final structure. When creating a derived class, include the base class's _CLASSNAME struct as the first element of the derived class's _CLASSNAME. So you end up with a data structure looking like

CHILDCLASS{
child VTBL*---------->CHILDCLASS_VTBL{
//_CHILDCLASS start     parent_method0()
  parent_data0          parent_method1()
  parent_data1          ...
  ...                   child_method0
  child_data0           child_method1
  child_data1         }
  ...
//_CHILDCLASS end
}

xobse_types_c's People

Contributors

michaelebert avatar

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.