C++ в lua

Tema05

Известный
Автор темы
1,471
435
Версия MoonLoader
.026-beta
Здравствуйте пользователи бластхака. Помогите пожалуйста перевести это чудо в lua.

C++:
#include <cstring>

namespace {
    const auto HOOK_ADDR = 0x70F4E; // R1
    const auto HOOK_LEN = 5;
    const auto HOOK_CODE = "\xE8\xA0\x4C\x04\x00"; // R1

    auto __cdecl name_hook(const char *buf, const char *fmt, const char *name, const int ID){
        if (!strcmp(name, "Dapo_Show")){
            return sprintf(buf, "Пидарас_Пидарасина {FFFFFFFF}(%d)", ID);
        }
    
        return sprintf(buf, "%s {FFFFFFFF}(%d)", name, ID);
    };
}

void installHook(){
    auto samp = (DWORD)GetModuleHandleA("samp");
    auto relative_addr = (DWORD)&name_hook - (samp + HOOK_ADDR + HOOK_LEN);
    DWORD vp;
    VirtualProtect((void*)(samp + HOOK_ADDR), HOOK_LEN, PAGE_EXECUTE_READWRITE, &vp);
    *(DWORD*)(samp + HOOK_ADDR + 1) = relative_addr;
    VirtualProtect((void*)(samp + HOOK_ADDR), HOOK_LEN, vp, &vp);
};

void removeHook(){
    auto samp = (DWORD)GetModuleHandleA("samp");
    DWORD vp;
    VirtualProtect((void*)(samp + HOOK_ADDR), HOOK_LEN, PAGE_EXECUTE_READWRITE, &vp);
    memcpy((void*)(samp + HOOK_ADDR), (char*)HOOK_CODE, HOOK_LEN);
    VirtualProtect((void*)(samp + HOOK_ADDR), HOOK_LEN, vp, &vp);
};
 
  • Злость
Реакции: sᴀxᴏɴ
Решение

#Northn

Pears Project — уже запущен!
Всефорумный модератор
2,652
2,535
 
  • Нравится
Реакции: Tema05

ImPasha

