Gmod Net Logger
Gmod Net Logger
com/id/Pastebin/
-- https://www.mpgh.net/forum/showthread.php?t=1432417
netCodes = netCodes or {
["SendToServer"] = net.SendToServer,
["Start"] = net.Start,
["WriteAngle"] = net.WriteAngle,
["WriteBit"] = net.WriteBit,
["WriteBool"] = net.WriteBool,
["WriteColor"] = net.WriteColor,
["WriteData"] = net.WriteData,
["WriteDouble"] = net.WriteDouble,
["WriteEntity"] = net.WriteEntity,
["WriteFloat"] = net.WriteFloat,
["WriteInt"] = net.WriteInt,
["WriteMatrix"] = net.WriteMatrix,
["WriteNormal"] = net.WriteNormal,
["WriteString"] = net.WriteString,
["WriteTable"] = net.WriteTable,
["WriteUInt"] = net.WriteUInt,
["WriteVector"] = net.WriteVector
}
function tableToString(t)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
function handle_net_message(netName)
return function (...) -- just doing this so I can give access to netName in
construct_net_block function
construct_net_block({...}, netName)
hook.Add( "RecvNetMsg", "netlogger", function(netmsg)
detour_net_functions(false)
RunString(netmsg)
detour_net_functions(true)
end)
-- netCodes[netName](...)
end
end
end
if (!detoured_net_functions) then
detoured_net_functions = true
detour_net_functions(true)
else
print("\n\n\nAlready detoured net functions\n\n\n")
end
surface.CreateFont( "customFont2", {
font = "Verdana", -- Use the font-name which is shown to you by your
operating system Font Viewer, not the file name
extended = false,
size = 15,
weight = 100,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
local net_message_box = {
setTextAndCount = function(self, text, count)
newLineCount = #mysplit(text, "\n")
self:SetTitle(" #" .. tostring(count))
self.netmsgBox:SetText(text)
W, H = self.netmsgBox:GetSize()
W, H = self.netmsgBox:GetSize()
self:SetSize(W, H + 200)
self:SizeToContents()
end,
Init = function(self)
outer_self = self
self:ShowCloseButton( false )
self:SetSize(150, 400)
self.W, self.H = self:GetSize()
self.netmsgBox = vgui.Create( "DTextEntry", self)
self.netmsgBox:SetPos( 40, 50 )
self.netmsgBox:Dock(FILL)
self.netmsgBox:SetMultiline(true);
self.netmsgBox.Paint = function(self,w,h)
draw.RoundedBox(0, 0, 0, w, h, Color(48,10,36, 255))
self:DrawTextEntryText(Color(255, 255, 255), Color(30, 130, 255),
Color(255, 255, 255))
end
end,
Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(48,10,36, 255))
surface.SetDrawColor( Color( 200, 200, 200, 255 ) )
surface.DrawOutlinedRect(0,0, w-1,h-1)
surface.DrawOutlinedRect(0,0, w-1,25)
end,
Think = function(self, w, h)
if (self:IsHovered()) then
end
end
}
browser = {
Init = function(self)
self.W, self.H = self:GetSize()
self:SetSize(self.W * 15, 555)
self:ShowCloseButton(false)
self:SetDraggable(true)
self.gmodwiki = vgui.Create("DHTML", self)
self.gmodwiki:OpenURL("http://wiki.garrysmod.com/page/Main_Page")
self.gmodwiki.zoom = 100
self.gmodwiki:Dock(FILL)
self:SetTitle("")
-- self:MakePopup()
backBtn.Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
end
self.gmodwiki:RunJavascript([[
String.prototype.startsWith = function(char){
return this[0] == char;
}
]]) -- pls update gmod's javascript engine
end
end,
}
vgui.Register("browser", browser, "DFrame")
-- vgui.Create("browser")
local infoPopup = {
Init = function(self)
self.infopopupTexts = {
-- Tab = {header = "", infoText = ""},
ExploitTab = {header = "Exploit Tab", infoText = "You can upload
your exploits locally or to the web here. This tab is also responsible for finding
every single net message name on the server you load this menu on and saves it
locally so we can tell if other servers have common exploits"},
NetLoggerTab = {header = "Net logger Tab", infoText = "Logs all
the net messages that come through. Useful for things that you can easily interact
with that sends net messages i.e NPCs"},
RepeaterTab = {header = "Repeater Tab", infoText = "Repeats the
given net messages"},
interceptorTab = {header = "Intercepter Tab", infoText = "Repeats
the given net messages"},
LuaViewerTab = {header = "Lua viewer Tab", infoText = "View all
the server's client side files here"},
LuaEditorTab = {header = "Lua editor Tab", infoText = "Simple lua
editor with a \"browser\" built in"}
},
self:SetTitle("")
self:SetSize(350, 350)
self:Center()
self:MakePopup()
self:ShowCloseButton(false)
self.Paint = function(self,w,h)
draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34))
surface.SetDrawColor(Color(255,255,255))
startX = 0
endX = 350
startY = 65
endY = 65
surface.DrawLine( startX, startY, endX, endY )
DrawRainbowRectOutline(1, 0,0, w-1,h-1, 2)
end
end,
gmodWikiFrame = {
Init = function(self)
self:SetSize(700, 600)
end,
}
local CodeEditor = {
setFill = function(self, b)
if (b) then
self:Dock(FILL)
end
end,
createButton = function(self)
end,
showButton = function(self, b)
self.shouldHaveButton = b
end,
Init = function(self)
self.shouldHaveButton = true
self:SetSize(250, 250)
-- self:SetPos(20, 30)
self.html:OpenURL("asset://garrysmod/lua/menu_plugins/luaviewer/index.html")
--thx metastruct
self.html:AddFunction("gmodinterface", "OnCode", function(code)
self.currentCode = code
end)
}
vgui.Register("CodeEditor", CodeEditor, "DPanel")
surface.CreateFont( "questionMarkFont", {
font = "Arial", -- Use the font-name which is shown to you by your operating
system Font Viewer, not the file name
extended = false,
size = 17,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
local net_message_table = {}
local PANEL = {
addToCatergory = function(self, netmsg, freq)
local name = mysplit(netmsg, "\n")[1]
if not net_message_table[name] then
local Category = self.CategoryList:Add(name)
Category:SetExpanded(false)
net_message_box = vgui.Create("netmessagebox")
net_message_box:Dock( TOP )
net_message_box:setTextAndCount(netmsg, 1)
DScrollPanel:Add(net_message_box)
DScrollPanel:Dock( FILL )
-- 51.38.95.230:27015
panel:SetLabel(name)
countLabel:SetFont("customFont2")
countLabel:SetColor(Color(255,255,255))
countLabel:SetPos( 280, 0 )
countLabel:SetText("COUNT: " .. count)
net_message_box = vgui.Create("netmessagebox")
net_message_box:setTextAndCount(netmsg, count)
net_message_box:Dock( TOP )
DScrollPanel:Add(net_message_box)
DScrollPanel:Dock( FILL )
self.i = 0
end
end,
Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(47, 48, 42, 255))
self:DrawRainbowRectOutline(1,0,0, w-1,h-1, 2)
end,
Think = function(self, w, h)
self.W, self.H = self:GetSize()
if (self.isFrameOpen) then
self.openGmodWiki:SetVisible(true)
else
self.openGmodWiki:SetVisible(false)
end
self.W, self.H = w, h
end
}
function PANEL:IsOpen(b)
self.isFrameOpen = b
end
function PANEL:Init()
self.isFrameOpen = true
outside_self = self
self:SetSize(400, 400)
self:SetTitle("Riddle's menu")
self:Center()
self:SetVisible( true )
self:SetDeleteOnClose(false)
self.W, self.H = self:GetSize()
self:ShowCloseButton(false)
self.currentTab = "ExploitTab"
self.NetLoggerPanel.Paint = function(s,w,h)
draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34))
end
-- closeBtn:SetPos(self.W * 0.95, 5)
-- luaViewerTab.Tab.DoClick = function(...)
-- outside_self:SizeTo(ScrW() * .95, ScrH() * .95, 0.2, 0, 4)
-- sheet:SetSize(ScrW() * .95, ScrH() * .95)
-- browser:SetVisible(false)
-- timer.Create( "Center1", 0.1, 5, function()
outside_self:Center() infoBtn:SetPos( self.W * 0.94, 5 ) closeBtn:SetPos(self.W *
0.97, 5) end )
-- self.currentTab = "LuaViewerTab"
-- DoClickLuaViewerTab(...)
-- end
self.currentTab = "LuaEditorTab"
DoClickluaEditorTab(...)
end
self.OnClose = function() self:IsOpen(false)
self.openGmodWiki:SetVisible(false) print("closing")
gui.EnableScreenClicker(false) end
sheet:SetSize(592, 578)
self.openGmodWiki.Paint = function(self, w, h)
-- 39 G: 40 B: 34
draw.RoundedBox(0, 0, 0, w, h, Color(69, 70, 64))
end
self.Think = function()
self.W, self.H = self:GetSize()
-- print(self.W)
end
end
exploit_menu = vgui.Create("frame_handler")
exploit_menu:MakePopup()
concommand.Add("_dbg", function()
net.Start("test_message")
net.SendToServer()
end)
concommand.Add("_menu", function ()
if (!exploit_menu) then
exploit_menu = vgui.Create("frame_handler")
end
gui.EnableScreenClicker(true)
exploit_menu:IsOpen(true)
exploit_menu:MakePopup()
exploit_menu:SetVisible( true )
end)