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 SearchWrite(Search, Write, Type) 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] if (w[3] == true) then local item = {} item[#item+1] = t[#t] item[#item].freeze = true gg.addListItems(item) end end end gg.setValues(t) gg.toast("已修改"..#t.."条数据") gg.addListItems(t) else gg.toast("无数据", false) return false end else gg.toast("Not Found") return false end end function Yx_is_Chongai_father(t,Tab,Name,type,free) nm=os.clock() rt={} gg.setRanges(type) gg.clearResults() if tostring(t[1][1]):find("{") then gg.searchNumber(t[1][1][1].."~"..t[1][1][2], t[1][2], false, gg.SIGN_EQUAL, 0, -1) else gg.searchNumber(t[1][1], t[1][2], false, gg.SIGN_EQUAL, 0, -1) end local r = gg.getResults(99999999) if #r==0 then goto last end for it=2,#t do for i=1,#r do r[i].address=r[i].address+t[it][2] r[i].flags=t[it][3] end local rr=gg.getValues(r) tt={} for i=1,#rr do if tostring(t[it][1]):find("{") then if tonumber(rr[i].value)>=tonumber(t[it][1][1]) and tonumber(rr[i].value)<=tonumber(t[it][1][2]) then ii=#tt+1 tt[ii]={} tt[ii].address=rr[i].address-t[it][2] tt[ii].flags=t[it][3] end else if tonumber(rr[i].value)==tonumber(t[it][1]) then ii=#tt+1 tt[ii]={} tt[ii].address=rr[i].address-t[it][2] tt[ii].flags=t[it][3] end end end if #tt==0 then goto last end r=gg.getValues(tt) if it==#t then rt=r goto last end end ::last:: if #rt>0 then for v=1,#Tab do tt={} for i=1,#rt do ii=#tt+1 tt[ii]={} tt[ii].address=rt[i].address+Tab[v][2] tt[ii].flags=Tab[v][3] tt[ii].value=Tab[v][1] if free or Tab[v][4] then tt[i].freeze=true end end if free or Tab[v][4] then gg.addListItems(tt) else gg.setValues(tt) end end gg.toast(Name.."已开启,共修改"..#rt*#Tab.."个数值,耗时"..os.clock()-nm.."s") gg.setVisible(false) gg.clearResults() else gg.toast(Name.."开启失败") end end function search(t,type) nm=os.clock() rt={} gg.setRanges(type) gg.clearResults() gg.searchNumber(t[1], 4, false, gg.SIGN_EQUAL, 0, -1) local r = gg.getResults(99999999) if #r==0 then goto last end for it=2,#t do for i=1,#r do r[i].address=r[i].address+t[it][2] end local rr=gg.getValues(r) tt={} for i=1,#rr do if rr[i].value== t[it][1] then ii=#tt+1 tt[ii]={} tt[ii].address=rr[i].address-t[it][2] tt[ii].flags=4 end end if #tt==0 then goto last end r=gg.getValues(tt) if it==#t then rt=r goto last end end ::last:: return rt end function YxEditOne(r,Tab) for sb=1,#Tab do tt={} for i=1,#r do ii=#tt+1 tt[ii]={} tt[ii].address=r[i].address+Tab[sb][3] tt[ii].flags=Tab[sb][2] tt[ii].value=Tab[sb][1] end gg.setValues(tt) gg.sleep(50) end end function YxEditAll(r,Tab,Name) if #r>0 then for v=1,#Tab do tt={} for i=1,#r do ii=#tt+1 tt[ii]={} tt[ii].address=r[i].address+Tab[v][3] tt[ii].flags=Tab[v][2] tt[ii].value=Tab[v][1] end gg.setValues(tt) end gg.toast(Name.."已开启,共修改"..#r*#Tab.."个数值,耗时"..os.clock()-nm.."s") gg.setVisible(false) gg.sleep(100) gg.clearResults() else gg.toast(Name.."开启失败") end end Offset_Yx = function(Tab) gg.setVisible(false) gg.clearResults() gg.setRanges(Tab["内存"]) gg.searchNumber(Tab["主特征码"][1], Tab["主特征码"][2], false, gg.SIGN_EQUAL, 0, -1, 0) local results = gg.getResults(gg.getResultsCount()) if not results then return gg.toast("未搜到结果") end gg.clearResults() local Ton = tonumber for index, value in pairs(Tab["副特征码"]) do for i = 1, #results do results[i].address = results[i].address + value[3] results[i].flags = value[2] end local _ofResults, Final = gg.getValues(results), {} for i = 1, #_ofResults do local __npt, Min, Max, Length = string.find(value[1], "~") if __npt then Min = Ton(string.sub(value[1], 0, (__npt-1))) Max = Ton(string.sub(value[1], (__npt+1), -1)) if _ofResults[i].value >= Min and _ofResults[i].value <= Max then Length = #Final + 1 Final[Length] = {} Final[Length].address = _ofResults[i].address - value[3] Final[Length].flags = value[2] end elseif type(value[1]) == "table" then for ind, key in pairs(value[1]) do if _ofResults[i].value == Ton(key) then Length = #Final + 1 Final[Length] = {} Final[Length].address = _ofResults[i].address - value[3] Final[Length].flags = value[2] end end elseif _ofResults[i].value == Ton(value[1]) then Length = #Final + 1 Final[Length] = {} Final[Length].address = _ofResults[i].address - value[3] Final[Length].flags = value[2] end end if #Final == 0 then return gg.toast("未偏移到结果") end results = gg.getValues(Final) end for index, value in pairs(Tab["修改"]) do local EditAll = {} for i = 1, #results do EditAll[i] = {} EditAll[i].address = results[i].address + value[3] EditAll[i].flags = value[2] EditAll[i].value = value[1] if value[4] or Tab["是否全部冻结"] then EditAll[i].freeze = true end end if value[4] or Tab["是否全部冻结"] then gg.addListItems(EditAll) else gg.setValues(EditAll) end end return gg.toast(Tab["功能名字"] .. "已开启 共修改" .. (#results * #Tab["修改"]) .."条数据") end function Main() SN =gg.multiChoice({ "自定义加速", "自动跑开", "自动跑关", "退出脚本", }, nil, "1") if SN == nil then else if SN[1] == true then b() end if SN[2] == true then c() end if SN[3] == true then R() end if SN[4] == true then Exit() end end XGCK = -1 end function R() so=gg.getRangesList('libil2cpp.so')[2].start py=0xE980ECC setvalue(so+py,4,-65269784) gg.toast("开启成功") end function c() so=gg.getRangesList('libil2cpp.so')[2].start py=0xE980ECC setvalue(so+py,4,335549580) gg.toast("开启成功") end function b() local f=gg.prompt({[1] = "输入修改为(原值0.27)\n默认0.33\n"}, {[1] = "0.33"}, {[1] = "txet"}) if f==nil then gg.toast("未输入") else local lf=f[1] so=gg.getRangesList('libil2cpp.so')[2].start py=0X11359A8 setvalue(so+py, 16, lf) gg.toast("开启成功") end end function Exit() os.exit() end while true do if gg.isVisible(true) then XGCK = 1 gg.setVisible(false) end gg.clearResults() if XGCK == 1 then Main() end end --1,385,055,112;946,367,176;872,416,552::21 --1708