Range=gg.getRangesList("anon:libc_malloc")
Start=Range[3]["start"]
End=Range[#Range-4]["end"]
YK=gg.makeRequest("https://api.iflynote.com/notes/share/note/shareFileDetail?fid=1647010791358767").content--链接
ch=YK:match("pv\":(.-),\"")
gg.alert("欢迎使用!\n全网启动次数"..ch.."次\n"..os.date("本次辅助开启时间为:\n%Y年%m月%d日%H时%M分%S秒"))
--gg.alert(" 三服公告\n感谢您使用 阿哲三服脚本\n麻烦您进一下交流群：192397541\nBy- 阿哲-祝你生活愉快-万事如意-心想事成-身体健康-By 阿哲\n4.1-国服091已适配-By 阿哲\n4.2-部分功能已修复\n4.3-功能大部修复\n4.4-功能全部修复\n4.5-已适配国际服与测试服\n更新时间：2022年-4月20日")----开始抓包检测
ffvpn = "https://biaozhunshijian.bmcx.com"
ffvpn = "https://vpn.uibe.edu.cn/por/phone_index.csp?rnd=0.23178949332658605#https%3A%2F%2Fvpn.uibe.edu.cn%2F"
x = tostring(gg.makeRequest(ffvpn))
if not x or not x:sub(1, 20) then
  gg.alert("无法访问网络请查看相应限权", "")
elseif #x < 100 or x:find("SSL") or x:find("I/O") or x:find("javax") then
  gg.alert("提示:\n网络异常❗")
  for _FORV_4_ = 1, 3 do
    print("网络请求警告:\n\n╾╾╾╾╾⚠ 警告 ⚠╾╾╾╾╾ \n检测到您正在使用恶意抓包软件破解脚本\n已自动删除原脚本\n请勿有违规行为\n╾╾╾╾╾⚠ 警告 ⚠╾╾╾╾╾ ")
  end
  for _FORV_4_ = 1, 10 do
    gg.setVisible(true)
    gg.setVisible(false)
  end
  while "http://www.time163.com/" do
    os.exit(gg.setVisible(true))
  end
end
while #tostring(gg.makeRequest("https://vpn.uibe.edu.cn/por/phone_index.csp?rnd=0.23178949332658605#https%3A%2F%2Fvpn.uibe.edu.cn%2F")) < 100 or tostring(gg.makeRequest("https://vpn.uibe.edu.cn/por/phone_index.csp?rnd=0.23178949332658605#https%3A%2F%2Fvpn.uibe.edu.cn%2F")):find("SSL") or tostring(gg
.makeRequest("https://vpn.uibe.edu.cn/por/phone_index.csp?rnd=0.23178949332658605#https%3A%2F%2Fvpn.uibe.edu.cn%2F")):find("I/O") or tostring(gg.makeRequest("https://vpn.uibe.edu.cn/por/phone_index.csp?rnd=0.23178949332658605#https%3A%2F%2Fvpn.uibe.edu.cn%2F")):find("javax") do
  os.remove(gg.getFile():match("[^/]*$"))
  print("网络请求警告:\n\n╾╾╾╾╾⚠ 警告 ⚠╾╾╾╾╾ \n检测到您正在使用恶意抓包软件破解脚本\n已自动删除原脚本\n请勿有违规行为\n╾╾╾╾╾⚠ 警告 ⚠╾╾╾╾╾ ")
  os.exit()
end
for _FORV_7_ = 1, 10 do
  for _FORV_11_ = 1, 255 do
  end
end
SJ = gg.makeRequest("http://www.baidu.com").content
if SJ == nil then
  gg.alert("网络连接失败\n请尝试重启脚本")
else
  gg.toast("网络连接成功...")
   gg.sleep("300")
   gg.toast("云端脚本获取中...")
   end
