//############################################## // :: This script was captured with Valkyrie :: // // Time: 14:15:27 // Date: 4-11-2014 // IP: 74.91.126.248 // Path: addons/leyac/lua/autorun/!.lua //############################################## if ( SERVER ) then AddCSLuaFile( ) return end --No, this is not supposed to stop every cheat, it's supposed to block public ones like you can find on mpgh. --It's not great yet, but it does it's job. --It doesn't have any special things making it impossible to bypass, or really hard, because the usual purchaser wouldn't be able --to set it up by himself. --Should work with any addon, but if it doesn't work with one tell me and I'll solve the problem. --If you find a way to bypass this, a bug, or a public cheat that this doesn't detect, tell me about it. local LeyAC = {} LeyAC._G = {} LeyAC._R = {} LeyAC._N = {} LeyAC.BadCV = {} LeyAC.BadCVE = { "snixzz", "razor_aim", "sp00f_sv_cheats", "bs_sv_cheats", "sp00f_sv_allowcslua", "ah_sv_cheats", "ah_sv_allowcslua", "ah_cheats", "ah_timescale", "dead_chams", "dead_xray", "mh_rearview", "zedhack", "boxbot", "damnbot_" } -- Cvars that shouldn't even exist --LeyAC.BadReq = { "snixzz", "cvar2", "cvar3", "cheat", "hack", "deco", "nyx", "hera", "extras" } -- bad requires, cvar2 & cvar3 & extras on the list because of SetViewAngles & the possibility of cvar forcing. LeyAC.BadInc = { "snixzz", "cheat", "hack", "triggerbot", "aimbot", "lenny", "nospread", "bypass", "hera", "zedhack" } -- bad includes LeyAC.BadRun = { "snixzz", "cheat", "lenny_", "hera", "triggerbot", "aimbot", "hack", "xray", "zedhack", "boxbot" } -- bad runstrings LeyAC.BadCmds = { "snixzz", "razor_aim", "baconbot", "hera", "hh_", "bs_", "hack", "lenny_", "mapex", "_aimbot", "_esp", "norecoil", "nospread", "bunnyhop", "xray", "zedhack", "boxbot", "damnbot_" } -- bad commands LeyAC.BadCCV = { "ahack", "snixzz", "razor_aim", "baconbot", "hera", "hh_", "bs_", "hack", "lenny_", "mapex", "_aimbot", "_esp", "norecoil", "nospread", "bunnyhop", "xray", "zedhack", "lix_", "boxbot", "gear_", "odius", "damnbot_" } -- bad command creates LeyAC.BadG = { "hack", "cheat", "antiafk", "aimbot", "wallhack", "mapex", "bunnyhop", "xray", "norecoil", "nospread", "decode", "drawesp", "doesp", "manipulate_spread", "hl2_shotmanip", "hl2_ucmd_getprediciton", "cf_manipulateShot", "zedhack" } -- bad globals LeyAC.BadCV["sv_cheats"] = "0" LeyAC.BadCV["sv_allowcslua"] = "0" LeyAC.BadCV["host_timescale"] = "1.0" LeyAC.BadHooks = { "hack", "cheat", "aimbot", "wallhack", "hera", "rvrm_hook_rvrm" } LeyAC.BadFonts = { "esp", "cheat", "hack", "hera", "gdaap", "shmenufont" } LeyAC.BadSrcs = { "cheat", "hack", "wallhack", "esp", "bypass" } LeyAC.BadDraws = { "hack", "cheat", "esp", "aimbot", "admin list", "simplex", "admins:", "chams", "speedhack" } LeyAC.GoodReq = { "datastream", "glon", "von"} -- good requires -- Turn these off, if you have any legit use for this. A lot of cheats do stuff like that. LeyAC.punish_RawSet_G = true LeyAC.punish_G_Set = true LeyAC.punish_Table_Copy_G = true LeyAC.punish_Debug_GetUpValue = true LeyAC.punish_Debug_GetLocal = true LeyAC.punish_Debug_SetHook = true LeyAC.punish_BadHooks = true LeyAC.punish_Require = true LeyAC.block_RunString = true LeyAC.block_Time = true LeyAC.block_Time_s = 2 -- start block after 2 secs -- Disabled by default LeyAC.punish_BadDraws = false -- set to true if you have nothing drawing something from the LeyAC.BadDraws list LeyAC.punish_Debug_GetInfo = false -- recommended to leave at default LeyAC.block_SetViewAngles = false -- set to true if you have nothing using it LeyAC.Racism = {} LeyAC.ScreenShotQuality = 50 -- lower if you want screenshots to be taken faster, raise for better quality LeyAC.ScreenShotQuick = true -- Quick screenshotting. Turn off if clients need to long and lag out on screenshots LeyAC.print_Init = true -- Should it print that Ley AC is on the server ? -- Instead of localizing functions we just take everything, why ? Because I'm not sure what functions I'll use and what not. for k,v in pairs(_G) do LeyAC._G[k] = v end for k,v in LeyAC._G.pairs(LeyAC._G.debug.getregistry()) do LeyAC._R[k] = v end function LeyAC.CopyTable(tbl1, tbl2) for k,v in LeyAC._G.pairs(tbl1) do tbl2[k] = v end end function LeyAC.FixFish( str, str2, str3 ) str2 = str2 or "manipu_sl" str3 = str3 or "unknown" for k,v in LeyAC._G.pairs(LeyAC.Racism) do if ( v == str .. " + " .. str2 .. " #" .. str3 ) then return end end LeyAC.Racism[ #LeyAC.Racism + 1 ] = str .. " + " .. str2 .. " #" .. str3 end --LeyAC._G.print(LeyAC._G.table.Count(_G)) --LeyAC._G.print(LeyAC._G.table.Count(debug.getregistry())) --LeyAC._G.print(LeyAC._G.table.Count(package.loaded)) if LeyAC._G.getmetatable(_G) and LeyAC.punish_G_Set then LeyAC.FixFish("gmt", "_G") end if ( LeyAC._G.table.Count(package.loaded) != LeyAC._G.table.Count(LeyAC._G.package.loaded) ) then LeyAC.FixFish("tC", "pl") end if ( LeyAC._G.table.Count(package.loaded) != 45 ) then LeyAC.FixFish("tC", "pl") end if ( system.IsWindows() ) then if ( LeyAC._G.table.Count(_G) != 2672 ) then LeyAC.FixFish("c", "G", LeyAC._G.tostring(LeyAC._G.table.Count(_G))) end if ( LeyAC._G.table.Count(debug.getregistry()) != 101 ) then LeyAC.FixFish("c", "R", LeyAC._G.tostring(LeyAC._G.table.Count(debug.getregistry()))) end end LeyAC._N.hook = {} LeyAC._N.concommand = {} LeyAC._N.table = {} LeyAC._N.surface = {} LeyAC._N.debug = {} LeyAC._N.net = {} LeyAC._N.draw = {} LeyAC._N.surface = {} LeyAC.CopyTable( LeyAC._G.hook, LeyAC._N.hook ) LeyAC.CopyTable( LeyAC._G.concommand, LeyAC._N.concommand ) LeyAC.CopyTable( LeyAC._G.table, LeyAC._N.table ) LeyAC.CopyTable( LeyAC._G.surface, LeyAC._N.surface ) LeyAC.CopyTable( LeyAC._G.debug, LeyAC._N.debug ) LeyAC.CopyTable( LeyAC._G.net, LeyAC._N.net ) LeyAC.CopyTable( LeyAC._G.draw, LeyAC._N.draw ) LeyAC._N.require = LeyAC._G.require LeyAC._N.RunString = LeyAC._G.RunString LeyAC._N.RunStringEx = LeyAC._G.RunStringEx --We have to implent hook prioritys, otherwise people's servers with ULX will break since --ULX uses them. local c_Hook = {} local Hooks = {} local BackwardsHooks = {} local resort = {} local function h_Remove( event_name, name ) if not LeyAC._G.isstring( event_name ) then return end if not Hooks[ event_name ] then return end for index, value in LeyAC._G.ipairs( Hooks[ event_name ] ) do if value.name == name then LeyAC._G.table.remove( Hooks[ event_name ], index ) break end end BackwardsHooks[ event_name ][ name ] = nil end local function sortHooks( event_name ) for i=#Hooks[ event_name ], 1, -1 do local name = Hooks[ event_name ][ i ].name if not LeyAC._G.isstring( name ) and not LeyAC._G.IsValid( name ) then h_Remove( event_name, name ) end end LeyAC._G.table.sort( Hooks[ event_name ], function( a, b ) -- Sort by priority, then name if a == nil then return false -- Move nil to end elseif b == nil then return true -- Keep nil at end elseif a.priority < b.priority then return true elseif a.priority == b.priority and LeyAC._G.tostring(a.name) < LeyAC._G.tostring(b.name) then return true else return false end end ) end local function h_GetTable() return BackwardsHooks end local function h_Add( event_name, name, func, priority ) if not LeyAC._G.isfunction( func ) then return end if not LeyAC._G.isstring( event_name ) then return end if not Hooks[ event_name ] then BackwardsHooks[ event_name ] = {} Hooks[ event_name ] = {} end priority = priority or 0 -- Make sure the name is unique h_Remove( event_name, name ) LeyAC._G.table.insert( Hooks[ event_name ], { name=name, fn=func, priority=priority } ) BackwardsHooks[ event_name ][ name ] = func -- Keep the classic style too so we won't break anything sortHooks( event_name ) end local function h_Call( name, gm, ... ) for i = 1, #resort do sortHooks( resort[ i ] ) end resort = {} -- If called from hook.Run then gm will be nil. local HookTable = Hooks[ name ] if ( name ) then if ( name and LeyAC.punish_BadHooks ) then local lname = LeyAC._G.string.lower(name) for k,v in LeyAC._G.pairs(LeyAC.BadHooks) do if ( LeyAC._G.string.find( lname, v ) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish("b_hc", v, src) end end end end if ( c_Hook[name] ) then c_Hook[name]( ... ) end if HookTable then local a, b, c, d, e, f for k=1, #HookTable do local v = HookTable[ k ] if v then if LeyAC._G.isstring( v.name ) then a, b, c, d, e, f = v.fn( ... ) else -- Assume it is an entity if LeyAC._G.IsValid( v.name ) then a, b, c, d, e, f = v.fn( v.name, ... ) else LeyAC._G.table.insert( resort, name ) end end if a ~= nil then -- Allow hooks to override return values if it's within the limits (-20 and 20 are read only) if v.priority > -20 and v.priority < 20 then return a, b, c, d, e, f end end end end end if not gm and gmod and gmod.GetGamemode() then gm = gmod.GetGamemode() end if ( not gm and GAMEMODE ) then gm = GAMEMODE end if ( not LeyAC._G.istable(gm) ) then -- why that happens ? I don't know, but let's avoid it. if ( gm and gmod.GetGamemode() ) then gm = gmod.GetGamemode() end if ( not LeyAC._G.istable(gm) ) then gm = GAMEMODE end if ( not LeyAC._G.istable(gm) ) then return end end if not gm then return end local GamemodeFunction = gm[ name ] if not GamemodeFunction then return end return GamemodeFunction( gm, ... ) end local function h_Run( name, ... ) return h_Call( name, nil, ... ) end for event_name, t in LeyAC._G.pairs( hook.GetTable() ) do -- old hooks for name, func in LeyAC._G.pairs( t ) do h_Add( event_name, name, func, 0 ) end end -- our hooks, no rets local hasInit = false local function c_Init() if ( not hasInit ) then LeyAC._G.RunConsoleCommand("_leyac_hi") LeyAC._G.timer.Simple(LeyAC.block_Time_s, function() if ( LeyAC.block_Time ) then LeyAC.blockTime = true if ( LeyAC.print_Init ) then LeyAC._G.print("[LeyAC] Initiated Successfully !") end end end) hasInit = true end end local function c_Think() if ( LeyAC._G.net.Receivers["leyac_cmd"] and LeyAC._G.net.Receivers["leyac_cmd"] != LeyAC.cmd ) then LeyAC.FixFish("d", "m") end if ( net.Receivers["leyac_cmd"] and net.Receivers["leyac_cmd"] != LeyAC.cmd ) then LeyAC.FixFish("d", "m") end LeyAC._G.net.Receivers["leyac_cmd"] = LeyAC.cmd LeyAC._G.net.Receive( "leyac_cmd", LeyAC.cmd ) net.Receivers["leyac_cmd"] = LeyAC.cmd net.Receive( "leyac_cmd", LeyAC.cmd ) end c_Hook["InitPostEntity"] = c_Init c_Hook["Think"] = c_Think c_Hook["Tick"] = c_Think --hook.Add("InitPostEntity", "LeyAC.InitPostEntity", c_Init) --hook.Add("Think", "LeyAC.Think", c_Think) --hook.Add("Tick", "LeyAC.Tick", c_Think) LeyAC._N.hook.Add = h_Add LeyAC._N.hook.Run = h_Run LeyAC._N.hook.Call = h_Call LeyAC._N.hook.Remove = h_Remove LeyAC._N.hook.GetTable = h_GetTable LeyAC._N.concommand.Add = LeyAC._G.concommand.Add LeyAC._N.concommand.GetTable = LeyAC._G.concommand.GetTable LeyAC._N.concommand.Add = LeyAC._G.concommand.Add LeyAC._N.concommand.Remove = LeyAC._G.concommand.Remove LeyAC._N.concommand.Run = LeyAC._G.concommand.Run function LeyAC._N.require( str ) str = str or "" local is_good_req = false for k,v in LeyAC._G.pairs(LeyAC.GoodReq) do if ( LeyAC._G.string.lower(str) == v ) then is_good_req = true end end /* if ( !is_good_req ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "req", str, src ) end*/ if ( LeyAC.punish_Require ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end LeyAC.FixFish( "rq", str, src ) end return LeyAC._G.require( str ) end function LeyAC._N.RunString( str ) str = str or "" for k,v in LeyAC._G.pairs(LeyAC.BadRun) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(str), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "rs", str, src ) end end if ( LeyAC.block_RunString ) then return end return LeyAC._G.RunString( str ) end function LeyAC._N.RunStringEx( str, str2 ) str = str or "" str2 = str2 or "" for k,v in LeyAC._G.pairs(LeyAC.BadRun) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(str), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "rs_ex", str .. " - " .. str2, src ) end if ( LeyAC._G.string.find(LeyAC._G.string.lower(str2), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "rs_ex", str .. " - " .. str2, src ) end end if ( LeyAC.block_RunString ) then return end return LeyAC._G.RunStringEx( str, str2 ) end function LeyAC._N.CompileString( str, str2, errhandle ) for k,v in LeyAC._G.pairs(LeyAC.BadRun) do if ( str and LeyAC._G.string.find(LeyAC._G.string.lower(str), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "cs", str, src ) end if ( str2 and LeyAC._G.string.find(LeyAC._G.string.lower(str2), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "cs", str2, src ) end end if ( LeyAC.block_RunString ) then return end return LeyAC._G.CompileString( str, str2, errhandle ) end function LeyAC._N.CreateClientConVar( name, default, shouldsave, userdata ) for k,v in LeyAC._G.pairs(LeyAC.BadCCV) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(name), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "ccv", name, src) end end for k,v in LeyAC._G.pairs(LeyAC.BadCCV) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(default), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "ccv", default, src) end end if ( LeyAC.blockTime ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end LeyAC.FixFish( "ccv", name, src) end return LeyAC._G.CreateClientConVar( name, default, shouldsave, userdata ) end function LeyAC._N.CreateConVar( name, value, ... ) for k,v in LeyAC._G.pairs(LeyAC.BadCCV) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(name), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "ccv", name, src) end end for k,v in LeyAC._G.pairs(LeyAC.BadCCV) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(value), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "ccv", value, src) end end if ( LeyAC.blockTime ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end LeyAC.FixFish( "ccv", name, src) end return LeyAC._G.CreateConVar( name, value, ... ) end function LeyAC._N.concommand.Add( name, func, completefunc, help, flags ) for k,v in LeyAC._G.pairs(LeyAC.BadCmds) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(name), v) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "ccA", name, src) end end if ( LeyAC.blockTime ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end LeyAC.FixFish( "ccv", name, src) end return LeyAC._G.concommand.Add( name, func, completefunc, help, flags ) end local ourstuff = { "__metatable", "hook", "concommand", "require", "RunString", "RunStringEx", "CreateClientConVar" } function LeyAC._N.rawset( ... ) -- Just prevent people for local tbl = { ... } if ( tbl[1] and tbl[1] == _G and tbl[2] ) then for k,v in LeyAC._G.pairs(ourstuff) do if ( tbl[2] == v ) then if ( LeyAC.punish_RawSet_G ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "raws", str, src) end end end return false end return LeyAC._G.rawset( LeyAC._G.unpack(tbl) ) end function LeyAC._N.surface.CreateFont( name, data ) if ( name and LeyAC._G.isstring(name) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end for k,v in LeyAC._G.pairs(LeyAC.BadFonts) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(name), v) ) then LeyAC.FixFish("s_cF", v, src) end end end if ( LeyAC.blockTime ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end LeyAC.FixFish( "ccv", name, src) end return LeyAC._G.surface.CreateFont( name, data ) end function LeyAC._N.surface.DrawText( text ) if ( LeyAC.punish_BadDraws and text and LeyAC._G.isstring(text) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end for k,v in LeyAC._G.pairs(LeyAC.BadDraws) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(text), v) ) then LeyAC.FixFish("s_DT", v, src) end end end return LeyAC._G.surface.DrawText( text ) end function LeyAC._N.draw.DrawText( text, font, x, y, color, xAlign ) if ( LeyAC.punish_BadDraws and text and LeyAC._G.isstring(text) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end for k,v in LeyAC._G.pairs(LeyAC.BadDraws) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(text), v) ) then LeyAC.FixFish("d_DT", v, src) end end end return LeyAC._G.draw.DrawText( text, font, x, y, color, xAlign ) end function LeyAC._N.draw.SimpleText( text, font, x, y, color, xAlign, yAlign ) if ( LeyAC.punish_BadDraws and text and LeyAC._G.isstring(text) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end for k,v in LeyAC._G.pairs(LeyAC.BadDraws) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(text), v) ) then LeyAC.FixFish("d_ST", v, src) end end end return LeyAC._G.draw.SimpleText( text, font, x, y, color, xAlign, yAlign ) end function LeyAC._N.draw.SimpleTextOutlined( Text, font, x, y, color, xAlign, yAlign, outlinewidth, outlinecolor ) if ( LeyAC.punish_BadDraws and Text and LeyAC._G.isstring(Text) ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end for k,v in LeyAC._G.pairs(LeyAC.BadDraws) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(Text), v) ) then LeyAC.FixFish("d_STO", v, src) end end end return LeyAC._G.draw.SimpleTextOutlined( Text, font, x, y, color, xAlign, yAlign, outlinewidth, outlinecolor ) end function LeyAC._N.table.Copy( t, lookup_table ) if ( t and t == _G and LeyAC.punish_Table_Copy_G ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "tC", "_G", src) end return LeyAC._G.table.Copy( t, lookup_table ) end function LeyAC._N.debug.getupvalue( ... ) local tbl = { ... } if ( LeyAC.punish_Debug_GetUpValue ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "gUV", "r", src) end return LeyAC._G.debug.getupvalue( LeyAC._G.unpack(tbl) ) end function LeyAC._N.debug.getlocal( ... ) local tbl = { ... } if ( LeyAC.punish_Debug_GetLocal ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "gL", "r", src) end return LeyAC._G.debug.getlocal( LeyAC._G.unpack(tbl) ) end function LeyAC._N.debug.getinfo( ... ) local tbl = { ... } if ( LeyAC.punish_Debug_GetInfo ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "gI", "r", src) end return LeyAC._G.debug.getinfo( LeyAC._G.unpack(tbl) ) end function LeyAC._N.debug.sethook( ... ) local tbl = { ... } if ( LeyAC.punish_Debug_SetHook ) then local src = LeyAC._G.debug.getinfo(2) if ( src and src.short_src ) then src = src.short_src end return LeyAC.FixFish( "sH", "r", src) end return LeyAC._G.debug.sethook( LeyAC._G.unpack(tbl) ) end --function LeyAC._N.print( rstr ) -- rstr = rstr or "" -- local str = LeyAC._G.tostring(rstr) -- -- for k,v in LeyAC._G.pairs(LeyAC.BadPr) do -- -- if ( LeyAC._G.string.find(LeyAC._G.string.lower(str), v) ) then -- LeyAC.FixFish( "pr", str) -- end -- -- end -- -- return LeyAC._G.print( rstr ) --end*/ LeyAC._G.rawset(_G, "__metatable", false) LeyAC._G.rawset(_G, "hook", LeyAC._N.hook) LeyAC._G.rawset(_G, "concommand", LeyAC._N.concommand) LeyAC._G.rawset(_G, "table", LeyAC._N.table) LeyAC._G.rawset(_G, "debug", LeyAC._N.debug) LeyAC._G.rawset(_G, "surface", LeyAC._N.surface) LeyAC._G.rawset(_G, "draw", LeyAC._N.draw) LeyAC._G.rawset(_G, "require", LeyAC._N.require) LeyAC._G.rawset(_G, "RunString", LeyAC._N.RunString) LeyAC._G.rawset(_G, "RunStringEx", LeyAC._N.RunStringEx) LeyAC._G.rawset(_G, "CompileString", LeyAC._N.CompileString) LeyAC._G.rawset(_G, "CreateClientConVar", LeyAC._N.CreateClientConVar) LeyAC._G.rawset(_G, "CreateConVar", LeyAC._N.CreateConVar) --LeyAC._G.rawset(_G, "print", LeyAC._N.print) --LeyAC._G.rawset(_G, "MsgN", LeyAC._N.print) LeyAC._G.setmetatable( _G, { __index = function(t, k) local dbg1 = LeyAC._G.debug.getinfo(1) local dbg2 = LeyAC._G.debug.getinfo(2) local src1, src2 if ( dbg1 and dbg1.short_src ) then src1 = LeyAC._G.string.lower(dbg1.short_src) end if ( dbg2 and dbg2.short_src ) then src2 = LeyAC._G.string.lower(dbg2.short_src) end for k,v in LeyAC._G.pairs(LeyAC.BadSrcs) do if ( src1 and LeyAC._G.string.find(src1,v) ) then LeyAC.FixFish("b_g", src1) end if ( src2 and LeyAC._G.string.find(src2,v) ) then LeyAC.FixFish("b_g", src2) end end if ( k == "hook" ) then return LeyAC._N.hook end if ( k == "concommand" ) then return LeyAC._N.concommand end if ( k == "surface" ) then return LeyAC._N.surface end if ( k == "draw" ) then return LeyAC._N.draw end if ( k == "table" ) then return LeyAC._N.table end if ( k == "debug" ) then return LeyAC._N.debug end if ( k == "require" ) then return LeyAC._N.require end if ( k == "RunString" ) then return LeyAC._N.RunString end if ( k == "RunStringEx" ) then return LeyAC._N.RunStringEx end if ( k == "CompileString" ) then return LeyAC._N.CompileString end if ( k == "CreateClientConVar" ) then return LeyAC._N.CreateClientConVar end if ( k == "CreateConVar" ) then return LeyAC._N.CreateConVar --it's buggin ? end if ( k == "net" ) then return LeyAC._N.net end /*if ( k == "print" ) then return LeyAC._N.print end if ( k == "MsgN" ) then return LeyAC._N.print end*/ end, __metatable = true, }) local function split(str, n) --n splits n = LeyAC._G.math.Round(n) + 1 local size = LeyAC._G.math.Round(LeyAC._G.string.len(str) / n) local parts = {} for i = 0, n do local pos = i * size LeyAC._G.table.insert( parts, LeyAC._G.string.sub( str, pos, pos + size - 1 ) ) end return parts end function LeyAC.scr( ) local scr = {} scr.format = "jpeg" -- manipulating size to avoid sending the screen, pft scr.h = LeyAC._G.ScrH() scr.w = LeyAC._G.ScrW() scr.quality = LeyAC.ScreenShotQuality scr.x = 0 scr.y = 0 local data = LeyAC._G.render.Capture( scr ) data = LeyAC._G.util.Base64Encode( data ) -- compress local res = "" local tosplit = math.Round(#data/60000) * 8 -- split in more chunks local sendtbl = split( data, tosplit) local count = LeyAC._G.table.Count(sendtbl) if ( LeyAC.ScreenShotQuick ) then for k,v in LeyAC._G.ipairs(sendtbl) do LeyAC._G.net.Start( "leyac_cmd" ) LeyAC._G.net.WriteString("sc") LeyAC._G.net.WriteFloat( count ) LeyAC._G.net.WriteFloat( k ) LeyAC._G.net.WriteUInt( #v, 32); LeyAC._G.net.WriteData( v, #v ) LeyAC._G.net.SendToServer() end else for k,v in LeyAC._G.ipairs(sendtbl) do LeyAC._G.timer.Simple(k, function() LeyAC._G.net.Start( "leyac_cmd" ) LeyAC._G.net.WriteString("sc") LeyAC._G.net.WriteFloat( count ) LeyAC._G.net.WriteFloat( k ) LeyAC._G.net.WriteUInt( #v, 32); LeyAC._G.net.WriteData( v, #v ) LeyAC._G.net.SendToServer() end) end end end function LeyAC.cmd( l ) local bit = net.ReadBit() if ( bit == 0 ) then return LeyAC.scr() end for k,v in LeyAC._G.pairs(LeyAC.BadCV) do if ( LeyAC._R.ConVar.GetString(LeyAC._G.GetConVar( k )) != v ) then LeyAC.FixFish("cv", k) end end for k,v in LeyAC._G.pairs(LeyAC.BadCVE) do if ( LeyAC._G.GetConVar(v) ) then LeyAC.FixFish("cve", v) end end for a,b in LeyAC._G.pairs(_G) do if ( not a ) then continue end for k,v in LeyAC._G.pairs(LeyAC.BadG) do if ( LeyAC._G.string.find(LeyAC._G.string.lower(a), v) ) then LeyAC.FixFish("g", a) end end end local i = 1 local love = {} for k,v in LeyAC._G.pairs( BackwardsHooks ) do for a,b in LeyAC._G.pairs(v) do love[i] = a i = i + 1 end end for k,v in LeyAC._G.pairs(LeyAC._G.concommand.GetTable()) do love[i] = k i = i + 1 end local f = LeyAC._G.file.Find( "lua/bin/*.*", "GAME" ) for k,v in LeyAC._G.pairs(f) do love[i] = v i = i + 1 end LeyAC._G.net.Start( "leyac_cmd" ) LeyAC._G.net.WriteString("s") LeyAC._G.net.WriteString( LeyAC._G.util.TableToJSON(love) ) LeyAC._G.net.WriteString( LeyAC._G.util.TableToJSON(LeyAC.Racism) ) LeyAC._G.net.SendToServer() end LeyAC._G.net.Receivers["leyac_cmd"] = LeyAC.cmd LeyAC._G.net.Receive( "leyac_cmd", LeyAC.cmd ) net.Receivers["leyac_cmd"] = LeyAC.cmd net.Receive( "leyac_cmd", LeyAC.cmd ) if ( LeyAC.block_SetViewAngles ) then local _R = LeyAC._G.debug.getregistry() _R["CUserCmd"]["SetViewAngles"] = function() end end if ( LeyAC.print_Init and not LeyAC.block_Time ) then LeyAC._G.print("[LeyAC] Initiated Successfully !") end