local ffi = require("ffi")
ffi.cdef[[
void * __stdcall GetModuleHandleA(const char *name);
int __stdcall VirtualProtect(void *address, size_t size, uint32_t protect, uint32_t *old);
]]
local PREFIX = string.byte("*") -- вот тут поменяй на символ который нужен
local base = ffi.cast("uint8_t*", ffi.C.GetModuleHandleA(nil))
for i = 0x1000, 0x200000 do
if base[i] == 0x80 and base[i+1] == 0xF9 and base[i+2] == 0x21 and base[i+3] == 0x0F and base[i+4] == 0x84 then
local addr, old = base + i + 2, ffi.new("uint32_t[1]")
ffi.C.VirtualProtect(addr, 1, 0x40, old)
addr[0] = PREFIX
ffi.C.VirtualProtect(addr, 1, old[0], old)
break
end
end