[DiscordArchive] Does somebody know why the multi inheritance in IDA seems so buggy...?
[DiscordArchive] Does somebody know why the multi inheritance in IDA seems so buggy...?
Archived author: Saty • Posted: 2025-06-23T11:49:54.974000+00:00
Original source
Does somebody know why the multi inheritance in IDA seems so buggy...?
```
struct __cppobj CScriptRegion : CScriptObject, CLayoutFrame
{
CScriptRegion *parent;
DWORD CScriptRegion_ukn[2];
};
```
I got this here, which works really well everywhere. But sometimes it doesn't for some reason.
Like sometimes the "this" pointer is accessed with a negative offset, I assume to get to the "real base" of the object.
But for some reason it assumes the "real base" of the object and anything inheriting of it starts at the CLayoutFrame.
The only way so far I found that fixes it, is to add __shifted to the this pointer, offsetting it be the 0x20 bytes of the CScriptObject.
Is that just a bug with IDA or did I setup the multi inheritance wrong somehow?
![[Image: 23_13_50_21_ida.png?ex=690c8b9e&is=690b3...320348bab&]](https://cdn.discordapp.com/attachments/1086807686571642900/1386674880694587535/23_13_50_21_ida.png?ex=690c8b9e&is=690b3a1e&hm=7d8addb2ceb2f33db455ea2f952bac7d8179c52687a25042af66239320348bab&)
![[Image: 23_13_50_12_ida.png?ex=690c8b9e&is=690b3...461daa2d8&]](https://cdn.discordapp.com/attachments/1086807686571642900/1386674880929595433/23_13_50_12_ida.png?ex=690c8b9e&is=690b3a1e&hm=14a8fdd5a696683e66e0fab4a2544055a5ab636a21d2c5e02ddfcf6461daa2d8&)
Archived author: Saty • Posted: 2025-06-23T11:50:54.836000+00:00
Original source
Here is a example where it is weird. It's fixed by offsetting it as you see in the arguments.
![[Image: 23_13_50_21_ida.png?ex=690c8b9e&is=690b3...320348bab&]](https://cdn.discordapp.com/attachments/1086807686571642900/1386674880694587535/23_13_50_21_ida.png?ex=690c8b9e&is=690b3a1e&hm=7d8addb2ceb2f33db455ea2f952bac7d8179c52687a25042af66239320348bab&)
![[Image: 23_13_50_12_ida.png?ex=690c8b9e&is=690b3...461daa2d8&]](https://cdn.discordapp.com/attachments/1086807686571642900/1386674880929595433/23_13_50_12_ida.png?ex=690c8b9e&is=690b3a1e&hm=14a8fdd5a696683e66e0fab4a2544055a5ab636a21d2c5e02ddfcf6461daa2d8&)
Archived author: Saty • Posted: 2025-06-23T11:55:18.103000+00:00
Original source
Spent hours already trying to fix it... googled the crap out of anything I could think of that could relate to this.
The __shifted way is the only fix I found so far, but it seems so wrong. Especially because this issue only happens in some cases.
Mostly everything points to where it should
Archived author: Killshot • Posted: 2025-06-23T11:59:17.764000+00:00
Original source
probably just the way C++ compiler works, you can even do some tests by making similar C++ code, compiling it and then looking at pdb
Archived author: Saty • Posted: 2025-06-23T12:00:11.558000+00:00
Original source
Hmm. Yeah. I mean using __shifted is not such a big deal, it's just ugly af.
Archived author: Saty • Posted: 2025-06-23T12:01:21.065000+00:00
Original source
It's just confusing me that this only happens sometimes and not everywhere.
Like nearly all functions using anything CScriptRegion related points to the right things.
And then just randomly a function like the example there, where everything is offset by 0x20.