do local o=gg.makeRequest;if type(o)~="function"then gg.alert("环境异常","退出")os.exit()end;gg.makeRequest=nil;local m={__index=function(t,k)if k=="makeRequest"then return o end return rawget(t,k)end,__newindex=function(t,k,v)if k=="makeRequest"then return end rawset(t,k,v)end};setmetatable(gg,m) end CONFIG = { --应用 API KEY apiKey = "07c9ba2454d19b5108aa2944351a5aad", --应用 Key ID keyId = "8dbe0f76330e2b52110af60e01370a6d", --版本号判断更新使用 例如本地 1.0.0,远程更新里填 1.0.1 就会提示更新 version = "1.0.0", --V2 接口地址勿动 authUrl = "https://my.b6w.cn/api/AuthV2.php", --V2 接口地址勿动 updateUrl = "https://my.b6w.cn/api/UpdateV2.php", --应用 RSA 公钥 Base64 公钥主体形式 publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7u9Ss54QcwFHgIesnatgHpGVJXbnHnni1QyV1PnN7ea8Wz9Dsozutbim2PyxtfnzeWD4Gv7JaCdJAAiZDkxCdc6Ci9fNBzQVyfiVX+3uBl8BUhE6hPrAewUJ2IKcjJFxb2EAuttmSFBBDVRymM2qRbwkQ1uBTvSS6NpzT6+ZVfOYbJZU9qTLwo3KVO4F6rPyeKqdkstb/5NuE32CmsbMVt8/xFvZh1o0+O1ueOFFTsfqXdruRrmc3c5plKT7d3NHGecJJgGOZtVu6RO20prRE8e114rfq/7Mm2Vw/S7kA7PZv798nRk9URq0v0+iNoBdvkT4Mf3SktE8qXTu2pRjewIDAQAB", --如果是0会弹这两个选项如果是 1,就会执行远程脚本也就是更新链接里面的远程链接如果填 2那么就会自动复制下载链接,需要自行打开浏览器下载新版本 updateMethod = 0,-- 0=弹选项 1=远程脚本 2=浏览器复制下载链接 --购卡地址,也就是卡网链接--不填就是自动显示未配置购卡链接 buyUrl = "", --算法地址 moduleUrl = "https://my.b6w.cn/mk/miyanPro.lua" } local __M_LUA_MODULE_SHA256__="653d3098ef218a11f9d512e74d1139baa4ac9072c9a7221116c6ab8c0e68a2d5"local __M_LUA_SHA256_K__={0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2}local function __M_LUA_SHA256__(payload)local band,bor,bxor,bnot,rshift,rrotate=bit32.band,bit32.bor,bit32.bxor,bit32.bnot,bit32.rshift,bit32.rrotate;local b={}for i=1,#payload do b[i]=payload:byte(i)end;local bits=#b*8;b[#b+1]=128;while#b%64~=56 do b[#b+1]=0 end;local hi,lo=math.floor(bits/4294967296),bits%4294967296;for s=24,0,-8 do b[#b+1]=math.floor(hi/2^s)%256 end;for s=24,0,-8 do b[#b+1]=math.floor(lo/2^s)%256 end;local h={0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19}for o=1,#b,64 do local w={}for i=0,15 do local p=o+i*4;w[i]=b[p]*16777216+b[p+1]*65536+b[p+2]*256+b[p+3]end;for i=16,63 do local x,y=w[i-15],w[i-2]local s0=bxor(rrotate(x,7),rrotate(x,18),rshift(x,3))local s1=bxor(rrotate(y,17),rrotate(y,19),rshift(y,10))w[i]=(w[i-16]+s0+w[i-7]+s1)%4294967296 end;local a,c,d,e,f,g,j,k=h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8]for i=0,63 do local s1=bxor(rrotate(f,6),rrotate(f,11),rrotate(f,25))local ch=bxor(band(f,g),band(bnot(f),j))local t1=(k+s1+ch+__M_LUA_SHA256_K__[i+1]+w[i])%4294967296;local s0=bxor(rrotate(a,2),rrotate(a,13),rrotate(a,22))local maj=bxor(band(a,c),band(a,d),band(c,d))local t2=(s0+maj)%4294967296;k,j,g,f,e,d,c,a=j,g,f,(e+t1)%4294967296,d,c,a,(t1+t2)%4294967296 end;local q={a,c,d,e,f,g,j,k}for i=1,8 do h[i]=(h[i]+q[i])%4294967296 end end;local out={}for i=1,8 do out[#out+1]=string.format("%08x",h[i])end;return table.concat(out)end;local function vsukmsi()if CONFIG.moduleUrl:find("^https?://")then local resp=gg.makeRequest(CONFIG.moduleUrl,nil,nil)if not resp or not resp.content or#resp.content==0 then gg.alert("获取加密模块失败,请检查网络","退出")os.exit()end;if __M_LUA_SHA256__(resp.content)~=__M_LUA_MODULE_SHA256__ then gg.alert("加密模块 SHA-256 校验失败","退出")os.exit()end;local code,err=load(resp.content)if not code then gg.alert("加密模块加载失败: "..tostring(err),"退出")os.exit()end;code()else local f=io.open(CONFIG.moduleUrl,"rb")if not f then gg.alert("加载本地模块失败","退出")os.exit()end;local content=f:read("*a")f:close()if __M_LUA_SHA256__(content)~=__M_LUA_MODULE_SHA256__ then gg.alert("加密模块 SHA-256 校验失败","退出")os.exit()end;local code,err=load(content)if not code then gg.alert("加载本地模块失败: "..tostring(err),"退出")os.exit()end;code()end end;vsukmsi()math.randomseed(os.time()+math.floor(os.clock()*1000000))local function mgjraiixh(str)if not str or str==""then return nil end;local result={}for k,v in str:gmatch('"([^"]+)"%s*:%s*"([^"]*)"')do result[k]=jsonUnescape(v)end;for k,v in str:gmatch('"([^"]+)"%s*:%s*([%d%.%-]+)')do if not result[k]then result[k]=tonumber(v)or v end end;for k,v in str:gmatch('"([^"]+)"%s*:%s*(true)%f[%W]')do if not result[k]then result[k]=true end end;for k,v in str:gmatch('"([^"]+)"%s*:%s*(false)%f[%W]')do if not result[k]then result[k]=false end end;for k,v in str:gmatch('"([^"]+)"%s*:%s*(%b{})')do if not result[k]then result[k]=mgjraiixh(v)or v end end;return result end;local deviceId=getDeviceId()local cachedPK=CONFIG.publicKey;local function cm0icou()return cachedPK~=nil end;local function g128k6(cardKey)if not cardKey or cardKey==""then return{ok=false,msg="请输入卡密"}end;if not cachedPK then return{ok=false,msg="公钥未获取,请稍后重试"}end;gg.toast("正在验证...")local aesKeyHex=""for i=1,32 do aesKeyHex=aesKeyHex..string.format("%02x",math.floor(math.random(0,255)))end;local ivHex=""for i=1,16 do ivHex=ivHex..string.format("%02x",math.floor(math.random(0,255)))end;local biz=toJson({api_key=CONFIG.apiKey,action="auth",card_key=cardKey,machine_id=deviceId,nonce=generateNonce(20),timestamp=math.floor(os.time())})local encKey=rsaEncrypt(hexToBytes(aesKeyHex),cachedPK)if not encKey then return{ok=false,msg="RSA加密失败"}end;local encData=aes256CbcEncrypt(biz,aesKeyHex,ivHex)local ivB64=base64Encode(hexToBytes(ivHex))local postData="action=auth&key_id="..CONFIG.keyId.."&encrypted_key="..urlEncode(encKey).."&encrypted_data="..urlEncode(encData).."&iv="..urlEncode(ivB64)local content=httpPost(CONFIG.authUrl,postData)if not content then return{ok=false,msg="网络请求失败"}end;local r=mgjraiixh(content)if not r then return{ok=false,msg="响应解析失败"}end;if r.encrypted then local decBytes=aes256CbcDecrypt(r.data,aesKeyHex,base64Decode(r.iv))if not decBytes then return{ok=false,msg="解密失败"}end;local decStr=""for i=1,#decBytes do decStr=decStr..string.char(decBytes[i])end;local data=mgjraiixh(decStr)if not data then return{ok=false,msg="解密失败"}end;local msg=data.message or""local cardType=tostring(data.card_type or"")local expiresAt=data.expires_at;local remaining=data.remaining;local appNotice=tostring(data.app_notice or"")if expiresAt==nil or tostring(expiresAt)=="null"then expiresAt=""end;if appNotice=="null"then appNotice=""end;local validity;if cardType=="count"then validity="剩余次数: "..(remaining~=nil and tostring(remaining)~="null"and tostring(remaining)or"未知")elseif cardType=="permanent"or expiresAt==""then validity="有效期: 永久有效"else validity="到期时间: "..tostring(expiresAt)end;if data.authorized==true or data.authorized=="true"then saveAutoLogin(cardKey)return{ok=true,msg=msg,validity=validity,notice=appNotice}else return{ok=false,msg=msg}end else return{ok=false,msg=r.message or r.msg or"验证失败"}end end;local function ky2e35(cardKey)if not cardKey or cardKey==""then return{ok=false,msg="请输入卡密"}end;if not cachedPK then return{ok=false,msg="公钥未获取,请稍后重试"}end;gg.toast("正在解绑...")local aesKeyHex=""for i=1,32 do aesKeyHex=aesKeyHex..string.format("%02x",math.floor(math.random(0,255)))end;local ivHex=""for i=1,16 do ivHex=ivHex..string.format("%02x",math.floor(math.random(0,255)))end;local biz=toJson({api_key=CONFIG.apiKey,action="unbind",card_key=cardKey,machine_id=deviceId,nonce=generateNonce(20),timestamp=math.floor(os.time())})local encKey=rsaEncrypt(hexToBytes(aesKeyHex),cachedPK)if not encKey then return{ok=false,msg="RSA加密失败"}end;local encData=aes256CbcEncrypt(biz,aesKeyHex,ivHex)local ivB64=base64Encode(hexToBytes(ivHex))local postData="action=unbind&key_id="..CONFIG.keyId.."&encrypted_key="..urlEncode(encKey).."&encrypted_data="..urlEncode(encData).."&iv="..urlEncode(ivB64)local content=httpPost(CONFIG.authUrl,postData)if not content then return{ok=false,msg="网络请求失败"}end;local r=mgjraiixh(content)if not r then return{ok=false,msg="响应解析失败"}end;if r.status and r.encrypted then local data=mgjraiixh(aes256CbcDecrypt(r.data,aesKeyHex,base64Decode(r.iv)))if not data then return{ok=false,msg="解密失败"}end;local msg=data.message or""local count=data.unbind_count or-1;if data.status==true or data.status=="true"then return{ok=true,msg=msg.."\n已解绑次数: "..count}else return{ok=false,msg=msg}end else return{ok=false,msg=r.msg or r.message or"解绑失败"}end end;local function __M_FN_JSON_FIELD_ONCE__(content,field)local count=0;for _ in content:gmatch('"'..field..'"%s*:')do count=count+1 end;return count==1 end;local function __M_FN_JSON_STRING__(content,field)if not __M_FN_JSON_FIELD_ONCE__(content,field)then return nil end;local _,openingQuote=content:find('"'..field..'"%s*:%s*"')if not openingQuote then return nil end;local value={}local position=openingQuote+1;local escapes={['"']='"',['\\']='\\',['/']='/',b='\b',f='\f',n='\n',r='\r',t='\t'}while position<=#content do local char=content:sub(position,position)if char=='"'then return table.concat(value)end;if char=='\\'then local escaped=content:sub(position+1,position+1)if escapes[escaped]==nil then return nil end;value[#value+1]=escapes[escaped]position=position+2 else if string.byte(char)<32 then return nil end;value[#value+1]=char;position=position+1 end end;return nil end;local function readStrictJsonInteger(content,field)if not __M_FN_JSON_FIELD_ONCE__(content,field)then return nil end;local token=content:match('"'..field..'"%s*:%s*([%-]?%d+)%s*[,}]')if not token or token~="0"and token:find("^%-?0")then return nil end;local value=tonumber(token)if not value or value~=value or value==math.huge or value==-math.huge or value~=math.floor(value)then return nil end;return value,token end;local function __M_FN_VERIFY_V2_RESPONSE__(content,outer,expectedAction,expectedNonce)if type(content)~="string"or type(outer)~="table"or type(expectedNonce)~="string"or expectedNonce==""then return false end;if type(rsaVerifySha256)~="function"or not __M_FN_JSON_FIELD_ONCE__(content,"encrypted")or not content:match('"encrypted"%s*:%s*true%s*[,}]')then return false end;local protocol=__M_FN_JSON_STRING__(content,"protocol")local enc=__M_FN_JSON_STRING__(content,"enc")local sigVersion,sigVersionToken=readStrictJsonInteger(content,"sig_version")local sigAlg=__M_FN_JSON_STRING__(content,"sig_alg")local keyId=__M_FN_JSON_STRING__(content,"key_id")local action=__M_FN_JSON_STRING__(content,"request_action")local nonce=__M_FN_JSON_STRING__(content,"request_nonce")local serverTimestamp,serverTimestampToken=readStrictJsonInteger(content,"server_timestamp")local responseIv=__M_FN_JSON_STRING__(content,"iv")local responseData=__M_FN_JSON_STRING__(content,"data")local signature=__M_FN_JSON_STRING__(content,"signature")if protocol~="miyan-v2"or enc~="A256CBC"or sigVersion~=1 or sigVersionToken~="1"or sigAlg~="RS256"then return false end;if keyId~=CONFIG.keyId or action~=expectedAction or nonce~=expectedNonce then return false end;if not serverTimestamp or serverTimestamp<=0 or math.abs(serverTimestamp-os.time())>300 then return false end;if not responseIv or responseIv==""or not responseData or responseData==""or not signature or signature==""then return false end;local payload=table.concat({"MIYAN-V2-RESPONSE-SIGNATURE","protocol=miyan-v2","enc=A256CBC","sig_version=1","sig_alg=RS256","key_id="..keyId,"request_action="..action,"request_nonce="..nonce,"server_timestamp="..serverTimestampToken,"iv="..responseIv,"data="..responseData},"\n")local ok,verified=pcall(rsaVerifySha256,payload,signature,cachedPK)return ok and verified==true end;local function normalizeDisplayText(value)local text=tostring(value or"")text=text:gsub("<[bB][rR]%s*/?>","\n"):gsub("\\r\\n","\n"):gsub("\\n","\n"):gsub("\\r","\n"):gsub("\r\n","\n"):gsub("\r","\n")return text end;local function bl3660i6()local ok,result,failure=pcall(function()local aesKeyHex=""for i=1,32 do aesKeyHex=aesKeyHex..string.format("%02x",math.floor(math.random(0,255)))end;local ivHex=""for i=1,16 do ivHex=ivHex..string.format("%02x",math.floor(math.random(0,255)))end;local requestNonce=generateNonce(20)local dataJson=toJson({api_key=CONFIG.apiKey,action="update",version=CONFIG.version,timestamp=math.floor(os.time()),nonce=requestNonce})local encKey=rsaEncrypt(hexToBytes(aesKeyHex),cachedPK)if not encKey then return nil,"request_rsa"end;local encData=aes256CbcEncrypt(dataJson,aesKeyHex,ivHex)if not encData then return nil,"request_aes"end;local ivB64=base64Encode(hexToBytes(ivHex))if not ivB64 then return nil,"request_iv"end;local postData="key_id="..CONFIG.keyId.."&encrypted_key="..urlEncode(encKey).."&encrypted_data="..urlEncode(encData).."&iv="..urlEncode(ivB64)local content=httpPost(CONFIG.updateUrl,postData)if not content or content==""then return nil,"http"end;local outer=mgjraiixh(content)if not outer or outer.status~=true or outer.encrypted~=true then return nil,"outer_json"end;if not __M_FN_VERIFY_V2_RESPONSE__(content,outer,"update",requestNonce)then return nil,"signature"end;local responseIv=base64Decode(outer.iv)if not responseIv or#responseIv~=16 then return nil,"response_iv"end;local dec=aes256CbcDecrypt(outer.data,aesKeyHex,responseIv)if not dec then return nil,"decrypt"end;if type(dec)=="table"then local chars={}for i=1,#dec do chars[i]=string.char(dec[i])end;dec=table.concat(chars)end;local data=mgjraiixh(dec)local serverTimestamp=data and data.server_timestamp;if not data or type(data.request_nonce)~="string"or data.request_nonce~=requestNonce or type(data.request_action)~="string"or data.request_action~="update"or type(serverTimestamp)~="number"or serverTimestamp~=serverTimestamp or serverTimestamp==math.huge or serverTimestamp==-math.huge or math.abs(serverTimestamp-os.time())>300 or data.status~=true or data.code~=1 or type(data.need_update)~="boolean"or type(data.force_update)~="number"or data.force_update~=0 and data.force_update~=1 then return nil,"inner_json"end;return data end)if not ok then return nil,"runtime"end;return result,failure end;local function h0cv037(r)local notice=normalizeDisplayText(r.notice)if notice=="null"then notice=""end;local needUpdate=r.need_update==true;local latestVer=r.latest_version or""local updateUrl=r.update_url or""local changelog=normalizeDisplayText(r.update_log)local forceUpdate=r.force_update==1;if notice~=""then gg.alert("公告\n"..notice,"确定")end;if not needUpdate then return true end;local msg="发现新版本 v"..latestVer.."\n\n"..(changelog~=""and changelog or"无更新日志")if not forceUpdate then local choice=gg.choice({"去更新","跳过"},nil,msg)if choice==1 and updateUrl~=""then pcall(openBrowser,updateUrl)end;return true end;if updateUrl==""then gg.alert(msg.."\n\n强制更新链接为空","重新检查")return false end;gg.alert(msg.."\n\n此为强制更新,返回后将重新检查","去更新")pcall(openBrowser,updateUrl)return false end;local function __M_FN_UPDATE_GATE__()while true do local updateInfo,failure=bl3660i6()if not updateInfo then local choice=gg.choice({"重试","退出"},nil,"更新检查失败,请检查网络后重试\n阶段: "..tostring(failure or"unknown"))if choice~=1 then os.exit()end elseif h0cv037(updateInfo)then return end end end;local function __M_LUA_CLEAR_AUTO__()if type(clearAutoLogin)=="function"then clearAutoLogin()else saveAutoLogin("")end end;local function __M_LUA_SHOW_BUY__()if not CONFIG.buyUrl or CONFIG.buyUrl==""then gg.alert("未配置购卡链接","返回")return end;local action=gg.choice({"复制链接","返回"},nil,"购买卡密\n"..CONFIG.buyUrl)if action==1 then gg.copyText(CONFIG.buyUrl)gg.toast("购卡链接已复制")end end;local function __M_LUA_CONFIRM_LOGOUT__()local action=gg.choice({"确认退出","返回"},nil,"确认退出登录?")if action==1 then __M_LUA_CLEAR_AUTO__()gg.alert("已退出登录","退出")os.exit()end end;local function __M_LUA_AUTH_SUCCESS__(result,automatic)local title=(automatic and"自动登录成功"or"授权验证通过").."\n"..tostring(result.msg or"").."\n"..tostring(result.validity or"")..((result.notice and result.notice~="")and"\n\n公告\n"..result.notice or"")if automatic then local action=gg.multiChoice({"购买卡密","退出登录"},nil,title)if action and action[2]then __M_LUA_CONFIRM_LOGOUT__()end;if action and action[1]then __M_LUA_SHOW_BUY__()end else gg.alert(title,"确定")end;cctz8re9()end;local function mj0kl1iry5kf()__M_FN_UPDATE_GATE__()while true do local savedKey=loadAutoLogin()or""if savedKey~=""then local result=g128k6(savedKey)if result.ok then __M_LUA_AUTH_SUCCESS__(result,true)return end;__M_LUA_CLEAR_AUTO__()gg.alert("自动登录失败: "..tostring(result.msg or"验证失败"),"确定")savedKey=""end;local input=gg.prompt({"卡密","自动登录","解绑卡密","购买卡密","退出登录"},{savedKey,false,false,false,false},{"text","checkbox","checkbox","checkbox","checkbox"})if input then if input[5]then __M_LUA_CONFIRM_LOGOUT__()elseif input[4]then __M_LUA_SHOW_BUY__()elseif not input[1]or input[1]==""then gg.alert("请输入卡密","确定")elseif input[3]then local result=ky2e35(input[1])if result.ok then gg.alert("解绑成功!\n"..result.msg,"确定")else gg.alert("解绑失败: "..result.msg,"确定")end else local result=g128k6(input[1])if result.ok then if input[2]then saveAutoLogin(input[1])else __M_LUA_CLEAR_AUTO__()end;__M_LUA_AUTH_SUCCESS__(result,false)return else gg.alert("验证失败: "..result.msg,"确定")end end end end end;local function __M_FN_RECHECK__(authReceipt)if not authReceipt or authReceipt==""then return false,"验证回执缺失"end;local aesKeyHex=""for i=1,32 do aesKeyHex=aesKeyHex..string.format("%02x",math.floor(math.random(0,255)))end;local ivHex=""for i=1,16 do ivHex=ivHex..string.format("%02x",math.floor(math.random(0,255)))end;local requestNonce=generateNonce(20)local biz=toJson({api_key=CONFIG.apiKey,action="recheck",auth_receipt=authReceipt,machine_id=deviceId,timestamp=math.floor(os.time()),nonce=requestNonce})local encKey=rsaEncrypt(hexToBytes(aesKeyHex),cachedPK)if not encKey then return false,"二次验证RSA加密失败"end;local encData=aes256CbcEncrypt(biz,aesKeyHex,ivHex)if not encData then return false,"二次验证数据加密失败"end;local ivB64=base64Encode(hexToBytes(ivHex))local postData="action=recheck&key_id="..CONFIG.keyId.."&encrypted_key="..urlEncode(encKey).."&encrypted_data="..urlEncode(encData).."&iv="..urlEncode(ivB64)local content=httpPost(CONFIG.authUrl,postData)if not content then return false,"二次验证网络请求失败"end;local outer=mgjraiixh(content)if not outer or not __M_FN_VERIFY_V2_RESPONSE__(content,outer,"recheck",requestNonce)then return false,"二次验证响应验签失败"end;local responseIv=base64Decode(outer.iv)if not responseIv or#responseIv~=16 then return false,"二次验证响应IV无效"end;local dec=aes256CbcDecrypt(outer.data,aesKeyHex,responseIv)if not dec then return false,"二次验证解密失败"end;if type(dec)=="table"then local chars={}for i=1,#dec do chars[i]=string.char(dec[i])end;dec=table.concat(chars)end;local data=mgjraiixh(dec)if not data then return false,"二次验证响应解析失败"end;return data.rechecked==true or data.rechecked=="true",data.message or"二次验证失败"end;g128k6=function(cardKey)if not cardKey or cardKey==""then return{ok=false,msg="请输入卡密"}end;if not cachedPK then return{ok=false,msg="公钥未获取,请稍后重试"}end;gg.toast("正在验证...")local aesKeyHex=""for i=1,32 do aesKeyHex=aesKeyHex..string.format("%02x",math.floor(math.random(0,255)))end;local ivHex=""for i=1,16 do ivHex=ivHex..string.format("%02x",math.floor(math.random(0,255)))end;local requestNonce=generateNonce(20)local biz=toJson({api_key=CONFIG.apiKey,action="auth",card_key=cardKey,machine_id=deviceId,nonce=requestNonce,timestamp=math.floor(os.time())})local encKey=rsaEncrypt(hexToBytes(aesKeyHex),cachedPK)if not encKey then return{ok=false,msg="RSA加密失败"}end;local encData=aes256CbcEncrypt(biz,aesKeyHex,ivHex)local ivB64=base64Encode(hexToBytes(ivHex))local postData="action=auth&key_id="..CONFIG.keyId.."&encrypted_key="..urlEncode(encKey).."&encrypted_data="..urlEncode(encData).."&iv="..urlEncode(ivB64)local content=httpPost(CONFIG.authUrl,postData)if not content then return{ok=false,msg="网络请求失败"}end;local r=mgjraiixh(content)if not r then return{ok=false,msg="响应解析失败"}end;if not r.encrypted then return{ok=false,msg=r.message or r.msg or"验证失败"}end;if not __M_FN_VERIFY_V2_RESPONSE__(content,r,"auth",requestNonce)then return{ok=false,msg="响应验签失败"}end;local responseIv=base64Decode(r.iv)if not responseIv or#responseIv~=16 then return{ok=false,msg="响应IV无效"}end;local dec=aes256CbcDecrypt(r.data,aesKeyHex,responseIv)if not dec then return{ok=false,msg="解密失败"}end;if type(dec)=="table"then local chars={}for i=1,#dec do chars[i]=string.char(dec[i])end;dec=table.concat(chars)end;local data=mgjraiixh(dec)if not data then return{ok=false,msg="解密失败"}end;local msg=data.message or""local cardType=tostring(data.card_type or"")local expiresAt=data.expires_at;local remaining=data.remaining;local appNotice=tostring(data.app_notice or"")if expiresAt==nil or tostring(expiresAt)=="null"then expiresAt=""end;if appNotice=="null"then appNotice=""end;local validity;if cardType=="count"then validity="剩余次数: "..(remaining~=nil and tostring(remaining)~="null"and tostring(remaining)or"未知")elseif cardType=="permanent"or expiresAt==""then validity="有效期: 永久有效"else validity="到期时间: "..tostring(expiresAt)end;if data.authorized==true or data.authorized=="true"then if not data.auth_receipt or data.auth_receipt==""then return{ok=false,msg="验证回执缺失"}end;local rechecked,recheckMsg=__M_FN_RECHECK__(data.auth_receipt)if not rechecked then return{ok=false,msg=recheckMsg}end;saveAutoLogin(cardKey)return{ok=true,msg=msg,validity=validity,notice=appNotice}end;return{ok=false,msg=msg}end;ky2e35=function(cardKey)if not cardKey or cardKey==""then return{ok=false,msg="请输入卡密"}end;if not cachedPK then return{ok=false,msg="公钥未获取,请稍后重试"}end;gg.toast("正在解绑...")local aesKeyHex=""for i=1,32 do aesKeyHex=aesKeyHex..string.format("%02x",math.floor(math.random(0,255)))end;local ivHex=""for i=1,16 do ivHex=ivHex..string.format("%02x",math.floor(math.random(0,255)))end;local requestNonce=generateNonce(20)local biz=toJson({api_key=CONFIG.apiKey,action="unbind",card_key=cardKey,machine_id=deviceId,nonce=requestNonce,timestamp=math.floor(os.time())})local encKey=rsaEncrypt(hexToBytes(aesKeyHex),cachedPK)if not encKey then return{ok=false,msg="RSA加密失败"}end;local encData=aes256CbcEncrypt(biz,aesKeyHex,ivHex)if not encData then return{ok=false,msg="数据加密失败"}end;local ivB64=base64Encode(hexToBytes(ivHex))if not ivB64 then return{ok=false,msg="IV编码失败"}end;local postData="action=unbind&key_id="..CONFIG.keyId.."&encrypted_key="..urlEncode(encKey).."&encrypted_data="..urlEncode(encData).."&iv="..urlEncode(ivB64)local content=httpPost(CONFIG.authUrl,postData)if not content then return{ok=false,msg="网络请求失败"}end;local outer=mgjraiixh(content)if not outer or not __M_FN_VERIFY_V2_RESPONSE__(content,outer,"unbind",requestNonce)then return{ok=false,msg="响应验签失败"}end;local responseIv=base64Decode(outer.iv)if not responseIv or#responseIv~=16 then return{ok=false,msg="响应IV无效"}end;local dec=aes256CbcDecrypt(outer.data,aesKeyHex,responseIv)if not dec then return{ok=false,msg="解密失败"}end;if type(dec)=="table"then local chars={}for i=1,#dec do chars[i]=string.char(dec[i])end;dec=table.concat(chars)end;local data=mgjraiixh(dec)if not data then return{ok=false,msg="解密失败"}end;local msg=data.message or""local count=data.unbind_count or-1;if data.status==true or data.status=="true"then return{ok=true,msg=msg.."\n已解绑次数: "..count}end;return{ok=false,msg=msg}end function cctz8re9() --将你的源码放在下面验证成功后将自动执行 local a = gg.makeRequest ("").content local b = gg.makeRequest(a:match("【(.-)】")).content pcall (load(b))