I’m trying to create an anti cheat using hooks and debug.getinfo.
Right now, with normal hooks, it the debug info returns fine, but when I tested it with cheats that have their own way of creating hooks without debug info, it errors out to this:
[ERROR] addons/anticheat/lua/autorun/client/cl_anticheat.lua:155: attempt to index field 'info' (a nil value) 1. Hook - addons/anticheat/lua/autorun/client/cl_anticheat.lua:155 2. func - addons/anticheat/lua/autorun/client/cl_anticheat.lua:338 3. unknown - lua/includes/extensions/net.lua:32
I tried making it so if info is nil, it just makes it say N/A and continues to list other hooks, but my issue is when it does that, it replaces every hook’s info, not just the one hook’s.
Here is the code that I tried:
if (v.info != nil) then dview:AddLine(v.name, v.bhook, v.info.short_src, v.info.source, v.info.func, v.info.namewhat, v.info.what, v.info.linedefined, v.info.nparams) else dview:AddLine(v.name, v.bhook, "N/A") end
Is there something im doing incorrect? If so, please explain how I should fix it.
Sorry if im posting too many of these threads, it just seems that my other one’s don’t get attention even after I bump them.