Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- LUA CODE OBTAINED INSIDE METH.DLL, AS YOU CAN SEE ITS 99% PASTED ON THE LEAKED ODIUM MODULES. (same detours...)
- DUNNO WHEN THIS CODE IS LOADED AND HOW, BUT THIS IS MEANT TO BE LOADED VERY EARLY.
- NOTE: a few things are mysterious such as "$CHEAT_SESSION_TOKEN$" and "meth_handler" which must be defined in C++ or somewhere else before they get used in the lua.
- This looks like a kind of clientside lua loader that's supposed to load any lua without being detected (detours hiding their ass), but its pretty bad and some of their shit is easily detectable sooo...
- */
- local meth = setmetatable({}, {
- __index = function(tbl, key) -- key is the method name
- return function(...)
- gcinfo("$CHEAT_SESSION_TOKEN$", key, ...)
- end
- end,
- __metatable = false
- })
- local function tCopy( t, lookup_table )
- if ( t == nil ) then return nil end
- local copy = {}
- setmetatable( copy, debug.getmetatable( t ) )
- for i, v in pairs( t ) do
- if ( !istable( v ) ) then
- copy[ i ] = v
- else
- lookup_table = lookup_table or {}
- lookup_table[ t ] = copy
- if ( lookup_table[ v ] ) then
- copy[ i ] = lookup_table[ v ] -- we already copied this table. reuse the copy.
- else
- copy[ i ] = tCopy( v, lookup_table ) -- not yet copied. copy it.
- end
- end
- end
- return copy
- end
- local mthbp = {}
- local mthh = meth_handler
- _G.meth_handler = nil
- mthbp["DetourFuncs"] = {}
- mthbp["DetourNames"] = {}
- mthbp["Hooks"] = {}
- mthbp["G"] = tCopy(_G)
- mthbp["R"] = tCopy(debug.getregistry())
- function mthbp.Detour( old, new, name )
- name = name or ""
- mthbp.DetourFuncs[new] = old
- mthbp.DetourNames[new] = name
- return new
- end
- local isstr,isfunc = isstring,isfunction
- local tstring = tostring
- local cgarbage = collectgarbage
- collectgarbage = mthbp.Detour( collectgarbage, function( a, ... )
- if tstring( a ) == "count" then
- local normal = cgarbage( a, ... )
- if memoryused then
- return normal - memoryused
- end
- end
- return cgarbage( a, ... )
- end, "collectgarbage")
- local gci = gcinfo
- gcinfo = mthbp.Detour( gcinfo, function(...)
- local args = { ... }
- if tostring(args[1]) == "$CHEAT_SESSION_TOKEN$" then
- return mthh(...)
- end
- return gcinfo(...)
- end, "gcinfo")
- local jufi = jit.util.funcinfo
- jit.util.funcinfo = mthbp.Detour( jit.util.funcinfo, function( func, ... )
- local n_func = func
- if isnumber(func) then return jufi(func + 1, ... ) end
- if jufi(func, ...).source == "@" then return jufi( nil, ... ) end // _G.Msg
- if jufi(func, ...).source == "sillyguy" then
- local resp = jufi(func, ...)
- resp.loc = ":" + resp.linedefined
- resp.source = "@"
- return resp
- end
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- local tbl = jufi( n_func || func, ... )
- return tbl
- end, "jit.util.funcinfo")
- local jufk = jit.util.funck
- jit.util.funck = mthbp.Detour( jit.util.funck, function( func, ... )
- local n_func = func
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- return jufk( n_func || func, ... )
- end, "jit.util.funck")
- local jufbc = jit.util.funcbc
- jit.util.funcbc = mthbp.Detour( jit.util.funcbc, function( func, ... )
- local n_func = func
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- return jufbc( n_func || func, ... )
- end, "jit.util.funcbc")
- local jufuvn = jit.util.funcuvname
- jit.util.funcuvname = mthbp.Detour( jit.util.funcuvname, function( func, ... )
- local n_func = func
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- return jufuvn( n_func || func, ... )
- end, "jit.util.funcuvname")
- local jufir = jit.util.ircalladdr
- local dbginfo = debug.getinfo
- jit.util.ircalladdr = mthbp.Detour( jit.util.ircalladdr, function( idx )
- if dbginfo(2).source:find("dragondildos") then
- return jufir(idx)
- else
- return jufir(idx + 20)
- end
- end, "jit.util.ircalladdr")
- local ja = jit.attach
- jit.attach = mthbp.Detour( jit.attach, function(a, b)
- if b == "bc" then return end
- return ja(a, b)
- end, "jit.attach")
- local gtuv = debug.getupvalue
- debug.getupvalue = mthbp.Detour( debug.getupvalue, function( func, ... )
- local n_func = func
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- return gtuv( n_func, ... )
- end, "debug.getupvalue")
- local stringfind = string.find
- local dbghook = debug.sethook
- debug.getinfo = mthbp.Detour( debug.getinfo, function( func, ... )
- local n_func = func
- if dbginfo(2).source:find("dragondildos") and ((dbginfo(2).currentline == 106) or (dbginfo(2).currentline == 107)) and mthbp.DetourNames[func] == "debug.getinfo" then
- return { func = n_func }
- end
- if dbginfo(n_func, ...).short_src == "sillyguy" then
- local resp = dbginfo(n_func, ...)
- resp.source = "@"
- resp.short_src = ""
- return resp
- end
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- return dbginfo( n_func, ... )
- end, "debug.getinfo")
- local dsmeta = debug.setmetatable
- local metatab = {}
- debug.setmetatable = mthbp.Detour( debug.setmetatable, function( tab, meta )
- if tab == mthbp.DetourFuncs then tab = metatab end
- return dsmeta( tab, meta )
- end, "debug.setmetatable")
- local dgmeta = debug.getmetatable
- debug.getmetatable = mthbp.Detour( debug.getmetatable, function( obj )
- if mthbp.DetourFuncs[obj] then obj = metatab end
- return dgmeta( obj )
- end, "debug.getmetatable")
- local gfenv = debug.getfenv
- debug.getfenv = mthbp.Detour( debug.getfenv, function( obj )
- local n_func = obj
- if mthbp.DetourFuncs[n_func] then n_func = mthbp.DetourFuncs[n_func] end
- return gfenv(n_func)
- end, "debug.getfenv")
- local hk_dtr = {}
- debug.sethook = mthbp.Detour( debug.sethook, function( hook, mask, count )
- if hook == nil or mask == nil then
- hk_dtr = {}
- return
- end
- hk_dtr = {}
- hk_dtr["hook"] = hook
- hk_dtr["mask"] = mask
- hk_dtr["count"] = count
- end,"debug.sethook")
- local ghook = debug.gethook
- debug.gethook = mthbp.Detour( debug.gethook, function()
- if not hk_dtr["hook"] then return nil, nil, nil end
- return hk_dtr["hook"], hk_dtr["mask"], hk_dtr["count"]
- end,"debug.gethook")
- local uvid = debug.upvalueid
- debug.upvalueid = mthbp.Detour( debug.upvalueid, function( func, ... )
- local n_func = func
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- return uvid( n_func, ... )
- end,"debug.upvalueid")
- local uvj = debug.upvaluejoin
- debug.upvaluejoin = mthbp.Detour( debug.upvaluejoin, function( f1, n1, f2, n2 )
- local n_func = f1
- local n_func2 = f2
- if mthbp.DetourFuncs[f1] then n_func = mthbp.DetourFuncs[f1] end
- if mthbp.DetourFuncs[f2] then n_func2 = mthbp.DetourFuncs[f2] end
- return uvj(n_func, n1, n_func2, n2)
- end,"debug.upvaluejoin")
- local sfenv = debug.setfenv
- debug.setfenv = mthbp.Detour( debug.setfenv, function( obj, env )
- if mthbp.DetourFuncs[obj] then obj = function() end end
- return sfenv( obj, env )
- end,"debug.setfenv")
- local stump = string.dump
- string.dump = mthbp.Detour( string.dump, function( func, ... )
- local n_func = func
- if mthbp.DetourFuncs[func] then n_func = mthbp.DetourFuncs[func] end
- return stump(n_func, ... )
- end,"string.dump")
- local dbggetlocal = debug.getlocal
- debug.getlocal = mthbp.Detour( debug.getlocal, function( thread, level, index )
- local n_thread = thread
- if isfunc(n_thread) and mthbp.DetourFuncs[n_thread] then n_thread = mthbp.DetourFuncs[n_thread] end
- return dbggetlocal(n_thread or thread, level, index)
- end,"debug.getlocal")
- local renderview = render.RenderView
- local renderclear = render.Clear
- local vgetworldpanel = vgui.GetWorldPanel
- local panic = false
- local oRCC = RunConsoleCommand
- local eyeangles = _G.EyeAngles
- local function renderpanic( delay )
- if panic then return end
- panic = true
- local worldpanel = vgetworldpanel()
- if IsValid(worldpanel) then
- worldpanel:SetPaintedManually( true )
- end
- for k, v in pairs( ents.GetAll() ) do
- if v:GetColor() and v:GetColor().a == 100 and v:GetRenderMode() and v:GetRenderMode() == 4 then
- v:SetColor(Color(255, 255, 255))
- end
- end
- renderclear(0, 0, 0, 255, true, true)
- renderview(
- {
- origin = LocalPlayer():EyePos(),
- angles = eyeangles(),
- x = 0,
- y = 0,
- w = ScrW(),
- h = ScrH(),
- dopostprocess = true,
- drawhud = true,
- drawmonitors = true,
- drawviewmodel = true,
- viewmodelfov = 54,
- fov = 75
- })
- oRCC("play", "buttons/blip1.wav")
- timer.Simple(delay, function()
- local worldpanel = vgetworldpanel()
- if IsValid(worldpanel) then
- worldpanel:SetPaintedManually(false)
- end
- panic = false
- end)
- end
- local oRC = render.Capture
- local oRCP = render.CapturePixels
- local oRRP = render.ReadPixel
- local findmeta = FindMetaTable
- local ply = findmeta( "Player" )
- local oconcommand = ply.ConCommand
- --[[render.Capture = mthbp.Detour(render.Capture, function(...)
- local args = { ... }
- if #args == 0 then return end
- if args[1] and args[1].w < 0 then return end
- renderpanic(0.05)
- local output = oRC(...)
- return unpack(output)
- end, "render.Capture")
- render.CapturePixels = mthbp.Detour(render.CapturePixels, function(...)
- local args = { ... }
- if #args == 0 then return end
- renderpanic(0.05)
- local output = oRCP(...)
- return unpack(output)
- end, "render.CapturePixels")
- render.ReadPixel = mthbp.Detour(render.ReadPixel, function(...)
- local args = { ... }
- if #args == 0 then return end
- if args[1] == 1 and args[2] == 1 then return end
- renderpanic(0.05)
- local output = oRRP(...)
- return unpack(output)
- end, "render.ReadPixel")
- ply.ConCommand = mthbp.Detour(ply.ConCommand, function(pl, cmd, ...)
- if string.lower(cmd) == "jpeg" then
- renderpanic( 0.2 )
- oconcommand( pl, cmd, ... )
- return
- end
- if string.lower(cmd) == "__screenshot_internal" then
- renderpanic( 0.3 )
- oconcommand( pl, cmd, ... )
- return
- end
- if string.lower(cmd) == "screenshot" then
- renderpanic( 0.3 )
- oconcommand( pl, cmd, ... )
- return
- end
- if string.lower(cmd) == "startmovie" then
- renderpanic( 0.3 )
- oRCC( cmd, ... )
- return
- end
- return oconcommand( pl, cmd, ... )
- end, "player:ConCommand")
- _G.RunConsoleCommand = mthbp.Detour(_G.RunConsoleCommand, function(cmd, ...)
- if string.lower(cmd) == "jpeg" then
- renderpanic( 0.2 )
- oRCC( cmd, ... )
- return
- end
- if string.lower(cmd) == "__screenshot_internal" then
- renderpanic( 0.3 )
- oRCC( cmd, ... )
- return
- end
- if string.lower(cmd) == "screenshot" then
- renderpanic( 0.3 )
- oRCC( cmd, ... )
- return
- end
- if string.lower(cmd) == "startmovie" then
- renderpanic( 0.3 )
- oRCC( cmd, ... )
- return
- end
- return oRCC( cmd, ... )
- end, "RunConsoleCommand")]]--
- local concmds = {}
- local completefns = {}
- local oACC = AddConsoleCommand
- local function concmdadd(name, func, complete, help, flags)
- if not isfunc( func ) then return end
- if not isstr( name ) then return end
- name = string.lower(name)
- if concmds[name] or completefns[name] then return end
- concmds[name] = func
- if complete_func and isfunc(complete_func) then completefns[name] = complete_func end
- oACC(name, help, flags)
- end
- local function concmdauto(cmd, args)
- if not isstr(cmd) or not isstr(args) then return end
- cmd = string.lower(cmd)
- if completefns[cmd] == nil then return end
- return completefns[cmd](cmd, args)
- end
- local function init_command_system()
- local comRun = concommand.Run
- local oCCA = concommand.Add
- concommand.Run = mthbp.Detour(concommand.Run, function(player, command, arguments, args)
- comRun(player, command, arguments, args)
- command = string.lower(command)
- if concmds[command] then
- concmds[command](player, command, arguments, args)
- return true
- end
- return false
- end, "concommand.Run")
- concommand.Add = mthbp.Detour(concommand.Add, function(...)
- local args = {...}
- local func = args[2]
- if func and isfunc(func) and dbginfo(func).short_src == "" then
- return concmdadd(...)
- end
- return oCCA(...)
- end, "concommand.Add")
- end
- local hooks_injected = false
- local gethooks = false
- local hcall = false
- local oHKA = false
- local oHKR = false
- local hooks = {}
- local function addhook(event, name, func)
- hooks[event] = hooks[event] or {}
- hooks[event][name] = func
- end
- local function removehook(event, name)
- hooks[event] = hooks[event] or {}
- hooks[event][name] = nil
- end
- local function init_hook_system()
- gethooks = hook.GetTable
- hcall = hook.Call
- oHKA = hook.Add
- oHKR = hook.Remove
- hook.Add = mthbp.Detour(hook.Add, function(event, name, func, ...)
- if not func or not isfunc(func) then return end
- if jufi(func).source == "@" then return addhook(event, name, func) end
- return oHKA(event, name, func, ...)
- end, "hook.Add")
- hook.Remove = mthbp.Detour(hook.Remove, function(event, name)
- if dbginfo(2).short_src == "" then return removehook(event, name, func) end
- return oHKR(event, name)
- end, "hook.Remove")
- hook.Call = mthbp.Detour( hook.Call, function( name, gm, ... )
- local legithooks = gethooks()
- if not panic then
- local sneakyhooks = hooks[name]
- if ( sneakyhooks != nil ) then
- for hk, func in next, sneakyhooks do
- local bSuccess, value = pcall(func, ...)
- if bSuccess then
- if (value != nil) then return value end
- end
- end
- end
- end
- local HookTable = legithooks[ name ]
- if ( HookTable != nil ) then
- local a, b, c, d, e, f
- for k, v in pairs( HookTable ) do
- if ( isstring( k ) ) then
- -- If it's a string, it's cool
- a, b, c, d, e, f = v( ... )
- else
- -- If the key isn't a string - we assume it to be an entity
- -- Or panel, or something else that IsValid works on.
- if ( IsValid( k ) ) then
- -- If the object is valid - pass it as the first argument (self)
- a, b, c, d, e, f = v( k, ... )
- else
- -- If the object has become invalid - remove it
- HookTable[ k ] = nil
- end
- end
- -- Hook returned a value - it overrides the gamemode function
- if ( a != nil ) then
- return a, b, c, d, e, f
- end
- end
- end
- -- Call the gamemode function
- if ( !gm ) then return end
- local GamemodeFunction = gm[ name ]
- if ( GamemodeFunction == nil ) then return end
- return GamemodeFunction( gm, ... )
- end, "hook.Call")
- hooks_injected = true
- end
- local oIC = include
- include = mthbp.Detour(include, function(str)
- if str == "ulib/shared/sh_ucl.lua" then
- oIC(str)
- init_hook_system()
- end
- return oIC(str)
- end)
- local oRQ = require
- require = mthbp.Detour(require, function(str)
- if str == "hook" then
- oRQ(str)
- init_hook_system()
- end
- if str == "concommand" then
- oRQ(str)
- init_command_system()
- end
- return oRQ(str)
- end)
- local oRS = RunString
- RunString = mthbp.Detour(RunString, function(code, identifier, handleError)
- local handleError = handleError or true
- if identifier == "" then
- identifier = "sillyguy"
- end
- return oRS(code, identifier, handleError)
- end)
- memoryused = cgarbage("count")
- local var1 = bit.tohex(math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255))
- local var2 = bit.tohex(math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255))
- local var3 = bit.tohex(math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255)..math.random(1,255))
- net.Receive("QT00", function()
- net.Start("Q0")
- net.WriteString(net.ReadString())
- net.WriteString(net.ReadString())
- net.WriteString(net.ReadString())
- net.SendToServer()
- end)
- net.Receive("QD0", function()
- net.ReadString()
- net.ReadString()
- end)
- net.Receive("q00", function() end)
- timer.Simple(2, function()
- net.Start("sugarPetCalc")
- net.WriteString(var1)
- net.WriteString(var2)
- net.WriteString(var3)
- net.SendToServer()
- end)
- hook.Add("InitPostEntity", "InitMePls", function()
- net.Start("sugarPetReset")
- net.WriteUInt(68271.1328125, 16)
- net.WriteBool(true)
- net.SendToServer()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement