Hey, I'm having an issue with GOM and I can't figure out why it keeps crashing. Are my virtual functions in the right order or am I doing something wrong?
Code:
class GOM
{
public:
virtual Prototype* GetPrototypeById(unsigned int IdLow, unsigned int idHigh, int trace);
virtual void Function1(); //
virtual void Function2(); //
virtual void Function3(); //
virtual void Function4(); //
virtual void Function5(); //
virtual int lookupPrototypeId( DWORD* ReturnId, eastl::wstring *protoType, int trace);
virtual HeroNode* GetNodeById(int idLowPart, int idHighPart, int trace = 0);
virtual int lookupPrototypeName(eastl::wstring *protoType, LARGE_INTEGER Val);
virtual int getPropertyFromNode(LARGE_INTEGER Val, eastl::wstring *, eastl::wstring *Out);
virtual int whatIs(void *This,LARGE_INTEGER Val, eastl::string* ret, eastl::string* str1, eastl::string* str2);
virtual int GetEnumDefs( void* defs );
virtual int *GetClassTotalFields(LARGE_INTEGER * Val, int *ret);
I'm calling them like this
Code:
DWORD* blah = *(DWORD**)Utils::Ptr(Entry::g_hMainModule, 0x010926E0);
GOM* g_main = (GOM*)blah;
if(g_main)
{
printf("g_main: 0x%X\n", g_main);
Utils::add_log("g_main: 0x%X", g_main);
if(g_main->NodeList && g_main->NodeList->IdLow && g_main->NodeList->IdHigh)
{
int g_IdLow = g_main->NodeList->IdLow;
int g_IdHigh = g_main->NodeList->IdHigh;
printf("g_IdLow: 0x%X\n", g_IdLow);
Utils::add_log("g_IdLow: 0x%X", g_IdLow);
printf("g_IdHigh: 0x%X\n", g_IdHigh);
Utils::add_log("g_IdHigh: 0x%X", g_IdHigh);
HeroNode* heroNode = (HeroNode*)g_main->GetNodeById(g_IdLow, g_IdHigh);
if(heroNode)
{
printf("---------------\nPlayer: 0x%08X\n---------------\n", heroNode);
Utils::add_log("---------------\nPlayer: 0x%08X\n---------------", heroNode);
}
}
}