⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 axd.vbs

📁 realview22.rar
💻 VBS
📖 第 1 页 / 共 5 页
字号:
	dim iindex
    iindex = ImageIndex
    
    If ImageIndex = -1 Then
        dim context
        set context = currentthread.Context
        set CheckForImage = context.Image
        UpdateImageList
    Else 
        if CheckListStatus(ImageList) = False Then
            err.raise 1000, "VBScript", "Please Load an Image."
        End If
        set CheckForImage = GetObjFromKey(iindex, ImageList, ImageNameString, ImageIDString, index)
    End If
    call UpdateImageFileList(CheckForImage)
    set ClassList = CheckForImage.Classes   
End Function

Function ImagesInt()
    dim txt
    call CheckForImage(-1)
    txt = headtext + ImageListText
    adw3cli.Display(txt) 
End Function


''''''''''
' Get files from an image
''''''''''''
Function Files(ImageIndex)              '<--- CLI command
On Error Resume Next    
    Files = FilesInt(ImageIndex)
    DisplayError
End Function

Function FilesInt(ImageIndex)
        dim txt

        call CheckForImage(ImageIndex)
        
        txt = headtext + ImageFileListText
        adw3cli.Display(txt) 
End Function

'''''''''''''''''''''''''''
' List all the classes in the spricfied image
'
'''''''''''''''''''''''
Function Classes(ImageIndex)                '<--- CLI command
On Error Resume Next    
    Classes = ClassesInt(ImageIndex)
    DisplayError
End Function

Function ClassesInt(ImageIndex)  
    dim ThisClass
    dim count
    dim iter
    dim txt
    
    call CheckForImage(ImageIndex)
    count = ClassList.count

    If count = 0 Then
        err.raise 1000, "VBScript", "Image does not have any classes."
    End If

    iter = 0
    do while iter < count
        set ThisClass = ClassList(iter)
        txt = txt & Chr(35) & CStr(iter + 1) & Chr(9) & ThisClass.Name & chr(13) & chr(10)
        iter = iter + 1
    loop
    txt = headertext & txt
    adw3cli.Display(txt) 
    call UpdateClassClasslist(ClassList)
    
End Function


'''''''''''''
' Get function from an image 
''''''''''''''''
Function Functions(ImageIndex)              '<--- CLI command
On Error Resume Next    
    Functions = FunctionsInt(ImageIndex)
    DisplayError
End Function

Function FunctionsInt(ImageIndex)
    Dim CurImage   
    Dim index
    dim iter
    dim txt

    Set CurImage = CheckForImage(ImageIndex)
    
    UpdateImageFunctionList CurImage
    Dim Head
    Head = "Index" & Chr(9) & "Function" & Chr(13) & Chr(10)
    txt = head & ImageFunctionListText
    adw3cli.Display(txt) 
End Function

'''''''''''''''''''
'Variarbles of an image
''''''''''''''''
Function Variables(ImageIndex)              '<--- CLI command
On Error Resume Next    
    Variables = VariablesInt(ImageIndex)
    DisplayError
End Function

Function VariablesInt(ImageIndex)
    Dim CurImage   
    
    Set CurImage = CheckForImage(ImageIndex)
    UpdateImageVariableList CurImage
    
    dim text 
    text = text & "Index" & Chr(9) & "Name" & Chr(13) & Chr(10)    
    txt = text & ImageVariableListText
    adw3cli.Display(txt) 
End Function

Function CVariables(ClassIndex)             '<--- CLI command
On Error Resume Next    
    CVariables = CVariablesInt(ClassIndex)
    DisplayError
End Function

Function CVariablesInt(ClassIndex)
    Dim CurClass   
    Dim ClassVarList
    Dim index
    Dim listStatus, listInit
    
    If CheckListStatus(ClassList) = False Then
        call CheckForImage(-1)              'retrieves top level classlist
    End If
    
    set CurClass = GetObjFromKey(ClassIndex, ClassList, ClassNameString, ClassIDString, index)
    set ClassVarList = CurClass.Variables()

    dim ThisVariable
    dim count
    dim iter
    dim txt

        count = ClassVarList.count
    If count = 0 Then
        err.raise 1000, "VBScript", "No variables in this class."
    End If

    iter = 0
    do while iter < count
        set ThisVariable = ClassVarList(iter)
        txt = txt & Chr(35) & CStr(iter + 1) & Chr(9) & ThisVariable.Type & Chr(9) & ThisVariable.Name & chr(13) & chr(10)
        iter = iter + 1
    loop
    
    Dim Head
    Head = "Index" & Chr(9) & "Type" & Chr(9) & Chr(9) & "Name" & Chr(13) & Chr(10)
    txt = head & txt
    adw3cli.Display(txt) 
End Function

Function CFunctions(ClassIndex)             '<--- CLI command
On Error Resume Next    
    CFunctions = CFunctionsInt(ClassIndex)
    DisplayError
End Function

Function CFunctionsInt(ClassIndex)
    Dim CurClass   
    Dim FunctionList
    Dim index
    Dim listStatus, listInit

    If CheckListStatus(ClassList) = False Then
        call CheckForImage(-1)              'retrieves top level classlist
    End If
    set CurClass = GetObjFromKey(ClassIndex, ClassList, ClassNameString, ClassIDString, index) 
    set FunctionList = CurClass.Functions()

    dim ThisFunction
    dim count
    dim iter
    dim txt

        count = FunctionList.count
    If count = 0 Then
        err.raise 1000, "VBScript", "No functions in this class."
    End If

    iter = 0
        do while iter < count
            set ThisFunction = FunctionList(iter)
            FuncText = ThisFunction.Type & ThisFunction.Name & ThisFunction.Params
            txt = txt & Chr(35) & CStr(iter + 1) & Chr(9) & FuncText & chr(13) & chr(10)
            iter = iter + 1
        loop
    
    Dim Head
    Head = "Index" & Chr(9) & "Function" & Chr(13) & Chr(10)
    txt = head & txt
    adw3cli.Display(txt) 
End Function

Function CClasses(ClassIndex)               '<--- CLI command
On Error Resume Next    
    CClasses = CClassesInt(ClassIndex)
    DisplayError
End Function

Function CClassesInt(ClassIndex)
    dim CurClass
    dim SubClassList
    
    If CheckListStatus(ClassList) = False Then
        call CheckForImage(-1)                      'retrieves top level classlist
    End If
    set CurClass = GetObjFromKey(ClassIndex, ClassList, ClassNameString, ClassIDString, index)
    set SubClassList = CurClass.Classes()

    dim subclass
    dim count
    dim iter
    dim txt

    count = subclasslist.count
    If count = 0 Then
        err.raise 1000, "VBScript", "No classes in this class."
    End If
    iter = 0
    do while iter < count
        set subclass = subclasslist(iter)
        txt = txt & Chr(35) & CStr(iter + 1) & Chr(9) &subclass.Name & chr(13) & chr(10)
        iter = iter + 1
    loop
    dim header 
    header = "Index" & Chr(9) & "Class Name" & Chr(13) & Chr(10)
    txt = header & txt
    adw3cli.Display(txt)
    call UpdateClassClasslist(SubClassList)
End Function

Function Source(StartLine, Line, FileIndex)             '<--- CLI command
On Error Resume Next    
    Source = SourceInt(StartLine, Line, FileIndex)
    DisplayError
End Function

Function SourceInt(StartLine, Line, FileIndex)
    Dim CurFile, SourceLineList, SrcLine  
    Dim ret, size, iter, txt, Header
    
    If Left(Line, 1) = Chr(43) Then
        CheckFormat = true
    Else
        CheckFormat = false
    End If

    call CheckForImage(-1)

    Header = "Line No." & Chr(9) & "Source" & Chr(13) & Chr(10)

    StartLine = ExprToAddress(StartLine) - 1
    If StartLine = -1  Then
        StartLine = 0
    End If

    If CheckFormat = true Then
        Line = ComRange(StartLine, Line)
    Else
        Line = ComRange(StartLine, Line) - 1
    End If 

    If FileIndex = -1 Then
        dim cxt 
        set cxt = currentThread.Context
        If cxt.PosObjectStatus(PosFileObj) = False Then
            err.raise 1000, "VBScript", "No source file associated with current context."
        End If
        set CurFile = cxt.File
    Else
        call CheckListStatus(FileList)
        set CurFile = GetObjFromKey(FileIndex, FileList, FileNameString, FileIDString, index)
    End If

    set SourceLineList = CurFile.Lines(Unsigned(StartLine), Unsigned(Line))
    size = sourcelinelist.count
    If size = 0 Then
        err.raise 1000, "VBScript", "Could not find any source lines in this range"
    End If
    iter = 0
    do while iter < size
        set SrcLine = SourceLineList(iter)
        txt = txt & Chr(9) & CStr(SrcLine.LineNumber + 1) & Chr(9) & Chr(9) & SrcLine.Text & chr(13) & chr(10)
        iter = iter + 1
    loop
    txt = Header & txt
    adw3cli.Display(txt)
End Function

Function Disassemble(StartAddress, Address, asm)                '<--- CLI command
On Error Resume Next    
    Disassemble = DisassembleInt(StartAddress, Address, asm)
    DisplayError
End Function

Function DisassembleInt(StartAddress, Address, asm)
    Dim CurImage, LastTime   
    Dim Range, SmallRange
    dim line, count, iter, txt, linelist
    
	If Address = -1 Then
		Address = Chr(43) & CStr(DefMemRange)
	End If

    LastTime = False
    If asm = -1 Then
        asm = DefInstrSize
    End If
    
    do 
        Range = InitRange(SmallRange, LastTime, StartAddress, Address)      
        set linelist = CurrentThread.AsmLines(StartAddress, Range, asm)
        count = linelist.count
        iter = 0
        do while iter < count
            set line = linelist(iter)
            txt = line.FormatAddress & Chr(9) & line.Text & chr(13) & chr(10)
            If adw3cli.Display(txt) = 0 Then 'user aborted
                Exit Function
            End If
            iter = iter + 1
        loop
        If LastTime Then
            Exit Function
        End If
        StartAddress = Unsigned(StartAddress+Range)
        Address = Unsigned(Address)
    Loop
End Function

Function LowLevel(ImageIndex)               '<--- CLI command
On Error Resume Next    
    LowLevel = LowLevelInt(ImageIndex)
    DisplayError
End Function

Function LowLevelInt(ImageIndex)
    Dim CurImage, index   
    Dim LowLevelList

    Set CurImage = CheckForImage(ImageIndex)
    
    set LowLevelList = CurImage.LowLevel

    dim ThisLowLevel
    dim count
    dim iter
    dim txt

    count = LowLevelList.count
    If count = 0 Then
        err.raise 1000, "VBScript", "No LowLevel available."
    End If

    iter = 0
    do while iter < count
        set ThisLowLevel = LowLevelList(iter)
        txt = txt & Chr(35) & CStr(iter + 1) & Chr(9) & ThisLowlevel.FormatAddress & Chr(9) & ThisLowLevel.Name & chr(13) & chr(10)
        LowLevelNameString = LowLevelNameString &  CStr(ThisLowLevel.Name) & "%" & CStr(iter) & "%"
        iter = iter + 1
    loop

    dim text
    text = "Index" & Chr(9) & "Address" & Chr(9) & Chr(9) & "Name" & Chr(13) & Chr(10)
    txt = text & txt
    adw3cli.Display(txt) 
End Function

Function RegBanks(ProcIndex)                '<--- CLI command
On Error Resume Next    
    RegBanks = RegBanksInt(ProcIndex)
    DisplayError
End Function

Function RegBanksInt(ProcIndex)
    dim txt
    txt = UpdateRegBankList(ProcIndex)
    txt = HeadText & txt
    adw3cli.Display(txt) 
End Function

Function Registers(RegBankIndex, fmt, fmtPar)           '<--- CLI command
On Error Resume Next    
    Registers = RegistersInt(RegBankIndex, fmt, fmtPar)
    DisplayError
End Function

Function RegistersInt(RegBankIndex, fmtKey, fmtPar)
    Dim CurRegBank
    dim Register
    dim count
    dim iter
    dim txt, RegisterList
    dim regtext, ListText
    
    If RegBankIndex = -1 Then
        RegBankIndex = "current"
    End If  

    If InStr(1, RegBankIndex, "User", 1) <> 0 or InStr(1, RegBankIndex, "System", 1) <> 0 Then
        RegBankIndex = "User/System"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -