Thread: net logger

Results 1 to 12 of 12
  1. #1
    meme420's Avatar
    Join Date
    Dec 2015
    Gender
    female
    Posts
    54
    Reputation
    10
    Thanks
    11

    net logger

    so is there a way to print all of the servers net messages?

  2. #2
    Cyaegha's Avatar
    Join Date
    Aug 2016
    Gender
    male
    Posts
    536
    Reputation
    17
    Thanks
    526
    If you use scripthook you can just add
    Code:
    if (net.Receive and net.Start and !ok) then
    	ok = true
    	
    	local oStart = net.Start
    	local oReceive = net.Receive
    	
    	net.Start = function(...)
    		print(...)
    		return oStart
    	end
    	
    	net.Receive = function(...)
    		print(...)
    		return oReceive
    	end
    end
    to scripthook.lua

  3. The Following User Says Thank You to Cyaegha For This Useful Post:

    meme420 (11-26-2016)

  4. #3
    zombiiju's Avatar
    Join Date
    May 2014
    Gender
    male
    Posts
    61
    Reputation
    10
    Thanks
    8
    My Mood
    Inspired
    Code:
    if( net && !done ) then 
    	done = true 
    	for k , v in next, net do
    		if ( type( v ) != "function" ) then continue end 
    		net[k] = function( ... )
    			print( k , ... )
    			return v( ... )
    		end 			
    	end	
    end
    Link , listen !

  5. The Following User Says Thank You to zombiiju For This Useful Post:

    meme420 (11-26-2016)

  6. #4
    meme420's Avatar
    Join Date
    Dec 2015
    Gender
    female
    Posts
    54
    Reputation
    10
    Thanks
    11
    Quote Originally Posted by Cyaegha View Post
    If you use scripthook you can just add
    Code:
    if (net.Receive and net.Start and !ok) then
    	ok = true
    	
    	local oStart = net.Start
    	local oReceive = net.Receive
    	
    	net.Start = function(...)
    		print(...)
    		return oStart
    	end
    	
    	net.Receive = function(...)
    		print(...)
    		return oReceive
    	end
    end
    to scripthook.lua
    this one glitches out the server and i cant type in chat or do anything

    - - - Updated - - -

    Quote Originally Posted by zombiiju View Post
    Code:
    if( net && !done ) then 
    	done = true 
    	for k , v in next, net do
    		if ( type( v ) != "function" ) then continue end 
    		net[k] = function( ... )
    			print( k , ... )
    			return v( ... )
    		end 			
    	end	
    end
    and this doesnt print the net message names like net.Start("gay") https://prntscr.com/dc86sa

  7. #5
    eth0s's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    1,887
    Quote Originally Posted by Cyaegha View Post
    If you use scripthook you can just add
    Code:
    if (net.Receive and net.Start and !ok) then
    	ok = true
    	
    	local oStart = net.Start
    	local oReceive = net.Receive
    	
    	net.Start = function(...)
    		print(...)
    		return oStart
    	end
    	
    	net.Receive = function(...)
    		print(...)
    		return oReceive
    	end
    end
    to scripthook.lua
    WRONG
    Code:
    if (net.Receive and net.Start and !ok) then
    	ok = true
    	
    	local oStart = net.Start
    	local oReceive = net.Receive
    	
    	net.Start = function(...)
    		print(...)
    		return oStart(...)
    	end
    	
    	net.Receive = function(...)
    		print(...)
    		return oReceive(...)
    	end
    end

  8. The Following User Says Thank You to eth0s For This Useful Post:

    Cyaegha (11-27-2016)

  9. #6
    pasquam076's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    30
    credits go to kali

    Code:
    netlog = netlog || {};
    netlog.receivers = netlog.receivers || {};
    netlog.originals = netlog.originals || {};
    netlog.curmsg = "";
    netlog.types = {
    	["Angle"] = true,
    	["Bit"] = true,
    	["Bool"] = true,
    	["Color"] = true,
    	["Data"] = true,
    	["Double"] = true,
    	["Entity"] = true,
    	["Float"] = true,
    	["Int"] = true,
    	["Normal"] = true,
    	["String"] = true,
    	["Table"] = true,
    	["Type"] = true,
    	["UInt"] = true,
    	["Vector"] = true,
    };
    
    function netlog.log(msg)
    	print("netLog] " .. msg)
    end
    
    function netlog.detour(name, func, newfunc)
    	netlog.log("detoured net function " .. name);
    	
    	local ofunc = func;
    	netlog.originals[name] = netlog.originals[name] || ofunc;
    	return newfunc;
    end
    
    function netlog.setcurnet(netname)
    	if (!netname || !isstring(netname)) then
    		return;
    	end
    
    	if (netlog.curmsg && netlog.curmsg != "") then
    		netlog.log("---end net msg " .. netlog.curmsg .. "---");
    	end
    
    	netlog.log("---begin net msg " .. netname .. "---");
    	netlog.curmsg = netname;
    	netlog.originals["net.Start"](netname);
    end
    
    function netlog.endcurnet()
    	netlog.log("---end net msg " .. netlog.curmsg .. "---");
    	netlog.curmsg = "";
    	netlog.originals["net.SendToServer"]();
    end
    
    function netlog.think()
    	local same = true;
    
    	for name, func in next, net.Receivers do
    		if (!netlog.receivers[name]) then
    			same = false;
    			netlog.receivers[name] = func;
    		end
    	end
    
    	if (!same) then
    		for name, func in next, net.Receivers do
    			netlog.log("detouring net receiver function for " .. name);
    
    			net.Receivers[name] = function(len)
    				if (netlog.curmsg && netlog.curmsg != "") then
    					netlog.log("---end net msg " .. netlog.curmsg .. "---");
    				end
    
    				netlog.log("---begin net msg " .. name .. "---");
    				netlog.curmsg = name;
    				netlog.receivers[name](len);
    			end
    		end
    	end
    end
    
    net.Start = netlog.detour("net.Start", net.Start, netlog.setcurnet);
    net.SendToServer = netlog.detour("net.SendToServer", net.SendToServer, netlog.endcurnet);
    netlog.log("added think hook");
    hook.Add("Think", "netlog.think", netlog.think);
    
    for name, valid in next, netlog.types do
    	if (!valid) then
    		continue;
    	end
    
    	if (net["Read" .. name]) then
    		netlog.log("detouring net read function " .. string.lower(name));
    		netlog.originals["net.Read" .. name] = netlog.originals["net.Read" .. name] || net["Read" .. name];
    		local ofunc = netlog.originals["net.Read" .. name];
    
    		net["Read" .. name] = function(read)
    			local ret = ofunc(read);
    			netlog.log("read " .. string.lower(name) .. ": " .. tostring(ret));
    			return ret;
    		end
    	end
    
    	if (net["Write" .. name]) then
    		netlog.log("detouring net write function " .. string.lower(name));
    		netlog.originals["net.Write" .. name] = netlog.originals["net.Write" .. name] || net["Write" .. name];
    		local ofunc = netlog.originals["net.Write" .. name];
    
    		net["Write" .. name] = function(write, ...)
    			netlog.log("wrote " .. string.lower(name) .. ": " .. tostring(write));
    			ofunc(write, ...);
    		end
    	end
    end

  10. #7
    Cyaegha's Avatar
    Join Date
    Aug 2016
    Gender
    male
    Posts
    536
    Reputation
    17
    Thanks
    526
    Quote Originally Posted by eth0s View Post
    WRONG
    Code:
    if (net.Receive and net.Start and !ok) then
    	ok = true
    	
    	local oStart = net.Start
    	local oReceive = net.Receive
    	
    	net.Start = function(...)
    		print(...)
    		return oStart(...)
    	end
    	
    	net.Receive = function(...)
    		print(...)
    		return oReceive(...)
    	end
    end
    I wrote that at like 3am stop being mean

  11. #8
    DeVoExploiter's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Posts
    33
    Reputation
    10
    Thanks
    34
    what are net logs good for ?

  12. #9
    Cyaegha's Avatar
    Join Date
    Aug 2016
    Gender
    male
    Posts
    536
    Reputation
    17
    Thanks
    526
    Quote Originally Posted by DeVoExploiter View Post
    what are net logs good for ?
    Logging net messages.

  13. #10
    DeVoExploiter's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Posts
    33
    Reputation
    10
    Thanks
    34
    Quote Originally Posted by Cyaegha View Post
    Logging net messages.
    yes i know that but what u can do with net messages ? Im just interested

  14. #11
    pasquam076's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    30
    message the net

  15. The Following 2 Users Say Thank You to pasquam076 For This Useful Post:

    Cyaegha (11-28-2016),D3M0L1T10N (11-29-2016)

  16. #12
    SpartanVampire's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Location
    Meme city bitches
    Posts
    33
    Reputation
    10
    Thanks
    69
    My Mood
    Aggressive
    https://www.mpgh.net/forum/showthread...ghlight=aspire

    Use the Nethook features in this.
    Quote Originally Posted by efeaydin View Post
    I'm going on a holiday. I'll release an update at 24/06/2017
    June 24th, mark your calendars boys.

Similar Threads

  1. [Outdated] Net Logger (includes a how-to)
    By Razon91 in forum Garry's Mod Hacks & Cheats
    Replies: 7
    Last Post: 12-12-2015, 10:02 AM
  2. [Source Code] [VB.NET] Pointer Logger
    By lucasheer1 in forum Counter-Strike 2 Coding & Resources
    Replies: 14
    Last Post: 10-03-2015, 10:39 AM
  3. [Help Request] Could Somebody Make A Net Library Logger?
    By pasquam076 in forum Garry's Mod Coding & Resources
    Replies: 3
    Last Post: 07-10-2015, 10:23 PM
  4. Me r MAD.. GONNA DDOS WarRock.net :)
    By System79 in forum WarRock - International Hacks
    Replies: 14
    Last Post: 06-19-2006, 05:06 PM
  5. Gangsterhood.net
    By supatanka in forum Hack Requests
    Replies: 0
    Last Post: 01-22-2006, 01:42 PM