---结束抓包检测
gg.alert("\n1.务必加入售后群 更好的为您服务\n\n3.旗下辅助目前有 TT桌球  光遇 \n\n4.游戏开局后等待1-3秒后开启延长线\n\n5.如果遇到突然无效或开启失败则需要全部关闭后重新开启\n\n6.如果已经加群接下来跳转网页点击『取消』")
gg.intent("https://jq.qq.com/?_wv=1027&k=9aLqja8E")

--注入工具一键注入的的验证仅供您个人测试使用，
--请勿商用，被通杀破解造成的损失，T3验证概不负责
--请根据开发文档以及官方事例自行参考验证登录原理，
--自写一份属于自己的登录验证，不要与官方例子雷同，
--官方例子是开源的，所有用户都可使用，
--不法分子会根据验证的登录判断规则改变编程软件底层代码进行破解，
--若您执意使用注入工具一键对接源码进行商用，
--造成的损失请自行承担，继续使用则您已同意。
-------------------------------------[脚本后台配置区-建议把配置区加密并且把变量也改了]------------------------------------
host="http://w.t3data.net/19DFD01697CB1F49" --单码登录接口
host2="http://w.t3data.net/C7D287F16DB7BD53" --解绑接口
appkey="98bd9c1974ca1985dd7cd0f4734a9508" --appkey
basekey="NdGsQMkSf06CAIO8BLDbrg57Rt1w9uomxE3jvFVY4HKTy/Uq+pXziJhcWnZeal2P" --base64密码集


-------------------------------------[脚本代码运行区]------------------------------------
web = gg.makeRequest


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 = {}

  --记录当前byte在4个字节的偏移
  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
  --先将最后一个字节组成4字节一组
  --表示0x80是否已插入
  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

  --后面加原始数据bit长度
  local bitLen = math.floor(len * 8)
  tLen = #rTab
  rTab[tLen + 1] = bitLen & 0xffffffff
  rTab[tLen + 2] = bitLen >> 32

  return rTab
end

--	Func:	计算MD5
--	Param:	string
--	Return:	string
---------------------------------------------

function string.md5(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

  --将Hash值转换成十六进制的字符串
  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 retStr
end

function Base64en(data)
  local b =basekey
  return ((data:gsub('.', function(x)
    local r, b='', x:byte()
    for i = 8, 1, -1 do r = r .. (b % 2 ^ i - b % 2 ^ (i - 1) > 0 and '1' or '0') end
    return r;
  end) .. '0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
    if (#x < 6) then return '' end
    local c = 0
    for i = 1, 6 do c = c + (x:sub(i, i)=='1' and 2 ^ (6 - i) or 0) end
    return b:sub(c + 1, c + 1)
  end) .. ({ '', '==', '=' })[#data % 3 + 1])
end

function Base64de(str)
  local b =basekey
  str = string.gsub(str, '[^' .. b .. '=]', '')
  return (str:gsub('.', function(x)
    if (x == '=') then return '' end
    local r, f = '', (b:find(x)-1)
    for i = 6, 1, -1 do r = r .. (f % 2 ^ i - f % 2 ^ (i - 1) > 0 and '1' or '0') end
    return r;
  end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
    if (#x ~= 8) then return '' end
    local c = 0
    for i = 1, 8 do c = c + (x:sub(i, i) == '1' and 2 ^ (8 - i) or 0) end
    return string.char(c)
  end))
end
function jzzh(str,ms)
  str = tostring(str)
  if ms=="加" then
    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
    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
    return ret
  end
end


imeifile="/sdcard/"..string.lower(string.md5(host)).."_imei.ini" ---机器码储存文件路径
kmfile="/sdcard/"..string.lower(string.md5(host)).."_kami.ini" ---卡密输入储存卡密路径@
function jiami(str)
  rc4=Base64en(str)
  sljz=jzzh(rc4,"加")
  return sljz
end

file=io.open(imeifile,"rb")
if file==nil then
  imeis=Base64en(math.random(10000000000,999999999999)..os.time())
  io.open(imeifile, 'w')
  io.open(imeifile,"w"):write(imeis):close()
end
imei=Base64de(io.open(imeifile):read("*a"))

kami=io.open(kmfile,"rb")
if kami==nil then
  kami=""
 else
  kami=Base64de(io.open(kmfile):read("*a"))
end


function main()
  local k=gg.prompt({"请输入卡密[输入1解绑]"},{kami},{"text"})
  if k==nil then
   else
    km=k[1]
    if km=="1" then
    
  local k=gg.prompt({"请输入要解绑的卡密"},{kami},{"text"})
  if k==nil then
   else
    km=k[1]
    time=os.time()
    local i=web(host2.."&kami="..jiami(k[1]).."&t="..jiami(tostring(os.time()))).content
    if i == nil then
      gg.toast("解绑失败")
      os.exit()
     else
      local i=Base64de(i)
      gg.alert(i)
    end
  end
  XGCK = -1
    end
    time=os.time()
    local i=web(host.."&kami="..jiami(k[1]).."&imei="..jiami(imei).."&t="..jiami(tostring(os.time()))).content
    if i == nil then
      gg.toast("登录失败")
      os.exit()
     else
      local i=Base64de(i)
      local is=i:match("登录成功:(.-);")
      local id=i:match("卡密ID:(.-);")
      local ends=i:match("到期时间:(.-);")
      local sysj=i:match("剩余时间:(.-);")
      local sbm=i:match("校验密钥:(.-);")
      local dqsjc=i:match("当前时间戳:(.-);")
      if is=="200" then
        if sbm==string.lower(string.md5(tostring(id..appkey..ends..os.date("%Y%m%d%H%M")))) then
          local times=dqsjc-os.time()
          if times<5 then--校验数据中的时间和本地时间是否大于5秒
            io.open(kmfile,"w"):write(Base64en(km)):close()
            gg.alert("登录成功\n到期时间:"..ends)
            --这里放登录成功后的事件
            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
local g = {}
g.file = gg.getFile()
g.sel = nil
gqlb={"请先搜索歌曲",}
idb={"1010"}
SN,gc=1,nil
g.config = gg.getFile():gsub('%lua$', '')..'cfg'
function bei()
g.data = loadfile(g.config)
if g.data ~= nil then
g.sel = g.data()
g.data = nil
end
if g.sel == nil then
g.sel = {"","10"}
end
end
bei()
------
--搜索歌曲
function start(name,sl)
fw=gg.makeRequest("http://music.163.com/api/search/get?s="..name.."&type=1&offset=0&total=true&limit="..sl)
return fw
end
-----
--歌词
function Lyric(gid)
geci=gg.makeRequest("http://music.163.com/api/song/media?id="..gid).content
geci = string.gsub(geci, "%[%d%d%p%d%d%p%d%d%d%]", "")
geci = string.gsub(geci, "%[%d%d%p%d%d%p%d%d%]", "")
geci = string.gsub(geci, "%[%d%d%p%d%d%p%d%]", "")
geci=zjson(geci)
return geci.lyric
end
--播放音乐
function play(id,name)
gg.toast("正在播放音乐："..name,true)
gg.playMusic("http://music.163.com/song/media/outer/url?id="..id..".mp3")
end
--停止播放
function stop()
gg.toast("正在停止播放...")
for i=1,100 do
gg.playMusic("stop")
end
gg.toast("播放已停止")
end
----
function Play(gqlb,idb)
SN = gg.choice(gqlb,nil,ts)
if SN == nil then XGCK =-1 else
sn=gg.choice({"播放音乐","查看歌词"},nil,"歌曲："..gqlb[SN])
if sn == nil then end
if sn == 1 then
play(idb[SN],gqlb[SN])
end
if sn == 2 then
gc=Lyric(idb[SN])
gg.alert(gc)
end
end
XGCK=-1
end

function zjson(jsonr)
local str = jsonr
-- 匹配Json Key的正则表达式
local pattern = "\"[%w]+\":"
string.gsub(str, pattern, function(v)
    if string.find(str, v) then
        str = string.gsub(str, v, string.gsub(v, "\"", ""))
    end
end)
str = string.gsub(str, ":", "=")
str = string.gsub(str, "%[", "{")
str = string.gsub(str, "%]", "}")
local data = "return " .. str
local res = load(data)()
return res
end


function json(con)
res=zjson(con)
zd=res.result.songCount
pd=go3-zd
if pd <= 0 then else go3=zd end
ts="《"..go1.."》找到"..zd.."首歌曲，当前显示"..go3.."首"
gqlb={}
idb={}
for i=1,go3 do
gqlb[i]=res.result.songs[i].name
idb[i]=res.result.songs[i].id
end
--print(idb)
end


--主页
function Main()
XW=gg.choice({
"搜索歌曲",
"歌曲列表",
"播放音乐",
"查看歌词",
"停止播放",
"--------∽-♡-∽------∽-♡-∽--------",
"使用教程",
"『开启』延长线",
"『关闭』延长线",
"退出脚本"
},nil,"")
if XW == nil then end
if XW == 1 then Main1() end
if XW == 2 then Play(gqlb,idb) end
if XW == 3 then play(idb[SN],gqlb[SN]) end
if XW == 4 then
if idb[1]=="1010" then gg.alert("请先搜索歌曲")else
 gc=Lyric(idb[SN]);gg.alert(gc) end end
if XW == 5 then stop() end
if XW == 7 then c() end
if XW == 8 then a() end
if XW == 9 then b() end
if XW == 10 then os.exit() end
XGCK=-1
end

---
function c()
gg.intent("https://weibo.com/6734409272/LvVhPdRO2")
end



function a()
local memory = 32
local array = {
{["lv"] = 1.75, ["type"] = 16},
{["lv"] = 1.875, ["offset"] = 0x60, ["type"] = 16},
{["lv"] = 1.875, ["offset"] = 0x68, ["type"] = 16},
{["lv"] = 29, ["hv"] = 80, ["offset"] = -0x24, ["type"] = 64},
{["lv"] = 10, ["hv"] = 30, ["offset"] = -0x2C, ["type"] = 64},
{["lv"] = 3, ["hv"] = 3.4, ["offset"] = -0x20, ["type"] = 16},
}
local isok, data = app.memorysearch(memory, array)
if isok then
for i = 1, #data do
app.memorywrite(data[i] + -0x20, 16, 4.9)
end
gg.toast("开启成功")
else
gg.toast("开启失败")
end
end
function b()
local memory = 32
local array = {
{["lv"] = 1.75, ["type"] = 16},
{["lv"] = 1.875, ["offset"] = 0x60, ["type"] = 16},
{["lv"] = 1.875, ["offset"] = 0x68, ["type"] = 16},
{["lv"] = 1830, ["hv"] = 1840, ["offset"] = -0x24, ["type"] = 64},
{["lv"] = 10, ["hv"] = 30, ["offset"] = -0x2C, ["type"] = 64},
{["lv"] = 4.9, ["offset"] = -0x20, ["type"] = 16},
}
local isok, data = app.memorysearch(memory, array)
if isok then
for i = 1, #data do
app.memorywrite(data[i] + -0x20, 16, 2.96875)
end
gg.toast("关闭成功")
else
gg.toast("关闭失败")
end
end
function Main1()
search = gg.prompt({
"输入要搜索的歌曲",
"设置显示数量(数字)",
},g.sel,{
"text",
"text",
})
if search == nil then Main() end
gg.saveVariable(search,g.config)
bei()
go1=search[1]
go3=search[2]
jg=start(go1,go3)
if jg.code == 200 then
fh=jg.content
fh=json(fh)
--print(fh)
Play(gqlb,idb)
else
function inspect()
gg.alert("访问网络异常，错误代码：\n\n"..jg.code)
end
if not pcall(inspect) then print("网络异常，请先连接上网络") os.exit() end
end
XGCK=-1
end

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

            --这里放登录成功后的事件
           else
            gg.alert("数据过期")
          end
         else
          gg.alert("校验失败")
        end
       else
        gg.alert(i)
        maine()
      end
    end
  end
  XGCK = -1
end




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