I'm sorry, my mother tongue is not English.
Game Version:36949
D3D12 present hook
problem:
1.Jump() function working ( When the frequent called(Once per frame, FPS > 100),the game client closes automatically or Report error: The memory could not be "read" or LUA PANIC:unprotected error in call to Lua API (attempt to concatenate a function value).)
2.CastSpellByName("Feign Death") not work,the game client closes automatically.
3. RegisterFunc("Testfunc",Testfunc); working, Consel. Execute in game console: print(Testfunc) outputfunction : 000001B73229317 , Execute in game console: Testfunc() Report error: invalid function pointer: 000001b7476d7d20.
I want to know why. Can someone help me?
Code:
uintptr_t BaseAdd = reinterpret_cast<uintptr_t>(GetModuleHandle(NULL));
using Script_JumpOrAscendStart = uintptr_t(__fastcall*)();
using Script_CastSpellByName = uintptr_t(__fastcall*)(const char*);
using FrameScript_RegisterFunction = uintptr_t(__fastcall*)(const char* name, uintptr_t(__fastcall* function)());
inline void Jump()
{
auto const TFunc = reinterpret_cast<Script_JumpOrAscendStart>(BaseAdd + 0x19D3100);
TFunc();
}
inline void CastSpellByName(const char* name)
{
auto const TFunc = reinterpret_cast<Script_CastSpellByName>(BaseAdd + 0x1576BE8);
TFunc(name);
}
inline void RegisterFunc(const char* name, uintptr_t func())
{
auto const TFunc = reinterpret_cast<FrameScript_RegisterFunction>(BaseAdd + 0x7BCA90);
(TFunc)(name, func);
}
inline uintptr_t Testfunc()
{
Jump();
return 0;
}