LUA скрипт Leg Breaker In Air | NL SOURCE

Забаненный
Статус
Оффлайн
Регистрация
6 Мар 2023
Сообщения
13
Реакции[?]
6
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
neverlose leg breaker

Код:
ffi.cdef[[
    typedef void*(__thiscall* get_client_entity_t)(void*, int);
    typedef struct {
        char  pad_0000[20];
        int m_nOrder; //0x0014
        int m_nSequence; //0x0018
        float m_flPrevCycle; //0x001C
        float m_flWeight; //0x0020
        float m_flWeightDeltaRate; //0x0024
        float m_flPlaybackRate; //0x0028
        float m_flCycle; //0x002C
        void *m_pOwner; //0x0030
        char  pad_0038[4]; //0x0034
    } CAnimationLayer;
]]

local vmt_hook = require("neverlose/vmt_hook")
local aaicon = ui.get_icon("cogs")
local main_aa = ui.create(aaicon.. " Anti-Aim", aaicon..  "  Anti-Aim")
local animbreakers = main_aa:selectable("Anim. Breakers", {"Leg Breaker In Air"})

local uintptr_t = ffi.typeof("uintptr_t**")
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 hooked_function = nil
local inside_updateCSA = function(thisptr, edx)
    hooked_function(thisptr, edx)
    local lp = entity.get_local_player()
    if not lp or not lp:is_alive() then return end
        if animbreakers:get("Leg Breaker In Air") then
        ffi.cast('CAnimationLayer**', ffi.cast('uintptr_t', thisptr) + 0x2990)[0][6].m_flWeight = 1
    end
end

function hookfield()
    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 hooked_function then return end

    local new_point = vmt_hook.new(self_address)
    hooked_function = new_point.hook("void(__fastcall*)(void*, void*)", inside_updateCSA, 224)
end


events.createmove_run:set(function()
    hookfield()
end)
 
Забаненный
Статус
Оффлайн
Регистрация
6 Мар 2023
Сообщения
13
Реакции[?]
6
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Участник
Статус
Оффлайн
Регистрация
4 Мар 2021
Сообщения
831
Реакции[?]
171
Поинты[?]
84K
neverlose leg breaker

Код:
ffi.cdef[[
    typedef void*(__thiscall* get_client_entity_t)(void*, int);
    typedef struct {
        char  pad_0000[20];
        int m_nOrder; //0x0014
        int m_nSequence; //0x0018
        float m_flPrevCycle; //0x001C
        float m_flWeight; //0x0020
        float m_flWeightDeltaRate; //0x0024
        float m_flPlaybackRate; //0x0028
        float m_flCycle; //0x002C
        void *m_pOwner; //0x0030
        char  pad_0038[4]; //0x0034
    } CAnimationLayer;
]]

local vmt_hook = require("neverlose/vmt_hook")
local aaicon = ui.get_icon("cogs")
local main_aa = ui.create(aaicon.. " Anti-Aim", aaicon..  "  Anti-Aim")
local animbreakers = main_aa:selectable("Anim. Breakers", {"Leg Breaker In Air"})

local uintptr_t = ffi.typeof("uintptr_t**")
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 hooked_function = nil
local inside_updateCSA = function(thisptr, edx)
    hooked_function(thisptr, edx)
    local lp = entity.get_local_player()
    if not lp or not lp:is_alive() then return end
        if animbreakers:get("Leg Breaker In Air") then
        ffi.cast('CAnimationLayer**', ffi.cast('uintptr_t', thisptr) + 0x2990)[0][6].m_flWeight = 1
    end
end

function hookfield()
    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 hooked_function then return end

    local new_point = vmt_hook.new(self_address)
    hooked_function = new_point.hook("void(__fastcall*)(void*, void*)", inside_updateCSA, 224)
end


events.createmove_run:set(function()
    hookfield()
end)
pdr:
ffi.cdef[[
    int VirtualFree(void* lpAddress, unsigned long dwSize, unsigned long dwFreeType);
    void* VirtualAlloc(void* lpAddress, unsigned long dwSize, unsigned long  flAllocationType, unsigned long flProtect);
    int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect);
]]

--- @region: create library
local library = {}
library.list = {}

library.copy = function(void, source, length)
    return ffi.copy(ffi.cast("void*", void), ffi.cast("const void*", source), length)
end

library.virtual_protect = function(point, size, new_protect, old_protect)
    return ffi.C.VirtualProtect(ffi.cast("void*", point), size, new_protect, old_protect)
end

library.virtual_alloc = function(point, size, allocation_type, protect)
    local alloc = ffi.C.VirtualAlloc(point, size, allocation_type, protect)
    return ffi.cast("intptr_t", alloc)
