Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetDebugPrivileges()
- local hwnd = 0
- while (hwnd == 0) do
- hwnd = FindWindow("Counter-Strike Source")
- end
- local procID = GetProcessId(hwnd)
- WriteConsole("Process ID: " .. tostring(procID) .. "\n")
- local procHandle = OpenProcess(PROCESS_ALL_ACCESS, procID)
- WriteConsole("Process Handle: " .. tostring(procHandle) .. " [" .. tostring(PROCESS_ALL_ACCESS) .. "]\n")
- local engine = GetBaseAddress(procHandle, "engine.dll")
- local client = GetBaseAddress(procHandle, "client.dll")
- local sv_cheats = engine.dll + 0x590AE8
- local r_drawothermodels = client + 0x700208
- --sigscan for \x89\x54\x24\x2C\x89\x44\x24\x30\xE8
- --then add 0xF to address found
- --resulting value = ptr to ptr to entity table
- local etbl = ReadInt(procHandle, engine + 0x3C6C88)
- WriteConsole("Entity Table @ " .. tostring(etbl) .. "\n");
- local GetEntity = function(idx)
- return ReadInt(procHandle, etbl + (40+(8*idx)))
- end
- local C_CSPlayer = {
- deadflag = function(base) return ReadInt(procHandle, base + 0x87) end,
- m_iHealth = function(base) return ReadInt(procHandle, base + 0x88) end,
- m_iTeamNum = function(base) return ReadInt(procHandle, base + 0x90) end,
- m_vecMins = function(base) return ReadFloat(procHandle, base + 0x168),
- ReadFloat(procHandle, base + 0x16C), ReadFloat(procHandle, base + 0x170) end,
- m_vecMaxs = function(base) return ReadFloat(procHandle, base + 0x174),
- ReadFloat(procHandle, base + 0x178), ReadFloat(procHandle, base + 0x17C) end,
- m_vecAbsOrigin = function(base) return ReadFloat(procHandle, base + 0x1F4),
- ReadFloat(procHandle, base + 0x1F8), ReadFloat(procHandle, base + 0x1FC) end,
- m_angAbsRotation = function(base) return ReadFloat(procHandle, base + 0x200),
- ReadFloat(procHandle, base + 0x204), ReadFloat(procHandle, base + 0x208) end,
- m_vecNetworkOrigin = function(base) return ReadFloat(procHandle, base + 0x20C),
- ReadFloat(procHandle, base + 0x210), ReadFloat(procHandle, base + 0x214) end,
- m_angNetworkAngles = function(base) return ReadFloat(procHandle, base + 0x218),
- ReadFloat(procHandle, base + 0x21C), ReadFloat(procHandle, base + 0x220) end,
- m_fFlags = function(base) return ReadInt(procHandle, base + 0x2DC) end,
- m_flFOVStart = function(base) return ReadFloat(procHandle, base + 0xF2C) end,
- m_bDucked = function(base) return ReadByte(procHandle, base + 0xD60) end,
- m_bDucking = function(base) return ReadByte(procHandle, base + 0xD61) end,
- m_flDucktime = function(base) return ReadFloat(procHandle, base + 0xD64) end,
- m_flFallVelocity = function(base) return ReadFloat(procHandle, base + 0xD74) end,
- m_nOldButtons = function(base) return ReadFloat(procHandle, base + 0xD78) end,
- m_vecPunchAngle = function(base) return ReadFloat(procHandle, base + 0xD88),
- ReadFloat(procHandle, base + 0xD8C), ReadFloat(procHandle, base + 0xD90) end,
- m_szLastPlaceName = function(base) return ReadStr(procHandle, base + 0x11A8, 20) end,
- m_flStamina = function(base) return ReadFloat(procHandle, base + 0x1380) end,
- }
- local o_EyeX = engine + 0x507F60
- local o_EyeY = engine + 0x507F64
- local o_EyeY = engine + 0x507F68
- local o_EyeP = engine + 0x3E80A0
- local o_EyeYaw = engine + 0x3E80A4
- local o_EyeR = engine + 0x3E80A8
- WriteConsole("ACTIVATED\n");
- local function AngleToTarget(pYaw,pX,pY,pZ, tX,tY,tZ)
- local pitch, yaw = 0, 0
- pitch = math.atan((tX - pX) / (tZ - pZ));
- yaw = math.atan((tZ - pZ) / (tY - pY));
- roll = math.atan((tY - pY) / (tX - pX));
- return pitch, yaw, 0
- end
- local function WriteDataToFile(pX,pY,pZ, tX,tY,tZ)
- local f = io.open("E:/aimbot.dat", "w+")
- if (f ~= nil) then
- f:write(tostring(pX)..":"..tostring(pY)..":"..tostring(pZ)
- .."|"..tostring(tX)..":"..tostring(tY)..":"..tostring(tZ))
- f:close()
- end
- end
- local tmp = 0
- local aimbot = false
- local abot_backup = 0
- while (IsKeyDown(VK_END) == 0) do --END
- if (IsKeyDown(VK_F11) == 1) then
- if (ReadInt(procHandle, r_drawothermodels) == 1) then
- WriteInt(procHandle, r_drawothermodels, 2)
- WriteConsole("wallhack on\n")
- else
- WriteInt(procHandle, r_drawothermodels, 1)
- WriteConsole("wallhack off\n")
- end
- end
- if (IsKeyDown(VK_F12) == 1) then
- if (ReadInt(procHandle, sv_cheats) == 0) then
- WriteInt(procHandle, sv_cheats, 1)
- WriteConsole("sv_cheats on\n")
- else
- WriteInt(procHandle, sv_cheats, 0)
- WriteConsole("sv_cheats off\n")
- end
- end
- if (IsKeyDown(VK_F10) == 1) then
- aimbot = not aimbot
- if (aimbot) then WriteConsole("Aimbot on\n")
- else WriteConsole("Aimbot off\n") end
- end
- if (aimbot) then
- local Me = GetEntity(1)
- local EyeX, EyeY, EyeZ = C_CSPlayer.m_vecNetworkOrigin(Me)
- local EyeP, EyeYaw, EyeZ = C_CSPlayer.m_angAbsRotation(Me)
- WriteConsole("Local Pos: " .. tostring(EyeX) .. ", "
- .. tostring(EyeY) .. ", " .. tostring(EyeZ) .. "\n")
- local Nme = GetEntity(2)
- local NmeX, NmeY, NmeZ = C_CSPlayer.m_vecNetworkOrigin(Nme)
- WriteConsole("Player 2 Pos: " .. tostring(NmeX) .. ", "
- .. tostring(NmeY) .. ", " .. tostring(NmeZ) .. "\n")
- if (C_CSPlayer.m_bDucked(Nme) == 1) then
- NmeZ = NmeZ + 32 else NmeZ = NmeZ + 65 end
- local pitch, yaw, roll = AngleToTarget(EyeYaw,EyeX,EyeY,EyeZ, NmeX,NmeY,NmeZ)
- --WriteDataToFile(EyeX,EyeY,EyeZ, NmeX,NmeY,NmeZ)
- WriteConsole("Angle to target: " .. tostring(pitch) .. ", "
- .. tostring(yaw) .. ", " .. tostring(roll) .. "\n")
- WriteFloat(procHandle, o_EyeP, math.NormalizeAngle(pitch))
- WriteFloat(procHandle, o_EyeYaw, math.NormalizeAngle(yaw))
- end
- Sleep(100)
- end
- CloseHandle(procHandle)
Add Comment
Please, Sign In to add comment