Software Developer & System Administrator
Друг
1,788
2,141
А вообще ставить хуки, представленные выше, не самая лучшая затея по словам FYP`a. Не знаю в чём конкретно заключается проблема, так как не сильно разбираюсь в этом вопросе, но предполагаю, что это может создать конфликт между скриптами и плагинами, либо положить игру. Лучше реализовать хуки в отдельной динамической библиотеки при помощи sol, гайд по написанию таких библиотек вроде где-то на форуме был, если я не ошибаюсь. Не знаю насколько такая реализация может обернуть ситуацию в лучшую сторону, но знающие люди говорят, что это куда лучше, чем чудо выше на LuaJIT FFI. Ни в коем случае не хочу сказать, что реализация выше бесполезная или плохая - она несомненно полезная и я лично её использую, но всё же советуют не использовать.
 

Tema05

Известный
Автор темы
1,471
435
Вместо либо решил попробовать перейти по ссылке автора темы https://www.blast.hk/threads/39138/ и сделал по примеру с хуком диалога.

Чёт крашит,
Lua:
local ffi = require 'ffi'

--HOOKS
local hook = {hooks = {}}
addEventHandler('onScriptTerminate', function(scr)
    if scr == script.this then
        for i, hook in ipairs(hook.hooks) do
            if hook.status then
                hook.stop()
            end
        end
    end
end)
ffi.cdef [[
    int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect);
    void* VirtualAlloc(void* lpAddress, unsigned long dwSize, unsigned long  flAllocationType, unsigned long flProtect);
    int VirtualFree(void* lpAddress, unsigned long dwSize, unsigned long dwFreeType);
]]
function hook.new(cast, callback, hook_addr, size, trampoline, org_bytes_tramp)
    local size = size or 5
    local trampoline = trampoline or false
    local new_hook, mt = {}, {}
    local detour_addr = tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, callback))))
    local void_addr = ffi.cast('void*', hook_addr)
    local old_prot = ffi.new('unsigned long[1]')
    local org_bytes = ffi.new('uint8_t[?]', size)
    ffi.copy(org_bytes, void_addr, size)
    if trampoline then
        local alloc_addr = ffi.gc(ffi.C.VirtualAlloc(nil, size + 5, 0x1000, 0x40), function(addr) ffi.C.VirtualFree(addr, 0, 0x8000) end)
        local trampoline_bytes = ffi.new('uint8_t[?]', size + 5, 0x90)
        if org_bytes_tramp then
            local bytes = {}
            for byte in org_bytes_tramp:gmatch('(%x%x)') do
                table.insert(bytes, tonumber(byte, 16))
            end
            trampoline_bytes = ffi.new('uint8_t[?]', size + 5, bytes)
        else
            ffi.copy(trampoline_bytes, org_bytes, size)
        end
        trampoline_bytes[size] = 0xE9
        ffi.cast('uint32_t*', trampoline_bytes + size + 1)[0] = hook_addr - tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, alloc_addr)))) - size
        ffi.copy(alloc_addr, trampoline_bytes, size + 5)
        new_hook.call = ffi.cast(cast, alloc_addr)
        mt = {__call = function(self, ...)
            return self.call(...)
        end}
    else
        new_hook.call = ffi.cast(cast, hook_addr)
        mt = {__call = function(self, ...)
            self.stop()
            local res = self.call(...)
            self.start()
            return res
        end}
    end
    local hook_bytes = ffi.new('uint8_t[?]', size, 0x90)
    hook_bytes[0] = 0xE9
    ffi.cast('uint32_t*', hook_bytes + 1)[0] = detour_addr - hook_addr - 5
    new_hook.status = false
    local function set_status(bool)
        new_hook.status = bool
        ffi.C.VirtualProtect(void_addr, size, 0x40, old_prot)
        ffi.copy(void_addr, bool and hook_bytes or org_bytes, size)
        ffi.C.VirtualProtect(void_addr, size, old_prot[0], old_prot)
    end
    new_hook.stop = function() set_status(false) end
    new_hook.start = function() set_status(true) end
    new_hook.start()
    if org_bytes[0] == 0xE9 or org_bytes[0] == 0xE8 then
        if trampoline then
            print('[WARNING] rewrote another hook (old hook is disabled, through trampoline)')
        else
            print('[WARNING] rewrote another hook')
        end
    end
    table.insert(hook.hooks, new_hook)
    return setmetatable(new_hook, mt)
end
--HOOKS

function main()
    name_hook = hook.new('void(__thiscall *)(void* this, const char *buf, const char *fmt, const char *name, const int ID)', name_hook, getModuleHandle('samp.dll') + 0x70F4E, 5, false, 'E8 A0 4C 04 00')
end

function name_hook(this, buf, fmt, name, ID)
    print(this, buf, fmt, name, ID) -- выводит: cdata<void *>: 0x2b8a64e0   cdata<const char *>: 0x0403835c   cdata<const char *>: 0x2b8a64ec   cdata<const char *>: 0x0000003e   85721600
    name_hook(this, ffi.cast('char*', ffi.string(name) .. ' {000000FF}(' .. ID .. ')'), fmt, name, ID)
end
 
Последнее редактирование:

#Northn

Pears Project — уже запущен!
Всефорумный модератор
2,652
2,535
Вместо либо решил попробовать перейти по ссылке автора темы https://www.blast.hk/threads/39138/ и сделал по примеру с хуком диалога.

Чёт крашит,
Lua:
local ffi = require 'ffi'

--HOOKS
local hook = {hooks = {}}
addEventHandler('onScriptTerminate', function(scr)
    if scr == script.this then
        for i, hook in ipairs(hook.hooks) do
            if hook.status then
                hook.stop()
            end
        end
    end
end)
ffi.cdef [[
    int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect);
    void* VirtualAlloc(void* lpAddress, unsigned long dwSize, unsigned long  flAllocationType, unsigned long flProtect);
    int VirtualFree(void* lpAddress, unsigned long dwSize, unsigned long dwFreeType);
]]
function hook.new(cast, callback, hook_addr, size, trampoline, org_bytes_tramp)
    local size = size or 5
    local trampoline = trampoline or false
    local new_hook, mt = {}, {}
    local detour_addr = tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, callback))))
    local void_addr = ffi.cast('void*', hook_addr)
    local old_prot = ffi.new('unsigned long[1]')
    local org_bytes = ffi.new('uint8_t[?]', size)
    ffi.copy(org_bytes, void_addr, size)
    if trampoline then
        local alloc_addr = ffi.gc(ffi.C.VirtualAlloc(nil, size + 5, 0x1000, 0x40), function(addr) ffi.C.VirtualFree(addr, 0, 0x8000) end)
        local trampoline_bytes = ffi.new('uint8_t[?]', size + 5, 0x90)
        if org_bytes_tramp then
            local bytes = {}
            for byte in org_bytes_tramp:gmatch('(%x%x)') do
                table.insert(bytes, tonumber(byte, 16))
            end
            trampoline_bytes = ffi.new('uint8_t[?]', size + 5, bytes)
        else
            ffi.copy(trampoline_bytes, org_bytes, size)
        end
        trampoline_bytes[size] = 0xE9
        ffi.cast('uint32_t*', trampoline_bytes + size + 1)[0] = hook_addr - tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, alloc_addr)))) - size
        ffi.copy(alloc_addr, trampoline_bytes, size + 5)
        new_hook.call = ffi.cast(cast, alloc_addr)
        mt = {__call = function(self, ...)
            return self.call(...)
        end}
    else
        new_hook.call = ffi.cast(cast, hook_addr)
        mt = {__call = function(self, ...)
            self.stop()
            local res = self.call(...)
            self.start()
            return res
        end}
    end
    local hook_bytes = ffi.new('uint8_t[?]', size, 0x90)
    hook_bytes[0] = 0xE9
    ffi.cast('uint32_t*', hook_bytes + 1)[0] = detour_addr - hook_addr - 5
    new_hook.status = false
    local function set_status(bool)
        new_hook.status = bool
        ffi.C.VirtualProtect(void_addr, size, 0x40, old_prot)
        ffi.copy(void_addr, bool and hook_bytes or org_bytes, size)
        ffi.C.VirtualProtect(void_addr, size, old_prot[0], old_prot)
    end
    new_hook.stop = function() set_status(false) end
    new_hook.start = function() set_status(true) end
    new_hook.start()
    if org_bytes[0] == 0xE9 or org_bytes[0] == 0xE8 then
        if trampoline then
            print('[WARNING] rewrote another hook (old hook is disabled, through trampoline)')
        else
            print('[WARNING] rewrote another hook')
        end
    end
    table.insert(hook.hooks, new_hook)
    return setmetatable(new_hook, mt)
end
--HOOKS

function main()
    name_hook = hook.new('void(__thiscall *)(void* this, const char *buf, const char *fmt, const char *name, const int ID)', name_hook, getModuleHandle('samp.dll') + 0x70F4E, 5, false, 'E8 A0 4C 04 00')
end

function name_hook(this, buf, fmt, name, ID)
    print(this, buf, fmt, name, ID) -- выводит: cdata<void *>: 0x2b8a64e0   cdata<const char *>: 0x0403835c   cdata<const char *>: 0x2b8a64ec   cdata<const char *>: 0x0000003e   85721600
    name_hook(this, ffi.cast('char*', ffi.string(name) .. ' {000000FF}(' .. ID .. ')'), fmt, name, ID)
end

Lua:
local ffi = require 'ffi'

--HOOKS
local hook = {hooks = {}}
addEventHandler('onScriptTerminate', function(scr)
    if scr == script.this then
        for i, hook in ipairs(hook.hooks) do
            if hook.status then
                hook.stop()
            end
        end
    end
end)
ffi.cdef [[
    int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect);
    void* VirtualAlloc(void* lpAddress, unsigned long dwSize, unsigned long  flAllocationType, unsigned long flProtect);
    int VirtualFree(void* lpAddress, unsigned long dwSize, unsigned long dwFreeType);
]]
function hook.new(cast, callback, hook_addr, size, trampoline, org_bytes_tramp)
    local size = size or 5
    local trampoline = trampoline or false
    local new_hook, mt = {}, {}
    local detour_addr = tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, callback))))
    local void_addr = ffi.cast('void*', hook_addr)
    local old_prot = ffi.new('unsigned long[1]')
    local org_bytes = ffi.new('uint8_t[?]', size)
    ffi.copy(org_bytes, void_addr, size)
    if trampoline then
        local alloc_addr = ffi.gc(ffi.C.VirtualAlloc(nil, size + 5, 0x1000, 0x40), function(addr) ffi.C.VirtualFree(addr, 0, 0x8000) end)
        local trampoline_bytes = ffi.new('uint8_t[?]', size + 5, 0x90)
        if org_bytes_tramp then
            local bytes = {}
            for byte in org_bytes_tramp:gmatch('(%x%x)') do
                table.insert(bytes, tonumber(byte, 16))
            end
            trampoline_bytes = ffi.new('uint8_t[?]', size + 5, bytes)
        else
            ffi.copy(trampoline_bytes, org_bytes, size)
        end
        trampoline_bytes[size] = 0xE9
        ffi.cast('uint32_t*', trampoline_bytes + size + 1)[0] = hook_addr - tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, alloc_addr)))) - size
        ffi.copy(alloc_addr, trampoline_bytes, size + 5)
        new_hook.call = ffi.cast(cast, alloc_addr)
        mt = {__call = function(self, ...)
            return self.call(...)
        end}
    else
        new_hook.call = ffi.cast(cast, hook_addr)
        mt = {__call = function(self, ...)
            self.stop()
            local res = self.call(...)
            self.start()
            return res
        end}
    end
    local hook_bytes = ffi.new('uint8_t[?]', size, 0x90)
    hook_bytes[0] = 0xE9
    ffi.cast('uint32_t*', hook_bytes + 1)[0] = detour_addr - hook_addr - 5
    new_hook.status = false
    local function set_status(bool)
        new_hook.status = bool
        ffi.C.VirtualProtect(void_addr, size, 0x40, old_prot)
        ffi.copy(void_addr, bool and hook_bytes or org_bytes, size)
        ffi.C.VirtualProtect(void_addr, size, old_prot[0], old_prot)
    end
    new_hook.stop = function() set_status(false) end
    new_hook.start = function() set_status(true) end
    new_hook.start()
    if org_bytes[0] == 0xE9 or org_bytes[0] == 0xE8 then
        if trampoline then
            print('[WARNING] rewrote another hook (old hook is disabled, through trampoline)')
        else
            print('[WARNING] rewrote another hook')
        end
    end
    table.insert(hook.hooks, new_hook)
    return setmetatable(new_hook, mt)
end
--HOOKS

function main()
    name_hook = hook.new('int(__cdecl *)(const char *buf, const char *fmt, const char *name, const int ID)', name_hook, getModuleHandle('samp.dll') + 0x70F4E, 5, true, 'E8 A0 4C 04 00')
end

function name_hook(this, buf, fmt, name, ID)
    return name_hook(this, ffi.cast("const char*", ffi.string(name) .. ' {000000FF}(' .. ID .. ')'), fmt, name, ID)
end

Попробуй
Но не рекомендую эти хуки использовать, спустя время краши гарантированы
 

Tema05

Известный
Автор темы
1,471
435
Lua:
local ffi = require 'ffi'

--HOOKS
local hook = {hooks = {}}
addEventHandler('onScriptTerminate', function(scr)
    if scr == script.this then
        for i, hook in ipairs(hook.hooks) do
            if hook.status then
                hook.stop()
            end
        end
    end
end)
ffi.cdef [[
    int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect);
    void* VirtualAlloc(void* lpAddress, unsigned long dwSize, unsigned long  flAllocationType, unsigned long flProtect);
    int VirtualFree(void* lpAddress, unsigned long dwSize, unsigned long dwFreeType);
]]
function hook.new(cast, callback, hook_addr, size, trampoline, org_bytes_tramp)
    local size = size or 5
    local trampoline = trampoline or false
    local new_hook, mt = {}, {}
    local detour_addr = tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, callback))))
    local void_addr = ffi.cast('void*', hook_addr)
    local old_prot = ffi.new('unsigned long[1]')
    local org_bytes = ffi.new('uint8_t[?]', size)
    ffi.copy(org_bytes, void_addr, size)
    if trampoline then
        local alloc_addr = ffi.gc(ffi.C.VirtualAlloc(nil, size + 5, 0x1000, 0x40), function(addr) ffi.C.VirtualFree(addr, 0, 0x8000) end)
        local trampoline_bytes = ffi.new('uint8_t[?]', size + 5, 0x90)
        if org_bytes_tramp then
            local bytes = {}
            for byte in org_bytes_tramp:gmatch('(%x%x)') do
                table.insert(bytes, tonumber(byte, 16))
            end
            trampoline_bytes = ffi.new('uint8_t[?]', size + 5, bytes)
        else
            ffi.copy(trampoline_bytes, org_bytes, size)
        end
        trampoline_bytes[size] = 0xE9
        ffi.cast('uint32_t*', trampoline_bytes + size + 1)[0] = hook_addr - tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, alloc_addr)))) - size
        ffi.copy(alloc_addr, trampoline_bytes, size + 5)
        new_hook.call = ffi.cast(cast, alloc_addr)
        mt = {__call = function(self, ...)
            return self.call(...)
        end}
    else
        new_hook.call = ffi.cast(cast, hook_addr)
        mt = {__call = function(self, ...)
            self.stop()
            local res = self.call(...)
            self.start()
            return res
        end}
    end
    local hook_bytes = ffi.new('uint8_t[?]', size, 0x90)
    hook_bytes[0] = 0xE9
    ffi.cast('uint32_t*', hook_bytes + 1)[0] = detour_addr - hook_addr - 5
    new_hook.status = false
    local function set_status(bool)
        new_hook.status = bool
        ffi.C.VirtualProtect(void_addr, size, 0x40, old_prot)
        ffi.copy(void_addr, bool and hook_bytes or org_bytes, size)
        ffi.C.VirtualProtect(void_addr, size, old_prot[0], old_prot)
    end
    new_hook.stop = function() set_status(false) end
    new_hook.start = function() set_status(true) end
    new_hook.start()
    if org_bytes[0] == 0xE9 or org_bytes[0] == 0xE8 then
        if trampoline then
            print('[WARNING] rewrote another hook (old hook is disabled, through trampoline)')
        else
            print('[WARNING] rewrote another hook')
        end
    end
    table.insert(hook.hooks, new_hook)
    return setmetatable(new_hook, mt)
end
--HOOKS

function main()
    name_hook = hook.new('int(__cdecl *)(const char *buf, const char *fmt, const char *name, const int ID)', name_hook, getModuleHandle('samp.dll') + 0x70F4E, 5, true, 'E8 A0 4C 04 00')
end

function name_hook(this, buf, fmt, name, ID)
    return name_hook(this, ffi.cast("const char*", ffi.string(name) .. ' {000000FF}(' .. ID .. ')'), fmt, name, ID)
end

Попробуй
Но не рекомендую эти хуки использовать, спустя время краши гарантированы
Всё равно крашит как только хукается 1 ник.
принт вывел cdata<const char *>: 0x03e5835c cdata<const char *>: 0x194521e0 cdata<const char *>: 0x000001fc 86049280 nil
думаю нужно убрать this из функции калбека. И по мне достаточно странно что id равно 86049280
Код:
SA-MP 0.3.7
Exception At Address: 0x76594662
Base: 0x03C90000

Registers:
EAX: 0x0177F818    EBX: 0x130F8AF8    ECX: 0x00000000    EDX: 0xE24C4A02
ESI: 0x130F8AF8    EDI: 0x130F8CF0    EBP: 0x0177F870    ESP: 0x0177F818
EFLAGS: 0x00200246

Stack:
+0000: 0xE24C4A02   0x00000001   0x00000000   0x76594662
+0010: 0x00000000   0x0177F83C   0x66DA1ED5   0x130F8AF8
+0020: 0x66DF9D34   0x66DFAB82   0x130F8AF8   0x130F8D00
+0030: 0x130F8D30   0x66DA1EE7   0x130F9270   0x00000300
+0040: 0x130F8D28   0x130F8D28   0x130F9870   0x130F64C0
+0050: 0x04030000   0xE49C655E   0x130F8D30   0x66DA3ADE
+0060: 0xE24C4A02   0x00000001   0x00000000   0x00000000
+0070: 0x130F8CF0   0x66DA4284   0x130F8AF8   0x130F8D00
+0080: 0x00000000   0x66DA3F65   0x130F8AF8   0x00000000
+0090: 0x130F64C0   0x66DA3EE3   0x130F8AF8   0x66DFAB82
+00A0: 0x66D94D09   0x130F8AF8   0x00000D6A   0x130F9140
+00B0: 0x130F9990   0x0177F9E0   0x00000009   0x00000000
+00C0: 0x00000004   0x00000000   0x00000005   0x130F8D30
+00D0: 0x130F8D38   0x66D94EB5   0x130F8AF8   0x130F64C0
+00E0: 0x130F9990   0x0177F920   0x00000086   0x130F8AF8
+00F0: 0x130F8AF8   0x130F64C0   0x130F6670   0x10B3C020
+0100: 0x2E7D77C4   0x11F81340   0x13310000   0x708B2D26
+0110: 0x10004800   0x0177F938   0x00000000   0x00000000
+0120: 0x00000000   0x00000000   0x00000000   0x00000000
+0130: 0x03D6835C   0x19414AFC   0x00000017   0x04F80200
+0140: 0x00000001   0x0177F9A0   0x708B2785   0x130F8AF8
+0150: 0x130B01F0   0x130F9860   0x0000000C   0x130F9870
+0160: 0x130F8D20   0x130F9880   0x130F64C0   0x02020000
+0170: 0x04030000   0x66D96BED   0x130F64C0   0x130F9220
+0180: 0x130F9870   0x130F8D20   0x0177FA60   0x00000000
+0190: 0x00000003   0x66D953CF   0x130F64C0   0x130F9870
+01A0: 0x00000000   0x130F8D20   0x0177FA60   0x130F8AF8
+01B0: 0x130F64C0   0x130B01F0   0x130B01F0   0x130F8AF8
+01C0: 0x66DAC8D4   0x364652D4   0x130F64C0   0x66DCB9F3
+01D0: 0x130F8AF8   0x130F6670   0x66DCB9A0   0x130B0D58
+01E0: 0x130B02C8   0x130F8AF8   0x66D8280D   0x00000086
+01F0: 0x130F8D48   0x130F8D78   0x1942FB10   0x00000006
+0200: 0x00000007   0x130B2A88   0x4090FC85   0x00000000
+0210: 0x0177FD0C   0x66DA4360   0x193B0A70   0x19511D70
+0220: 0x00000017   0x1942FB10   0x03DBC848   0x130F8AF8
+0230: 0x00000000   0x00000000   0xFFFFFFFF   0x03D6835C
+0240: 0x19414AFC   0x00000017   0x04F80200   0x193B3CE8
+0250: 0x0177FA78   0x00000000   0x42B60000   0x000003E7
+0260: 0x0177FD18   0x03D0119A   0x04F80200   0x007F99B0
+0270: 0x00000000   0xCE2CD2BE   0x0177FAE4   0x708B2067

SCM Op: 0x6BD, lDbg: 0 LastRendObj: 19197

Game Version: US 1.0

State Information: Ped Context: 0
P0 (0,0) P1 (0,0) P2 (0,0) P3 (0,0)
P4 (0,0) P5 (0,0) P6 (0,0) P7 (0,0)
P8 (0,0) P9 (0,0) P10 (0,0) P11 (0,0)
P12 (0,0) P13 (0,0) P14 (0,0) P15 (0,0)
P16 (0,0) P17 (0,0) P18 (0,0) P19 (0,0)
P20 (0,0) P21 (0,0) P22 (0,0) P23 (17,0)
P24 (0,0) P25 (0,0) P26 (0,0) P27 (0,0)
P28 (0,0) P29 (0,0) P30 (0,0) P31 (0,0)
P32 (0,0) P33 (0,0) P34 (0,0) P35 (0,0)
P36 (0,0) P37 (0,0) P38 (0,0) P39 (0,0)
P40 (0,0) P41 (0,0) P42 (0,0) P43 (0,0)
P44 (0,0) P45 (0,0) P46 (0,0) P47 (0,0)
P48 (0,0) P49 (0,0) P50 (0,0) P51 (0,0)
P52 (0,0) P53 (0,0) P54 (0,0) P55 (0,0)
P56 (0,0) P57 (0,0) P58 (0,0) P59 (0,0)
P60 (0,0) P61 (0,0) P62 (0,0) P63 (0,0)
P64 (0,0) P65 (0,0) P66 (0,0) P67 (0,0)
P68 (0,0) P69 (0,0) P70 (0,0) P71 (0,0)
P72 (0,0) P73 (0,0) P74 (0,0) P75 (0,0)
P76 (0,0) P77 (0,0) P78 (0,0) P79 (0,0)
P80 (0,0) P81 (0,0) P82 (0,0) P83 (0,0)
P84 (0,0) P85 (0,0) P86 (0,0) P87 (0,0)
P88 (0,0) P89 (0,0) P90 (0,0) P91 (0,0)
P92 (0,0) P93 (0,0) P94 (0,0) P95 (0,0)
P96 (0,0) P97 (0,0) P98 (0,0) P99 (0,0)
P100 (0,0) P101 (0,0) P102 (0,0) P103 (0,0)
P104 (0,0) P105 (0,0) P106 (0,0) P107 (0,0)
P108 (0,0) P109 (0,0) P110 (0,0) P111 (0,0)
P112 (0,0) P113 (0,0) P114 (0,0) P115 (0,0)
P116 (0,0) P117 (0,0) P118 (0,0) P119 (0,0)
P120 (0,0) P121 (0,0) P122 (0,0) P123 (0,0)
P124 (0,0) P125 (0,0) P126 (0,0) P127 (0,0)
P128 (0,0) P129 (0,0) P130 (0,0) P131 (0,0)
P132 (17,0) P133 (0,0) P134 (0,0) P135 (0,0)
P136 (0,0) P137 (0,0) P138 (0,0) P139 (0,0)
P140 (0,0) P141 (0,0) P142 (0,0) P143 (0,0)
P144 (0,0) P145 (0,0) P146 (0,0) P147 (0,0)
P148 (0,0) P149 (0,0) P150 (0,0) P151 (0,0)
P152 (0,0) P153 (0,0) P154 (0,0) P155 (0,0)
P156 (0,0) P157 (0,0) P158 (0,0) P159 (0,0)
P160 (0,0) P161 (0,0) P162 (0,0) P163 (0,0)
P164 (0,0) P165 (0,0) P166 (0,0) P167 (0,0)
P168 (0,0) P169 (0,0) P170 (0,0) P171 (0,0)
P172 (0,0) P173 (0,0) P174 (0,0) P175 (0,0)
P176 (0,0) P177 (0,0) P178 (0,0) P179 (0,0)
P180 (0,0) P181 (0,0) P182 (0,0) P183 (0,0)
P184 (0,0) P185 (0,0) P186 (0,0) P187 (0,0)
P188 (0,0) P189 (0,0) P190 (0,0) P191 (0,0)
P192 (0,0) P193 (0,0) P194 (0,0) P195 (0,0)
P196 (0,0) P197 (0,0) P198 (0,0) P199 (0,0)
P200 (0,0) P201 (0,0) P202 (0,0) P203 (0,0)
P204 (0,0) P205 (0,0) P206 (0,0) P207 (0,0)
P208 (0,0) P209 (0,0) P210 (0,0) P211 (0,0)
P212 (0,0) P213 (0,0) P214 (0,0) P215 (0,0)
P216 (0,0) P217 (0,0) P218 (0,0) P219 (0,0)
P220 (0,0) P221 (0,0) P222 (0,0) P223 (0,0)
P224 (0,0) P225 (0,0) P226 (0,0) P227 (0,0)
P228 (0,0) P229 (0,0) P230 (0,0) P231 (0,0)
P232 (0,0) P233 (0,0) P234 (0,0) P235 (0,0)
P236 (0,0) P237 (0,0) P238 (0,0) P239 (0,0)
P240 (0,0) P241 (0,0) P242 (0,0) P243 (0,0)
P244 (0,0) P245 (0,0) P246 (0,0) P247 (0,0)
P248 (0,0) P249 (0,0) P250 (0,0) P251 (0,0)
P252 (0,0) P253 (0,0) P254 (0,0) P255 (0,0)
P256 (0,0) P257 (0,0) P258 (0,0) P259 (0,0)
P260 (0,0) P261 (0,0) P262 (0,0) P263 (0,0)
P264 (0,0) P265 (0,0) P266 (0,0) P267 (0,0)
P268 (0,0) P269 (0,0) P270 (0,0) P271 (32,0)
P272 (0,0) P273 (0,0) P274 (0,0) P275 (0,0)
P276 (0,0) P277 (0,0) P278 (0,0) P279 (0,0)
P280 (0,0) P281 (0,0) P282 (0,0) P283 (0,0)
P284 (0,0) P285 (0,0) P286 (0,0) P287 (0,0)
P288 (0,0) P289 (0,0) P290 (0,0) P291 (0,0)
P292 (0,0) P293 (0,0) P294 (0,0) P295 (0,0)
P296 (0,0) P297 (0,0) P298 (0,0) P299 (0,0)
P300 (0,0) P301 (0,0) P302 (0,0) P303 (0,0)
P304 (0,0) P305 (0,0) P306 (0,0) P307 (0,0)
P308 (0,0) P309 (0,0) P310 (0,0) P311 (0,0)
P312 (0,0) P313 (0,0) P314 (0,0) P315 (0,0)
P316 (0,0) P317 (0,0) P318 (0,0) P319 (0,0)
P320 (0,0) P321 (0,0) P322 (0,0) P323 (0,0)
P324 (0,0) P325 (0,0) P326 (0,0) P327 (0,0)
P328 (0,0) P329 (0,0) P330 (0,0) P331 (0,0)
P332 (0,0) P333 (0,0) P334 (0,0) P335 (0,0)
P336 (0,0) P337 (0,0) P338 (0,0) P339 (0,0)
P340 (0,0) P341 (0,0) P342 (0,0) P343 (0,0)
P344 (0,0) P345 (0,0) P346 (0,0) P347 (0,0)
P348 (0,0) P349 (0,0) P350 (0,0) P351 (0,0)
P352 (0,0) P353 (0,0) P354 (0,0) P355 (0,0)
P356 (0,0) P357 (0,0) P358 (0,0) P359 (0,0)
P360 (0,0) P361 (0,0) P362 (0,0) P363 (0,0)
P364 (0,0) P365 (0,0) P366 (0,0) P367 (0,0)
P368 (0,0) P369 (0,0) P370 (0,0) P371 (0,0)
P372 (0,0) P373 (0,0) P374 (0,0) P375 (0,0)
P376 (0,0) P377 (0,0) P378 (0,0) P379 (0,0)
P380 (19,140) P381 (0,0) P382 (0,0) P383 (0,0)
P384 (0,0) P385 (0,0) P386 (0,0) P387 (0,0)
P388 (0,0) P389 (0,0) P390 (0,0) P391 (0,0)
P392 (0,0) P393 (0,0) P394 (0,0) P395 (0,0)
P396 (0,0) P397 (0,0) P398 (0,0) P399 (0,0)
P400 (0,0) P401 (0,0) P402 (0,0) P403 (0,0)
P404 (0,0) P406 (0,0) P407 (0,0)
P408 (0,0) P409 (0,0) P410 (0,0) P411 (0,0)
P412 (0,0) P413 (0,0) P414 (0,0) P415 (0,0)
P416 (0,0) P417 (0,0) P418 (0,0) P419 (0,0)
P420 (0,0) P421 (0,0) P422 (0,0) P423 (0,0)
P424 (0,0) P425 (0,0) P426 (0,0) P427 (0,0)
P428 (0,0) P429 (0,0) P430 (0,0) P431 (0,0)
P432 (0,0) P433 (0,0) P434 (0,0) P435 (0,0)
P436 (0,0) P437 (0,0) P438 (0,0) P439 (0,0)
P440 (0,0) P441 (0,0) P442 (0,0) P443 (0,0)
P444 (0,0) P445 (0,0) P446 (0,0) P447 (0,0)
P448 (0,0) P449 (0,0) P450 (0,0) P451 (0,0)
P452 (0,0) P453 (0,0) P454 (0,0) P455 (0,0)
P456 (0,0) P457 (0,0) P458 (0,0) P459 (0,0)
P460 (0,0) P461 (0,0) P462 (0,0) P463 (0,0)
P464 (0,0) P465 (0,0) P466 (0,0) P467 (0,0)
P468 (0,0) P469 (0,0) P470 (0,0) P471 (0,0)
P472 (0,0) P473 (0,0) P474 (0,0) P475 (0,0)
P476 (0,0) P477 (0,0) P478 (0,0) P479 (0,0)
P480 (0,0) P481 (0,0) P482 (0,0) P483 (0,0)
P484 (0,0) P485 (0,0) P486 (0,0) P487 (0,0)
P488 (0,0) P489 (0,0) P490 (0,0) P491 (0,0)
P492 (0,0) P493 (0,0) P494 (0,0) P495 (0,0)
P496 (0,0) P497 (0,0) P498 (0,0) P499 (0,0)
P500 (0,0) P501 (0,0) P502 (0,0) P503 (0,0)
P504 (0,0) P505 (0,0) P506 (0,0) P507 (0,0)
P508 (0,0) P509 (0,0) P510 (0,0) P511 (0,0)
P512 (0,0) P513 (0,0) P514 (0,0) P515 (0,0)
P516 (0,0) P517 (0,0) P518 (0,0) P519 (0,0)
P520 (0,0) P521 (0,0) P522 (0,0) P523 (0,0)
P524 (0,0) P525 (0,0) P526 (0,0) P527 (0,0)
P528 (0,0) P529 (0,0) P530 (0,0) P531 (0,0)
P532 (0,0) P533 (0,0) P534 (0,0) P535 (0,0)
P536 (0,0) P537 (0,0) P538 (0,0) P539 (0,0)
P540 (0,0) P541 (0,0) P542 (0,0) P543 (0,0)
P544 (0,0) P545 (0,0) P546 (0,0) P547 (0,0)
P548 (0,0) P549 (0,0) P550 (0,0) P551 (0,0)
P552 (0,0) P553 (0,0) P554 (0,0) P555 (0,0)
P556 (0,0) P557 (0,0) P558 (0,0) P559 (0,0)
P560 (0,0) P561 (0,0) P562 (0,0) P563 (0,0)
P564 (0,0) P565 (0,0) P566 (0,0) P567 (0,0)
P568 (0,0) P569 (0,0) P570 (0,0) P571 (0,0)
P572 (0,0) P573 (0,0) P574 (0,0) P575 (0,0)
P576 (0,0) P577 (0,0) P578 (0,0) P579 (0,0)
P580 (0,0) P581 (0,0) P582 (0,0) P583 (0,0)
P584 (0,0) P585 (0,0) P586 (0,0) P587 (0,0)
P588 (0,0) P589 (0,0) P590 (0,0) P591 (0,0)
P592 (0,0) P593 (0,0) P594 (0,0) P595 (0,0)
P596 (0,0) P597 (0,0) P598 (0,0) P599 (0,0)
P600 (0,0) P601 (0,0) P602 (0,0) P603 (0,0)
P604 (0,0) P605 (0,0) P606 (0,0) P607 (0,0)
P608 (0,0) P609 (0,0) P610 (0,0) P611 (0,0)
P612 (0,0) P613 (0,0) P614 (0,0) P615 (0,0)
P616 (0,0) P617 (0,0) P618 (0,0) P619 (0,0)
P620 (0,0) P621 (0,0) P622 (0,0) P623 (0,0)
P624 (0,0) P625 (0,0) P626 (0,0) P627 (0,0)
P628 (0,0) P629 (0,0) P630 (0,0) P631 (0,0)
P632 (0,0) P633 (0,0) P634 (0,0) P635 (0,0)
P636 (0,0) P637 (0,0) P638 (0,0) P639 (0,0)
P640 (0,0) P641 (0,0) P642 (0,0) P643 (0,0)
P644 (0,0) P645 (0,0) P646 (0,0) P647 (0,0)
P648 (0,0) P649 (0,0) P650 (0,0) P651 (0,0)
P652 (0,0) P653 (0,0) P654 (0,0) P655 (0,0)
P656 (0,0) P657 (0,0) P658 (0,0) P659 (0,0)
P660 (0,0) P661 (0,0) P662 (0,0) P663 (0,0)
P664 (0,0) P665 (0,0) P666 (0,0) P667 (0,0)
P668 (0,0) P669 (0,0) P670 (0,0) P671 (0,0)
P672 (0,0) P673 (0,0) P674 (0,0) P675 (0,0)
P676 (0,0) P677 (0,0) P678 (0,0) P679 (0,0)
P680 (0,0) P681 (0,0) P682 (0,0) P683 (0,0)
P684 (0,0) P685 (0,0) P686 (0,0) P687 (0,0)
P688 (0,0) P689 (0,0) P690 (0,0) P691 (0,0)
P692 (0,0) P693 (0,0) P694 (0,0) P695 (0,0)
P696 (0,0) P697 (0,0) P698 (0,0) P699 (0,0)
P700 (0,0) P701 (0,0) P702 (0,0) P703 (0,0)
P704 (0,0) P705 (0,0) P706 (0,0) P707 (0,0)
P708 (0,0) P709 (0,0) P710 (0,0) P711 (0,0)
P712 (0,0) P713 (0,0) P714 (0,0) P715 (0,0)
P716 (0,0) P717 (0,0) P718 (0,0) P719 (0,0)
P720 (0,0) P721 (0,0) P722 (0,0) P723 (0,0)
P724 (0,0) P725 (0,0) P726 (0,0) P727 (0,0)
P728 (0,0) P729 (0,0) P730 (0,0) P731 (0,0)
P732 (0,0) P733 (0,0) P734 (0,0) P735 (0,0)
P736 (0,0) P737 (0,0) P738 (0,0) P739 (0,0)
P740 (0,0) P741 (0,0) P742 (0,0) P743 (0,0)
P744 (0,0) P745 (0,0) P746 (0,0) P747 (0,0)
P748 (0,0) P749 (0,0) P750 (0,0) P751 (0,0)
P752 (0,0) P753 (0,0) P754 (0,0) P755 (0,0)
P756 (0,0) P757 (0,0) P758 (0,0) P759 (0,0)
P760 (0,0) P761 (0,0) P762 (0,0) P763 (0,0)
P764 (0,0) P765 (0,0) P766 (0,0) P767 (0,0)
P768 (0,0) P769 (0,0) P770 (0,0) P771 (0,0)
P772 (0,0) P773 (0,0) P774 (0,0) P775 (0,0)
P776 (0,0) P777 (0,0) P778 (0,0) P779 (0,0)
P780 (0,0) P781 (0,0) P782 (0,0) P783 (0,0)
P784 (0,0) P785 (0,0) P786 (0,0) P787 (0,0)
P788 (0,0) P789 (0,0) P790 (0,0) P791 (0,0)
P792 (0,0) P793 (0,0) P794 (0,0) P795 (0,0)
P796 (0,0) P797 (0,0) P798 (0,0) P799 (0,0)
P800 (0,0) P801 (0,0) P802 (0,0) P803 (0,0)
P804 (0,0) P805 (0,0) P806 (0,0) P807 (0,0)
P808 (0,0) P809 (0,0) P810 (0,0) P811 (0,0)
P812 (0,0) P813 (0,0) P814 (0,0) P815 (0,0)
P816 (0,0) P817 (0,0) P818 (0,0) P819 (0,0)
P820 (0,0) P821 (0,0) P822 (0,0) P823 (0,0)
P824 (0,0) P825 (0,0) P826 (0,0) P827 (0,0)
P828 (0,0) P829 (0,0) P830 (0,0) P831 (0,0)
P832 (0,0) P833 (0,0) P834 (0,0) P835 (0,0)
P836 (0,0) P837 (0,0) P838 (0,0) P839 (0,0)
P840 (0,0) P841 (0,0) P842 (0,0) P843 (0,0)
P844 (0,0) P845 (0,0) P846 (0,0) P847 (0,0)
P848 (0,0) P849 (0,0) P850 (0,0) P851 (0,0)
P852 (0,0) P853 (0,0) P854 (0,0) P855 (0,0)
P856 (0,0) P857 (0,0) P858 (0,0) P859 (0,0)
P860 (0,0) P861 (0,0) P862 (0,0) P863 (0,0)
P864 (0,0) P865 (0,0) P866 (0,0) P867 (0,0)
P868 (0,0) P869 (0,0) P870 (0,0) P871 (0,0)
P872 (0,0) P873 (0,0) P874 (0,0) P875 (0,0)
P876 (0,0) P877 (0,0) P878 (0,0) P879 (0,0)
P880 (0,0) P881 (0,0) P882 (0,0) P883 (0,0)
P884 (0,0) P885 (0,0) P886 (0,0) P887 (0,0)
P888 (0,0) P889 (0,0) P890 (0,0) P891 (0,0)
P892 (0,0) P893 (0,0) P894 (0,0) P895 (0,0)
P896 (0,0) P897 (0,0) P898 (0,0) P899 (0,0)
P900 (0,0) P901 (0,0) P902 (0,0) P903 (0,0)
P904 (0,0) P905 (0,0) P906 (0,0) P907 (0,0)
P908 (0,0) P909 (0,0) P910 (0,0) P911 (0,0)
P912 (0,0) P913 (0,0) P914 (0,0) P915 (0,0)
P916 (0,0) P917 (0,0) P918 (0,0) P919 (0,0)
P920 (0,0) P921 (0,0) P922 (0,0) P923 (0,0)
P924 (0,0) P925 (0,0) P926 (0,0) P927 (0,0)
P928 (0,0) P929 (0,0) P931 (0,0)
P932 (0,0) P933 (0,0) P934 (0,0) P935 (0,0)
P936 (0,0) P937 (0,0) P938 (0,0) P939 (0,0)
P940 (0,0) P941 (0,0) P942 (0,0) P943 (0,0)
P944 (0,0) P945 (0,0) P946 (0,0) P947 (0,0)
P948 (0,0) P949 (0,0) P950 (0,0) P951 (0,0)
P952 (0,0) P953 (0,0) P954 (0,0) P955 (0,0)
P956 (0,0) P957 (0,0) P958 (0,0) P959 (0,0)
P960 (0,0) P961 (0,0) P962 (0,0) P963 (0,0)
P964 (0,0) P965 (0,0) P966 (0,0) P967 (0,0)
P968 (0,0) P969 (0,0) P970 (0,0) P971 (0,0)
P972 (0,0) P973 (0,0) P974 (0,0) P975 (0,0)
P976 (0,0) P977 (0,0) P978 (0,0) P979 (0,0)
P980 (0,0) P981 (0,0) P982 (0,0) P983 (0,0)
P984 (0,0) P985 (0,0) P986 (0,0) P987 (0,0)
P988 (0,0) P989 (0,0) P990 (0,0) P991 (0,0)
P992 (0,0) P993 (0,0) P994 (0,0) P995 (0,0)
P996 (0,0) P997 (0,0) P998 (0,0) P999 (0,0)
Код:
[22:24:29.724003] (system)    Session started.
[22:24:29.724003] (debug)    Module handle: 66E50000

MoonLoader v.026.5-beta loaded.
Developers: FYP, hnnssy, EvgeN 1137

Copyright (c) 2016, BlastHack Team
https://www.blast.hk/moonloader/

[22:24:29.725001] (info)    Working directory: D:\GTA San Andreas\moonloader
[22:24:29.725001] (debug)    FP Control: 0009001F
[22:24:29.725001] (debug)    Game: GTA SA 1.0.0.0 US
[22:24:29.725001] (system)    Installing pre-game hooks...
[22:24:29.725998] (system)    Hooks installed.
[22:24:31.410198] (debug)    Initializing opcode handler table
[22:24:31.410198] (debug)    package.path = D:\GTA San Andreas\moonloader\lib\?.lua;D:\GTA San Andreas\moonloader\lib\?\init.lua;D:\GTA San Andreas\moonloader\?.lua;D:\GTA San Andreas\moonloader\?\init.lua;.\?.lua;D:\GTA San Andreas\moonloader\lib\?.luac;D:\GTA San Andreas\moonloader\lib\?\init.luac;D:\GTA San Andreas\moonloader\?.luac;D:\GTA San Andreas\moonloader\?\init.luac;.\?.luac
[22:24:31.410198] (debug)    package.cpath = D:\GTA San Andreas\moonloader\lib\?.dll;
[22:24:31.413189] (system)    Loading script 'D:\GTA San Andreas\moonloader\AutoBikeMotoRunSwimOnMaxSpeed.lua'...
[22:24:31.413189] (debug)    New script: 10AD69DC
[22:24:31.414187] (system)    AutoBicycleRunSwimOnMaxSpeed: Loaded successfully.
[22:24:31.414187] (system)    Loading script 'D:\GTA San Andreas\moonloader\LH_manager.luac'...
[22:24:31.414187] (debug)    New script: 10AD7C3C
[22:24:31.417179] (system)    LH_manager: Loaded successfully.
[22:24:31.417179] (system)    Loading script 'D:\GTA San Andreas\moonloader\LiteHelper.lua'...
[22:24:31.417179] (debug)    New script: 10AD7DC4
[22:24:31.431141] (system)    LiteHelper: Loaded successfully.
[22:24:31.431141] (system)    Loading script 'D:\GTA San Andreas\moonloader\marketlist.lua'...
[22:24:31.431141] (debug)    New script: 10AD6B64
[22:24:31.439120] (system)    marketlist.lua: Loaded successfully.
[22:24:31.439120] (system)    Loading script 'D:\GTA San Andreas\moonloader\reload_all.lua'...
[22:24:31.439120] (debug)    New script: 10AD761C
[22:24:31.440118] (system)    ML-ReloadAll: Loaded successfully.
[22:24:31.440118] (system)    Loading script 'D:\GTA San Andreas\moonloader\SF Integration.lua'...
[22:24:31.440118] (debug)    New script: 10AD825C
[22:24:31.442112] (system)    SF Integration: Loaded successfully.
[22:24:31.442112] (system)    Loading script 'D:\GTA San Andreas\moonloader\test.lua'...
[22:24:31.442112] (debug)    New script: 10AD856C
[22:24:31.443109] (system)    test.lua: Loaded successfully.
[22:24:35.854457] (system)    Installing post-load hooks...
[22:24:35.854457] (system)    Hooks installed.
[22:24:35.854457] (script)    test.lua: [WARNING] rewrote another hook (old hook is disabled, through trampoline)
[22:24:37.334808] (system)    LiteHelper: Script terminated. (10AD7DC4)
[22:24:37.334808] (system)    Loading script 'D:\GTA San Andreas\moonloader\LiteHelper.lua'...
[22:24:37.334808] (debug)    New script: 10AD7494
[22:24:37.524439] (system)    LiteHelper: Loaded successfully.
[22:26:25.455701] (script)    test.lua: cdata<const char *>: 0x03e4835c   cdata<const char *>: 0x194bfa44   cdata<const char *>: 0x0000003c   85393920
[22:26:28.878951] (system)    Unloading...
[22:26:28.878951] (system)    AutoBicycleRunSwimOnMaxSpeed: Script terminated. (10AD69DC)
[22:26:28.878951] (system)    LH_manager: Script terminated. (10AD7C3C)
[22:26:28.878951] (system)    marketlist.lua: Script terminated. (10AD6B64)
[22:26:28.879949] (system)    ML-ReloadAll: Script terminated. (10AD761C)
[22:26:28.879949] (system)    SF Integration: Script terminated. (10AD825C)
[22:26:28.880949] (system)    test.lua: Script terminated. (10AD856C)
[22:26:28.880949] (system)    LiteHelper: Script terminated. (10AD7494)
[22:26:28.916880] (system)    Session terminated.
 
Последнее редактирование:

#Northn

Pears Project — уже запущен!
Всефорумный модератор
2,652
2,535

Salvatore_Ferrari

Известный
427
239
Я так понял нечего не вышло.
бля целый день сидел даже через cheat engine смотрел
хук проходит , инструкция jmp заменяется на call и вызывается всё прекрасно , а дальше что происходит хрен разберешь. Хотя я знаю ассемблер и все инструкции но почему то после выхода из хука таблица со значениями пуста.
Если будет время попытаюсь досконально изучить.