Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------------------------------------
- -- Assaultcube (match client v 1202.2) wallhack cheat by Unarmed
- -- notes:
- -- only works on 32 bit systems
- -- lua ffi is required
- ------------------------------------------------------------------------------
- ffi = require("ffi")
- ffi.cdef[[
- void* FindWindowA (void*, const char[]);
- void* OpenProcess (int, int, int);
- int VirtualProtectEx (void*, void*, int, int, int*);
- int GetWindowThreadProcessId (void*, int*);
- int WriteProcessMemory (void*, void*, void*, int, int*);
- ]]
- function get_process_handler(wname, permission)
- local hwnd = ffi.C.FindWindowA(nil, wname)
- local res = ffi.cast("void*", 0)
- local tmp = ffi.new("int[1]", 0)
- if tonumber(ffi.cast("int", hwnd)) == 0 then
- return res
- end
- ffi.C.GetWindowThreadProcessId(hwnd, tmp)
- if tmp[0] ~= 0 then
- res = ffi.C.OpenProcess(permission , 0, tmp[0]);
- end
- return res
- end
- function write_memory(hproc, offset, buffer, size)
- local dwprotect = ffi.new("int[1]", 0)
- local offs = ffi.cast("void*", offset)
- if ffi.C.VirtualProtectEx(hproc, offs, size, 4, dwprotect) == 0 then
- return false
- end
- local res = ffi.C.WriteProcessMemory(hproc, offs, buffer, size, nil)
- ffi.C.VirtualProtectEx(hproc, offs, size, 4, dwprotect)
- if res ~= 0 then
- return true
- end
- return false
- end
- hwnd = get_process_handler("AssaultCube", 2035711)
- if tonumber(ffi.cast("int", hwnd)) == 0 then
- print("Run the game first, You moron.")
- os.exit()
- end
- buffer = ffi.new("unsigned char[4]", 0)
- buffer[0] = 0x18
- buffer[1] = 0x98
- buffer[2] = 0x4F
- if not write_memory(hwnd, 0x004B9DD8, buffer, 4) then
- os.exit()
- end
- -- renders the player models even if they are ocluded
- if not write_memory(hwnd, 0x004B0B8D, buffer, 4) then
- os.exit()
- end
- print("Done, enable wallhack now (/wallhack 1).")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement