print("[GABV9K] Adding ExecuteCmdString hook")
ecs_ptr = GABV9K_MENU.MODULE.SigScan({
    ['dll'] = "engine.dll",
    ['dfn'] = "CreateInterface", --Function exported from the dll
    ['sig'] = GABV9K_MENU.tosig("?\x8B\x6C\x24?\x8B??\x85?\x75??\xC3\x85??\xBE"),
    ['len'] = 18,
})
if (ecs_ptr ~= nil) then GABV9K_MENU.MODULE.HookExecuteCmdString(ecs_ptr)
else print("[GABV9K] Failed to hook ExecuteCmdString") end

--[[ GABV9K ConCommand Firewall ]]--
GABV9K_MENU.CmdFirewall = {}
GABV9K_MENU.CmdFirewall.Enabled = false
GABV9K_MENU.CmdFirewall.BlockedCmds = { --Checked before whitelist
    --cvars
    "mat_fullbright", "mat_drawwater", "mat_fastno",
    "mat_wireframe", "r_drawropes", "r_drawrain",
    "r_drawdecals", "r_drawtranslucentrenderables",
    "r_farz", "r_drawskybox", "fog_enable_water_fog",
    "cl_phys_timescale", "host_timescale",
    "net_fakelag", "net_fakeloss", "net_fakejitter",
    --general AntiCheat
    "say I'm ", "say_team I'm ", "team_say I'm ",
    "lua_run_cl",
    --Blade AntiCheat
    "say [BLADE] ", "say_team [BLADE] ", "team_say [BLADE] ",
    "blade_client_check",
    "blade_client_message",
    "blade_client_detected_message",
    --Flapdar AntiCheat
    "_zs_class", "_zs_setclass", "_zs_spread",
    "_cmd", "_ac_log", "_ac_devpass",
}
GABV9K_MENU.CmdFirewall.Hook = function(cmd)
    if (string.sub(cmd, 0, 25) == "GABV9K_CMDFIREWALL") then
        GABV9K_MENU.CmdFirewall.Enabled = not GABV9K_MENU.CmdFirewall.Enabled
        print("[GABV9K] [CmdFirewall] " ..
            (GABV9K_MENU.CmdFirewall.Enabled and "Enabled" or "Disabled"))
        return false
    end
    if (GABV9K_MENU.CmdFirewall.Enabled) then
        for _,v in pairs(GABV9K_MENU.CmdFirewall.BlockedCmds) do
            if (string.sub(cmd, 0, string.len(v)) == v) then
                print("[GABV9K] [CmdFirewall] Blocked command '"..cmd.."'")
                return false
            end
        end
    end
end
GABV9K_MENU.AddHook("ExecuteCmdString", "CmdFirewall", GABV9K_MENU.CmdFirewall.Check)