I have the following code disassembled by Ghidra. It first initialises the local variable of the particular type (local_68) and then passes it to the constructor. The variable seems to be initialised just as a particular object type, i.e. Game. But the constructor expects (according to the decompiler) pointer to that object, i.e. Game * this.

So, is there a standard way the constructor is called in situation like this? And what should be there in this case, the object or a pointer to it?

I am trying to see currently what would make the program run, as it is currently failing. Which might be because the way I have setup the constructor is not right.

Here is the calling function:

int main(int param_1,char **param_2,char **param_3)

  int iVar1;
  Game local_68 [96];
  iVar1 = gladius::Game::main(local_68,param_1,param_2,param_3);
  return iVar1;

And here is the constructor I am interested in:

Game * __thiscall gladius::Game::Game(Game *this)

  *(undefined8 *)this = 0;
  *(undefined8 *)(this + 8) = 0;
  *(undefined8 *)(this + 0x10) = 0;
  *(undefined8 *)(this + 0x18) = 0;
  *(undefined8 *)(this + 0x20) = 0;
  *(undefined8 *)(this + 0x28) = 0;
  *(undefined8 *)(this + 0x30) = 0;
  *(undefined8 *)(this + 0x38) = 0;
  *(undefined8 *)(this + 0x40) = 0;
  *(undefined8 *)(this + 0x48) = 0;
  *(undefined8 *)(this + 0x50) = 0;
  return this;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.