CE lua脚本

CE递归遍历主界面控件

local fnGetSpace = function(n)
    local ret = ""
    for i = 1,n do
        ret = (ret .. "-")
    end
    return ret
end

enum_ui = function(ui,level)
    if not ui then return end
    print(fnGetSpace(level) .. ui:getClassName() .. ":" ..  ui:getName())
    if not ui.getControlCount then return end
    for i = 0,ui:getControlCount() - 1 do
        enum_ui(ui:getControl(i),level + 1)
    end    
end

local ui = getMainForm()
local level = 0
enum_ui(ui,level)

结果:

TMainForm:MainForm
-TSplitter:Splitter1
-TPanel:Panel1
--TAddresslist:
---TTreeviewWithScroll:
---THeaderControl:
-TPanel:Panel4
--TLabel:Label7
--TSpeedButton:advancedbutton
--TSpeedButton:CommentButton
-TPanel:Panel5
--TLabel:ProcessLabel
--TLabel:foundcountlabel
--TLabel:ScanText
--TLabel:lblScanType
--TLabel:lblValueType
--TSpeedButton:LoadButton
--TSpeedButton:SaveButton
--TLabel:Label6
--TSpeedButton:SpeedButton2
--TSpeedButton:SpeedButton3
--TLabel:Label5
--TLabel:Label38
--TLabel:Label57
--TLabel:Label59
--TLabel:Label61
--TCheckBox:cbSpeedhack
--TButton:btnNewScan
--TCheckBox:cbUnicode
--TGroupBox:gbScanOptions
---TPanel:Panel2
----TCheckBox:cbCopyOnWrite
----TCheckBox:cbWritable
----TCheckBox:cbExecutable
---TPanel:Panel3
----TMemo:FromAddress
----TMemo:ToAddress
----TLabel:Label2
----TLabel:Label1
---TPanel:Panel6
----TCheckBox:cbFastScan
----TEdit:edtAlignment
----TCheckBox:cbPauseWhileScanning
----TRadioButton:rbfsmLastDigts
----TRadioButton:rbFsmAligned
--TButton:btnNextScan
--TComboBox:ScanType
--TComboBox:VarType
--TButton:btnMemoryView
--TButton:btnAddAddressManually
--TProgressBar:ProgressBar1
--TCheckBox:cbHexadecimal
--TButton:UndoScan
--TRadioButton:rbBit
--TRadioButton:rbDec
--TEdit:scanvalue
--TCheckBox:cbCaseSensitive
--TPanel:Panel7
---TSpeedButton:sbOpenProcess
--TPanel:pnlFloat
---TRadioButton:rt3
---TRadioButton:rt1
---TRadioButton:rt2
--TCheckBox:cbUnrandomizer
--TButton:Button2
--TButton:Button4
--TPanel:LogoPanel
---TImage:Logo
---TSpeedButton:SettingsButton
--TPanel:Panel14
---TLabel:Label54
---TLabel:lblSH0
---TLabel:lblSH20
---TButton:btnSetSpeedhack2
---TEdit:editSH2
---TTrackBar:tbSpeed
--TLabel:lblcompareToSavedScan
--TLabel:Label3
--TListView:Foundlist3
---TCustomListViewEditor:
--TCheckBox:cbFloatSimple

 

遍历找到的地址:

local found_list = getCurrentMemscan()
local addr_count = found_list.foundList:getCount()
for i = 0,addr_count - 1 do
    local found_addr = getAddress(found_list.foundList:GetAddress(i))
    print(found_addr)
end

 

posted @ 2018-06-21 22:51  瓜蛋  阅读(4618)  评论(0编辑  收藏  举报