string.toMusic('欢迎使用太白全防,减小音量可以隐藏,加大音量可显示') draw.text("太白全防",150,150) draw.setColor("#00ffff") function split(szFullString, szSeparator) local nFindStartIndex = 1 local nSplitIndex = 1 local nSplitArray = {} while true do local nFindLastIndex = string.find(szFullString, szSeparator, nFindStartIndex) if not nFindLastIndex then nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, string.len(szFullString)) break end nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, nFindLastIndex - 1) nFindStartIndex = nFindLastIndex + string.len(szSeparator) nSplitIndex = nSplitIndex + 1 end return nSplitArray end function xgxc(szpy, qmxg) for x = 1, #(qmxg) do xgpy = szpy + qmxg[x]["offset"] xglx = qmxg[x]["type"] xgsz = qmxg[x]["value"] gg.setValues({[1] = {address = xgpy, flags = xglx, value = xgsz}}) xgsl = xgsl + 1 end end function xqmnb(qmnb) gg.clearResults() gg.setRanges(qmnb[1]["memory"]) gg.searchNumber(qmnb[3]["value"], qmnb[3]["type"]) if gg.getResultCount() == 0 then gg.toast(qmnb[2]["name"] .. "开启失败") else gg.refineNumber(qmnb[3]["value"], qmnb[3]["type"]) gg.refineNumber(qmnb[3]["value"], qmnb[3]["type"]) gg.refineNumber(qmnb[3]["value"], qmnb[3]["type"]) if gg.getResultCount() == 0 then gg.toast(qmnb[2]["name"] .. "开启失败") else sl = gg.getResults(999999) sz = gg.getResultCount() xgsl = 0 if sz > 999999 then sz = 999999 end for i = 1, sz do pdsz = true for v = 4, #(qmnb) do if pdsz == true then pysz = {} pysz[1] = {} pysz[1].address = sl[i].address + qmnb[v]["offset"] pysz[1].flags = qmnb[v]["type"] szpy = gg.getValues(pysz) pdpd = qmnb[v]["lv"] .. ";" .. szpy[1].value szpd = split(pdpd, ";") tzszpd = szpd[1] pyszpd = szpd[2] if tzszpd == pyszpd then pdjg = true pdsz = true else pdjg = false pdsz = false end end end if pdjg == true then szpy = sl[i].address xgxc(szpy, qmxg) xgjg = true end end if xgjg == true then gg.toast(qmnb[2]["name"] .. "开启成功,共修改" .. xgsl .. "条ΔΘ") else gg.toast(qmnb[2]["name"] .. "开启失败") end end end end --[[静态配置]]function Address(adds,offset,chang,value,flags,freeze,save,name)local add=gg.getRangesList(adds)[1]["start"]+offset local data={{["address"]=add,["value"]=value,["flags"]=flags,["freeze"]=freeze}}if chang==true then gg.setValues(data)end if freeze or save ==true then gg.addListItems(data)end if name~="false" then gg.toast("🛡["..name.."]已装载🛡")end end function Fxs(Search, Write,Neicun,Mingcg,Shuzhiliang) gg.clearResults() gg.setRanges(Neicun) gg.setVisible(false) gg.searchNumber(Search[1][1], Search[1][3]) 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 = Search[k][3] 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(Mingcg.."搜索到"..#data.."条数据") local t = {} local base = Search[1][2] if Shuzhiliang == "" and Shuzhiliang > 0 and Shuzhiliang < #data then Shuzhiliang=Shuzhiliang else Shuzhiliang=#data end for i=1, Shuzhiliang do for k, w in ipairs(Write) do offset = w[2] - base t[#t+1] = {} t[#t].address = data[i] + offset t[#t].flags = w[3] t[#t].value = w[1] if (w[4] == true) then local item = {} item[#item+1] = t[#t] item[#item].freeze = true gg.addListItems(item) end end end gg.setValues(t) gg.toast(Mingcg.."已修改"..#t.."条数据") gg.addListItems(t) else gg.toast(Mingcg.."开启失败", false) return false end else gg.toast("搜索失败") return false end end function split(szFullString, szSeparator) end function setvalue(address,flags,value) split('修改地址数值(地址,数值类型,要修改的值)') local tt={} tt[1]={} tt[1].address=address tt[1].flags=flags tt[1].value=value gg.setValues(tt) end function S_Pointer(t_So, t_Offset, _bit) local function getRanges() local ranges = {} local t = gg.getRangesList('^/data/*.so*$') for i, v in pairs(t) do if v.type:sub(2, 2) == 'w' then table.insert(ranges, v) end end return ranges end local function Get_Address(N_So, Offset, ti_bit) local ti = gg.getTargetInfo() local S_list = getRanges() local _Q = tonumber(123456) local t = {} local _t local _S = nil if ti_bit then _t = 32 else _t = 4 end for i in pairs(S_list) do local _N = S_list[i].internalName:gsub('^.*/', '') if N_So[1] == _N and N_So[2] == S_list[i].state then _S = S_list[i] break end end if _S then t[#t + 1] = {} t[#t].address = _S.start + Offset[1] t[#t].flags = _t if #Offset ~= 1 then for i = 2, #Offset do local S = gg.getValues(t) t = {} for _ in pairs(S) do if not ti.x64 then S[_].value = S[_].value & 0xFFFFFFFF end t[#t + 1] = {} t[#t].address = S[_].value + Offset[i] t[#t].flags = _t end end end _S = t[#t].address print(string.char(231,190,164,58).._Q) end return _S end local _A = string.format('0x%X', Get_Address(t_So, t_Offset, _bit)) return _A end--动态 MAIN = 1 function setvalue(address,flags,value) local tt={} tt[1]={} tt[1].address=address tt[1].flags=flags tt[1].value=value gg.setValues(tt) end function WRITEBYTES(address,flags,value) local tt={} tt[1]={} tt[1].address=address tt[1].flags=flags tt[1].value=value gg.setValues(tt) end ---------------------------------------------------------------------------------------------------------------- jianbian6 = luajava.new(GradientDrawable) jianbian6:setCornerRadius(25) jianbian6:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbian6:setColors({0xddC70100,0xFFFF7FD6}) jianbian6:setStroke(0,"0xdd282F4B")--边框宽度和颜色 jianbian7 = luajava.new(GradientDrawable) jianbian7:setCornerRadius(40) jianbian7:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbian7:setColors({0x6600FF76,0x9900A5FF}) jianbian7:setStroke(8,"0xffffffff") jianbian8 = luajava.new(GradientDrawable) jianbian8:setCornerRadius(40) jianbian8:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbian8:setColors({0x66FF2C22,0x998600FF}) jianbian8:setStroke(8,"0xffffffff") jianbian9 = luajava.new(GradientDrawable) jianbian9:setCornerRadius(4) jianbian9:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbian9:setColors({0x998600FF,0xddC70100}) jianbian9:setStroke(4,"0x44000000") local json =json 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("-- WSG PRO 1.0.9(109)\n"..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 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") gg.playMusic("stop") gg.playMusic("stop") end 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 local XEY=gg.makeRequest("http://music.163.com/song/media/outer/url?id="..idb[SN]..".mp3").content local XEY1=gg.getFile():gsub("[^/]+$","")..gqlb[SN]..".mp3" io.open(XEY1,"w"):write(XEY) gg.alert("提示:\n\n音乐已成功下载位置:\n\n"..XEY1) end XGCK=-1 end 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 = "-- WSG PRO 1.0.9(109)\nreturn " .. 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 YY998() Obtain=gg.makeRequest("https://api.uomg.com/api/rand.music?sort=热歌榜&format=json").content muchen=Obtain:match('url":"(.-)","picurl') gg.playMusic(muchen) end function tst(text) text = tostring(text) local block = luajava.getBlock() local layout = luajava.loadlayout({ LinearLayout, background=jianbian7, gravity='center', layout_height='match_parent', layout_width='match_parent', layout_wight='1', { TextView, id = luajava.newId('TextView'), text = text, textSize = '18sp', textColor = "#ffffffff", margins = {'10dp', '10dp', '0dp', '10dp'} } }) local function invoke() if toaa==nil then toaa = Toast:makeText(app.context, '', 1) end toaa:setView(layout) toaa:show() end luajava.handlerPost(invoke) end gg.sleep(2000) -------------------------------------------------------------------------------------------------- local function switch2(...) local menus = {...} local block = luajava.getBlock() local context = app.context local window = context:getSystemService("window") -- 获取窗口管理器 local function getWindowManagerParams() local params = luajava.new(WindowManager.LayoutParams) params.type = (Build.VERSION.SDK_INT >= 26 and 2038 or 2002) params.format = PixelFormat.RGBA_8888 -- 设置背景 params.flags = params.FLAG_NOT_FOCUSABLE -- 焦点设置Finish params.width = params.WRAP_CONTENT -- 布局宽度 params.height = params.WRAP_CONTENT -- 布局高度 params.gravity = Gravity.LEFT | Gravity.TOP -- 重力设置 return params end local mainLayout = { LinearLayout, background=jianbian6, orientation = 'vertical', layout_width = 'wrap_content', padding = {'10dp', '10dp', '10dp', '10dp'} } local function exit() window:removeView(mainLayout) block('end') end setExitEvent(exit) local hideLayout = { LinearLayout, orientation = 'horizontal', layout_width = 'fill_parent', gravity = 'center_horizontal', { ImageView, src = 0x7F02000C, padding = {'5dp', '5dp', '5dp', '5dp'}, onClick = function() local gridLayout = luajava.getIdView('功能界面') if not gridLayout then return end local VISIBLE = GridLayout.VISIBLE local GONE = GridLayout.GONE local visibility = gridLayout:getVisibility() > VISIBLE and VISIBLE or GONE gridLayout:setVisibility(visibility) end } } mainLayout[#mainLayout + 1] = hideLayout local main2Layout = { LinearLayout, id = luajava.newId('功能界面'), orientation = 'vertical', layout_width = 'wrap_content', gravity = 'center_horizontal' } mainLayout[#mainLayout + 1] = main2Layout local function formatList(list) local gridLayout = { GridLayout, orientation = 'horizontal', columnCount = '3', layout_width = 'wrap_content' } list[#list + 1] = { setText = '退出', onCheckedChanged = function(buttonView) return exit() end } list[#list + 1] = { setText = '进程', textColor = "0xFFC90000", onCheckedChanged = function(buttonView) string.toMusic('请选择进程') gg.setProcessX() end } for i, value in ipairs(list) do local name do local names = {'name', 'text', 'setText'} for i, key in ipairs(names) do name = value[key] if name then break end end if not name then name = string.format('功能%d', i) end for i, key in ipairs(names) do value[key] = name end end local switchLayout = { Switch, text = name, } local onCheckedChanged = value.onCheckedChanged if not isFunction(onCheckedChanged) then onCheckedChanged = function(switch, isChecked) if not isSurvive() then gg.toast('脚本已结束') return exit() end local mode = isChecked and 'open' or 'close' local func = value[mode] if not isFunction(func) then switch:setChecked(not isChecked) func = function(self) gg.alert(string.format('%s缺少%s函数,该属性必须为function类型', value.name, mode)) end end luajava.startThread(function(...) pcall(func, ...) end, name, value, switch) end end if isFunction(onCheckedChanged) then onCheckedChanged = luajava.createProxy('android.widget.CompoundButton$OnCheckedChangeListener', { onCheckedChanged = onCheckedChanged }) end switchLayout.onCheckedChangeListener = onCheckedChanged gridLayout[#gridLayout + 1] = switchLayout end return gridLayout end local navigate2 = { LinearLayout, orientation = 'horizontal', layout_width = 'match_parent', gravity = 'center_horizontal' } local ids = {} local views = {} for i, menu in ipairs(menus) do local name = menu.name if not name then name = ('菜单%s'):format(i) menu.name = name end ids[i] = string.format('%s-%s', i, name) local menuLayout = { Button, text = name, background = '#0000000', layout_width = 'wrap_content', onClick = function() for i2, id in ipairs(ids) do local view = views[i2] if not view then view = luajava.getIdView(id) if view then views[i2] = view end end if view then local VISIBLE = view.VISIBLE local GONE = view.GONE local state = i == i2 and VISIBLE or GONE view:setVisibility(state) end end end } navigate2[#navigate2 + 1] = menuLayout end main2Layout[#main2Layout + 1] = navigate2 local main3Layout = { LinearLayout, layout_width = 'match_parent', gravity = 'center_horizontal' } for i, menu in ipairs(menus) do local gridLayout = formatList(menu) gridLayout.id = luajava.newId(ids[i]) gridLayout.visibility = i == 1 and GridLayout.VISIBLE or GridLayout.GONE main3Layout[#main3Layout + 1] = gridLayout end main2Layout[#main2Layout + 1] = main3Layout local function setOnTouchListener(move, layout, params) local RawX, RawY, x, y local ACTION_DOWN = MotionEvent.ACTION_DOWN local ACTION_MOVE = MotionEvent.ACTION_MOVE local tonumber = tonumber move:setOnTouchListener(luajava.createProxy("android.view.View$OnTouchListener", { onTouch = function(v, event) local Action = event:getAction() if Action == ACTION_DOWN then -- 点击时的XY坐标 RawX = event:getRawX() -- 获取X坐标 RawY = event:getRawY() -- 获取Y坐标 x = params.x -- 申明变量xmX为原X坐标 y = params.y -- 申明变量xmY为原Y坐标 elseif Action == ACTION_MOVE then -- 移动时的XY坐标 params.x = tonumber(x) + (event:getRawX() - RawX) params.y = tonumber(y) + (event:getRawY() - RawY) window:updateViewLayout(layout, params) end end })) end local params = getWindowManagerParams() mainLayout = luajava.loadlayout(mainLayout) setOnTouchListener(mainLayout, mainLayout, params) local function invoke() window:addView(mainLayout, params) end gg.setVisible(false) local c1 setOnAudioListener(function() local c2 = os.time() if not c1 or c2 - c1 > 1 then c1 = c2 luajava.runUiThread(function() mainLayout:setVisibility(mainLayout:getVisibility() == mainLayout.GONE and mainLayout.VISIBLE or mainLayout.GONE) end) end end) luajava.post(invoke) block('join') gg.setVisible(true) end _ENV['腾讯1'] = { name = '防封页面', [1] = { name = '腾讯开', open = function(self) end, close = function(self) if gg.getRangesList("libUE4.so")[1] then local t = {} t[1] = gg.getRangesList("libUE4.so")[1]["start"] + 0x11059630; -- 数值地址:0x7BA1EDA630 gg.addListItems({ [1] = { address = t[1], flags = 4, value = 130023424, freeze = true, }, }) gg.toast("开启成功") end _ENV['菜单2'] = { name = '功能页面', [1] = { name = '按钮', open = function(self) end, close = function(self) end }, } _ENV['菜单3'] = { name = '音乐', [1] = { name = '搜索歌曲',---8391694libil2cpp.so:bss+0x2E268+0xBB0+0x200+0x798+0x1A60 open = function(self) search = gg.prompt({ "输入要搜索的歌曲\n可加上歌手名字", "设置显示数量(数字)", },g.sel,{ "text", }) if not search then return 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, close = function(self) end }, [2] = { name = '停止播放', open = function(self) gg.playMusic("stop") gg.playMusic("stop") gg.playMusic("stop") end, close = function(self) end } } _ENV['菜单4'] = { name = '页面四', [1] = { name = '按钮', open = function(self) end, close = function(self) end }, } switch2(_ENV['菜单1'], _ENV['菜单2'], _ENV['菜单3'], _ENV['菜单4']) --官方频道@XHENB