local vmt = require("neverlose/vmt_hook")
ffi.cdef[[
typedef void*(__thiscall* get_client_entity_t)(void*, int);
]]
local this_call = function(call_function, parameters)
return function(...)
return call_function(parameters, ...)
end
end
local entity_list_003 = ffi.cast("uintptr_t**", utils.create_interface("client.dll", "VClientEntityList003"))
local get_entity_address = this_call(ffi.cast("get_client_entity_t", entity_list_003[0][3]), entity_list_003)
local originalCSA = nil
local updateCSA = function(thisptr, edx)
originalCSA(thisptr, edx)
end
local applyHook = function()
local self = entity.get_local_player()
if not self or not self:is_alive() then
return
end
local self_index = self:get_index()
local self_address = get_entity_address(self_index)
if not self_address or originalCSA then
return
end
local vtable = vmt.new(self_address)
originalCSA = vtable.hook("void(__fastcall*)(void*, void*)", updateCSA, 224)
print("updateclientanimation hooked")
end