Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function searchMethod(Method)
- function offset(offs, Vtype)
- local addoff = gg.getResults(gg.getResultsCount())
- for i, v in ipairs(addoff) do v.address, Vtype = v.address + offs, Vtype end
- gg.loadResults(addoff)
- end
- local Xbit = gg.getTargetInfo().x64 and 64 or 32
- local xand = gg.getRangesList("libil2cpp.so")[(Xbit == 64 and 2 or 1)].start
- local gmds = gg.getRangesList("global-metadata.dat")[1]["start"]
- local gmde = gg.getRangesList("global-metadata.dat")[1]["end"]
- local off1, typ = (Xbit == 64) and -16 or -8, (Xbit == 64) and 32 or 4
- if Xbit == 64 then gvo, gvo1, gvo2 = 24, 16, 24 else gvo, gvo1, gvo2 = 12, 8, 12 end
- local Moffset = {}
- local Mranges = {}
- gg.setRanges(gg.REGION_OTHER | gg.REGION_C_ALLOC)
- gg.clearResults()
- gg.searchNumber(":"..Method,1,false,gg.SIGN_EQUAL,gmds, gmde)
- local Xr = gg.getResults(2)
- gg.refineNumber(Xr[1].value..";"..Xr[2].value.."::2")
- gg.refineNumber(Xr[1].value)
- offset(-1, 1)
- gg.refineNumber(0,1)
- offset(#(tostring(Method)) + 1,1)
- gg.refineNumber(0,1)
- offset(-#(tostring(Method)),1)
- gg.searchPointer(0)
- local xpoint=gg.getResults(gg.getResultsCount())
- gg.clearResults()
- for i, v in pairs(xpoint) do v.address, v.flags = v.address + off1, typ end
- local xoff=gg.getValues(xpoint)
- for i, v in pairs(xoff) do
- xadd = tonumber((Xbit == 64 and v.value or "0x"..string.sub(tostring(string.format("%X",tonumber(v.value)) ), -8,-1)))
- table.insert(Moffset,xadd-xand)
- end
- return Moffset
- end
- function update()
- local offset, off = {}, {}
- local libe = gg.getRangesList("libil2cpp.so")[(Xbit == 64 and 2 or 1)]["end"]
- for i, v in pairs({{"RemoveCoinsToPrefs",1},{"UpdateMoney",2},{"IsWWEnabled",1}}) do
- Moffset = searchMethod(v[1])[v[2]]
- Xvalue = gg.getValues({{address = libs + Moffset, flags = 4},{address = libs + Moffset + 0x4, flags = 4}})
- table.insert(offset,{Moffset,Moffset + 0x4})
- table.insert(off,{Xvalue[1].value,Xvalue[2].value})
- end
- local Xout = {"(function(Data) return end)([==[CPM["..Xversion.."][x"..Xbit.."]]==])", "\noffset = {"}
- for _, v in pairs(offset) do table.insert(Xout,"\n {"..v[1]..","..v[2].."},") end
- table.insert(Xout,"\n}\noff = {")
- for _, v in pairs(off) do table.insert(Xout,"\n {"..v[1]..","..v[2].."},") end
- table.insert(Xout,"\n}")
- gg.saveList(Qfile)
- io.open(Qfile,"w"):write(string.dump(load(table.concat(Xout)),true))
- gg.toast("Done")
- print("update completed")
- return true
- end
- function XaEdit(offs,value)
- local R = {}
- for i = 1, #value do R[i] = {address = libs + offs[i], flags = 4, value = value[i], freeze = true} end
- if #R < #offs then return false end
- gg.setRanges(gg.REGION_CODE_APP)
- gg.addListItems(R)
- gg.clearList()
- return true
- end
- Xbit = (gg.getTargetInfo().x64 and 64 or 32)
- Xversion = gg.getTargetInfo().versionName
- Qfile = "/sdcard/Q/File/t.$_$.t"
- if #gg.getRangesList("libil2cpp.so") < 1 then
- print("Sorry this script cannot run in this virtual")
- return os.exit()
- elseif Xbit == 64 then
- libs = gg.getRangesList("libil2cpp.so")[2].start
- on = {'h200080D2','hC0035FD6'}
- elseif Xbit == 32 then
- libs = gg.getRangesList("libil2cpp.so")[1].start
- on = {'h0100A0E3','h1EFF2FE1'}
- end
- if io.open(Qfile,"r") and loadfile(Qfile) then
- FVersion = io.open(Qfile,"r"):read("*all"):match("CPM%[.-%]%[x.-%]")
- if FVersion:find("CPM%["..Xversion.."%]%[x"..Xbit.."%]") then
- loadfile(Qfile)()
- end
- elseif io.open(Qfile,"r") then
- gg.toast("Script ERROR Auto Remove Update")
- os.remove(Qfile)
- end
- repeat
- repeat until gg.isVisible()
- gg.setVisible(false)
- local menu = gg.choice({'❄️Coin❄️','OFF','❄️MONEY❄️','OFF','🌎WorldSale🌎','UpdateScript','Exit'},nil,FVersion)
- if menu == 7 then break end
- if menu and (menu == 6 or offset == nil) then
- if gg.alert("Do You Want To Update This Script?","Yes","No") == 1 and update() then
- gg.setVisible(true)
- return os.exit()
- else
- gg.toast("Please Update The Script")
- end
- else
- if menu == 1 and XaEdit(offset[1],on) then gg.toast("ON") end
- if menu == 2 and XaEdit(offset[1],off[1]) then gg.toast("OFF") end
- if menu == 3 and XaEdit(offset[2],on) then gg.toast("ON") end
- if menu == 4 and XaEdit(offset[2],off[2]) then gg.toast("OFF") end
- if menu == 5 and XaEdit(offset[3],on) then gg.toast("ON") end
- end
- until 1>2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement