0
bool __thiscall sub_5DF8F0(_DWORD *this)
{
  int v1; // eax

  v1 = this[358];
  return !v1 || v1 == 1;
}

I'm a little bit experienced with C++, I'm also new to IDA_PRO... I'm having trouble reading this simple code right above. I know that the argument _DWORD *this is a Class Object, but don't know why this code indexing a Class????

  • It is saying that from the beginning of the class, at the offset 358, retrieve that field.. Similar to doing `offsetof(SomeClassOrStruct, someField)` and the result is `358`. – Brandon Apr 18 '21 at 03:46
  • Example: https://ideone.com/OmurLA – Brandon Apr 18 '21 at 03:57
  • This usage is not valid C++, because `this` is a language keyword, so cannot be used as an identifier (in this case, the name of a function argument). However, `this` (in contexts where usage is valid) is a pointer, so `this[358]` would treat `this` as a pointer to the first element of an array, and retrieve the 359'th element of that array. – Peter Apr 18 '21 at 04:43
  • `_DWORD *this` is not a class object. It's a pointer. Full stop. – Pete Becker Apr 18 '21 at 13:58

0 Answers0