--[[



抹布制作



]]


exit=os.exit
function os.exit()
gg.clearList()--清楚保存
gg.clearResults()--清楚搜索 
exit()
end

gg.clearList()--清楚保存
gg.clearResults()--清楚搜索 


function split(szFullString, szSeparator)

  local nFindStartIndex = 1
  local nSplitIndex = 1
  local nSplitArray = {}
  
  while true do
  gg.setVisible(false)
    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 j(szpy, qmxg)
for i, v in ipairs(qmxg) do
    xgpy= szpy + v['偏移']
    xglx = v['类型']
    xgsz = v['修改征码']
    xgdj = v['是否冻结']
    if xgdj == nil or xgdj == '' then
    gg.addListItems({[1]={address = xgpy, flags = xglx, value = xgsz}})
     else
    gg.addListItems({[1]= {address = xgpy, flags = xglx,freeze = xgdj, value = xgsz}}) 
    end
    
    xgsl = xgsl + 1 
    xgjg = true 
    end 
    
    end
-------------------------------------------------------------------------------------------------------------------------------
function xsBOOS(qmnb,qmxg)
  gg.setVisible(false)
  gg.clearResults()
  gg.setRanges(qmnb[1]['内存范围'])
  gg.setVisible(false)
  gg.searchNumber(qmnb[3]['联合搜索'],qmnb[3]['类型'],qmnb[3]['是否加密搜索'])
  if gg.getResultCount() == 0 then
    gg.toast(qmnb[2]['功能名字'] .. '开启失败')
   else
    h=gg.getResults(gg.getResultCount())--值数量
    gg.toast('一共搜索到[ '..(#h)..' ]个数值')
    
    gg.searchNumber(qmnb[4]['主特征码'], qmnb[4]['类型'])
    gg.refineNumber(qmnb[4]['主特征码'], qmnb[4]['类型'])
    gg.refineNumber(qmnb[4]['主特征码'], qmnb[4]['类型'])
    gg.refineNumber(qmnb[4]['主特征码'], qmnb[4]['类型'])
    
    if gg.getResults(gg.getResultCount()) == 0 then
      gg.toast(qmnb[2]['功能名字'] .. '开启失败')
     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 = 5, #(qmnb) do 
        
        if pdsz == true then
            pysz = {} 
            pysz[1]= {} 
            
            pysz[1].address= sl[i].address + qmnb[v]['偏移'] 
            
            pysz[1].flags= qmnb[v]['类型']
           
            szpy = gg.getValues(pysz)
            
            pdpd = qmnb[v]['副特征'] .. ';' .. 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 
           j(szpy,qmxg) 
           end 
           end
      if xgjg == true then
        gg.sleep(1200)--延迟
        gg.toast(''..qmnb[2]['功能名字'] .. '开启成功共修改 [' ..xgsl.. '] 条数据')
        gg.clearResults()
       else
        gg.toast(qmnb[2]['功能名字'] .. '开启失败')
        gg.clearResults()
      end
    end
  end
end



xs1={
  
    {['内存范围'] = 32},
    
    {['功能名字'] ='初始中……'},
   
    {['联合搜索'] ='999;-5;-14;0;-14',['类型'] =4},--内存块过滤

    {['主特征码'] ='999', ['类型'] = 4},
    
    {['副特征'] = '-5', ['偏移'] = -12, ['类型'] =4},
    
    {['副特征'] = '-14', ['偏移'] = 4, ['类型'] =4},
   
    {['副特征'] = '0', ['偏移'] = 648, ['类型'] =4},
    
    {['副特征'] = '-14', ['偏移'] = 652, ['类型'] =4},
    
  }
  
  
  xs2={
{
    ['修改征码'] ='600', 
    ['偏移'] = 648, 
    ['类型'] = 4,
    ['是否冻结']=true},
    

  }



function main()
main_a=gg.choice({
'>>>>>>[初始化]<<<<<<',
'💥全爆炸特效',
'🐤魔力鸡[容易卡炸_装B]',
'💥横排爆炸特效',
'💥竖版爆炸特效',
'退出',
},{},'先初始[就可以上分了]')--单选功能



if main_a == 1 then
csh()
elseif main_a == 2 then
main_aa()
elseif main_a == 3 then
main_aa2()
elseif main_a == 4 then
main_aa3()
elseif main_a == 5 then
main_aa4()
elseif main_a == 6 then
os.exit()
end

gg.setVisible(false)
end





----------------------------------------------------------------------------------------------------------------------
local ca={}--配
local cv={}--改
----------------------------------------------------------------------------------------------------------------------
function csh()
xsBOOS(xs1,xs2)--判定
xs={
  
    {['内存范围'] = 32},
    
    {['功能名字'] =''},
   
    {['联合搜索'] ='256;32;1024::',['类型'] =4},--内存块过滤

    {['主特征码'] ='256', ['类型'] = 4},
    
    {['副特征'] = '32', ['偏移'] = 24, ['类型'] =4},
    
    {['副特征'] = '1024', ['偏移'] = 48, ['类型'] =4},

  }
  
    
  xs2={
  
 
  
   {
     --1080877056
    ['偏移'] = '-188', 
    ['类型'] = 4,
    ['是否冻结']=''},
    
    
    {
      --1080098816', 
    ['偏移'] = -116, 
    ['类型'] = 4,
    ['是否冻结']=''},
    
    {
      --1081303040', 
    ['偏移'] = -20, 
    ['类型'] = 4,
    ['是否冻结']=''},
    
    {
    --1081524224
    ['偏移'] = 244, 
    ['类型'] = 4,
    ['是否冻结']=''},
    
    

  }






xst={
  
    {['内存范围'] = 32},
    
    {['功能名字'] =''},
   
    {['联合搜索'] ='91;6;-1;0;0;0;0::',['类型'] =4},--内存块过滤

    {['主特征码'] ='91', ['类型'] = 4},
    
    {['副特征'] = '6', ['偏移'] = 28, ['类型'] =4},
    
    {['副特征'] = '-1', ['偏移'] = 40, ['类型'] =4},
   
    {['副特征'] = '0', ['偏移'] = 44, ['类型'] =4},
    
    {['副特征'] = '0', ['偏移'] = 52, ['类型'] =4},
    
  }

xst2={
   {
     --1,079,083,008D
    ['偏移'] = 48, 
    ['类型'] = 4,
    ['是否冻结']=''},
 
    {
      --1,079,853,056D', 
    ['偏移'] = 56, 
    ['类型'] = 4,
    ['是否冻结']=''},
    
    {
    --1,080,000,512D', 
    ['偏移'] = 64, 
    ['类型'] = 4,
    ['是否冻结']=''},
    
    {
    --1,080,246,272D  改  0
    ['偏移'] = 72, 
    ['类型'] = 4,
    ['是否冻结']=''},
}


---------------------------------------------------------------------------------------------------------------------

xsBOOS(xs,xs2)


t=gg.getListItems()
for i, v in ipairs(t) do
ca[i]={['address']=v.address,['value']=v.value,['flags']=v.flags}
end

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

if gg.getListItems()~=0 then
gg.clearList()--清楚保存
gg.clearResults()--清楚搜索 
end

----------------------------------------------------------------------------------------------------------------------

xsBOOS(xst,xst2)


t=gg.getListItems()
for i, v in ipairs(t) do
cv[i]={['address']=v.address,['value']=v.value,['flags']=v.flags}
end

----------------------------------------------------------------------------------------------------------------------
xsBOOS(xs,xs2)

t=gg.getListItems()

if #t ~= 8 then
gg.alert('初始化失败...')--对话框
csh()
end


end


-- ca=配寄存器
--cv--改寄存器

function yu(a,b,c)
gg.setValues({[1]={
address=a,
flags=b,
value=c
}})
end







function main_aa1()

y=gg.choice({
'[关闭]爆炸💥特效'
})--单选功能

if y== 1then
yu(cv[4].address,cv[4].flags,cv[4].value)
yu(ca[3].address,ca[3].flags,ca[3].value)
gg.toast('全炸爆炸💥[关闭]')--提示
ui=false
main()
end

end


function main_aa()
if #ca==0 or #cv==0 then
gg.alert('请先初始化')--对话框
main()
end

yu(cv[4].address,cv[4].flags,0)
yu(ca[3].address,ca[3].flags,0)
gg.setVisible(false)
gg.toast('全炸爆炸💥[成功]')--提示
ui=true
while ui do
  if gg.isVisible(true) then
    gg.setVisible(false)
   main_aa1()
  end
end

end






function main_ab1()

y=gg.choice({
'[关闭]🐤魔力鸡'
})--单选功能

if y== 1then
yu(cv[4].address,cv[4].flags,cv[4].value)
yu(ca[4].address,ca[4].flags,ca[4].value)
gg.toast('🐤魔力鸡[关闭]')--提示
ui=false
main()
end

end


function main_aa2()
if #ca==0 or #cv==0 then
gg.alert('请先初始化')--对话框
main()
end

yu(cv[4].address,cv[4].flags,0)
yu(ca[4].address,ca[4].flags,0)
gg.setVisible(false)
gg.toast('🐤魔力鸡[成功]')--提示
ui=true
while ui do
  if gg.isVisible(true) then
    gg.setVisible(false)
   main_ab1()
  end
end

end





function main_ac1()

y=gg.choice({
'[关闭]横爆炸💥'
})--单选功能

if y== 1then
yu(cv[4].address,cv[4].flags,cv[4].value)
yu(ca[2].address,ca[2].flags,ca[2].value)
gg.toast('横爆炸💥[关闭]')--提示
ui=false
main()
end

end


function main_aa3()
if #ca==0 or #cv==0 then
gg.alert('请先初始化')--对话框
main()
end

yu(cv[4].address,cv[4].flags,0)
yu(ca[2].address,ca[2].flags,0)
gg.setVisible(false)
gg.toast('横爆炸💥[成功]')--提示
ui=true
while ui do
  if gg.isVisible(true) then
    gg.setVisible(false)
   main_ac1()
  end
end

end







function main_ad1()

y=gg.choice({
'[关闭]竖爆炸💥'
})--单选功能

if y== 1then
yu(cv[4].address,cv[4].flags,cv[4].value)
yu(ca[1].address,ca[1].flags,ca[1].value)
gg.toast('竖爆炸💥[关闭]')--提示
ui=false
main()
end

end


function main_aa4()
if #ca==0 or #cv==0 then
gg.alert('请先初始化')--对话框
main()
end

yu(cv[4].address,cv[4].flags,0)
yu(ca[1].address,ca[1].flags,0)
gg.setVisible(false)
gg.toast('竖爆炸💥[成功]')--提示
ui=true
while ui do
  if gg.isVisible(true) then
    gg.setVisible(false)
   main_ad1()
  end
end

end












while true do
  if gg.isVisible(true) then
main()
  end
end



