Advertisement
clark

BreakPoint Servers Anti Cheat

Jun 18th, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.07 KB | None | 0 0
  1. if SERVER then return end
  2.  
  3. require("hook")
  4. require("concommand")
  5. require("timer")
  6.  
  7. local sv_cheats = GetConVar("sv_cheats")
  8. local host_timescale = GetConVar("host_timescale")
  9.  
  10. local function stringRandom(num)
  11.     local ret = ""
  12.     for i = 1 , num do
  13.         ret = ret .. string.char(math.random(65 , 116))
  14.     end
  15.     return ret
  16. end
  17.  
  18. local cmdQueue = {}
  19.  
  20. local RunConCmmd = RunConsoleCommand
  21. local hookEx = hook._M
  22.  
  23. function RunConsoleCommand( ... )
  24.     for _,cmd in pairs( {...} ) do
  25.         if string.find( cmd, "+jump" ) then
  26.             error( "Blocked command +jump" )
  27.             return
  28.         end
  29.     end
  30.     RunConCmmd( ... )
  31. end
  32.  
  33. local function runCommand(cmd,...)
  34.     if LocalPlayer and !LocalPlayer():IsValid() then
  35.         table.insert(cmdQueue, {
  36.             cmd=cmd,
  37.             args={...},
  38.         })
  39.     else
  40.         RunConCmmd(cmd, unpack({...}))
  41.     end
  42. end
  43.  
  44. local nm = stringRandom(10)
  45.  
  46. hookEx.GetTable()["InitPostEntity"] = hookEx.GetTable()["InitPostEntity"] or {}
  47.  
  48. hookEx.GetTable()["InitPostEntity"][nm] = function()
  49.     for k,v in pairs(cmdQueue) do
  50.         RunConCmmd(v.cmd, unpack(v.args))
  51.     end
  52.     hookEx.GetTable()["InitPostEntity"][nm] = nil
  53.     hook = hookEx
  54. end
  55.  
  56. local varsToCheck = {}
  57. local lastKnownValues = {}
  58.  
  59. local function addVarCheck( var )
  60.     varsToCheck[ var ] = GetConVar( var )
  61.     lastKnownValues[ var ] = varsToCheck[ var ]:GetInt()
  62. end
  63.  
  64. addVarCheck( "sv_cheats" )
  65. addVarCheck( "host_timescale" )
  66. addVarCheck( "mat_wireframe" )
  67.  
  68. hookEx.GetTable()["Think"] = hookEx.GetTable()["Think"] or {}
  69.  
  70. local funCommands = {
  71.     "_____b__c",
  72.     "___m",
  73.     "sc",
  74.     "bg",
  75.     "bm",
  76.     "kickme",
  77.     "gw_iamacheater",
  78.     "imafaggot",
  79.     "birdcage_browse",
  80.     "reportmod",
  81.     "_fuckme",
  82.     "st_openmenu",
  83.     "_NOPENOPE",
  84.     "__ping",
  85.     "ar_check",
  86.     "GForceRecoil",
  87.     "~__ac_auth",
  88. }
  89.  
  90. local ourAuthCmd = funCommands[ math.random(1,#funCommands) ]
  91.  
  92. runCommand( ourAuthCmd )
  93. for var,value in pairs( lastKnownValues ) do
  94.     runCommand( ourAuthCmd, "varcar", var, value )
  95. end
  96.  
  97. hookEx.GetTable()["Think"][stringRandom(10)] = function()
  98.     for var,cvar in pairs( varsToCheck ) do
  99.         if lastKnownValues[ var ] != cvar:GetInt() then
  100.             runCommand(ourAuthCmd, "varcar", var, cvar:GetInt())
  101.             lastKnownValues[ var ] = cvar:GetInt()
  102.         end
  103.     end
  104. end
  105.  
  106. local ccmd = concommand
  107. concommand = nil
  108.  
  109. ccmd.Add( "pp_pixelrender", function( ply, cmd, args )
  110.     runCommand( "say", "I tried using pp_pixelrender!" )
  111.     runCommand( ourAuthCmd, "ppppp" )
  112. end )
  113.  
  114. local SteamUser = util.RelativePathToFull( "gameinfo.txt" ):gsub( '\\', "/" ):match( "steamapps/(.-)/" ) or "lolmac"
  115.  
  116. if datastream or table.Inherit or math.Clamp or string.ToTable or sql or TEAM_CONNECTING or TEAM_UNASSIGNED or TEAM_SPECTATOR or NOTIFY_GENERIC then
  117.     runCommand( ourAuthCmd, "anal", SteamUser )
  118. end
  119.  
  120. local c = _G[ string.char( 115, 116, 114, 105, 110, 103 ) ][ string.char( 99, 104, 97, 114 ) ]
  121. local f = _G[ string.char( 115, 116, 114, 105, 110, 103 ) ][ string.char( 102, 105, 110, 100 ) ]
  122. local l = _G[ string.char( 115, 116, 114, 105, 110, 103 ) ][ string.char( 108, 111, 119, 101, 114 ) ]
  123.  
  124. local o = _R[ string.char( 80, 97, 110, 101, 108 ) ][ string.char( 83, 101, 116, 84, 101, 120, 116 ) ]
  125.  
  126. _R[ c( 80, 97, 110, 101, 108 ) ][ c( 83, 101, 116, 84, 101, 120, 116 ) ] = function( a, b )
  127.     o( a, b )
  128.     if b and f( l( b ), c( 97, 105, 109, 98, 111, 116 ) ) then
  129.         runCommand( ourAuthCmd, "penis", SteamUser, b )
  130.     end
  131. end
  132.  
  133. local function commandAdd(cmd, func, auto)
  134.     if string.lower(cmd) ~= "pp_pixelrender" then
  135.         return ccmd.Add(cmd, func, auto)
  136.     else
  137.         MsgN( "[AntiCheat] Blocked pp_pixelrender" )
  138.     end
  139.     return
  140. end
  141.  
  142. setmetatable( _G, {
  143.     __index = function(t , k)
  144.         if k == "concommand" then
  145.             return {Remove = ccmd.Remove , Add = commandAdd , Run = ccmd.Run , AutoComplete = ccmd.AutoComplete , _NAME = "concommand"}
  146.         end
  147.     end,
  148.     __metatable = true,
  149. } )
  150.  
  151. --[[local oldPlyCmd = _R.Player.ConCommand
  152. function _R.Player:ConCommand( str )
  153.     if string.find( str, "+jump" ) then
  154.         error( "Blocked command +jump" )
  155.     else
  156.         self:oldPlyCmd( cmd )
  157.     end
  158. end]]
  159.  
  160. setmetatable( _R.CUserCmd, {
  161.     __index = function(t,k)
  162.         if k == "SetButtons" then
  163.             return nil
  164.         end
  165.     end,
  166.     __metatable = true,
  167. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement