Ahh, so when I hook with the ATA_LUA_GETTOP
Code:
::MH_CreateHook(((void*) ATA_LUA_GETTOP), &hf_lua_gettop, reinterpret_cast<void**>(&g_fp_lua_gettop))
I define 3 parameters:
pTarget [in] A pointer to the target function, which will be overridden by the detour function. In our case with ATA_LUA_GETTOP, we were overridden every call to a lua function by casting the address into a (void*)
Code:
(void*) ATA_LUA_GETTOP
pDetour[in] A pointer to the detour function, which will override the target function. In our case, we give the address of our function:
Question about that though. How do I know that the call I override takes 1 argument?
Code:
uint64_t __fastcall hf_lua_gettop(void* lua_state)
ppOriginal [out] A pointer to the trampoline function, which will be used to call the original target function. This is stored in
Code:
static ft_lua_gettop g_fp_lua_gettop = nullptr;
and we call it at the end of our function by giving it the argument it was supposed to receive.
Code:
return g_fp_lua_gettop(lua_state);
So I actualy need to do the same thing but for the ADA_LOCAL_PLAYER.
I just need to figure out how many argument the call that I inject is receiving, if that make sense.
Regarding animation speed being outdated.
Quote:
localplayer is for animation speed which is outdated anyway.
|
I presume you talk about the offsets to find :
character_control_address
character_scene_address
and animation speed address
Hmm, at that point maybe I would have to code something to read memory and display their values, and see which one is changing accordingly to what I'm doing in BDO. In the end, all I want is the offset of the animation speed from the local_player_address.