Hook check system issue

So I recently made a system to check a client’s hooks, for anti cheat purposes, but I’m having a few issues with it.

First off, this file keeps appearing in the check, even though there are no hooks for it. Here is the debug info for it:



Hook Name: Entity [116][gmod_hands]
Source: @gamemodes/base/entities/entities/gmod_hands.lua
Function: Not Available
Function Name: Not Available
Type: Lua
Line Defined: 50
Number of Arguements: 4


(it only appears after a player has spawned)

and everytime a player dies, one of these hooks are added to the list:



Hook Name: [NULL Entity]
Source: @gamemodes/base/entities/entities/gmod_hands.lua
Function: Not Available
Function Name: Not Available
Type: Lua
Line Defined: 50
Number of Arguements: 4


My system has a list of whitelisted hooks. If a hook isn’t on the whitelist, if puts it in the dview.

The second issue, it that the window duplicates.

Here is the code for the window:



local function ShowHook(ply, hooks, called)
	local frame = vgui.Create("DFrame");
	frame:SetSize(350, 400);
	frame:Center();
	frame:SetTitle("Showing unknown hooks for "..called:Nick().."..");
	frame:MakePopup();
	
	local dview = vgui.Create("DListView", frame);
	dview:DockMargin(10, 0, 10, 24)
	dview:Dock(FILL);
	dview:SetMultiSelect(false);
	
	dview:AddColumn("Hook Name");
	dview:AddColumn("File Location");

	for k, v in pairs(hooks) do
		dview:AddLine(v.name, "@"..v.info.short_src, v.info.source, v.info.func, v.info.namewhat, v.info.what, v.info.linedefined, v.info.nparams)
	end
	
	local info = vgui.Create("DButton", frame)
	info:AlignLeft(15)
	info:AlignBottom(2)
	info:SetText("View Full Info")
	info:SetSize( 85, 20 )
	info.DoClick = function()
		<unneeded code>
	end		
	info.Think = function()
		if (dview:GetSelectedLine())
		then
			info:SetDisabled(false);
		else
			info:SetDisabled(true);
		end
	end
	info:SetDisabled(true);
end

net.Receive("hook_gh", function()
	local ply = net.ReadEntity();
	local hooks = glon.decode(net.ReadString());
	local called = net.ReadEntity()
	ShowHook(ply, hooks, called);
end)


Thanks.

Anyone have any idea?

It’s the same hook both times: https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/entities/entities/gmod_hands.lua#L10.

When using an entity as a hook ID, it’ll be called with that entity as the first parameter until that entity is removed.

So how would I block it from showing up?

Would I just make the entity name the whitelisted hook?

bump