function Main()
SN = gg.choice({   
  "①  猎人or神陵",
  "②  阿拉德之怒",
  "③  时空猎人3",
  "⚠  退出科技",
}, nil,"鼎鼎科技，稳定奔放 "..os.date("\n%Y年-%m月-%d日 %H时:%M分:%S秒"))
  if SN == nil then
  else
  if SN == 1 then A() end
  if SN == 2 then B() end
  if SN == 3 then C() end
  if SN == 4 then Exit()
  end
  end
  XGCK = -1
end


function A()
local function json2true(str,from,to) return true, from+3 end local function json2false(str,from,to) return false, from+4 end local function json2null(str, from, to) return nil, from+3 end local function json2nan(str, from, to) return nul, from+2 end local numberchars = {['-'] = true,['+'] = true,['.'] = true,['0'] = true,['1'] = true,['2'] = true,['3'] = true,['4'] = true,['5'] = true,['6'] = true,['7'] = true,['8'] = true,['9'] = true} local function json2number(str,from,to) local i = from+1 while(i<=to) do local char = string.sub(str, i, i) if not numberchars[char] then break end i = i + 1 end local num = tonumber(string.sub(str, from, i-1)) if not num then error(_format('json格式错误，不正确的数字, 错误位置:{from}', from)) end return num, i-1 end local function json2string(str,from,to) local ignor = false for i = from+1, to do local char = string.sub(str, i, i) if not ignor then if char == '\"' then return string.sub(str, from+1, i-1), i elseif char == '\\' then ignor = true end else ignor = false end end error(_format('json格式错误，字符串没有找到结尾, 错误位置:{from}', from)) end local function json2array(str,from,to)    local result = {}    from = from or 1    local pos = from+1    local to = to or string.len(str)    while(pos<=to) do        local char = string.sub(str, pos, pos)        if char == '\"' then            result[#result+1], pos = json2string(str,pos,to)        elseif char == '[' then            result[#result+1], pos = json2array(str,pos,to)        elseif char == '{' then            result[#result+1], pos = json2table(str,pos,to)        elseif char == ']' then            return result, pos        elseif (char=='f' or char=='F') then            result[#result+1], pos = json2false(str,pos,to)        elseif (char=='t' or char=='T') then            result[#result+1], pos = json2true(str,pos,to)        elseif (char=='n') then            result[#result+1], pos = json2null(str,pos,to)        elseif (char=='N') then            result[#result+1], pos = json2nan(str,pos,to)        elseif numberchars[char] then            result[#result+1], pos = json2number(str,pos,to)        end        pos = pos + 1    end    error(_format('json格式错误，表没有找到结尾, 错误位置:{from}', from)) end function _G.json2table(str,from,to)    local result = {}    from = from or 1    local pos = from+1    local to = to or string.len(str)    local key    while(pos<=to) do        local char = string.sub(str, pos, pos)        if char == '\"' then            if not key then                key, pos = json2string(str,pos,to)            else                result[key], pos = json2string(str,pos,to)                key = nil            end        elseif char == '[' then            if not key then                key, pos = json2array(str,pos,to)            else                result[key], pos = json2array(str,pos,to)                key = nil            end        elseif char == '{' then            if not key then                key, pos = json2table(str,pos,to)            else                result[key], pos = json2table(str,pos,to)                key = nil            end        elseif char == '}' then            return result, pos        elseif (char=='f' or char=='F') then            result[key], pos = json2false(str,pos,to)            key = nil        elseif (char=='t' or char=='T') then            result[key], pos = json2true(str,pos,to)            key = nil        elseif (char=='n') then            result[key], pos = json2null(str,pos,to)            key = nil        elseif (char=='N') then            result[key], pos = json2nan(str,pos,to)            key = nil        elseif numberchars[char] then            if not key then                key, pos = json2number(str,pos,to)            else                result[key], pos = json2number(str,pos,to)                key = nil            end        end        pos = pos + 1    end    error(_format('格式错误，表没有找到结尾, 错误位置:{from}', from)) end local jsonfuncs={['\"']=json2string,['[']=json2array,['{']=json2table,['f']=json2false,['F']=json2false,['t']=json2true,['T']=json2true} function json2lua(str) if str==nil then gg.alert('错误json') else local char = string.sub(str, 1, 1) local func=jsonfuncs[char] if func then return func(str, 1, string.len(str)) end if numberchars[char] then return json2number(str, 1, string.len(str)) end end end

function md5(code) local code = tostring(code) local HexTable = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"} local A = 0x67452301 local B = 0xefcdab89 local C = 0x98badcfe local D = 0x10325476 local S11 = 7 local S12 = 12 local S13 = 17 local S14 = 22 local S21 = 5 local S22 = 9 local S23 = 14 local S24 = 20 local S31 = 4 local S32 = 11 local S33 = 16 local S34 = 23 local S41 = 6 local S42 = 10 local S43 = 15 local S44 = 21 local function F(x,y,z) return (x & y) | ((~x) & z) end local function G(x,y,z) return (x & z) | (y & (~z)) end local function H(x,y,z) return x ~ y ~ z end local function I(x,y,z) return y ~ (x | (~z)) end local function FF(a,b,c,d,x,s,ac) a = a + F(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function GG(a,b,c,d,x,s,ac) a = a + G(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function HH(a,b,c,d,x,s,ac) a = a + H(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function II(a,b,c,d,x,s,ac) a = a + I(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function MD5StringFill(s) local len = s:len() local mod512 = len * 8 % 512 local fillSize = (448 - mod512) // 8 if mod512 > 448 then fillSize = (960 - mod512) // 8 end local rTab = {} local byteIndex = 1 for i = 1,len do local index = (i - 1) // 4 + 1 rTab[index] = rTab[index] or 0 rTab[index] = rTab[index] | (s:byte(i) << (byteIndex - 1) * 8) byteIndex = byteIndex + 1 if byteIndex == 5 then byteIndex = 1 end end local b0x80 = false local tLen = #rTab if byteIndex ~= 1 then rTab[tLen] = rTab[tLen] | 0x80 << (byteIndex - 1) * 8 b0x80 = true end for i = 1,fillSize // 4 do if not b0x80 and i == 1 then rTab[tLen + i] = 0x80 else rTab[tLen + i] = 0x0 end end local bitLen = math.floor(len * 8) tLen = #rTab rTab[tLen + 1] = bitLen & 0xffffffff rTab[tLen + 2] = bitLen >> 32 return rTab end function getmd5(s) local fillTab = MD5StringFill(s) local result = {A,B,C,D} for i = 1,#fillTab // 16 do local a = result[1] local b = result[2] local c = result[3] local d = result[4] local offset = (i - 1) * 16 + 1 a = FF(a, b, c, d, fillTab[offset + 0], S11, 0xd76aa478) d = FF(d, a, b, c, fillTab[offset + 1], S12, 0xe8c7b756) c = FF(c, d, a, b, fillTab[offset + 2], S13, 0x242070db) b = FF(b, c, d, a, fillTab[offset + 3], S14, 0xc1bdceee) a = FF(a, b, c, d, fillTab[offset + 4], S11, 0xf57c0faf) d = FF(d, a, b, c, fillTab[offset + 5], S12, 0x4787c62a) c = FF(c, d, a, b, fillTab[offset + 6], S13, 0xa8304613) b = FF(b, c, d, a, fillTab[offset + 7], S14, 0xfd469501) a = FF(a, b, c, d, fillTab[offset + 8], S11, 0x698098d8) d = FF(d, a, b, c, fillTab[offset + 9], S12, 0x8b44f7af) c = FF(c, d, a, b, fillTab[offset + 10], S13, 0xffff5bb1) b = FF(b, c, d, a, fillTab[offset + 11], S14, 0x895cd7be) a = FF(a, b, c, d, fillTab[offset + 12], S11, 0x6b901122) d = FF(d, a, b, c, fillTab[offset + 13], S12, 0xfd987193) c = FF(c, d, a, b, fillTab[offset + 14], S13, 0xa679438e) b = FF(b, c, d, a, fillTab[offset + 15], S14, 0x49b40821) a = GG(a, b, c, d, fillTab[offset + 1], S21, 0xf61e2562) d = GG(d, a, b, c, fillTab[offset + 6], S22, 0xc040b340) c = GG(c, d, a, b, fillTab[offset + 11], S23, 0x265e5a51) b = GG(b, c, d, a, fillTab[offset + 0], S24, 0xe9b6c7aa) a = GG(a, b, c, d, fillTab[offset + 5], S21, 0xd62f105d) d = GG(d, a, b, c, fillTab[offset + 10], S22, 0x2441453) c = GG(c, d, a, b, fillTab[offset + 15], S23, 0xd8a1e681) b = GG(b, c, d, a, fillTab[offset + 4], S24, 0xe7d3fbc8) a = GG(a, b, c, d, fillTab[offset + 9], S21, 0x21e1cde6) d = GG(d, a, b, c, fillTab[offset + 14], S22, 0xc33707d6) c = GG(c, d, a, b, fillTab[offset + 3], S23, 0xf4d50d87) b = GG(b, c, d, a, fillTab[offset + 8], S24, 0x455a14ed) a = GG(a, b, c, d, fillTab[offset + 13], S21, 0xa9e3e905) d = GG(d, a, b, c, fillTab[offset + 2], S22, 0xfcefa3f8) c = GG(c, d, a, b, fillTab[offset + 7], S23, 0x676f02d9) b = GG(b, c, d, a, fillTab[offset + 12], S24, 0x8d2a4c8a) a = HH(a, b, c, d, fillTab[offset + 5], S31, 0xfffa3942) d = HH(d, a, b, c, fillTab[offset + 8], S32, 0x8771f681) c = HH(c, d, a, b, fillTab[offset + 11], S33, 0x6d9d6122) b = HH(b, c, d, a, fillTab[offset + 14], S34, 0xfde5380c) a = HH(a, b, c, d, fillTab[offset + 1], S31, 0xa4beea44) d = HH(d, a, b, c, fillTab[offset + 4], S32, 0x4bdecfa9) c = HH(c, d, a, b, fillTab[offset + 7], S33, 0xf6bb4b60) b = HH(b, c, d, a, fillTab[offset + 10], S34, 0xbebfbc70) a = HH(a, b, c, d, fillTab[offset + 13], S31, 0x289b7ec6) d = HH(d, a, b, c, fillTab[offset + 0], S32, 0xeaa127fa) c = HH(c, d, a, b, fillTab[offset + 3], S33, 0xd4ef3085) b = HH(b, c, d, a, fillTab[offset + 6], S34, 0x4881d05) a = HH(a, b, c, d, fillTab[offset + 9], S31, 0xd9d4d039) d = HH(d, a, b, c, fillTab[offset + 12], S32, 0xe6db99e5) c = HH(c, d, a, b, fillTab[offset + 15], S33, 0x1fa27cf8) b = HH(b, c, d, a, fillTab[offset + 2], S34, 0xc4ac5665) a = II(a, b, c, d, fillTab[offset + 0], S41, 0xf4292244) d = II(d, a, b, c, fillTab[offset + 7], S42, 0x432aff97) c = II(c, d, a, b, fillTab[offset + 14], S43, 0xab9423a7) b = II(b, c, d, a, fillTab[offset + 5], S44, 0xfc93a039) a = II(a, b, c, d, fillTab[offset + 12], S41, 0x655b59c3) d = II(d, a, b, c, fillTab[offset + 3], S42, 0x8f0ccc92) c = II(c, d, a, b, fillTab[offset + 10], S43, 0xffeff47d) b = II(b, c, d, a, fillTab[offset + 1], S44, 0x85845dd1) a = II(a, b, c, d, fillTab[offset + 8], S41, 0x6fa87e4f) d = II(d, a, b, c, fillTab[offset + 15], S42, 0xfe2ce6e0) c = II(c, d, a, b, fillTab[offset + 6], S43, 0xa3014314) b = II(b, c, d, a, fillTab[offset + 13], S44, 0x4e0811a1) a = II(a, b, c, d, fillTab[offset + 4], S41, 0xf7537e82) d = II(d, a, b, c, fillTab[offset + 11], S42, 0xbd3af235) c = II(c, d, a, b, fillTab[offset + 2], S43, 0x2ad7d2bb) b = II(b, c, d, a, fillTab[offset + 9], S44, 0xeb86d391) result[1] = result[1] + a result[2] = result[2] + b result[3] = result[3] + c result[4] = result[4] + d result[1] = result[1] & 0xffffffff result[2] = result[2] & 0xffffffff result[3] = result[3] & 0xffffffff result[4] = result[4] & 0xffffffff end local retStr = '' for i = 1,4 do for _ = 1,4 do local temp = result[i] & 0x0F local str = HexTable[temp + 1] result[i] = result[i] >> 4 temp = result[i] & 0x0F retStr = retStr .. HexTable[temp + 1] .. str result[i] = result[i] >> 4 end end return string.lower(retStr) end return getmd5(code) end
--md5加密 md5("加密内容")

ZZRc4 = {}
ZZMathBit = {}
function ZZMathBit.__xorBit(left, right) return (left + right) == 1 and 1 or 0 end function ZZMathBit.__base(left, right, op) if left < right then left, right = right, left end local res = 0 local shift = 1 while left ~= 0 do local ra = left % 2 local rb = right % 2 res = shift * op(ra,rb) + res shift = shift * 2 left = math.modf( left / 2) right = math.modf( right / 2) end return res end function ZZMathBit.xorOp(left, right) return ZZMathBit.__base(left, right, ZZMathBit.__xorBit) end function RC4(text,key,kasi)
  if kasi==false then str = text str=str:gsub("[%s%p]",""):upper() local index=1 local ret="" for index=1,str:len(),2 do ret=ret..string.char(tonumber(str:sub(index,index+1),16)) end text=ret end local function KSA(key) local keyLen = string.len(key) local schedule = {} local keyByte = {} for i = 0, 255 do schedule[i] = i end for i = 1, keyLen do keyByte[i - 1] = string.byte(key, i, i) end local j = 0 for i = 0, 255 do j = (j + schedule[i] + keyByte[ i % keyLen]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] end return schedule end local function PRGA(schedule, textLen) local i = 0 local j = 0 local k = {} for n = 1, textLen do i = (i + 1) % 256 j = (j + schedule[i]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] k[n] = schedule[(schedule[i] + schedule[j]) % 256] end return k end local function output(schedule, text) local len = string.len(text) local c = nil local res = {} for i = 1, len do c = string.byte(text, i,i) res[i] = string.char(ZZMathBit.xorOp(schedule[i], c)) end return table.concat(res) end local textLen = string.len(text) local schedule = KSA(key) local k = PRGA(schedule, textLen) str=output(k, text) if kasi==true then str = tostring(str) local index=1 local ret="" for index=1,str:len() do ret=ret..string.format("%02X",str:sub(index):byte()) end return string.lower(ret) else return str end end
--极简云RC42加密和解密配置     RC4("加密内容","密码",false=解密_true=加密)

function ultra(get,post) local c=gg.makeRequest(get,nil,post).content  if c==nil then gg.alert("网络错误了，请检查你的网络") os.exit() end return c  end
--请求
function download(get,address) local c=gg.makeRequest(get,nil,nil).content  if c==nil then gg.alert("网络错误了，请检查你的网络") os.exit() end io.open(address,"w+"):write(c) gg.toast("下载成功") end
--下载文件


---[=[上面不要乱动]=]-------------------------------------------------------------------------------------------------------------------

local xxxxxxx="http://cute521.cn"
--官网

local xxxxxxx_Kami=xxxxxxx.."/api.php?api=kmlogon"
--接口名称[卡密登录]

local xxxxxxx_jieba=xxxxxxx.."/api.php?api=kmunmachine"
--接口名称[卡密解绑]

local xxxxxxx_to_configure=xxxxxxx.."/api.php?api=ini"
--接口名称[应用配置]

local xxxxxxx_Notice=xxxxxxx.."/api.php?api=notice"
--接口名称[应用公告]

---[=[  上面是对接  ]=]-------------------------------------------------------------------------------------------------------------------

local xxxxxxx_APPID='11114'
--APPID

local xxxxxxx_APPKEY='jxd57Xl99fSM3s7D'
--APPKEY

local xxxxxxx_RC4_key='g7797Yy4lgg11114'
--是否 RC4 加密[key 密钥]


local xxxbanb='1.0'
--1.0


local xxxxxxx_RC4=true
--是否 RC4 加密[false=关 true=开]
--选择 RC4加密-2 否则会乱码
--打开 签名放DATA里:打开


AMI_YDO="/sdcard/Android/"
--卡密 设备码 路径

----------------------------------------------------------------------------------------------------------------------

if xxxxxxx_APPID=="" or xxxxxxx_APPKEY=="" then
  gg.alert("对接数据,空...")--对话框
  os.exit()
end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------


file=ultra(xxxxxxx_to_configure.."&app="..xxxxxxx_APPID,"")
if xxxxxxx_RC4 == true then
  file=RC4(file,xxxxxxx_RC4_key,false)
  gg.setVisible(false)
end
if json2lua(file).code ~= 200 then
gg.alert("应用配置接口："..json2lua(file).msg)--错误提示
os.exit()
else

api_total=json2lua(file).msg.api_total
--调用几次接口[ 判断使用人数 ]

app_update_must=json2lua(file).msg.app_update_must
--是否强行更新 y是 n否

app_update_show=json2lua(file).msg.app_update_show
--更新内容

app_update_url=json2lua(file).msg.app_update_url
--更新地址

version=json2lua(file).msg.version
--版本号

version_info=json2lua(file).msg.version_info
--应用版本信息


if version == xxxbanb then
gg.setVisible(false)
gg.toast("最新版")--提示
else

if app_update_must=="y" then
gg.setVisible(false)
gg.alert("强制更新："..app_update_show,"下载")--对话框
if app_update_url ~=""  then
download(app_update_url,"/sdcard/新版本.lua")
os.exit()
else
gg.alert("没有找到更新下载链接!，请联系客服")--对话框
os.exit()
end

else
gg.setVisible(false)
gg.alert("更新内容："..app_update_show,"下载")--对话框
if app_update_url ~=""  then
download(app_update_url,"/sdcard/新版本.lua")
else
gg.alert("没有找到更新下载链接!，请联系客服")--对话框
os.exit()
end

end
end

end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------

Notice=ultra(xxxxxxx_Notice.."&app=".. xxxxxxx_APPID,"")
if xxxxxxx_RC4 == true then
  Notice=RC4(Notice,xxxxxxx_RC4_key,false)
  gg.setVisible(false)
end


if json2lua(Notice)['code'] == 200 then
if json2lua(Notice)['app_gg'] ~= nil then
gg.alert("公告："..json2lua(Notice).msg.app_gg)--对话框
end
else
gg.alert("公告接口："..json2lua(Notice).msg)--对话框
os.exit()
end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------



function MIAN()
miei=io.open(AMI_YDO..'/slimei','r')
if miei==nil or miei:read("*a")== "" then 
miei=md5(os.time()*1000+611-99999)
io.open(AMI_YDO..'/slimei','w+'):write(miei)--写
else
miei=io.open(AMI_YDO..'/slimei','r'):read("*a")--读
end--设备码


function KM_G(km)---[=[ 卡密解绑 ]=]-------------------------------------------------------------------------------------------------------------------
key=md5("kami="..km.."&markcode="..miei.."&t="..os.time().."&".. xxxxxxx_APPKEY)
--签名
bops="kami="..km.."&markcode="..miei.."&t="..os.time().."&sign="..key
--合成发送数据
if  xxxxxxx_RC4 == true then
bops= "data="..RC4(bops,xxxxxxx_RC4_key,true) 
end

HUT=ultra(xxxxxxx_jieba.."&app=".. xxxxxxx_APPID,bops)

if  xxxxxxx_RC4 == true then
HUT=RC4(HUT,xxxxxxx_RC4_key,false) 
end-- xxxxxxx_Base64
return HUT
end


km=io.open(AMI_YDO..'/slkm','r') 
if km==nil  then else 
km=io.open(AMI_YDO..'/slkm','r'):read("*a")
end--卡密保存到本地


e=io.open(AMI_YDO..'/e','r')
if e==nil or e:read("*a")== "" then 
e="1"
io.open(AMI_YDO..'/e','w+'):write(e)--写
else
e=io.open(AMI_YDO..'/e','r'):read("*a")--读
end--储存自动登入
if e== "1" then e=false else  e=true 

end


Random=md5(os.time()*1000+611*os.time()-999999)..xxxxxxx_APPKEY..miei
--随机[用来计算是否相等]
function KM_L(km)---[=[ 卡密登入 ]=]-------------------------------------------------------------------------------------------------------------------
key=md5("kami="..km.."&markcode="..miei.."&t="..os.time().."&".. xxxxxxx_APPKEY)
--计算签名

bops="kami="..km.."&markcode="..miei.."&t="..os.time().."&sign="..key
--需要请求的数据

if  xxxxxxx_RC4 == true then
bops="data="..RC4(bops,xxxxxxx_RC4_key,true)
end-- 把请求数据用RC4加密

HUT=ultra(xxxxxxx_Kami.."&app=".. xxxxxxx_APPID,bops.."&value="..Random)
--请求数据

if  xxxxxxx_RC4 == true then
HUT=RC4(HUT,xxxxxxx_RC4_key,false) 
end-- 把返回的数据用RC4解密
KM_L=json2lua(HUT)

code=KM_L.code--判断整数 200是成功
msg=KM_L.msg--数据提示 也是错误提示
check=KM_L.check--验证数据
time=KM_L.time--返回时间

if check~= md5(time..xxxxxxx_APPKEY..Random) then
gg.alert("脚本：检测到你有非法操作")--对话框
os.exit()
end

if time-os.time()>30 or time-os.time()<-30 then
gg.alert("脚本：数据过期")--对话框
os.exit()
end

if code~= 200 then
e=false
gg.alert(msg)--对话框
MIAN()
else

TT=gg.alert([[

到期时间: ]]..os.date("%Y".."年".."%m".."月".."%d".."日  %H".."时".."%M".."分".."%S".."秒",msg.vip)..[[


使用卡密: ]]..msg.kami
,"确定","返回")--对话框
io.open(AMI_YDO..'/km.log','w+'):write(msg.kami)--写

if TT== 2 then
io.open(AMI_YDO..'/e.log','w+'):write("1")--写
MIAN()
else

---[=[   ]=]-------------------------------------------------------------------------------------------------------------------






function SearchWrite(Search, Write, Type, Name)
    gg.clearResults()
    gg.setVisible(false)
    gg.searchNumber(Search[1][1], Type)
    local count = gg.getResultCount()
    local result = gg.getResults(count)
    gg.clearResults()
    local data = {} 
    local base = Search[1][2] 
    
   if (count > 0) then
        for i, v in ipairs(result) do
            v.isUseful = true 
        end
        
        for k=2, #Search do
            local tmp = {}
            local offset = Search[k][2] - base 
            local num = Search[k][1] 
            
            for i, v in ipairs(result) do
                tmp[#tmp+1] = {} 
                tmp[#tmp].address = v.address + offset  
                tmp[#tmp].flags = v.flags  
            end
            
            tmp = gg.getValues(tmp) 
            
            for i, v in ipairs(tmp) do
                if ( tostring(v.value) ~= tostring(num) ) then 
                    result[i].isUseful = false 
                end
            end
        end
  
        for i, v in ipairs(result) do
            if (v.isUseful) then 
                data[#data+1] = v.address
            end
        end
        
        if (#data > 0) then
           gg.toast("搜索到"..#data.."条数据")
           local t = {}
           local base = Search[1][2]
           for i=1, #data do
               for k, w in ipairs(Write) do
                   offset = w[2] - base
                   t[#t+1] = {}
                   t[#t].address = data[i] + offset
                   t[#t].flags = Type
                   t[#t].value = w[1]
                  
                   
               end
           end
           gg.setValues(t)
          gg.toast(Name.."开启成功！已修改"..#t.."条数据")
         
        else
            gg.toast(Name.."开启失败", false)
            return false
        end
    else
        gg.toast(Name.."开启失败")
        return false
    end
end

function Main()
  SN = gg.choice({   
  "①  无敌倍攻【幻界推荐】",
  "②  无敌倍攻全屏【推荐】",
  "③  海战秒大船", 
  "④  无敌配合秒杀暗杀",
  "⑤  秒杀开启不要移动",
  "⑥  暗杀开启不要移动",
  "⑦  关闭秒杀暗杀可移动",
  "⑧  全局加速",
  "⑨  加速关闭",
  "⚠  退出科技",
}, nil,"鼎鼎科技，稳定奔放 "..os.date("\n%Y年-%m月-%d日 %H时:%M分:%S秒"))
  if SN == nil then
  else
  if SN == 1 then a1() end
  if SN == 2 then a2() end
  if SN == 3 then a3() end
  if SN == 4 then a4() end
  if SN == 5 then a5() end
  if SN == 6 then a6() end
  if SN == 7 then a7() end
  if SN == 8 then a8() end
  if SN == 9 then a9() end
  if SN == 10 then Exit()
  end
  end
  XGCK = -1
end
function a0()
gg.setRanges(32)
    local Name="无敌"
    local tb1 = {{256,0},{16777216,4},{9,80}}
    local tb2 = {{-971227136, 88},{-971227136, 88},}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    
   gg.setRanges(32)
    local Name="倍攻"
    local tb1 = {{256,0},{0,4},{0,8},{0,16},{1~20000,20},{1108082688,40}}
    local tb2 = {{300, 28},}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name) 
    
end

function a1()
gg.setRanges(32)
    local Name="无敌"
    local tb1 = {{256,0},{16777216,4},{9,72}}
    local tb2 = {{-971227136, 92}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    
gg.setRanges(32)
    local Name="倍攻"
    local tb1 = {{256,0},{1, 44},{1108082688,56}}
    local tb2 = {{300, 44},}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name) 
    gg.setRanges(32)
    local Name="倍攻"
    local tb1 = {{256,0},{1,28},{1108082688,40}}
    local tb2 = {{300, 28},}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name) 
   end
   
     
function a2()
gg.setRanges(32)
    local Name="无敌"
    local tb1 = {{256,0},{16777216,4},{9,72}}
    local tb2 = {{-971227136, 92}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    
    
   gg.setRanges(32)
    local Name="倍攻"
    local tb1 = {{256,0},{1, 44},{1108082688,56}}
    local tb2 = {{300, 44},}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name) 
    
   gg.setRanges(32)
    local Name="倍攻"
    local tb1 = {{256,0},{1,28},{1108082688,40}}
    local tb2 = {{300, 28},}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name) 
    
    gg.setRanges(32)
    local Name="全屏"
    local tb1 = {{1065353215,0},{864026624,8}}
    local tb2 = {{1106247680,24},{1106247680,28},{1106247680,32}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name) 
    
   
     end
     
function a3()   

    gg.setRanges(32)
gg.searchNumber("1;1;1065353216;1::49", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("1065353216", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("1120403456", gg.TYPE_DWORD)
gg.toast("秒大船")

    gg.setRanges(32)
    local Name="全屏"
    local tb1 = {{1065353215,0},{864026624,8}}
    local tb2 = {{1106247680,24},{1106247680,28},{1106247680,32}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name) 
    

end
   
function a4()   
gg.setRanges(32)
    local Name="无敌"
    local tb1 = {{256,0},{16777216,4},{9,80}}
    local tb2 = {{-971227136, 92},{-971227136, 96},{-971227136, 100}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    
     end
    function a5()   
     gg.setRanges(16384)
    local Name="秒杀"
    local tb1 = {{1176256512,0}}
    local tb2 = {{-135162190,0}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    
     end 

function a6()   
     gg.setRanges(16384)
    local Name="暗杀"
    local tb1 = {{1067030938,0}}
    local tb2 = {{-720272153,0}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    
     end

function a7()   
     gg.setRanges(16384)
    local Name="暗杀关闭"
    local tb1 = {{-720272153,0}}
    local tb2 = {{1067030938,0}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    gg.setRanges(16384)
    local Name="秒杀关闭"
    local tb1 = {{-135162190,0}}
    local tb2 = {{1176256512,0}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    
     end


function a8()   
    gg.setRanges(4)
gg.searchNumber("1065353216;1073741824;1022739087::9", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("1065353216", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("1075838976", gg.TYPE_DWORD,true, gg.SIGN_EQUAL)
gg.toast("加速")

end
    
   
    function a9()    
gg.setRanges(4)
gg.searchNumber("1075838976;1073741824;1022739087::9", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("1075838976", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("1065353216", gg.TYPE_DWORD)
gg.toast("加速关闭")
    end
function Exit()
print("鼎鼎科技")
os.exit()
end
cs = "欢迎下次使用"

while true do
  if gg.isVisible(true) then
    XGCK = 1
    gg.setVisible(false)
  end
  gg.clearResults()
  if XGCK == 1then
  Main()
  end
end



---[=[   ]=]-------------------------------------------------------------------------------------------------------------------
end

     end

end



if km == nil  then
else
if km ~=""  then
if e==true then
KM_L(km)
end 
end
end



hak=gg.prompt({
[[全网使用次数：]]..api_total..[[

输入 >1< 解绑卡密
在下方输入你的卡密]],
"是否自动登入",
},{
km,
e
},{
'text',--文字
'checkbox',--多选
})--文本功能


if hak==nil then
elseif hak[2]==true then
io.open(AMI_YDO..'/e.log','w+'):write("2")--写
elseif hak[2]==false then
io.open(AMI_YDO..'/e.log','w+'):write("1")--写
end


if hak==nil then gg.setVisible(false) 
elseif hak[1]== "1" then
G_B=gg.prompt({"输入要解绑的卡密"},{},{"text"})
if  G_B[1]== "" then
gg.alert("空，请填写卡密")--对话框
else
KM_G=json2lua(KM_G(G_B[1]))
if KM_G.code== 200 then
else
gg.alert(KM_G.msg)--对话框
end
end
elseif hak[1]== "2" then

elseif hak[1]== "" then
gg.alert("空，请填写卡密")--对话框
else
KM_L(hak[1])
end

end

while true do
  if gg.isVisible(true) then
  MIAN()
  end
end

end

function C()
local function json2true(str,from,to) return true, from+3 end local function json2false(str,from,to) return false, from+4 end local function json2null(str, from, to) return nil, from+3 end local function json2nan(str, from, to) return nul, from+2 end local numberchars = {['-'] = true,['+'] = true,['.'] = true,['0'] = true,['1'] = true,['2'] = true,['3'] = true,['4'] = true,['5'] = true,['6'] = true,['7'] = true,['8'] = true,['9'] = true} local function json2number(str,from,to) local i = from+1 while(i<=to) do local char = string.sub(str, i, i) if not numberchars[char] then break end i = i + 1 end local num = tonumber(string.sub(str, from, i-1)) if not num then error(_format('json格式错误，不正确的数字, 错误位置:{from}', from)) end return num, i-1 end local function json2string(str,from,to) local ignor = false for i = from+1, to do local char = string.sub(str, i, i) if not ignor then if char == '\"' then return string.sub(str, from+1, i-1), i elseif char == '\\' then ignor = true end else ignor = false end end error(_format('json格式错误，字符串没有找到结尾, 错误位置:{from}', from)) end local function json2array(str,from,to)    local result = {}    from = from or 1    local pos = from+1    local to = to or string.len(str)    while(pos<=to) do        local char = string.sub(str, pos, pos)        if char == '\"' then            result[#result+1], pos = json2string(str,pos,to)        elseif char == '[' then            result[#result+1], pos = json2array(str,pos,to)        elseif char == '{' then            result[#result+1], pos = json2table(str,pos,to)        elseif char == ']' then            return result, pos        elseif (char=='f' or char=='F') then            result[#result+1], pos = json2false(str,pos,to)        elseif (char=='t' or char=='T') then            result[#result+1], pos = json2true(str,pos,to)        elseif (char=='n') then            result[#result+1], pos = json2null(str,pos,to)        elseif (char=='N') then            result[#result+1], pos = json2nan(str,pos,to)        elseif numberchars[char] then            result[#result+1], pos = json2number(str,pos,to)        end        pos = pos + 1    end    error(_format('json格式错误，表没有找到结尾, 错误位置:{from}', from)) end function _G.json2table(str,from,to)    local result = {}    from = from or 1    local pos = from+1    local to = to or string.len(str)    local key    while(pos<=to) do        local char = string.sub(str, pos, pos)        if char == '\"' then            if not key then                key, pos = json2string(str,pos,to)            else                result[key], pos = json2string(str,pos,to)                key = nil            end        elseif char == '[' then            if not key then                key, pos = json2array(str,pos,to)            else                result[key], pos = json2array(str,pos,to)                key = nil            end        elseif char == '{' then            if not key then                key, pos = json2table(str,pos,to)            else                result[key], pos = json2table(str,pos,to)                key = nil            end        elseif char == '}' then            return result, pos        elseif (char=='f' or char=='F') then            result[key], pos = json2false(str,pos,to)            key = nil        elseif (char=='t' or char=='T') then            result[key], pos = json2true(str,pos,to)            key = nil        elseif (char=='n') then            result[key], pos = json2null(str,pos,to)            key = nil        elseif (char=='N') then            result[key], pos = json2nan(str,pos,to)            key = nil        elseif numberchars[char] then            if not key then                key, pos = json2number(str,pos,to)            else                result[key], pos = json2number(str,pos,to)                key = nil            end        end        pos = pos + 1    end    error(_format('格式错误，表没有找到结尾, 错误位置:{from}', from)) end local jsonfuncs={['\"']=json2string,['[']=json2array,['{']=json2table,['f']=json2false,['F']=json2false,['t']=json2true,['T']=json2true} function json2lua(str) if str==nil then gg.alert('错误json') else local char = string.sub(str, 1, 1) local func=jsonfuncs[char] if func then return func(str, 1, string.len(str)) end if numberchars[char] then return json2number(str, 1, string.len(str)) end end end

function md5(code) local code = tostring(code) local HexTable = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"} local A = 0x67452301 local B = 0xefcdab89 local C = 0x98badcfe local D = 0x10325476 local S11 = 7 local S12 = 12 local S13 = 17 local S14 = 22 local S21 = 5 local S22 = 9 local S23 = 14 local S24 = 20 local S31 = 4 local S32 = 11 local S33 = 16 local S34 = 23 local S41 = 6 local S42 = 10 local S43 = 15 local S44 = 21 local function F(x,y,z) return (x & y) | ((~x) & z) end local function G(x,y,z) return (x & z) | (y & (~z)) end local function H(x,y,z) return x ~ y ~ z end local function I(x,y,z) return y ~ (x | (~z)) end local function FF(a,b,c,d,x,s,ac) a = a + F(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function GG(a,b,c,d,x,s,ac) a = a + G(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function HH(a,b,c,d,x,s,ac) a = a + H(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function II(a,b,c,d,x,s,ac) a = a + I(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function MD5StringFill(s) local len = s:len() local mod512 = len * 8 % 512 local fillSize = (448 - mod512) // 8 if mod512 > 448 then fillSize = (960 - mod512) // 8 end local rTab = {} local byteIndex = 1 for i = 1,len do local index = (i - 1) // 4 + 1 rTab[index] = rTab[index] or 0 rTab[index] = rTab[index] | (s:byte(i) << (byteIndex - 1) * 8) byteIndex = byteIndex + 1 if byteIndex == 5 then byteIndex = 1 end end local b0x80 = false local tLen = #rTab if byteIndex ~= 1 then rTab[tLen] = rTab[tLen] | 0x80 << (byteIndex - 1) * 8 b0x80 = true end for i = 1,fillSize // 4 do if not b0x80 and i == 1 then rTab[tLen + i] = 0x80 else rTab[tLen + i] = 0x0 end end local bitLen = math.floor(len * 8) tLen = #rTab rTab[tLen + 1] = bitLen & 0xffffffff rTab[tLen + 2] = bitLen >> 32 return rTab end function getmd5(s) local fillTab = MD5StringFill(s) local result = {A,B,C,D} for i = 1,#fillTab // 16 do local a = result[1] local b = result[2] local c = result[3] local d = result[4] local offset = (i - 1) * 16 + 1 a = FF(a, b, c, d, fillTab[offset + 0], S11, 0xd76aa478) d = FF(d, a, b, c, fillTab[offset + 1], S12, 0xe8c7b756) c = FF(c, d, a, b, fillTab[offset + 2], S13, 0x242070db) b = FF(b, c, d, a, fillTab[offset + 3], S14, 0xc1bdceee) a = FF(a, b, c, d, fillTab[offset + 4], S11, 0xf57c0faf) d = FF(d, a, b, c, fillTab[offset + 5], S12, 0x4787c62a) c = FF(c, d, a, b, fillTab[offset + 6], S13, 0xa8304613) b = FF(b, c, d, a, fillTab[offset + 7], S14, 0xfd469501) a = FF(a, b, c, d, fillTab[offset + 8], S11, 0x698098d8) d = FF(d, a, b, c, fillTab[offset + 9], S12, 0x8b44f7af) c = FF(c, d, a, b, fillTab[offset + 10], S13, 0xffff5bb1) b = FF(b, c, d, a, fillTab[offset + 11], S14, 0x895cd7be) a = FF(a, b, c, d, fillTab[offset + 12], S11, 0x6b901122) d = FF(d, a, b, c, fillTab[offset + 13], S12, 0xfd987193) c = FF(c, d, a, b, fillTab[offset + 14], S13, 0xa679438e) b = FF(b, c, d, a, fillTab[offset + 15], S14, 0x49b40821) a = GG(a, b, c, d, fillTab[offset + 1], S21, 0xf61e2562) d = GG(d, a, b, c, fillTab[offset + 6], S22, 0xc040b340) c = GG(c, d, a, b, fillTab[offset + 11], S23, 0x265e5a51) b = GG(b, c, d, a, fillTab[offset + 0], S24, 0xe9b6c7aa) a = GG(a, b, c, d, fillTab[offset + 5], S21, 0xd62f105d) d = GG(d, a, b, c, fillTab[offset + 10], S22, 0x2441453) c = GG(c, d, a, b, fillTab[offset + 15], S23, 0xd8a1e681) b = GG(b, c, d, a, fillTab[offset + 4], S24, 0xe7d3fbc8) a = GG(a, b, c, d, fillTab[offset + 9], S21, 0x21e1cde6) d = GG(d, a, b, c, fillTab[offset + 14], S22, 0xc33707d6) c = GG(c, d, a, b, fillTab[offset + 3], S23, 0xf4d50d87) b = GG(b, c, d, a, fillTab[offset + 8], S24, 0x455a14ed) a = GG(a, b, c, d, fillTab[offset + 13], S21, 0xa9e3e905) d = GG(d, a, b, c, fillTab[offset + 2], S22, 0xfcefa3f8) c = GG(c, d, a, b, fillTab[offset + 7], S23, 0x676f02d9) b = GG(b, c, d, a, fillTab[offset + 12], S24, 0x8d2a4c8a) a = HH(a, b, c, d, fillTab[offset + 5], S31, 0xfffa3942) d = HH(d, a, b, c, fillTab[offset + 8], S32, 0x8771f681) c = HH(c, d, a, b, fillTab[offset + 11], S33, 0x6d9d6122) b = HH(b, c, d, a, fillTab[offset + 14], S34, 0xfde5380c) a = HH(a, b, c, d, fillTab[offset + 1], S31, 0xa4beea44) d = HH(d, a, b, c, fillTab[offset + 4], S32, 0x4bdecfa9) c = HH(c, d, a, b, fillTab[offset + 7], S33, 0xf6bb4b60) b = HH(b, c, d, a, fillTab[offset + 10], S34, 0xbebfbc70) a = HH(a, b, c, d, fillTab[offset + 13], S31, 0x289b7ec6) d = HH(d, a, b, c, fillTab[offset + 0], S32, 0xeaa127fa) c = HH(c, d, a, b, fillTab[offset + 3], S33, 0xd4ef3085) b = HH(b, c, d, a, fillTab[offset + 6], S34, 0x4881d05) a = HH(a, b, c, d, fillTab[offset + 9], S31, 0xd9d4d039) d = HH(d, a, b, c, fillTab[offset + 12], S32, 0xe6db99e5) c = HH(c, d, a, b, fillTab[offset + 15], S33, 0x1fa27cf8) b = HH(b, c, d, a, fillTab[offset + 2], S34, 0xc4ac5665) a = II(a, b, c, d, fillTab[offset + 0], S41, 0xf4292244) d = II(d, a, b, c, fillTab[offset + 7], S42, 0x432aff97) c = II(c, d, a, b, fillTab[offset + 14], S43, 0xab9423a7) b = II(b, c, d, a, fillTab[offset + 5], S44, 0xfc93a039) a = II(a, b, c, d, fillTab[offset + 12], S41, 0x655b59c3) d = II(d, a, b, c, fillTab[offset + 3], S42, 0x8f0ccc92) c = II(c, d, a, b, fillTab[offset + 10], S43, 0xffeff47d) b = II(b, c, d, a, fillTab[offset + 1], S44, 0x85845dd1) a = II(a, b, c, d, fillTab[offset + 8], S41, 0x6fa87e4f) d = II(d, a, b, c, fillTab[offset + 15], S42, 0xfe2ce6e0) c = II(c, d, a, b, fillTab[offset + 6], S43, 0xa3014314) b = II(b, c, d, a, fillTab[offset + 13], S44, 0x4e0811a1) a = II(a, b, c, d, fillTab[offset + 4], S41, 0xf7537e82) d = II(d, a, b, c, fillTab[offset + 11], S42, 0xbd3af235) c = II(c, d, a, b, fillTab[offset + 2], S43, 0x2ad7d2bb) b = II(b, c, d, a, fillTab[offset + 9], S44, 0xeb86d391) result[1] = result[1] + a result[2] = result[2] + b result[3] = result[3] + c result[4] = result[4] + d result[1] = result[1] & 0xffffffff result[2] = result[2] & 0xffffffff result[3] = result[3] & 0xffffffff result[4] = result[4] & 0xffffffff end local retStr = '' for i = 1,4 do for _ = 1,4 do local temp = result[i] & 0x0F local str = HexTable[temp + 1] result[i] = result[i] >> 4 temp = result[i] & 0x0F retStr = retStr .. HexTable[temp + 1] .. str result[i] = result[i] >> 4 end end return string.lower(retStr) end return getmd5(code) end
--md5加密 md5("加密内容")

ZZRc4 = {}
ZZMathBit = {}
function ZZMathBit.__xorBit(left, right) return (left + right) == 1 and 1 or 0 end function ZZMathBit.__base(left, right, op) if left < right then left, right = right, left end local res = 0 local shift = 1 while left ~= 0 do local ra = left % 2 local rb = right % 2 res = shift * op(ra,rb) + res shift = shift * 2 left = math.modf( left / 2) right = math.modf( right / 2) end return res end function ZZMathBit.xorOp(left, right) return ZZMathBit.__base(left, right, ZZMathBit.__xorBit) end function RC4(text,key,kasi)
  if kasi==false then str = text str=str:gsub("[%s%p]",""):upper() local index=1 local ret="" for index=1,str:len(),2 do ret=ret..string.char(tonumber(str:sub(index,index+1),16)) end text=ret end local function KSA(key) local keyLen = string.len(key) local schedule = {} local keyByte = {} for i = 0, 255 do schedule[i] = i end for i = 1, keyLen do keyByte[i - 1] = string.byte(key, i, i) end local j = 0 for i = 0, 255 do j = (j + schedule[i] + keyByte[ i % keyLen]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] end return schedule end local function PRGA(schedule, textLen) local i = 0 local j = 0 local k = {} for n = 1, textLen do i = (i + 1) % 256 j = (j + schedule[i]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] k[n] = schedule[(schedule[i] + schedule[j]) % 256] end return k end local function output(schedule, text) local len = string.len(text) local c = nil local res = {} for i = 1, len do c = string.byte(text, i,i) res[i] = string.char(ZZMathBit.xorOp(schedule[i], c)) end return table.concat(res) end local textLen = string.len(text) local schedule = KSA(key) local k = PRGA(schedule, textLen) str=output(k, text) if kasi==true then str = tostring(str) local index=1 local ret="" for index=1,str:len() do ret=ret..string.format("%02X",str:sub(index):byte()) end return string.lower(ret) else return str end end
--极简云RC42加密和解密配置     RC4("加密内容","密码",false=解密_true=加密)

function ultra(get,post) local c=gg.makeRequest(get,nil,post).content  if c==nil then gg.alert("网络错误了，请检查你的网络") os.exit() end return c  end
--请求
function download(get,address) local c=gg.makeRequest(get,nil,nil).content  if c==nil then gg.alert("网络错误了，请检查你的网络") os.exit() end io.open(address,"w+"):write(c) gg.toast("下载成功") end
--下载文件


---[=[上面不要乱动]=]-------------------------------------------------------------------------------------------------------------------

local xxxxxxx="http://cute521.cn"
--官网

local xxxxxxx_Kami=xxxxxxx.."/api.php?api=kmlogon"
--接口名称[卡密登录]

local xxxxxxx_jieba=xxxxxxx.."/api.php?api=kmunmachine"
--接口名称[卡密解绑]

local xxxxxxx_to_configure=xxxxxxx.."/api.php?api=ini"
--接口名称[应用配置]

local xxxxxxx_Notice=xxxxxxx.."/api.php?api=notice"
--接口名称[应用公告]

---[=[  上面是对接  ]=]-------------------------------------------------------------------------------------------------------------------

local xxxxxxx_APPID='12049'
--APPID

local xxxxxxx_APPKEY='csIV6ces6F9t6666'
--APPKEY

local xxxxxxx_RC4_key='KeNybY7aN5c12049'
--是否 RC4 加密[key 密钥]


local xxxbanb='1.0'
--1.0


local xxxxxxx_RC4=true
--是否 RC4 加密[false=关 true=开]
--选择 RC4加密-2 否则会乱码
--打开 签名放DATA里:打开


AMI_YDO="/sdcard/Android/"
--卡密 设备码 路径

----------------------------------------------------------------------------------------------------------------------

if xxxxxxx_APPID=="" or xxxxxxx_APPKEY=="" then
  gg.alert("对接数据,空...")--对话框
  os.exit()
end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------


file=ultra(xxxxxxx_to_configure.."&app="..xxxxxxx_APPID,"")
if xxxxxxx_RC4 == true then
  file=RC4(file,xxxxxxx_RC4_key,false)
  gg.setVisible(false)
end
if json2lua(file).code ~= 200 then
gg.alert("应用配置接口："..json2lua(file).msg)--错误提示
os.exit()
else

api_total=json2lua(file).msg.api_total
--调用几次接口[ 判断使用人数 ]

app_update_must=json2lua(file).msg.app_update_must
--是否强行更新 y是 n否

app_update_show=json2lua(file).msg.app_update_show
--更新内容

app_update_url=json2lua(file).msg.app_update_url
--更新地址

version=json2lua(file).msg.version
--版本号

version_info=json2lua(file).msg.version_info
--应用版本信息


if version == xxxbanb then
gg.setVisible(false)
gg.toast("最新版")--提示
else

if app_update_must=="y" then
gg.setVisible(false)
gg.alert("强制更新："..app_update_show,"下载")--对话框
if app_update_url ~=""  then
download(app_update_url,"/sdcard/新版本.lua")
os.exit()
else
gg.alert("没有找到更新下载链接!，请联系客服")--对话框
os.exit()
end

else
gg.setVisible(false)
gg.alert("更新内容："..app_update_show,"下载")--对话框
if app_update_url ~=""  then
download(app_update_url,"/sdcard/新版本.lua")
else
gg.alert("没有找到更新下载链接!，请联系客服")--对话框
os.exit()
end

end
end

end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------

Notice=ultra(xxxxxxx_Notice.."&app=".. xxxxxxx_APPID,"")
if xxxxxxx_RC4 == true then
  Notice=RC4(Notice,xxxxxxx_RC4_key,false)
  gg.setVisible(false)
end


if json2lua(Notice)['code'] == 200 then
if json2lua(Notice)['app_gg'] ~= nil then
gg.alert("公告："..json2lua(Notice).msg.app_gg)--对话框
end
else
gg.alert("公告接口："..json2lua(Notice).msg)--对话框
os.exit()
end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------



function MIAN()
miei=io.open(AMI_YDO..'/dwimei','r')
if miei==nil or miei:read("*a")== "" then 
miei=md5(os.time()*1000+611-99999)
io.open(AMI_YDO..'/dwimei','w+'):write(miei)--写
else
miei=io.open(AMI_YDO..'/dwimei','r'):read("*a")--读
end--设备码


function KM_G(km)---[=[ 卡密解绑 ]=]-------------------------------------------------------------------------------------------------------------------
key=md5("kami="..km.."&markcode="..miei.."&t="..os.time().."&".. xxxxxxx_APPKEY)
--签名
bops="kami="..km.."&markcode="..miei.."&t="..os.time().."&sign="..key
--合成发送数据
if  xxxxxxx_RC4 == true then
bops= "data="..RC4(bops,xxxxxxx_RC4_key,true) 
end

HUT=ultra(xxxxxxx_jieba.."&app=".. xxxxxxx_APPID,bops)

if  xxxxxxx_RC4 == true then
HUT=RC4(HUT,xxxxxxx_RC4_key,false) 
end-- xxxxxxx_Base64
return HUT
end


km=io.open(AMI_YDO..'/dwkm','r') 
if km==nil  then else 
km=io.open(AMI_YDO..'/dwkm','r'):read("*a")
end--卡密保存到本地


e=io.open(AMI_YDO..'/e','r')
if e==nil or e:read("*a")== "" then 
e="1"
io.open(AMI_YDO..'/e','w+'):write(e)--写
else
e=io.open(AMI_YDO..'/e','r'):read("*a")--读
end--储存自动登入
if e== "1" then e=false else  e=true 

end


Random=md5(os.time()*1000+611*os.time()-999999)..xxxxxxx_APPKEY..miei
--随机[用来计算是否相等]
function KM_L(km)---[=[ 卡密登入 ]=]-------------------------------------------------------------------------------------------------------------------
key=md5("kami="..km.."&markcode="..miei.."&t="..os.time().."&".. xxxxxxx_APPKEY)
--计算签名

bops="kami="..km.."&markcode="..miei.."&t="..os.time().."&sign="..key
--需要请求的数据

if  xxxxxxx_RC4 == true then
bops="data="..RC4(bops,xxxxxxx_RC4_key,true)
end-- 把请求数据用RC4加密

HUT=ultra(xxxxxxx_Kami.."&app=".. xxxxxxx_APPID,bops.."&value="..Random)
--请求数据

if  xxxxxxx_RC4 == true then
HUT=RC4(HUT,xxxxxxx_RC4_key,false) 
end-- 把返回的数据用RC4解密
KM_L=json2lua(HUT)

code=KM_L.code--判断整数 200是成功
msg=KM_L.msg--数据提示 也是错误提示
check=KM_L.check--验证数据
time=KM_L.time--返回时间

if check~= md5(time..xxxxxxx_APPKEY..Random) then
gg.alert("脚本：检测到你有非法操作")--对话框
os.exit()
end

if time-os.time()>30 or time-os.time()<-30 then
gg.alert("脚本：数据过期")--对话框
os.exit()
end

if code~= 200 then
e=false
gg.alert(msg)--对话框
MIAN()
else

TT=gg.alert([[

到期时间: ]]..os.date("%Y".."年".."%m".."月".."%d".."日  %H".."时".."%M".."分".."%S".."秒",msg.vip)..[[


使用卡密: ]]..msg.kami
,"确定","返回")--对话框
io.open(AMI_YDO..'/km.log','w+'):write(msg.kami)--写

if TT== 2 then
io.open(AMI_YDO..'/e.log','w+'):write("1")--写
MIAN()
else

---[=[   ]=]-------------------------------------------------------------------------------------------------------------------






local app = {}
function Assert(data)   --判断
	if data == nil or data == "" or data == "nil" then
		return false
	else
		return true
	end
end
function mearrass(memory, array)   --判断
	if Assert(memory) and Assert(array) then
		return true
	else
		return false
	end
end
function typetab(array, type)   --把所有类型组成一个数组防不写类型
	local datatype = {}
	for i = 1, #array do
		if Assert(array[i].type) then
			table.insert(datatype, i, array[i].type)
		else
			if Assert(type) then
				table.insert(datatype, i, type)
			else
				return false
			end
		end
	end
	return true, datatype
end
function app.memorysearch(memory, array, type)   --内存搜索，参数为(内存， 特征码数组， 类型(类型可空))
	gg.setVisible(false)
	local isok = mearrass(memory, array)
	if isok then
		local isok, datatype = typetab(array, type)
		if isok then
			if Assert(array[1].hv) then   --判断主特征码是否有hv，有即范围搜索
				gg.clearResults()
				gg.setRanges(memory)
				gg.searchNumber(array[1].lv .. "~" .. array[1].hv, datatype[1])   --有hv进行范围搜索
			else
				gg.clearResults()
				gg.setRanges(memory)
				gg.searchNumber(array[1].lv, datatype[1])   --普通搜索
			end
			if gg.getResultCount() == 0 then   --判断搜索到值没
				return false   --没搜到值返回false
			else
				local tab = {}
				local data = gg.getResults(gg.getResultCount())   --保存搜索到的数据到data
				gg.clearResults()
				for i = 1, #data do
					data[i].isok = true   --把搜索到的值，全部设置为true
				end
				for i = 2, #array do
					local t = {}
					local offset = array[i].offset
					for x = 1, #data do   --遍历内存
						t[#t + 1] = {}
						t[#t].address = data[x].address + offset
						t[#t].flags = datatype[i]
					end
					local t = gg.getValues(t)
					for z = 1, #t do
						if Assert(array[i].hv) then   --判断副特征码是否有hv参数
							if tonumber(t[z].value) < tonumber(array[i].lv) or tonumber(t[z].value) > tonumber(array[i].hv) then
								--↑↑↑进行范围判断
								data[z].isok = false   --不符合条件的设置为false
							end
						else
							if tostring(t[z].value) ~= tostring(array[i].lv) then   --普通判断(没有hv参数)
								data[z].isok = false   --不符合设置为false
							end
						end
					end
				end
				for i = 1, #data do   --重新遍历数组
					if data[i].isok then   --判断是否为true(符合条件的)
						tab[#tab + 1] = data[i].address   --把符合条件的地址写入数组
					end
				end
				if #tab > 0 then   --判断地址数组是否大于0，大于0就是搜到了符合条件的值，反之没搜到
					return true, tab   --搜到返回true和地址数组
				else
					return false   --没搜到返回false
				end
			end
		else
			print("type参数错误")   --类型错误
			gg.toast("type参数错误")
			os.exit()
		end
	else
		print("memory or array参数错误")   --内存或类型错误
		gg.toast("memory or array参数错误")
		os.exit()
	end
end
function app.memoryread(addr, type)   --读内存，参数为(地址，类型)
	local t = {}
	t[1] = {}
	t[1].address = addr
	t[1].flags = type
	if #t > 0 then
		return true, gg.getValues(t)[1].value   --读到返回true和读到得值
	else
		return false   --反之返回false
	end
end
function app.memorywrite(addr, type, value, freeze)   --写内存，参数为(地址，类型，写入得值，是否冻结(可空))
	local t = {}
	t[1] = {}
	t[1].address = addr
	t[1].flags = type
	t[1].value = value
	if #t > 0 then
		if Assert(freeze) then   --判断是否有冻结参数
			t[1].freeze = freeze
			--gg.setValues(t)   --这行自行选择，如果有这行，false会修改并保存到列表，如果没这行，false只会保存到列表而不会修改
			return gg.addListItems(t)   --成功返回true
		else
			return gg.setValues(t)   --成功返回true
		end
	else
		return false   --失败
	end
end

--↓↓↓用上边的代码进行二次封装出来的指针写法
qmnb = function(daarr)
	local array = {}
	for i = 1, #daarr["搜索数组"] do
		local data = {["lv"] = daarr["搜索数组"][i][1], ["offset"] = daarr["搜索数组"][i][2], ["type"] = daarr["搜索类型"]}
		table.insert(array, i, data)
	end
	local isok, data = app.memorysearch(daarr["搜索内存"], array)
	if isok then
		for i = 1, #data do
			for x = 1, #daarr["修改数组"] do
				app.memorywrite(data[i] + daarr["修改数组"][x][2], daarr["搜索类型"], daarr["修改数组"][x][1])
			end
		end
		gg.toast(daarr["功能名称"] .. "开启成功，共修改" .. #data * #daarr["修改数组"] .. "条数据")
	else
		gg.toast(daarr["功能名称"] .. "开启失败")
	end
end

--↑↑↑








function chiguai()

local starxyz=false

    local memory = 4+1+32
	local a= 4
	local b= 4
	local array = {
		{["lv"] = 1092616192, ["type"] = 4},
		{["lv"] = 1061997773 , ["offset"] = 4, ["type"] = 4},
		
	}
	local isok, data = app.memorysearch(memory, array)
	if isok then
		for i = 1, #data do
		c,d1=app.memoryread(data[i] - 64, b )
		c,d2=app.memoryread(data[i] - 56, b )
		c,d3=app.memoryread(data[i] - 48, b )
		c,d4=app.memoryread(data[i] - 84, b )
		c,d5=app.memoryread(data[i] - 12, b )
		
		--gg.toast("x"..d1)
		--gg.toast("y"..d2)
		--gg.toast("z"..d3)
		if d1~=0 and d2~=0 and d3~=0 and (d4==65536 or d4==262144)  and starxyz==false then
		    starxyz=true
			rwx=d1
			rwy=d2
			gg.toast("定位坐标成功")
		elseif d1~=0 and d2~=0 and d3~=0 and (d4==65536 or d4==262144) and d5~=1042972415 then
			app.memorywrite(data[i] - 64, 4, rwx)
			app.memorywrite(data[i] - 56, 4, rwy)
			app.memorywrite(data[i] - 48, 4, -998653952)
			gg.toast("执行吃怪")
		end
		end
	else
		gg.toast("没搜到")
	end
end





function miaosha()
    local memory = 32
	local a= 4
	local b= 4
	local array = {
		{["lv"] = 200000004, ["type"] = a},
		{["lv"] = 134482445 , ["offset"] = 4, ["type"] = a},	
	}
	local isok, data = app.memorysearch(memory, array)
	if isok then
		for i = 1, #data do
		c,d1=app.memoryread(data[i] + 16, b )
		c,d2=app.memoryread(data[i] + 12, b )
		hfh[i] = d1
		hfh2[i] = d2
		if c  then
		    app.memorywrite(data[i] + 16, a, xgh)
		end
		end
	else
		gg.toast("没搜到")
	end
	gg.toast("修改数据")
end


function huifushuju()
    local memory = 32
	local a= 4
	local b= 4
	local array = {
		{["lv"] = 200000004, ["type"] = a},
		{["lv"] = 134482445 , ["offset"] = 4, ["type"] = a},
	}
	local isok, data = app.memorysearch(memory, array)
	if isok then
		for i = 1, #data do
		c,d1=app.memoryread(data[i] + 16, b )
		if c  then
		    app.memorywrite(data[i] + 16, a, hfh[i])
			app.memorywrite(data[i] + 12, a, hfh2[i])
		end
		end
	else
		gg.toast("没搜到")
	end
	gg.toast("恢复数据")
end




function Main()

  SN = gg.choice({  
  "①  千刃爆伤",
  "②  互秒",
"③  全屏",
"④  无限技能",
  "⚠  退出科技",
}, nil,"鼎鼎科技，稳定奔放 "..os.date("\n%Y年-%m月-%d日 %H时:%M分:%S秒"))
  if SN == nil then
  else
  if SN == 1 then miaosha() end
  if SN == 2 then huifushuju() end
  if SN == 3 then quanping() end
  if SN == 4 then wuxian() end
  if SN == 5 then Exit()
  end
  end
  XGCK = -1
end

xgh = 1083127808
hfh = {}
hfh2 = {}
while true do

  if gg.isVisible(true) then
    XGCK = 1
    gg.setVisible(false)
  end
  gg.clearResults()
  if XGCK == 1then
  Main()
  end
end



function Exit()
print("鼎鼎科技")
os.exit()
end
cs =""



---[=[   ]=]-------------------------------------------------------------------------------------------------------------------
end

     end

end



if km == nil  then
else
if km ~=""  then
if e==true then
KM_L(km)
end 
end
end



hak=gg.prompt({
[[全网使用次数：]]..api_total..[[

输入 >1< 解绑卡密
在下方输入你的卡密]],
"是否自动登入",
},{
km,
e
},{
'text',--文字
'checkbox',--多选
})--文本功能


if hak==nil then
elseif hak[2]==true then
io.open(AMI_YDO..'/e.log','w+'):write("2")--写
elseif hak[2]==false then
io.open(AMI_YDO..'/e.log','w+'):write("1")--写
end


if hak==nil then gg.setVisible(false) 
elseif hak[1]== "1" then
G_B=gg.prompt({"输入要解绑的卡密"},{},{"text"})
if  G_B[1]== "" then
gg.alert("空，请填写卡密")--对话框
else
KM_G=json2lua(KM_G(G_B[1]))
if KM_G.code== 200 then
else
gg.alert(KM_G.msg)--对话框
end
end
elseif hak[1]== "2" then

elseif hak[1]== "" then
gg.alert("空，请填写卡密")--对话框
else
KM_L(hak[1])
end

end

while true do
  if gg.isVisible(true) then
  MIAN()
  end
end

end

function B()
local function json2true(str,from,to) return true, from+3 end local function json2false(str,from,to) return false, from+4 end local function json2null(str, from, to) return nil, from+3 end local function json2nan(str, from, to) return nul, from+2 end local numberchars = {['-'] = true,['+'] = true,['.'] = true,['0'] = true,['1'] = true,['2'] = true,['3'] = true,['4'] = true,['5'] = true,['6'] = true,['7'] = true,['8'] = true,['9'] = true} local function json2number(str,from,to) local i = from+1 while(i<=to) do local char = string.sub(str, i, i) if not numberchars[char] then break end i = i + 1 end local num = tonumber(string.sub(str, from, i-1)) if not num then error(_format('json格式错误，不正确的数字, 错误位置:{from}', from)) end return num, i-1 end local function json2string(str,from,to) local ignor = false for i = from+1, to do local char = string.sub(str, i, i) if not ignor then if char == '\"' then return string.sub(str, from+1, i-1), i elseif char == '\\' then ignor = true end else ignor = false end end error(_format('json格式错误，字符串没有找到结尾, 错误位置:{from}', from)) end local function json2array(str,from,to)    local result = {}    from = from or 1    local pos = from+1    local to = to or string.len(str)    while(pos<=to) do        local char = string.sub(str, pos, pos)        if char == '\"' then            result[#result+1], pos = json2string(str,pos,to)        elseif char == '[' then            result[#result+1], pos = json2array(str,pos,to)        elseif char == '{' then            result[#result+1], pos = json2table(str,pos,to)        elseif char == ']' then            return result, pos        elseif (char=='f' or char=='F') then            result[#result+1], pos = json2false(str,pos,to)        elseif (char=='t' or char=='T') then            result[#result+1], pos = json2true(str,pos,to)        elseif (char=='n') then            result[#result+1], pos = json2null(str,pos,to)        elseif (char=='N') then            result[#result+1], pos = json2nan(str,pos,to)        elseif numberchars[char] then            result[#result+1], pos = json2number(str,pos,to)        end        pos = pos + 1    end    error(_format('json格式错误，表没有找到结尾, 错误位置:{from}', from)) end function _G.json2table(str,from,to)    local result = {}    from = from or 1    local pos = from+1    local to = to or string.len(str)    local key    while(pos<=to) do        local char = string.sub(str, pos, pos)        if char == '\"' then            if not key then                key, pos = json2string(str,pos,to)            else                result[key], pos = json2string(str,pos,to)                key = nil            end        elseif char == '[' then            if not key then                key, pos = json2array(str,pos,to)            else                result[key], pos = json2array(str,pos,to)                key = nil            end        elseif char == '{' then            if not key then                key, pos = json2table(str,pos,to)            else                result[key], pos = json2table(str,pos,to)                key = nil            end        elseif char == '}' then            return result, pos        elseif (char=='f' or char=='F') then            result[key], pos = json2false(str,pos,to)            key = nil        elseif (char=='t' or char=='T') then            result[key], pos = json2true(str,pos,to)            key = nil        elseif (char=='n') then            result[key], pos = json2null(str,pos,to)            key = nil        elseif (char=='N') then            result[key], pos = json2nan(str,pos,to)            key = nil        elseif numberchars[char] then            if not key then                key, pos = json2number(str,pos,to)            else                result[key], pos = json2number(str,pos,to)                key = nil            end        end        pos = pos + 1    end    error(_format('格式错误，表没有找到结尾, 错误位置:{from}', from)) end local jsonfuncs={['\"']=json2string,['[']=json2array,['{']=json2table,['f']=json2false,['F']=json2false,['t']=json2true,['T']=json2true} function json2lua(str) if str==nil then gg.alert('错误json') else local char = string.sub(str, 1, 1) local func=jsonfuncs[char] if func then return func(str, 1, string.len(str)) end if numberchars[char] then return json2number(str, 1, string.len(str)) end end end

function md5(code) local code = tostring(code) local HexTable = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"} local A = 0x67452301 local B = 0xefcdab89 local C = 0x98badcfe local D = 0x10325476 local S11 = 7 local S12 = 12 local S13 = 17 local S14 = 22 local S21 = 5 local S22 = 9 local S23 = 14 local S24 = 20 local S31 = 4 local S32 = 11 local S33 = 16 local S34 = 23 local S41 = 6 local S42 = 10 local S43 = 15 local S44 = 21 local function F(x,y,z) return (x & y) | ((~x) & z) end local function G(x,y,z) return (x & z) | (y & (~z)) end local function H(x,y,z) return x ~ y ~ z end local function I(x,y,z) return y ~ (x | (~z)) end local function FF(a,b,c,d,x,s,ac) a = a + F(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function GG(a,b,c,d,x,s,ac) a = a + G(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function HH(a,b,c,d,x,s,ac) a = a + H(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function II(a,b,c,d,x,s,ac) a = a + I(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function MD5StringFill(s) local len = s:len() local mod512 = len * 8 % 512 local fillSize = (448 - mod512) // 8 if mod512 > 448 then fillSize = (960 - mod512) // 8 end local rTab = {} local byteIndex = 1 for i = 1,len do local index = (i - 1) // 4 + 1 rTab[index] = rTab[index] or 0 rTab[index] = rTab[index] | (s:byte(i) << (byteIndex - 1) * 8) byteIndex = byteIndex + 1 if byteIndex == 5 then byteIndex = 1 end end local b0x80 = false local tLen = #rTab if byteIndex ~= 1 then rTab[tLen] = rTab[tLen] | 0x80 << (byteIndex - 1) * 8 b0x80 = true end for i = 1,fillSize // 4 do if not b0x80 and i == 1 then rTab[tLen + i] = 0x80 else rTab[tLen + i] = 0x0 end end local bitLen = math.floor(len * 8) tLen = #rTab rTab[tLen + 1] = bitLen & 0xffffffff rTab[tLen + 2] = bitLen >> 32 return rTab end function getmd5(s) local fillTab = MD5StringFill(s) local result = {A,B,C,D} for i = 1,#fillTab // 16 do local a = result[1] local b = result[2] local c = result[3] local d = result[4] local offset = (i - 1) * 16 + 1 a = FF(a, b, c, d, fillTab[offset + 0], S11, 0xd76aa478) d = FF(d, a, b, c, fillTab[offset + 1], S12, 0xe8c7b756) c = FF(c, d, a, b, fillTab[offset + 2], S13, 0x242070db) b = FF(b, c, d, a, fillTab[offset + 3], S14, 0xc1bdceee) a = FF(a, b, c, d, fillTab[offset + 4], S11, 0xf57c0faf) d = FF(d, a, b, c, fillTab[offset + 5], S12, 0x4787c62a) c = FF(c, d, a, b, fillTab[offset + 6], S13, 0xa8304613) b = FF(b, c, d, a, fillTab[offset + 7], S14, 0xfd469501) a = FF(a, b, c, d, fillTab[offset + 8], S11, 0x698098d8) d = FF(d, a, b, c, fillTab[offset + 9], S12, 0x8b44f7af) c = FF(c, d, a, b, fillTab[offset + 10], S13, 0xffff5bb1) b = FF(b, c, d, a, fillTab[offset + 11], S14, 0x895cd7be) a = FF(a, b, c, d, fillTab[offset + 12], S11, 0x6b901122) d = FF(d, a, b, c, fillTab[offset + 13], S12, 0xfd987193) c = FF(c, d, a, b, fillTab[offset + 14], S13, 0xa679438e) b = FF(b, c, d, a, fillTab[offset + 15], S14, 0x49b40821) a = GG(a, b, c, d, fillTab[offset + 1], S21, 0xf61e2562) d = GG(d, a, b, c, fillTab[offset + 6], S22, 0xc040b340) c = GG(c, d, a, b, fillTab[offset + 11], S23, 0x265e5a51) b = GG(b, c, d, a, fillTab[offset + 0], S24, 0xe9b6c7aa) a = GG(a, b, c, d, fillTab[offset + 5], S21, 0xd62f105d) d = GG(d, a, b, c, fillTab[offset + 10], S22, 0x2441453) c = GG(c, d, a, b, fillTab[offset + 15], S23, 0xd8a1e681) b = GG(b, c, d, a, fillTab[offset + 4], S24, 0xe7d3fbc8) a = GG(a, b, c, d, fillTab[offset + 9], S21, 0x21e1cde6) d = GG(d, a, b, c, fillTab[offset + 14], S22, 0xc33707d6) c = GG(c, d, a, b, fillTab[offset + 3], S23, 0xf4d50d87) b = GG(b, c, d, a, fillTab[offset + 8], S24, 0x455a14ed) a = GG(a, b, c, d, fillTab[offset + 13], S21, 0xa9e3e905) d = GG(d, a, b, c, fillTab[offset + 2], S22, 0xfcefa3f8) c = GG(c, d, a, b, fillTab[offset + 7], S23, 0x676f02d9) b = GG(b, c, d, a, fillTab[offset + 12], S24, 0x8d2a4c8a) a = HH(a, b, c, d, fillTab[offset + 5], S31, 0xfffa3942) d = HH(d, a, b, c, fillTab[offset + 8], S32, 0x8771f681) c = HH(c, d, a, b, fillTab[offset + 11], S33, 0x6d9d6122) b = HH(b, c, d, a, fillTab[offset + 14], S34, 0xfde5380c) a = HH(a, b, c, d, fillTab[offset + 1], S31, 0xa4beea44) d = HH(d, a, b, c, fillTab[offset + 4], S32, 0x4bdecfa9) c = HH(c, d, a, b, fillTab[offset + 7], S33, 0xf6bb4b60) b = HH(b, c, d, a, fillTab[offset + 10], S34, 0xbebfbc70) a = HH(a, b, c, d, fillTab[offset + 13], S31, 0x289b7ec6) d = HH(d, a, b, c, fillTab[offset + 0], S32, 0xeaa127fa) c = HH(c, d, a, b, fillTab[offset + 3], S33, 0xd4ef3085) b = HH(b, c, d, a, fillTab[offset + 6], S34, 0x4881d05) a = HH(a, b, c, d, fillTab[offset + 9], S31, 0xd9d4d039) d = HH(d, a, b, c, fillTab[offset + 12], S32, 0xe6db99e5) c = HH(c, d, a, b, fillTab[offset + 15], S33, 0x1fa27cf8) b = HH(b, c, d, a, fillTab[offset + 2], S34, 0xc4ac5665) a = II(a, b, c, d, fillTab[offset + 0], S41, 0xf4292244) d = II(d, a, b, c, fillTab[offset + 7], S42, 0x432aff97) c = II(c, d, a, b, fillTab[offset + 14], S43, 0xab9423a7) b = II(b, c, d, a, fillTab[offset + 5], S44, 0xfc93a039) a = II(a, b, c, d, fillTab[offset + 12], S41, 0x655b59c3) d = II(d, a, b, c, fillTab[offset + 3], S42, 0x8f0ccc92) c = II(c, d, a, b, fillTab[offset + 10], S43, 0xffeff47d) b = II(b, c, d, a, fillTab[offset + 1], S44, 0x85845dd1) a = II(a, b, c, d, fillTab[offset + 8], S41, 0x6fa87e4f) d = II(d, a, b, c, fillTab[offset + 15], S42, 0xfe2ce6e0) c = II(c, d, a, b, fillTab[offset + 6], S43, 0xa3014314) b = II(b, c, d, a, fillTab[offset + 13], S44, 0x4e0811a1) a = II(a, b, c, d, fillTab[offset + 4], S41, 0xf7537e82) d = II(d, a, b, c, fillTab[offset + 11], S42, 0xbd3af235) c = II(c, d, a, b, fillTab[offset + 2], S43, 0x2ad7d2bb) b = II(b, c, d, a, fillTab[offset + 9], S44, 0xeb86d391) result[1] = result[1] + a result[2] = result[2] + b result[3] = result[3] + c result[4] = result[4] + d result[1] = result[1] & 0xffffffff result[2] = result[2] & 0xffffffff result[3] = result[3] & 0xffffffff result[4] = result[4] & 0xffffffff end local retStr = '' for i = 1,4 do for _ = 1,4 do local temp = result[i] & 0x0F local str = HexTable[temp + 1] result[i] = result[i] >> 4 temp = result[i] & 0x0F retStr = retStr .. HexTable[temp + 1] .. str result[i] = result[i] >> 4 end end return string.lower(retStr) end return getmd5(code) end
--md5加密 md5("加密内容")

ZZRc4 = {}
ZZMathBit = {}
function ZZMathBit.__xorBit(left, right) return (left + right) == 1 and 1 or 0 end function ZZMathBit.__base(left, right, op) if left < right then left, right = right, left end local res = 0 local shift = 1 while left ~= 0 do local ra = left % 2 local rb = right % 2 res = shift * op(ra,rb) + res shift = shift * 2 left = math.modf( left / 2) right = math.modf( right / 2) end return res end function ZZMathBit.xorOp(left, right) return ZZMathBit.__base(left, right, ZZMathBit.__xorBit) end function RC4(text,key,kasi)
  if kasi==false then str = text str=str:gsub("[%s%p]",""):upper() local index=1 local ret="" for index=1,str:len(),2 do ret=ret..string.char(tonumber(str:sub(index,index+1),16)) end text=ret end local function KSA(key) local keyLen = string.len(key) local schedule = {} local keyByte = {} for i = 0, 255 do schedule[i] = i end for i = 1, keyLen do keyByte[i - 1] = string.byte(key, i, i) end local j = 0 for i = 0, 255 do j = (j + schedule[i] + keyByte[ i % keyLen]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] end return schedule end local function PRGA(schedule, textLen) local i = 0 local j = 0 local k = {} for n = 1, textLen do i = (i + 1) % 256 j = (j + schedule[i]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] k[n] = schedule[(schedule[i] + schedule[j]) % 256] end return k end local function output(schedule, text) local len = string.len(text) local c = nil local res = {} for i = 1, len do c = string.byte(text, i,i) res[i] = string.char(ZZMathBit.xorOp(schedule[i], c)) end return table.concat(res) end local textLen = string.len(text) local schedule = KSA(key) local k = PRGA(schedule, textLen) str=output(k, text) if kasi==true then str = tostring(str) local index=1 local ret="" for index=1,str:len() do ret=ret..string.format("%02X",str:sub(index):byte()) end return string.lower(ret) else return str end end
--极简云RC42加密和解密配置     RC4("加密内容","密码",false=解密_true=加密)

function ultra(get,post) local c=gg.makeRequest(get,nil,post).content  if c==nil then gg.alert("网络错误了，请检查你的网络") os.exit() end return c  end
--请求
function download(get,address) local c=gg.makeRequest(get,nil,nil).content  if c==nil then gg.alert("网络错误了，请检查你的网络") os.exit() end io.open(address,"w+"):write(c) gg.toast("下载成功") end
--下载文件


---[=[上面不要乱动]=]-------------------------------------------------------------------------------------------------------------------

local xxxxxxx="http://cute521.cn"
--官网

local xxxxxxx_Kami=xxxxxxx.."/api.php?api=kmlogon"
--接口名称[卡密登录]

local xxxxxxx_jieba=xxxxxxx.."/api.php?api=kmunmachine"
--接口名称[卡密解绑]

local xxxxxxx_to_configure=xxxxxxx.."/api.php?api=ini"
--接口名称[应用配置]

local xxxxxxx_Notice=xxxxxxx.."/api.php?api=notice"
--接口名称[应用公告]

---[=[  上面是对接  ]=]-------------------------------------------------------------------------------------------------------------------

local xxxxxxx_APPID='11351'
--APPID

local xxxxxxx_APPKEY='Y54kv100xx1CsXf0'
--APPKEY

local xxxxxxx_RC4_key='fbY05JyG0Bv11351'
--是否 RC4 加密[key 密钥]


local xxxbanb='1.0'
--1.0


local xxxxxxx_RC4=true
--是否 RC4 加密[false=关 true=开]
--选择 RC4加密-2 否则会乱码
--打开 签名放DATA里:打开


AMI_YDO="/sdcard/"
--卡密 设备码 路径

----------------------------------------------------------------------------------------------------------------------

if xxxxxxx_APPID=="" or xxxxxxx_APPKEY=="" then
  gg.alert("对接数据,空...")--对话框
  os.exit()
end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------


file=ultra(xxxxxxx_to_configure.."&app="..xxxxxxx_APPID,"")
if xxxxxxx_RC4 == true then
  file=RC4(file,xxxxxxx_RC4_key,false)
  gg.setVisible(false)
end
if json2lua(file).code ~= 200 then
gg.alert("应用配置接口："..json2lua(file).msg)--错误提示
os.exit()
else

api_total=json2lua(file).msg.api_total
--调用几次接口[ 判断使用人数 ]

app_update_must=json2lua(file).msg.app_update_must
--是否强行更新 y是 n否

app_update_show=json2lua(file).msg.app_update_show
--更新内容

app_update_url=json2lua(file).msg.app_update_url
--更新地址

version=json2lua(file).msg.version
--版本号

version_info=json2lua(file).msg.version_info
--应用版本信息


if version == xxxbanb then
gg.setVisible(false)
gg.toast("最新版")--提示
else

if app_update_must=="y" then
gg.setVisible(false)
gg.alert("强制更新："..app_update_show,"下载")--对话框
if app_update_url ~=""  then
download(app_update_url,"/sdcard/新版本.lua")
os.exit()
else
gg.alert("没有找到更新下载链接!，请联系客服")--对话框
os.exit()
end

else
gg.setVisible(false)
gg.alert("更新内容："..app_update_show,"下载")--对话框
if app_update_url ~=""  then
download(app_update_url,"/sdcard/新版本.lua")
else
gg.alert("没有找到更新下载链接!，请联系客服")--对话框
os.exit()
end

end
end

end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------

Notice=ultra(xxxxxxx_Notice.."&app=".. xxxxxxx_APPID,"")
if xxxxxxx_RC4 == true then
  Notice=RC4(Notice,xxxxxxx_RC4_key,false)
  gg.setVisible(false)
end


if json2lua(Notice)['code'] == 200 then
if json2lua(Notice)['app_gg'] ~= nil then
gg.alert("公告："..json2lua(Notice).msg.app_gg)--对话框
end
else
gg.alert("公告接口："..json2lua(Notice).msg)--对话框
os.exit()
end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------



function MIAN1()
miei=io.open(AMI_YDO..'/aimei','r')
if miei==nil or miei:read("*a")== "" then 
miei=md5(os.time()*1000+611-99999)
io.open(AMI_YDO..'/aimei','w+'):write(miei)--写
else
miei=io.open(AMI_YDO..'/aimei','r'):read("*a")--读
end--设备码


function KM_G(km)---[=[ 卡密解绑 ]=]-------------------------------------------------------------------------------------------------------------------
key=md5("kami="..km.."&markcode="..miei.."&t="..os.time().."&".. xxxxxxx_APPKEY)
--签名
bops="kami="..km.."&markcode="..miei.."&t="..os.time().."&sign="..key
--合成发送数据
if  xxxxxxx_RC4 == true then
bops= "data="..RC4(bops,xxxxxxx_RC4_key,true) 
end

HUT=ultra(xxxxxxx_jieba.."&app=".. xxxxxxx_APPID,bops)

if  xxxxxxx_RC4 == true then
HUT=RC4(HUT,xxxxxxx_RC4_key,false) 
end-- xxxxxxx_Base64
return HUT
end


km=io.open(AMI_YDO..'/akm','r') 
if km==nil  then else 
km=io.open(AMI_YDO..'/akm','r'):read("*a")
end--卡密保存到本地


e=io.open(AMI_YDO..'/e','r')
if e==nil or e:read("*a")== "" then 
e="1"
io.open(AMI_YDO..'/e','w+'):write(e)--写
else
e=io.open(AMI_YDO..'/e','r'):read("*a")--读
end--储存自动登入
if e== "1" then e=false else  e=true 

end


Random=md5(os.time()*1000+611*os.time()-999999)..xxxxxxx_APPKEY..miei
--随机[用来计算是否相等]
function KM_L(km)---[=[ 卡密登入 ]=]-------------------------------------------------------------------------------------------------------------------
key=md5("kami="..km.."&markcode="..miei.."&t="..os.time().."&".. xxxxxxx_APPKEY)
--计算签名

bops="kami="..km.."&markcode="..miei.."&t="..os.time().."&sign="..key
--需要请求的数据

if  xxxxxxx_RC4 == true then
bops="data="..RC4(bops,xxxxxxx_RC4_key,true)
end-- 把请求数据用RC4加密

HUT=ultra(xxxxxxx_Kami.."&app=".. xxxxxxx_APPID,bops.."&value="..Random)
--请求数据

if  xxxxxxx_RC4 == true then
HUT=RC4(HUT,xxxxxxx_RC4_key,false) 
end-- 把返回的数据用RC4解密
KM_L=json2lua(HUT)

code=KM_L.code--判断整数 200是成功
msg=KM_L.msg--数据提示 也是错误提示
check=KM_L.check--验证数据
time=KM_L.time--返回时间

if check~= md5(time..xxxxxxx_APPKEY..Random) then
gg.alert("脚本：检测到你有非法操作")--对话框
os.exit()
end

if time-os.time()>30 or time-os.time()<-30 then
gg.alert("脚本：数据过期")--对话框
os.exit()
end

if code~= 200 then
e=false
gg.alert(msg)--对话框
MIAN1()
else

TT=gg.alert([[

到期时间: ]]..os.date("%Y".."年".."%m".."月".."%d".."日  %H".."时".."%M".."分".."%S".."秒",msg.vip)..[[


使用卡密: ]]..msg.kami
,"确定","返回")--对话框
io.open(AMI_YDO..'/km.log','w+'):write(msg.kami)--写

if TT== 2 then
io.open(AMI_YDO..'/e.log','w+'):write("1")--写
MIAN()
else

---[=[   ]=]-------------------------------------------------------------------------------------------------------------------






function SearchWrite(Search, Write, Type, Name)
    gg.clearResults()
    gg.setVisible(false)
    gg.searchNumber(Search[1][1], Type)
    local count = gg.getResultCount()
    local result = gg.getResults(count)
    gg.clearResults()
    local data = {} 
    local base = Search[1][2] 
    
   if (count > 0) then
        for i, v in ipairs(result) do
            v.isUseful = true 
        end
        
        for k=2, #Search do
            local tmp = {}
            local offset = Search[k][2] - base 
            local num = Search[k][1] 
            
            for i, v in ipairs(result) do
                tmp[#tmp+1] = {} 
                tmp[#tmp].address = v.address + offset  
                tmp[#tmp].flags = v.flags  
            end
            
            tmp = gg.getValues(tmp) 
            
            for i, v in ipairs(tmp) do
                if ( tostring(v.value) ~= tostring(num) ) then 
                    result[i].isUseful = false 
                end
            end
        end
  
        for i, v in ipairs(result) do
            if (v.isUseful) then 
                data[#data+1] = v.address
            end
        end
        
        if (#data > 0) then
           gg.toast("搜索到"..#data.."条数据")
           local t = {}
           local base = Search[1][2]
           for i=1, #data do
               for k, w in ipairs(Write) do
                   offset = w[2] - base
                   t[#t+1] = {}
                   t[#t].address = data[i] + offset
                   t[#t].flags = Type
                   t[#t].value = w[1]
                  
                   
               end
           end
           gg.setValues(t)
          gg.toast(Name.."开启成功！已修改"..#t.."条数据")
         
        else
            gg.toast(Name.."开启失败", false)
            return false
        end
    else
        gg.toast(Name.."开启失败")
        return false
    end
end

function Main()
  SN = gg.multiChoice({   
  "①  狂血四维强化",
  "②  普通攻击秒杀",
  "③  技能秒杀(不能击飞)", 
  "④  超级移速(副本开启，全局有效)",
  "⑤  斗龙秒杀",
  "⑥  团本飞机秒杀",
  "⑦  人物变大",
  "⑧  通幽指环秒杀",
  "⑨  全屏(明王波动，崩山击银光落刃需要把这些技能学到2级以上才有效)",
  "⑩  微加属性(配合全屏的)",
  "⑪  技能无CD",
  "⑫ 骑士幻影戒指特效",
  "⚠  退出科技",
}, nil,"稳定奔放 "..os.date("\n%Y年-%m月-%d日 %H时:%M分:%S秒"))
  if SN == nil then
  else
  if SN[1] == true then a1() end
  if SN[2] == true then a2() end
  if SN[3] == true then a3() end
  if SN[4] == true then a4() end
  if SN[5] == true then a5() end
  if SN[6] == true then a6() end
  if SN[7] == true then a7() end
  if SN[8] == true then a8() end 
  if SN[9] == true then a9() end
  if SN[10] == true then a10() end
  if SN[11] == true then a11() end
  if SN[12] == true then a12() end
  if SN[13] == true then Exit()
  end
  end
  XGCK = -1
end
function a1()
    gg.setRanges(32)
gg.searchNumber("500;488;1;136068113;45;800~2000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("800~2000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("99999999", gg.TYPE_DWORD)
gg.toast("狂血四维强化开启成功")
end
 
         
function a2()
    gg.setRanges(32)
gg.searchNumber("1;60000~130000;1;30000~60000;1;1~200::33", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("60000~130000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("999999999", gg.TYPE_DWORD)
gg.toast("普通攻击秒杀开启成功")
end
    

function a3()   
    gg.setRanges(32)
gg.searchNumber("262152;1;24::61", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("262152", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("262151", gg.TYPE_DWORD)
gg.toast("技能秒杀开启成功")
end
    
   
function a4()    
    gg.setRanges(32)
    local Name="超级移速"
    local tb1 = {{4095,0},{4096,4},{10000,8}}
    local tb2 = {{3000,8}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
end


function a5()   
    gg.setRanges(32)
gg.searchNumber("8;1;20000;10~20::37", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("20000;10~20", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("999999", gg.TYPE_DWORD)
gg.toast("稍等")
    gg.setRanges(32)
gg.searchNumber("1;136068113;10000;1;10000::29", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("10000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("999999999", gg.TYPE_DWORD)
gg.toast("斗龙秒杀开启成功")
end


function a6()   
    gg.setRanges(32)
gg.searchNumber("1000;500;0::13", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("1000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(30)
gg.editAll("999999", gg.TYPE_DWORD)
gg.toast("团本飞机秒杀开启成功")
end


function a7()   
    gg.setRanges(32)
gg.searchNumber("34200;10000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("10000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(80)
gg.editAll("25000", gg.TYPE_DWORD)
gg.toast("人物变大开启成功")
end


function a8()   
    gg.setRanges(32)
gg.searchNumber("20000;20", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("20000;20", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(2000)
gg.editAll("9999999", gg.TYPE_DWORD)
gg.toast("稍等")    
gg.setRanges(32)
gg.searchNumber("136068113;1;10000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("10000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(2000)
gg.editAll("999999999", gg.TYPE_DWORD)
gg.toast("通幽指环秒杀开启成功")
end


function a9()   
    gg.setRanges(32)
    local Name="明王buff"
    local tb1 = {{-135674,0},{152,12},{170,16},{190,20},{210,24},{230,28}}
    local tb2 = {{900000,12},{900000,16},{900000,20},{900000,24},{900000,28},{900000,32},{900000,36},{900000,40},{900000,44},{900000,48},{900000,52},{900000,56},{900000,60},{900000,64},{900000,68},{900000,72},{900000,76}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    gg.setRanges(32)
    local Name="明王buff"
    local tb1 = {{262152,0},{-442588443,24},{-1343846776,40}}
    local tb2 = {{90000000,0}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    gg.setRanges(32)
    local Name="战士银光落刃"
    local tb1 = {{262152,0},{-1184,20},{-1128,76}}
    local tb2 = {{262151,0}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)   
    gg.setRanges(32)
    local Name="战士银光落刃"
    local tb1 = {{-95408,0},{-95546,12},{510,52}}
    local tb1 = {{-95408,0},{-95546,12},{510,52}}
    local tb2 = {{900000,52},{900000,24},{900000,28},{900000,32},{900000,36},{900000,40},{900000,44},{900000,48},{900000,56},{900000,60},{900000,64},{900000,68},{900000,72},{900000,76},{900000,80},{900000,84},{900000,88},{900000,92},{900000,96},{900000,100}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    gg.setRanges(32)
    local Name="战士银光落刃"
    local tb1 = {{-97518,0},{4000,16},{-89878,36}}
    local tb2 = {{0,16}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
    gg.setRanges(32)
    local Name="战士银光落刃"
    local tb1 = {{4095,0},{4096,4},{10000,8}}
    local tb2 = {{3000,8}}
    local dataType = gg.TYPE_DWORD
    SearchWrite(tb1, tb2, dataType,Name)
     end


function a10()
    gg.setRanges(32)
gg.searchNumber("500;488;1;136068113;45;800~2000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("800~2000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(8000)
gg.editAll("9999999", gg.TYPE_DWORD)
gg.toast("开启成功")
    end
function a11()
    gg.setRanges(32)
gg.searchNumber("45;1000~120000;1;3::73", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("1", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(2000)
gg.editAll("9999", gg.TYPE_DWORD)
gg.toast("开启成功")
end
function a12()
    gg.setRanges(32)
gg.searchNumber("1;50;10000", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("50", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(1800)
gg.editAll("999999", gg.TYPE_DWORD)
gg.toast("开启成功")
end


     
while true do
  if gg.isVisible(true) then
    XGCK = 1
    gg.setVisible(false)
  end
  gg.clearResults()
  if XGCK == 1then
  Main()
  end
end



---[=[   ]=]-------------------------------------------------------------------------------------------------------------------
end

     end

end



if km == nil  then
else
if km ~=""  then
if e==true then
KM_L(km)
end 
end
end



hak=gg.prompt({
[[全网使用次数：]]..api_total..[[

输入 >1< 解绑卡密
在下方输入你的卡密]],
"是否自动登入",
},{
km,
e
},{
'text',--文字
'checkbox',--多选
})--文本功能


if hak==nil then
elseif hak[2]==true then
io.open(AMI_YDO..'/e.log','w+'):write("2")--写
elseif hak[2]==false then
io.open(AMI_YDO..'/e.log','w+'):write("1")--写
end


if hak==nil then gg.setVisible(false) 
elseif hak[1]== "1" then
G_B=gg.prompt({"输入要解绑的卡密"},{},{"text"})
if  G_B[1]== "" then
gg.alert("空，请填写卡密")--对话框
else
KM_G=json2lua(KM_G(G_B[1]))
if KM_G.code== 200 then
else
gg.alert(KM_G.msg)--对话框
end
end
elseif hak[1]== "2" then

elseif hak[1]== "" then
gg.alert("空，请填写卡密")--对话框
else
KM_L(hak[1])
end

end

while true do
  if gg.isVisible(true) then
  MIAN1()
  end
end

end


function Exit()
print("欢迎下次使用")
os.exit()
end


function HOME()
lw=1
Main()
end



cs = '鼎鼎科技'
while(true)do
if gg.isVisible(true) then
XGCK=1
gg.setVisible(false)
end
gg.clearResults()
if XGCK==1 then
Main()
end
end