Advertisement
pinenxu

UnlockWorldSale

May 25th, 2024 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.31 KB | None | 0 0
  1. function searchMethod(Method)
  2.   function offset(offs, Vtype)
  3.     local addoff = gg.getResults(gg.getResultsCount())
  4.     for i, v in ipairs(addoff) do v.address, Vtype = v.address + offs, Vtype end
  5.     gg.loadResults(addoff)
  6.   end
  7.   local Xbit = gg.getTargetInfo().x64 and 64 or 32
  8.   local xand = gg.getRangesList("libil2cpp.so")[(Xbit == 64 and 2 or 1)].start
  9.   local gmds = gg.getRangesList("global-metadata.dat")[1]["start"]
  10.   local gmde = gg.getRangesList("global-metadata.dat")[1]["end"]
  11.   local off1, typ = (Xbit == 64) and -16 or -8, (Xbit == 64) and 32 or 4
  12.   if Xbit == 64 then gvo, gvo1, gvo2 = 24, 16, 24 else gvo, gvo1, gvo2 = 12, 8, 12 end
  13.   local Moffset = {}
  14.   local Mranges = {}
  15.   gg.setRanges(gg.REGION_OTHER | gg.REGION_C_ALLOC)
  16.   gg.clearResults()
  17.   gg.searchNumber(":"..Method,1,false,gg.SIGN_EQUAL,gmds, gmde)
  18.   local Xr = gg.getResults(2)
  19.   gg.refineNumber(Xr[1].value..";"..Xr[2].value.."::2")
  20.   gg.refineNumber(Xr[1].value)
  21.   offset(-1, 1)
  22.   gg.refineNumber(0,1)
  23.   offset(#(tostring(Method)) + 1,1)
  24.   gg.refineNumber(0,1)
  25.   offset(-#(tostring(Method)),1)
  26.   gg.searchPointer(0)
  27.   local xpoint=gg.getResults(gg.getResultsCount())
  28.   gg.clearResults()
  29.   for i, v in pairs(xpoint) do v.address, v.flags = v.address + off1, typ end
  30.   local xoff=gg.getValues(xpoint)
  31.   for i, v in pairs(xoff) do
  32.     xadd = tonumber((Xbit == 64 and v.value or "0x"..string.sub(tostring(string.format("%X",tonumber(v.value)) ), -8,-1)))
  33.     table.insert(Moffset,xadd-xand)
  34.   end
  35.   return Moffset
  36. end
  37.  
  38. function update()
  39.   local offset, off = {}, {}
  40.   local libe = gg.getRangesList("libil2cpp.so")[(Xbit == 64 and 2 or 1)]["end"]
  41.   for i, v in pairs({{"RemoveCoinsToPrefs",1},{"UpdateMoney",2},{"IsWWEnabled",1}}) do
  42.     Moffset = searchMethod(v[1])[v[2]]
  43.     Xvalue = gg.getValues({{address = libs + Moffset, flags = 4},{address = libs + Moffset + 0x4, flags = 4}})
  44.     table.insert(offset,{Moffset,Moffset + 0x4})
  45.     table.insert(off,{Xvalue[1].value,Xvalue[2].value})
  46.   end
  47.   local Xout = {"(function(Data) return end)([==[CPM["..Xversion.."][x"..Xbit.."]]==])", "\noffset = {"}
  48.   for _, v in pairs(offset) do table.insert(Xout,"\n  {"..v[1]..","..v[2].."},") end
  49.   table.insert(Xout,"\n}\noff = {")
  50.   for _, v in pairs(off) do table.insert(Xout,"\n  {"..v[1]..","..v[2].."},") end
  51.   table.insert(Xout,"\n}")
  52.   gg.saveList(Qfile)
  53.   io.open(Qfile,"w"):write(string.dump(load(table.concat(Xout)),true))
  54.   gg.toast("Done")
  55.   print("update completed")
  56.   return true
  57. end
  58.  
  59. function XaEdit(offs,value)
  60.   local R = {}
  61.   for i = 1, #value do R[i] = {address = libs + offs[i], flags = 4, value = value[i], freeze = true} end
  62.   if #R < #offs then return false end
  63.   gg.setRanges(gg.REGION_CODE_APP)
  64.   gg.addListItems(R)
  65.   gg.clearList()
  66.   return true
  67. end
  68.  
  69. Xbit = (gg.getTargetInfo().x64 and 64 or 32)
  70. Xversion = gg.getTargetInfo().versionName
  71. Qfile = "/sdcard/Q/File/t.$_$.t"
  72.  
  73. if #gg.getRangesList("libil2cpp.so") < 1 then
  74.   print("Sorry this script cannot run in this virtual")
  75.   return os.exit()
  76. elseif Xbit == 64 then
  77.   libs = gg.getRangesList("libil2cpp.so")[2].start
  78.   on = {'h200080D2','hC0035FD6'}
  79. elseif Xbit == 32 then
  80.   libs = gg.getRangesList("libil2cpp.so")[1].start
  81.   on = {'h0100A0E3','h1EFF2FE1'}
  82. end
  83.  
  84. if io.open(Qfile,"r") and loadfile(Qfile) then
  85.   FVersion = io.open(Qfile,"r"):read("*all"):match("CPM%[.-%]%[x.-%]")
  86.   if FVersion:find("CPM%["..Xversion.."%]%[x"..Xbit.."%]") then
  87.     loadfile(Qfile)()
  88.   end
  89. elseif io.open(Qfile,"r") then
  90.   gg.toast("Script ERROR Auto Remove Update")
  91.   os.remove(Qfile)
  92. end
  93.  
  94. repeat
  95.   repeat until gg.isVisible()
  96.   gg.setVisible(false)
  97.   local menu = gg.choice({'❄️Coin❄️','OFF','❄️MONEY❄️','OFF','🌎WorldSale🌎','UpdateScript','Exit'},nil,FVersion)
  98.     if menu == 7 then break end
  99.     if menu and (menu == 6 or offset == nil) then
  100.       if gg.alert("Do You Want To Update This Script?","Yes","No") == 1 and update() then
  101.         gg.setVisible(true)
  102.         return os.exit()
  103.       else
  104.         gg.toast("Please Update The Script")
  105.       end
  106.     else
  107.       if menu == 1 and XaEdit(offset[1],on) then gg.toast("ON") end
  108.       if menu == 2 and XaEdit(offset[1],off[1]) then gg.toast("OFF") end
  109.       if menu == 3 and XaEdit(offset[2],on) then gg.toast("ON") end
  110.       if menu == 4 and XaEdit(offset[2],off[2]) then gg.toast("OFF") end
  111.       if menu == 5 and XaEdit(offset[3],on) then gg.toast("ON") end
  112.     end
  113. until 1>2
  114.  
  115.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement