Advertisement
Frost1

cobalt anticheat™ (ONLY ON AMR TDM )

Oct 10th, 2014
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 KB | None | 0 0
  1. 8:27 PM - YVL: you cant even fucking steal my source code
  2. 8:27 PM - YVL: because its not even on your client
  3.  
  4. MONTHS AND MONTHS OF CAREFUL PLANNING FINALLY PAID OFF
  5. I PRESENT TO YOU THE "UNSTEALABLE" ANTICHEAT CREATED BY THE ONE AND ONLY YVL
  6. COUSTOM CODED FOR AFTERMATH GAMING TDM
  7.  
  8. cobalt: tell him i dont care anymore
  9. cobalt: i was done with gmod a while ago
  10. cobalt: if he still has that grudge on me thats his problem
  11. cobalt: lmao i wish there was a date timestamp on those messages
  12. cobalt: that had to be like 4 or more months ago when i said that
  13. cobalt: long ago that i dont even remember it
  14. cobalt: thats the new source too, i remember updating one small thing like a couple weeks ago
  15. cobalt: so if it took him months to finally figure out how to get it (?) i guess thats a win on my part
  16. cobalt: even though it was a shitty anticheat and its very easy to steal the code for
  17. cobalt: holy shit the more i think about this the more im laughing at it
  18. cobalt: tell frost that made my day
  19.  
  20.  
  21. local _R = debug.getregistry()
  22. local _N = table.Copy( _G )
  23.  
  24. function hook.Exists( type, value )
  25. local tab = hook.GetTable()
  26.  
  27. for k, v in next, tab[ type ] do
  28. if k == value then
  29. return true
  30. end
  31. end
  32.  
  33. return false
  34. end
  35.  
  36. function concommand.Exists( type, value )
  37. local tab = concommand.GetTable()
  38. for k, v in next, tab do
  39. if k == value then
  40. return true
  41. end
  42. end
  43.  
  44. return false
  45. end
  46.  
  47. local function SendBan( message )
  48. net.Start( "SendBan" )
  49. net.WriteString( message )
  50. net.SendToServer()
  51. end
  52.  
  53. local a_cheating = false
  54. local c_cheating = false
  55. local f_cheating = false
  56.  
  57. hook.Add( "Think", "CheckConVars", function()
  58. local gcv_banned = false
  59. if debug.getinfo( GetConVar ).short_src ~= "[C]" then
  60. if gcv_banned then
  61. return
  62. end
  63.  
  64. gcv_banned = true
  65. SendBan( "Overwriting GetConVar" )
  66. end
  67.  
  68. local ggb_banned = false
  69. if debug.getinfo( GetGlobalBool ).short_src ~= "[C]" then
  70. if ggb_banned then
  71. return
  72. end
  73.  
  74. ggb_banned = true
  75. SendBan( "Overwriting GetGlobalBool" )
  76. end
  77.  
  78. local ascl = GetConVar( "sv_allowcslua" ):GetInt()
  79.  
  80. if ascl and ascl ~= 0 then
  81. if a_cheating then
  82. return
  83. end
  84.  
  85. if GetGlobalBool( "allowcslua" ) == false then
  86. a_cheating = true
  87.  
  88. timer.Simple( 0.5, function()
  89. if GetGlobalBool( "allowcslua" ) == false then
  90. SendBan( "Forcing sv_allowcslua" )
  91. else
  92. a_cheating = false
  93. end
  94. end )
  95. end
  96. end
  97.  
  98. local cheats = GetConVar( "sv_cheats" ):GetInt()
  99.  
  100. if cheats and cheats ~= 0 then
  101. if c_cheating then
  102. return
  103. end
  104.  
  105. if GetGlobalBool( "cheats" ) == false then
  106. c_cheating = true
  107. timer.Simple( 0.5, function()
  108. if GetGlobalBool( "cheats" ) == false then
  109. SendBan( "Forcing sv_cheats" )
  110. else
  111. c_cheating = false
  112. end
  113. end )
  114. end
  115. end
  116.  
  117. local fr = GetConVar( "host_framerate" ):GetInt()
  118.  
  119. if fr and fr ~= 0 then
  120. if f_cheating then
  121. return
  122. end
  123.  
  124. f_cheating = true
  125. SendBan( "Forcing host_framerate" )
  126. end
  127.  
  128. end )
  129.  
  130. usermessage.Hook( "CheckHooks", function()
  131. if not hook.Exists( "Think", "CheckConVars" ) then
  132. SendBan( "Removing Clientside Hooks" )
  133. end
  134. end )
  135.  
  136. usermessage.Hook( "CheckCookies", function()
  137. local c = cookie.GetString( "tdm_banned", "" )
  138.  
  139. if c == "true" then
  140. SendBan( "Ban Evasion" )
  141. end
  142. end )
  143.  
  144. local function isvalidfile( str )
  145. if string.find( str, "mad" ) or string.find( str, "fas2" ) or string.find( str, "wac" ) then
  146. return false
  147. end
  148.  
  149. return true
  150. end
  151.  
  152. local v_banned = false
  153. _R[ "CUserCmd" ][ "SetViewAngles" ] = function( ... )
  154. if v_banned then
  155. return
  156. end
  157.  
  158. v_banned = true
  159. local fi = debug.getinfo( 2 ).short_src
  160.  
  161. if isvalidfile( fi ) then
  162. SendBan( "Forbidden function call [SetViewAngles]" )
  163. end
  164.  
  165. return _G[ "CUserCmd" ][ "SetViewAngles" ]( ... )
  166. end
  167.  
  168. local sfm_banned = false
  169. _R[ "CUserCmd" ][ "SetForwardMove" ] = function( speed )
  170. if sfm_banned then
  171. return
  172. end
  173.  
  174. sfm_banned = true
  175. local fi = debug.getinfo( 2 ).short_src
  176.  
  177. if isvalidfile( fi ) then
  178. SendBan( "Forbidden function call [SetForwardMove]" )
  179. end
  180.  
  181. return _G[ "CUserCmd" ][ "SetForwardMove" ]( speed )
  182. end
  183.  
  184. local ssm_banned = false
  185. _R[ "CUserCmd" ][ "SetSideMove" ] = function( speed )
  186. if ssm_banned then
  187. return
  188. end
  189.  
  190. ssm_banned = true
  191. local fi = debug.getinfo( 2 ).short_src
  192.  
  193. if isvalidfile( fi ) then
  194. SendBan( "Forbidden function call [SetSideMove]" )
  195. end
  196.  
  197. return _G[ "CUserCmd" ][ "SetSideMove" ]( speed )
  198. end
  199.  
  200. local sum_banned = false
  201. _R[ "CUserCmd" ][ "SetUpMove" ] = function( speed )
  202. if sum_banned then
  203. return
  204. end
  205.  
  206. sum_banned = true
  207. local fi = debug.getinfo( 2 ).short_src
  208.  
  209. if isvalidfile( fi ) then
  210. SendBan( "Forbidden function call [SetUpMove]" )
  211. end
  212.  
  213. return _G[ "CUserCmd" ][ "SetUpMove" ]( speed )
  214. end
  215.  
  216. _G[ "RunString" ] = function( str )
  217. local fi = debug.getinfo( 2 ).short_src
  218.  
  219. if isvalidfile( fi ) then
  220. SendBan( "Forbidden function call [RunString]" )
  221. end
  222.  
  223. return _N.RunString( str )
  224. end
  225.  
  226. _G[ "RunStringEx" ] = function( str, val )
  227. local fi = debug.getinfo( 2 ).short_src
  228.  
  229. if isvalidfile( fi ) then
  230. SendBan( "Forbidden function call [RunStringEx]" )
  231. end
  232.  
  233. return _N.RunStringEx( str, val )
  234. end
  235.  
  236. _G[ "CompileString" ] = function( code, id, err )
  237. local fi = debug.getinfo( 2 ).short_src
  238.  
  239. if isvalidfile( fi ) then
  240. SendBan( "Forbidden function call [CompileString]" )
  241. end
  242.  
  243. SendBan( "Forbidden function call [CompileString]" )
  244. return _N.CompileString( code, id, err )
  245. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement