captmicro

l33t aimbot for lua hack kit - DOES NOT WORK!

Jun 26th, 2012
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.41 KB | None | 0 0
  1. SetDebugPrivileges()
  2.  
  3. local hwnd = 0
  4. while (hwnd == 0) do
  5.     hwnd = FindWindow("Counter-Strike Source")
  6. end
  7.  
  8. local procID = GetProcessId(hwnd)
  9. WriteConsole("Process ID: " .. tostring(procID) .. "\n")
  10. local procHandle = OpenProcess(PROCESS_ALL_ACCESS, procID)
  11. WriteConsole("Process Handle: " .. tostring(procHandle) .. " [" .. tostring(PROCESS_ALL_ACCESS) .. "]\n")
  12.  
  13. local engine = GetBaseAddress(procHandle, "engine.dll")
  14. local client = GetBaseAddress(procHandle, "client.dll")
  15.  
  16. local sv_cheats = engine.dll + 0x590AE8
  17. local r_drawothermodels = client + 0x700208
  18. --sigscan for \x89\x54\x24\x2C\x89\x44\x24\x30\xE8
  19. --then add 0xF to address found
  20. --resulting value = ptr to ptr to entity table
  21. local etbl = ReadInt(procHandle, engine + 0x3C6C88)
  22. WriteConsole("Entity Table @ " .. tostring(etbl) .. "\n");
  23.  
  24. local GetEntity = function(idx)
  25.     return ReadInt(procHandle, etbl + (40+(8*idx)))
  26. end
  27.  
  28. local C_CSPlayer = {
  29.     deadflag = function(base) return ReadInt(procHandle, base + 0x87) end,
  30.     m_iHealth = function(base) return ReadInt(procHandle, base + 0x88) end,
  31.     m_iTeamNum = function(base) return ReadInt(procHandle, base + 0x90) end,
  32.     m_vecMins = function(base) return ReadFloat(procHandle, base + 0x168),
  33.         ReadFloat(procHandle, base + 0x16C), ReadFloat(procHandle, base + 0x170) end,
  34.     m_vecMaxs = function(base) return ReadFloat(procHandle, base + 0x174),
  35.         ReadFloat(procHandle, base + 0x178), ReadFloat(procHandle, base + 0x17C) end,
  36.     m_vecAbsOrigin = function(base) return ReadFloat(procHandle, base + 0x1F4),
  37.         ReadFloat(procHandle, base + 0x1F8), ReadFloat(procHandle, base + 0x1FC) end,
  38.     m_angAbsRotation = function(base) return ReadFloat(procHandle, base + 0x200),
  39.         ReadFloat(procHandle, base + 0x204), ReadFloat(procHandle, base + 0x208) end,
  40.     m_vecNetworkOrigin = function(base) return ReadFloat(procHandle, base + 0x20C),
  41.         ReadFloat(procHandle, base + 0x210), ReadFloat(procHandle, base + 0x214) end,
  42.     m_angNetworkAngles = function(base) return ReadFloat(procHandle, base + 0x218),
  43.         ReadFloat(procHandle, base + 0x21C), ReadFloat(procHandle, base + 0x220) end,
  44.     m_fFlags = function(base) return ReadInt(procHandle, base + 0x2DC) end,
  45.     m_flFOVStart = function(base) return ReadFloat(procHandle, base + 0xF2C) end,
  46.     m_bDucked = function(base) return ReadByte(procHandle, base + 0xD60) end,
  47.     m_bDucking = function(base) return ReadByte(procHandle, base + 0xD61) end,
  48.     m_flDucktime = function(base) return ReadFloat(procHandle, base + 0xD64) end,
  49.     m_flFallVelocity = function(base) return ReadFloat(procHandle, base + 0xD74) end,
  50.     m_nOldButtons = function(base) return ReadFloat(procHandle, base + 0xD78) end,
  51.     m_vecPunchAngle = function(base) return ReadFloat(procHandle, base + 0xD88),
  52.         ReadFloat(procHandle, base + 0xD8C), ReadFloat(procHandle, base + 0xD90) end,
  53.     m_szLastPlaceName = function(base) return ReadStr(procHandle, base + 0x11A8, 20) end,
  54.     m_flStamina = function(base) return ReadFloat(procHandle, base + 0x1380) end,
  55. }
  56. local o_EyeX = engine + 0x507F60
  57. local o_EyeY = engine + 0x507F64
  58. local o_EyeY = engine + 0x507F68
  59. local o_EyeP = engine + 0x3E80A0
  60. local o_EyeYaw = engine + 0x3E80A4
  61. local o_EyeR = engine + 0x3E80A8
  62.  
  63. WriteConsole("ACTIVATED\n");
  64.  
  65. local function AngleToTarget(pYaw,pX,pY,pZ, tX,tY,tZ)
  66.     local pitch, yaw = 0, 0
  67.     pitch = math.atan((tX - pX) / (tZ - pZ));
  68.     yaw = math.atan((tZ - pZ) / (tY - pY));
  69.     roll = math.atan((tY - pY) / (tX - pX));
  70.     return pitch, yaw, 0
  71. end
  72. local function WriteDataToFile(pX,pY,pZ, tX,tY,tZ)
  73.     local f = io.open("E:/aimbot.dat", "w+")
  74.     if (f ~= nil) then
  75.         f:write(tostring(pX)..":"..tostring(pY)..":"..tostring(pZ)
  76.          .."|"..tostring(tX)..":"..tostring(tY)..":"..tostring(tZ))
  77.         f:close()
  78.     end
  79. end
  80.  
  81. local tmp = 0
  82. local aimbot = false
  83. local abot_backup = 0
  84. while (IsKeyDown(VK_END) == 0) do --END
  85.     if (IsKeyDown(VK_F11) == 1) then
  86.         if (ReadInt(procHandle, r_drawothermodels) == 1) then
  87.             WriteInt(procHandle, r_drawothermodels, 2)
  88.             WriteConsole("wallhack on\n")
  89.         else
  90.             WriteInt(procHandle, r_drawothermodels, 1)
  91.             WriteConsole("wallhack off\n")
  92.         end
  93.     end
  94.     if (IsKeyDown(VK_F12) == 1) then
  95.         if (ReadInt(procHandle, sv_cheats) == 0) then
  96.             WriteInt(procHandle, sv_cheats, 1)
  97.             WriteConsole("sv_cheats on\n")
  98.         else
  99.             WriteInt(procHandle, sv_cheats, 0)
  100.             WriteConsole("sv_cheats off\n")
  101.         end
  102.     end
  103.     if (IsKeyDown(VK_F10) == 1) then
  104.         aimbot = not aimbot
  105.         if (aimbot) then WriteConsole("Aimbot on\n")
  106.         else WriteConsole("Aimbot off\n") end
  107.     end
  108.     if (aimbot) then
  109.         local Me = GetEntity(1)
  110.         local EyeX, EyeY, EyeZ = C_CSPlayer.m_vecNetworkOrigin(Me)
  111.         local EyeP, EyeYaw, EyeZ = C_CSPlayer.m_angAbsRotation(Me)
  112.         WriteConsole("Local Pos: " .. tostring(EyeX) .. ", "
  113.             .. tostring(EyeY) .. ", " .. tostring(EyeZ) .. "\n")
  114.        
  115.         local Nme = GetEntity(2)
  116.         local NmeX, NmeY, NmeZ = C_CSPlayer.m_vecNetworkOrigin(Nme)
  117.         WriteConsole("Player 2 Pos: " .. tostring(NmeX) .. ", "
  118.             .. tostring(NmeY) .. ", " .. tostring(NmeZ) .. "\n")
  119.         if (C_CSPlayer.m_bDucked(Nme) == 1) then
  120.             NmeZ = NmeZ + 32 else NmeZ = NmeZ + 65 end
  121.        
  122.         local pitch, yaw, roll = AngleToTarget(EyeYaw,EyeX,EyeY,EyeZ, NmeX,NmeY,NmeZ)
  123.         --WriteDataToFile(EyeX,EyeY,EyeZ, NmeX,NmeY,NmeZ)
  124.         WriteConsole("Angle to target: " .. tostring(pitch) .. ", "
  125.             .. tostring(yaw) .. ", " .. tostring(roll) .. "\n")
  126.         WriteFloat(procHandle, o_EyeP, math.NormalizeAngle(pitch))
  127.         WriteFloat(procHandle, o_EyeYaw, math.NormalizeAngle(yaw))
  128.     end
  129.     Sleep(100)
  130. end
  131.  
  132. CloseHandle(procHandle)
Add Comment
Please, Sign In to add comment