end

library.new = function(address)
    local cache = {
        data = {},
        org_func = {},

        old_protection = ffi.new("unsigned long[1]"),
        virtual_table = ffi.cast("intptr_t**", address)[0]
    }

    cache.data.hook = function(cast, __function, method)
        cache.org_func[method] = cache.virtual_table[method]
        library.virtual_protect(cache.virtual_table + method, 4, 0x4, cache.old_protection)

        cache.virtual_table[method] = ffi.cast("intptr_t", ffi.cast(cast, __function))
        library.virtual_protect(cache.virtual_table + method, 4, cache.old_protection[0], cache.old_protection)

        return ffi.cast(cast, cache.org_func[method])
    end

    cache.data.unhook = function(method)
        library.virtual_protect(cache.virtual_table + method, 4, 0x4, cache.old_protection)

        local alloc_addr = library.virtual_alloc(nil, 5, 0x1000, 0x40)
        local trampoline_bytes = ffi.new("uint8_t[?]", 5, 0x90)

        trampoline_bytes[0] = 0xE9
        ffi.cast("int32_t*", trampoline_bytes + 1)[0] = cache.org_func[method] - tonumber(alloc_addr) - 5

        library.copy(alloc_addr, trampoline_bytes, 5)
        cache.virtual_table[method] = ffi.cast("intptr_t", alloc_addr)

        library.virtual_protect(cache.virtual_table + method, 4, cache.old_protection[0], cache.old_protection)
        cache.org_func[method] = nil
    end

    cache.data.unhook_all = function()
        for method, _ in pairs(cache.org_func) do
            cache.data.unhook(method)
        end
    end

    table.insert(library.list, cache.data.unhook_all)
    return cache.data
end
--- @endregion

ffi.cdef[[
    typedef struct {
        char  pad_0000[20];
        int m_nOrder; //0x0014
        int m_nSequence; //0x0018
        float m_flPrevCycle; //0x001C
        float m_flWeight; //0x0020
        float m_flWeightDeltaRate; //0x0024
        float m_flPlaybackRate; //0x0028
        float m_flCycle; //0x002C
        void *m_pOwner; //0x0030
        char  pad_0038[4]; //0x0034
    } CAnimationLayer;
]]
ffi.cdef[[
    typedef void*(__thiscall* get_client_entity_t)(void*, int);
]]

local uintptr_t = ffi.typeof("uintptr_t**")
local this_call = function(call_function, parameters)
return function(...)
return call_function(parameters, ...)
end
end

local entity_list_003 = ffi.cast(uintptr_t, client.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 hooked_function = nil
local inside_updateCSA = function(thisptr, edx)
hooked_function(thisptr, edx)
ffi.cast('CAnimationLayer**', ffi.cast('uintptr_t', thisptr) + 0x2990)[0][12].m_flWeight = 1
end

local update_hook = function()
if not client.is_alive() then
return
end

local self_index = entity_list.get_client_entity(engine.get_local_player()):index()
local self_address = get_entity_address(self_index)

if not self_address or hooked_function then
return
end

local new_point = library.new(self_address)
hooked_function = new_point.hook("void(__fastcall*)(void*, void*)", inside_updateCSA, 224)
end

callbacks.register("post_move", function()
    update_hook()
end)
долго переписывал? только честно
 
Начинающий
Статус
Оффлайн
Регистрация
23 Авг 2019
Сообщения
50
Реакции[?]
8
Поинты[?]
4K
ты конечно молодец шайтан машина что сделал но оно работает на всех людей а не на локал)))))))
 
Участник
Статус
Оффлайн
Регистрация
4 Мар 2021
Сообщения
831
Реакции[?]
171
Поинты[?]
84K
ты конечно молодец шайтан машина что сделал но оно работает на всех людей а не на локал)))))))
так надо :seemsgood:
Код:
local animbreakers = main_aa:selectable("Anim. Breakers", {"Leg Breaker In Air"})
один вопрос возник, а нахуя тебе селектебл на 1 функцию :roflanEbalo:
 
Последнее редактирование:
Забаненный
Статус
Оффлайн
Регистрация
6 Мар 2023
Сообщения
13
Реакции[?]
6
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
60
Реакции[?]
3
Поинты[?]
3K
ты конечно молодец шайтан машина что сделал но оно работает на всех людей а не на локал)))))))
вместо thisptr на lp замени
Код:
 ffi.cast('CAnimationLayer**', ffi.cast('uintptr_t', lp) + 0x2990)[0][6].m_flWeight = 1
 
Сверху Снизу