QAC and vcmod

I’m trying to learn how the old QAC anti cheat worked. I installed it on my server but doesn’t seem compatible with vcmod.


---Scan Functions
function qac.SCAN_G()
	for _, ft in qac.pairs(qac.scanf) do
		local ofunc = ft[1][ft[2]]

		ft[1][ft[2]] = (
			function(...)
				local args = {...}
				//ofunc(qac.unpack(args))
				qac.scan_func()
			end
		)
	end
end

Full source: https://github.com/zerothefallen/Quack-Anti-Cheat/blob/master/lua/autorun/client/!!_cl_qac.lua

The line “ofunc(qac.unpack(args))” seems to cause an error with vcmod on client. I’m trying to understand what this function does and how I can stop it messing with vcmod loading.
Its my understanding that it’s going through every table in _G copied into qac.scanf and copying them into the 2d array ft? and then unpacking them from ft. I think this is correct? I could be wrong i’d appreciate if someone could explain how this function works and how I can prevent vcmod error.(I will copy the vcmod error when I restart server)

I have tried setting if string.find(args[1], “vcmod”) then don’t unpack but the error continues

The function detours all of the functions that are located in qac.scanf so when that function is then called, it runs qac.scan_func and checks if the source of where that was just called is naughty or not. This will also run the original function which is ofunc. Thich prevents other addons from breaking (for the most part)

If you had the error, it would be possible to tell which function is causing the error

Well, VCMod uses RunString to run it’s files and it gives them a source like: lua/vcmod/whatever. This doesn’t exist serverside (or clientside), as it’s (probably) verified on the server so the player gets kicked or banned.

I thought possibly adding initcl to the sources would maybe prevent it but it still occured. So the error that happens is:



[ERROR] vcmod/shared/init_shared_after.lua:2: bad argument #1 to 'JSONToTable' (string expected, got no value)
  1. JSONToTable - [C]:-1
   2. LoadSettings - vcmod/shared/init_shared_after.lua:2
    3. unknown - vcmod/shared/init_shared_after.lua:2
     4. ofunc - [C]:-1
      5. unknown - addons/qactest/lua/autorun/client/!!_cl_qac.lua:107
       6. Include - initcl:2
        7. unknown - initcl:2
         8. ofunc - [C]:-1
          9. unknown - addons/qactest/lua/autorun/client/!!_cl_qac.lua:107
           10. func - addons/vcmod_els_autoupdate/lua/vcmod/client/vc_load.lua:24
            11. unknown - lua/includes/extensions/net.lua:32
 
 
Second error after:
 
[ERROR] vcmod/client/menu.lua:2: bad argument #1 to 'JSONToTable' (string expected, got no value)
  1. JSONToTable - [C]:-1
   2. unknown - vcmod/client/menu.lua:2

Timer Failed! [Simple][@addons/qactest/lua/autorun/client/!!_cl_qac.lua (line 107)]



I was able to resolve the issue for the server side banning of it but now this is the only issue