Yup, i've tried using a typedef too,
Code:
typedef bool(__cdecl* fnCastSpellByID)(unsigned int SpellID,unsigned int Unk2,unsigned int Unk3, unsigned int Unk4);
...
fnCastSpellByID LUACastSpellByID;
...
LUACastSpellByID = (fnCastSpellByID)OFFSET_LUACASTSPELLBYID;
...
bool ret = LUACastSpellByID(78,0,0,0);//Heroic Strike (R1)
Gives the exact same error..
EDIT:
Turns out here is where the code is crashing, apparently according to Visual Studio 2010:
Code:
/***
* _unlock - Release multi-thread lock
*
*Purpose:
* Note that it is legal for a thread to aquire _EXIT_LOCK1
* multiple times.
*
*Entry:
* locknum = number of the lock to release
*
*Exit:
*
*Exceptions:
*
*******************************************************************************/
void __cdecl _unlock (
int locknum
)
{
/*
* leave the critical section.
*/
LeaveCriticalSection( _locktable[locknum].lock ); <-- Access violation reading 0x5E here..
}