Sorry for the late reply. I have tried to run the code Kynox posted but still nothing happens. Here is what I did:
Made a new dll32 project in Visual Studio.
Pasted the code from Kynox.
Injected the dll in WoW with an injector found on GameDeception.
The method is being called like it was before, but it does not cast any spell:
Here is the code:
SpellCastDLL.cpp:
Code:
#include "stdafx.h"
void main()
{
CastSpellById( 168 ); //Frost Armor (Rank 1)
}
void __forceinline UpdateCurMgr()
{
DWORD dwClientCon = 0x00D43318;
DWORD s_curMgr = *(DWORD*)(*(DWORD*)dwClientCon + 0x2218);
DWORD* pTmp = NULL;
_asm mov eax, DWORD PTR FS:[0x2C]
_asm mov eax, DWORD PTR DS:[eax]
_asm mov pTmp, eax
*(DWORD*)((DWORD)pTmp + 0x10) = s_curMgr;
}
void CastSpellById( DWORD dwSpellID )
{
DWORD dwCastSpellById = 0x006FC520;
UpdateCurMgr();
__asm
{
PUSH 0
PUSH 0
PUSH 0
PUSH dwSpellID
MOV EAX, dwCastSpellById
CALL EAX
ADD ESP, 0x10
}
}
dllmain.cpp:
Code:
#include "stdafx.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
main();
break;
}
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
stdafx.h:
Code:
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
void main();
void CastSpellById( DWORD dwSpellID );