So I am trying to call GetObjectName(), VMT #47, but it keeps crashing wow.
So here is the code I got so far but I am stumped to why its crashing WoW.
Code:
void __declspec(naked) __start_GetObjName()
{
__asm
{
MOV EDX, [0x011CA310]
MOV EDX, [EDX+0x28A4]
MOV EAX, FS:[0x2C]
MOV EAX, [EAX]
ADD EAX, 8
MOV [EAX], EDX
MOV ECX, [0xDEADBEEF] // WoW uses ECX to store class pointer?
MOV EDX, [0xDEADBEEF]
MOV EAX, [EDX + 4 * 47] // Get the address of GetObjectName()
CALL EAX
RETN
}
}
void __end_GetObjName() { }
Here is the injecting code.
Code:
// Create our injector
gpWoW->GetSyringe()->CreateInjector( (unsigned long)__start_GetObjName, dwFuncLen, "GetObjectName" );
// Inject our code into a code cave.
gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->Inject();
// Set the 0xDEADBEEF offsets to the correct class pointer.
gpWoW->GetSyringe()->GetMemory()->SetMem( ((unsigned long)gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->GetAllocAddr() + 0x19), m_dwObject );
gpWoW->GetSyringe()->GetMemory()->SetMem( ((unsigned long)gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->GetAllocAddr() + 0x1E), m_dwObject );
// Execute returns the DWORD exit code of GetExitCodeThread();
dwLvl02 = gpWoW->GetSyringe()->GetInjectorByName( "GetObjectName" )->Execute();
Everything injects find and the memory gets changed correctly but when every it gets to the Execute() line. Wow just crashes. There is no crash dump or anything it just closes.