local function getRangesListBss()local so={}local list={}local n=0 local t=gg.getRangesList('^/data/*so:bss$')if not t then gg.alert('进程模块读取失败')os.exit()end for i,v in ipairs(t)do if t[i].type:sub(2,2)=='w' then so={}so['start']=t[i]['start']so['internalName']=t[i]['internalName']so['name']=t[i]['name']so['state']=t[i]['state']so['type']=t[i]['type']so['end']=t[i]['end']so['so']=string.match(t[i].internalName,'[^/]+$')n=(so['end']-so.start)/4096 so.n=n so.solen='【bss'..n..'】' so.son=so.so..n table.insert(list,so)end end local t_name={}for i,v in ipairs(list)do t_name[v.son]=v end return list,t_name end local function getRangesListSo()local so={}local list={}local n=0 local t=gg.getRangesList('^/data/*so$')if not t then gg.alert('进程模块读取失败')os.exit()end for i,v in ipairs(t)do if t[i].type:sub(2,2)=='w' then so={}so['start']=t[i]['start']so['internalName']=t[i]['internalName']so['name']=t[i]['name']so['state']=t[i]['state']so['type']=t[i]['type']so['end']=t[i]['end']so['so']=string.match(t[i].internalName,'[^/]+$')n=(so['end']-so.start)/4096 so.n=n so.solen='【so'..n..'】' so.son=so.so..n table.insert(list,so)end end local t_name={}for i,v in ipairs(list)do t_name[v.son]=v end return list,t_name end local function getRangesListAll()local so={}local list={}local n=0 local t=gg.getRangesList('^/data/*lib*$')if not t then gg.alert('进程模块读取失败')os.exit()end for i,v in ipairs(t)do so={}so['start']=t[i]['start']so['internalName']=t[i]['internalName']so['name']=t[i]['name']so['state']=t[i]['state']so['type']=t[i]['type']so['end']=t[i]['end']so['so']=string.match(t[i].internalName,'[^/]+$')n=(so['end']-so.start)/4096 so.n=n so.solen='【'..n..'】' so.son=so.so..n table.insert(list,so)end local t_name={}for i,v in ipairs(list)do t_name[v.son]=v end return list,t_name end local function getRangesListEnd()local so={}local list={}local n=0 local t=gg.getRangesList('^/data/app/*so*$')if not t then gg.alert('进程模块读取失败')os.exit()end for i,v in ipairs(t)do if t[i]['state']=='Cd' and t[i].type:sub(2,2)=='w' then so={}so['start']=t[i]['start']so['internalName']=t[i]['internalName']so['name']=t[i]['name']so['state']=t[i]['state']so['type']=t[i]['type']so['end']=t[i]['end']so['so']=string.match(t[i].internalName,'[^/]+$')if t[i+1]then if t[i+1].type:sub(2,2)=='w' then so['end']=t[i+1]['end']end n=(so['end']-so.start)/4096 so.solen='【app'..n..'】' so.son=so.so..n table.insert(list,so)end end end local t_name={}for i,v in ipairs(list)do t_name[v.son]=v end return list,t_name end function xqmnb(Search,Modification) gg.clearResults() gg.setRanges(Search[1].memory) gg.searchNumber(Search[3].value,Search[3].type,false,536870912,0,-1) if gg.getResultCount()==0 then print(Search[2].name..'开启失败 getResultCount = 0') return end local Result=gg.getResults(gg.getResultCount()) local sum for index=4,#Search do sum=0 for i=1,#Result do if gg.getValues({{address=Result[i].address+Search[index].offset,flags=Search[index].type}})[1].value~=Search[index].lv then Result[i].Usable=true sum=sum+1 end end if sum==#Result then print(Search[2].name..'开启失败') return end end local Data,Freeze,Freezes={},{},0 sum=0 for index,value in ipairs(Modification)do for index=1,#Result do if not Result[index].Usable then local Value={address=Result[index].address+value.offset,flags=value.type,value=value.value,freeze=true} if value.freeze then Freeze[#Freeze+1]=Value Freezes=Freezes+1 else Data[#Data+1]=Value end sum=sum+1 end end end gg.removeListItems(Data) gg.setValues(Data) gg.addListItems(Data) gg.addListItems(Freeze) if Freezes==0 then print(Search[2].name..'成功 共修改'..sum..'条数据') else print(Search[2].name..'成功 共修改'..sum..'条数据 冻结'..Freezes..'条数据') end gg.clearResults() 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(0x167ba0fe) 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 end return _S end local _A = string.format('0x%X', Get_Address(t_So, t_Offset, _bit)) return _A end function GetValue(Address , Flag) return gg.getValues({{address = Address , flags = Flag}})[1].value end function SetValue(Address , Flag , Value) return gg.setValues({{address = Address , flags = Flag , value = Value}}) end function GetSo(So) local So_List = gg.getRangesList('^/data/*.so*$') for i = 1 , #So_List do if So_List[i].internalName:gsub('^.*/', '') == So[1] and So_List[i].state == So[2] then return So_List[i].start end end end function ToPointer(So_Start,Offsets) local Address = So_Start for i = 1 , #Offsets do Address = gg.getValues({{ address = Address + Offsets[i] , flags = 32 }})[1]["value"] end return Address end function FH_Pointer(So,Pointer,Flag) Temp_So = gg.getRangesList(So)[1].start Address = Temp_So + Pointer return Address end --[[ Cb_So , Xa_So = {"libminecraftpe.so:bss", "Cb"} , {"libminecraftpe.so", "Xa"}--so立表 So_Start_Cb , So_Start_Xa = GetSo(Cb_So) , GetSo(Xa_So) So_Cb , So_Xa = So_Start_Cb , So_Start_Xa if not So_Cb and So_Xa then os.exit(gg.alert('无法获取到So')) end ]] function ReadChain(ChainContent) local Temp_UI = { 'S_Pointer HEX', 'S_Pointer Not Hex', 'ToPointer', 'FH_Pointer' } local Temp_TextContent = '链条:'..ChainContent..'\n选择输出模式' Choice = gg.choice(Temp_UI,math.random(1,#Temp_UI),Temp_TextContent) if not Choice then gg.toast('弹窗被取消') return end ranges , sonamelist =getRangesListBss() local So_List = {} So_List.List , Temp_SoContent = {} , '' local Temp_UI = { '链条:'..ChainContent..'偏移', '链条类型(String)\n[A类 TYPE_AUTO = 127] [B类 TYPE_BYTE = 1]\n[E类 TYPE_DOUBLE = 64] [D类 TYPE_DWORD = 4]\n[F类 TYPE_FLOAT = 16] [Q类 TYPE_QWORD = 32]\n[W类 TYPE_WORD = 2] [X类 TYPE_XOR = 8]', '输出自定义前缀 输入N则为不设置', '输出自定义后缀 输入N则为不设置', } Temp_TextContent = {'0x0','16','N','N'} Temp_Type = {'number','number','number','number'} So_List.i = #Temp_UI So_List.List.i = 0 for so, v in pairs(sonamelist) do table.insert(Temp_Type, 'checkbox') table.insert(Temp_UI,v.state..' '..so) So_List.i = So_List.i+1 So_List['list'..So_List.i] = so So_List['state'..So_List.i] = v.state end gg.toast('So建议不要选择多个 最好是单个 <=2则不稳定') Prompt = gg.prompt(Temp_UI,Temp_TextContent,Temp_Type) if not Prompt then gg.toast('弹窗被取消') return end for i=1,#Temp_UI do if Prompt[i] == true then So_List.List[i] = So_List['list'..i] So_List.So = So_List.List[i] So_List.State = So_List['state'..i] --gg.alert(So_List.So) So_List.List.i = So_List.List.i + 1 --gg.alert(So_List.List[i]) gg.alert(So_List.List.i) Temp_SoContent = '['..So_List['state'..i]..' - '..So_List.List[i]..'] '..Temp_SoContent end--Prompt[i] end--for Type_List,Temp_i= {1,2,4,8,16,32,64,127},0 Temp_Value = '>'..Prompt[2] for i=1,#Type_List do Temp_TypeList = '>'..Type_List[i] if Temp_Value == Temp_TypeList then Temp_i = Temp_i + 1 end--Prompt[2] end--for --gg.alert(Temp_i) if Temp_i <= 0 or Temp_i >= 2 then gg.alert('链条类型['..Temp_Value..']错误 请重新输入','重试') return gg.setVisible(true) end if So_List.List.i == 0 or So_List.List.i <= 0 then gg.alert('未选择So库 请选择So','重试') return gg.setVisible(true) end if So_List.List.i >= 3 then gg.alert('超过最大选择So限制') return gg.setVisible(true) end if Prompt then ChainType = Prompt[2] local Temp_UI = { '保存到搜索列表', '保存到保存列表', '退出重选' } local Temp_TextContent = '链条:'..ChainContent..'\n选择的So:\n'..Temp_SoContent Choice = gg.choice(Temp_UI,math.random(1,#Temp_UI),Temp_TextContent) if not Choice then gg.toast('弹窗被取消 默认保存到保存列表') end if Choice == 3 then return gg.setVisible(true) end if Choice then gg.alert(So_List.So) gg.alert(ChainContent) gg.alert(ChainType) Temp_So = GetSo({''..So_List.So,''..So_List.State}) --Pointer = ChainContent + Temp_So gg.alert(Temp_So) --gg.alert(Chain_F) --Chain_T = ToPointer(So_Start_Cb,{0x641A20,0x10B0,0x38}) --Chain_S = S_Pointer(Cb_So,LongJump, true) end--Choice end--Prompt end--ReadChain while true do if gg.isVisible(true) then gg.setVisible(false) Temp_UI = { '输入基址链条 点击取消退出' } Pointer = gg.prompt(Temp_UI,{'0x0'},{'number'}) if not Pointer then os.exit(gg.toast('输入框被取消'),print('手动退出')) end if Pointer then Temp_Content = Pointer[1] if Temp_Content == '' or Temp_Content == nil then if gg.alert('输入内容为空','重试','退出') == 1 then gg.setVisible(true) end else ReadChain(Temp_Content) end end end--if visible end--while