local version_spoof = ui.new_checkbox("MISC", "Settings", "Spoof latest client")
local ffi = require("ffi")
local http = require("gamesense/http")
local panorama_events = require("gamesense/panorama_events")
local version = ffi.cast("uint32_t**",ffi.cast("char*",client.find_signature("engine.dll","\xFF\x35\xcc\xcc\xcc\xcc\x8D\x4C\x24\x10"))+2)[0][0]
local function update()
if not ui.get(version_spoof) then return end
http.get("https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?appid=730&version=" .. version, function(success, response)
if not success or response.status ~= 200 then
return
end
local data = json.parse(response.body)
if data.response.required_version ~= nil then
ffi.cast("uint32_t**",ffi.cast("char*",client.find_signature("engine.dll","\xFF\x35\xcc\xcc\xcc\xcc\x8D\x4C\x24\x10"))+2)[0][0]=data.response.required_version
end
end)
end
ui.set_callback(version_spoof, update)
client.set_event_callback("console_input", function(i) if i == "disconnect" then update() end end)
client.set_event_callback('cs_win_panel_match', update)
panorama_events.register_event('CSGOShowMainMenu', update)