--exechack.cc/lua 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 local buffer = "" local function construct_net_block(t, netName) makeString = "net." ..netName .. "(" for i=1, #t do indexValue = t[i] if (type(indexValue) == "number") then if (i == #t) then makeString = makeString .. indexValue else makeString = makeString .. indexValue .. ", " end elseif (type(indexValue) == "boolean") then makeString = makeString .. tostring(indexValue) elseif (type(indexValue) == "string") then if (i == #t) then makeString = makeString .. "\"" .. indexValue .. "\"" else makeString = makeString .. "\"" .. indexValue .. "\", " end elseif (type(indexValue) == "Player" || type(indexValue) == "Entity" || type(indexValue) == "NPC") then makeString = makeString .. "Entity(" .. tostring(indexValue:EntIndex()) .. ")" elseif (type(indexValue) == "Vector") then makeString = makeString .. "Vector(" .. string.gsub(tostring(indexValue), "%s+", ", ") .. ")" elseif (type(indexValue) == "table") then print("INDEXVALUE IS TABLE") print("indevalue", table.ToString(indexValue)) makeString = makeString .. table.ToString(indexValue) else ErrorNoHalt("[netlogthing] !!! UNHANDLED !!! " .. "type(index): " .. "[" .. type(indexValue) .. "]" .. " index: " .. "[" .. tostring(indexValue) .. "]") end end buffer = buffer .. makeString .. ")" .. "\n" if (string.match(buffer, "SendToServer")) then hook.Run( "RecvNetMsg", buffer ) buffer = "" end end -- net request sent -- net requests go through our 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 function detour_net_functions(bool) -- WriteTable calls a bunch of other net functions internally, so got to turn it off if (bool) then for k, v in pairs(netCodes) do net[k] = handle_net_message(k) end else for k, v in pairs(netCodes) do net[k] = v 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, } ) function mysplit(inputstr, sep) if sep == nil then sep = "%s" end local t={} ; i=1 for str in string.gmatch(inputstr, "([^"..sep.."]+)") do t[i] = str i = i + 1 end return t end 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 local closeBtn = vgui.Create( "Button", self) closeBtn:SetSize( 14,14 ) closeBtn:SetPos(5,6) closeBtn:SetVisible( true ) closeBtn:SetText( "" ) closeBtn.Paint = function(self,w,h) draw.RoundedBox(5, 0, 0, w, h, Color(225,81,32, 255)) -- surface.DrawCircle( 100, 100, 50, Color(255,255,255,255) ) draw.DrawText( "x", "customFont2", w/2, -1, Color( 255,255,255, 255 ), TEXT_ALIGN_CENTER ) end print("outer_self", outer_self) function closeBtn:OnMousePressed() outer_self:SetVisible(false) outer_self:Remove() 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 } vgui.Register("netmessagebox", net_message_box, "DFrame") -- net_message_box = vgui.Create("netmessagebox") -- net_message_box:setTextAndCount("net.Start('test')\nnet.SendToServer()") 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() local addressBar = vgui.Create( "DTextEntry", self ) -- create the form as a child of frame addressBar:SetPos( 60, 2 ) addressBar:SetSize( 400, 25 ) addressBar:SetText("http://wiki.garrysmod.com/page/Main_Page") addressBar.OnEnter = function( self1 ) self.gmodwiki:OpenURL( self1:GetValue() ) -- print the form's text as server text end local backBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame backBtn:SetPos( 5, 2 ) backBtn:SetSize( 25, 25 ) backBtn:SetText("<") backBtn:SetTextColor(Color(255,255,255)) backBtn.DoClick = function() self.gmodwiki:RunJavascript([[window.history.go(-1)]]) end backBtn.Paint = function(self, w, h) draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49)) end local forwardBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame forwardBtn:SetPos( 35, 2 ) forwardBtn:SetSize( 25, 25 ) forwardBtn:SetText(">") forwardBtn:SetTextColor(Color(255,255,255)) forwardBtn.DoClick = function() self.gmodwiki:RunJavascript([[window.history.go(1)]]) end forwardBtn.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 local zoomInBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame zoomInBtn:SetPos( 465, 2 ) zoomInBtn:SetSize( 45, 25 ) zoomInBtn:SetText("Zoom in") zoomInBtn:SetTextColor(Color(255,255,255)) zoomInBtn.DoClick = function() self.gmodwiki.zoom = self.gmodwiki.zoom + 10 self.gmodwiki:RunJavascript("document.body.style.zoom = \"" .. tostring(self.gmodwiki.zoom) .. "%\";") end zoomInBtn.Paint = function(self, w, h) draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49)) end local zoomOutBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame zoomOutBtn:SetPos( 515, 2 ) zoomOutBtn:SetSize( 45, 25 ) zoomOutBtn:SetText("Zoom out") zoomOutBtn:SetTextColor(Color(255,255,255)) zoomOutBtn.DoClick = function() self.gmodwiki.zoom = self.gmodwiki.zoom - 10 self.gmodwiki:RunJavascript("document.body.style.zoom = \"" .. tostring(self.gmodwiki.zoom) .. "%\";") end zoomOutBtn.Paint = function(self, w, h) draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49)) end -- local closeBtn = vgui.Create( "DButton", self ) -- closeBtn:SetText( "X" ) -- closeBtn:SetPos( 575, 5 ) -- closeBtn:SetSize( 20, 20 ) -- closeBtn:SetTextColor(Color(255,255,255)) -- closeBtn.DoClick = function() -- self.gmodwiki:RunJavascript([[document.getElementsByTagName("body")[0].style.zoom = "200%"]]) -- timer.Simple(5, function() -- self:Close() -- end) -- end -- closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end self.Paint = function(self, w,h) draw.RoundedBox(0, 0, 0, w, h, Color(47, 48, 42, 255)) end self.Think = function(self) end end, } vgui.Register("browser", browser, "DFrame") -- vgui.Create("browser") local infoPopup = { setInfoText = function(self, tab_name) -- print(self.infopopupTexts[tab_name].header) self.header:SetText(self.infopopupTexts[tab_name].header) self.infoText:SetText(self.infopopupTexts[tab_name].infoText) end, Init = function(self) self.infopopupTexts = { -- Tab = {header = "", infoText = ""}, 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"}, }, self:SetTitle("") self:SetSize(350, 350) self:Center() self:MakePopup() self:ShowCloseButton(false) local closeBtn = vgui.Create( "DButton", self ) closeBtn:SetText( "X" ) closeBtn:SetPos( 325, 5 ) closeBtn:SetSize( 20, 20 ) closeBtn:SetTextColor(Color(255,255,255)) closeBtn.DoClick = function() self:Close() end closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end self.header = vgui.Create("DLabel", self) self.header:SetFont("headerFont1") self.header:SetSize(150, 35) -- self.header:SetText("Exploits tab") self.header:Center() self.header.posX, self.header.posY = self.header:GetPos() self.header:SetPos(self.header.posX, 15) self.infoText = vgui.Create("DLabel", self) self.infoText:SetFont("infoFont") self.infoText:SetSize(320, 200) self.infoText:SetPos(30, 10) -- self.infoText:SetText("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") self.infoText:SetWrap(true) self.footerText = vgui.Create("DLabel", self) self.footerText:SetFont("infoFont") self.footerText:SetSize(100, 20) self.footerText:Center() self.footerText.posX, self.footerText.posY = self.footerText:GetPos() self.footerText:SetPos(self.footerText.posX, 320) self.footerText:SetText("Net logger by Rompish") self.footerText:SetWrap(true) 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, } vgui.Register("infoPopup", infoPopup, "DFrame") 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, } ) -- if (string.len(file.Read( "exploits.txt", "DATA" )) < 5) then -- default = {serversWithExploits = {}, exploits = {}, loggedServers = {}} -- file.Write( "exploits.txt", util.TableToJSON(default) ) -- end 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) local countLabel = vgui.Create( "DLabel", Category ) countLabel:SetFont("customFont2") countLabel:SetColor(Color(255,255,255)) countLabel:SetPos( 280, 0 ) countLabel:SetSize(200,16) countLabel:SetText("COUNT: 1") net_message_box = vgui.Create("netmessagebox") net_message_box:Dock( TOP ) net_message_box:setTextAndCount(netmsg, 1) DScrollPanel = vgui.Create( "DScrollPanel") Category:SetContents(DScrollPanel) DScrollPanel:Add(net_message_box) DScrollPanel:Dock( FILL ) -- 51.38.95.230:27015 net_message_table[name] = {panel = Category, count = 1, countLabel = countLabel, DScrollPanel = DScrollPanel} Category.Paint = function (s,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(70,69,65)) end else count = net_message_table[name].count + 1 countLabel = net_message_table[name]["countLabel"] panel = net_message_table[name]["panel"] DScrollPanel = net_message_table[name]["DScrollPanel"] net_message_table[name] = { panel = panel, count = count, countLabel = countLabel, DScrollPanel = DScrollPanel} 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, DrawRainbowRectOutline = function(self, frequency, x, y, w, h ) for i = x, x + w - 1 do surface.SetDrawColor( HSVToColor( i * frequency % 360, 1, 1 ) ) surface.DrawLine( i, y, i + 1, y ) surface.DrawLine( i, y + h - 1, i + 1, y + h ) end for i = y, y + h - 1 do surface.SetDrawColor( HSVToColor( i * frequency % 360, 1, 1 ) ) surface.DrawLine( x, i, x, i + 1 ) surface.DrawLine( x + w - 1, i, x + w, i + 1 ) 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 self.W, self.H = self:GetSize() outside_self = self self:SetSize(400, 400) self:SetTitle("Net logger by Rompish") self:Center() self:SetVisible( true ) self:SetDeleteOnClose(false) self:SetDraggable(true) self.W, self.H = self:GetSize() self:ShowCloseButton(false) self.currentTab = "NetLoggerTab" local closeBtn = vgui.Create( "DButton", self ) closeBtn:SetText( "X" ) closeBtn:SetPos( self.W * 0.93, 5 ) closeBtn:SetSize( 20, 20 ) closeBtn:SetTextColor(Color(255,255,255)) closeBtn.DoClick = function() self:Close() end closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end local infoBtn = vgui.Create( "DButton", self ) infoBtn:SetText( "?" ) infoBtn:SetFont("questionMarkFont") infoBtn:SetPos( self.W * 0.87, 5 ) infoBtn:SetSize( 20, 20 ) infoBtn:SetTextColor(Color(255,255,255)) infoBtn.DoClick = function() infoPopup = vgui.Create("infoPopup") infoPopup:setInfoText(self.currentTab) end infoBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(37, 37, 170)) end sheet = vgui.Create( "DPropertySheet", self ) sheet:SetPos(1, 20) sheet:SetSize(397, 376) self.NetLoggerPanel = vgui.Create( "DPanel", sheet ) self.NetLoggerPanel:Dock(FILL) NetLoggerTab = sheet:AddSheet( "Net Logger", self.NetLoggerPanel, "icon16/page_white_edit.png" ) self.NetLoggerPanel.Paint = function(s,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34)) end self.CategoryList = vgui.Create( "DCategoryList", self.NetLoggerPanel ) self.CategoryList.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34)) end self.CategoryList:Dock( FILL ) -- adding stuff to net_logger c = 0 hook.Add( "RecvNetMsg", "netlogger2", function( netmsg ) c = c + 1 self:addToCatergory(netmsg, c) end ) -- creating the panels -- luaViewer = vgui.Create("luaviewer", luaViewerPanel) --main_menu = vgui.Create("main_menu", exploitsPanel) local browser = vgui.Create("browser", self) browser:SetPos(600,40) browser:SetVisible(false) -- Detouring and resizeing the panels when you click on them DoClickNetLoggerTab = NetLoggerTab.Tab.DoClick NetLoggerTab.Tab.DoClick = function (...) outside_self:SizeTo(400, 400, 0.2, 0, 4) sheet:SetSize(397, 376) timer.Create( "Center3", 0.1, 5, function() outside_self:Center() infoBtn:SetPos( self.W * 0.87, 2 ) closeBtn:SetPos(self.W * 0.93, 2) end ) self.currentTab = "NetLoggerTab" DoClickNetLoggerTab(...) end self.Think = function() self.W, self.H = self:GetSize() -- print(self.W) end end vgui.Register("frame_handler", PANEL, "DFrame") exploit_menu = vgui.Create("frame_handler") exploit_menu:MakePopup() -- concommand.Add("_dbg", function() -- net.Start("test_message") -- net.SendToServer() -- end) local homeKeyPressed = false concommand.Add("gentox_netlogger", function() if (!exploit_menu) then exploit_menu = vgui.Create("frame_handler") end exploit_menu.isFrameOpen = not exploit_menu.isFrameOpen gui.EnableScreenClicker(exploit_menu.isFrameOpen) exploit_menu:IsOpen(exploit_menu.isFrameOpen) exploit_menu:MakePopup() exploit_menu:SetVisible(exploit_menu.isFrameOpen) print("NetLogger menu is now " .. (exploit_menu.isFrameOpen and "open" or "closed")) end) hook.Add("Think", "CheckHomeKeyForNetLogger", function() if input.IsKeyDown(KEY_HOME) then if not homeKeyPressed then RunConsoleCommand("gentox_netlogger") homeKeyPressed = true end else homeKeyPressed = false end end) print("Press HOME key to toggle the NetLogger menu")