Beispiel #1
0
    def __init__(self, crawled_apis, from_addr=0, to_addr=0):
        self.invert = False
        self.chosenApis = []
        self.apiChooser = ApiChooser("Apis", crawled_apis, flags=Choose.CH_MULTI)
        Form.__init__(self, r"""STARTITEM {id:rNormal}
BUTTON YES* Annotate
BUTTON CANCEL Cancel
IDA ApiScout (Results)

{FormChangeCb}
ApiScout has found the following APIs (select to annotate, e.g. CTRL+A):

<APIs:{cApiChooser}>
{cApiInfo}

Filter APIs by Range -  
<##from  :{iAddrFrom}>
<##to    :{iAddrTo}>
Filter APIs by Grouping - require another API 
<##within:{iByteRange}> bytes
<##Apply Filter:{bApplyFilter}>
""", {
    'cApiInfo': Form.StringLabel("APIs (unfiltered)"),
    'bApplyFilter': Form.ButtonInput(self.OnButtonApplyFilter),
    'iAddrFrom': Form.NumericInput(tp=Form.FT_ADDR, value=from_addr),
    'iAddrTo': Form.NumericInput(tp=Form.FT_ADDR, value=to_addr),
    'iByteRange': Form.NumericInput(tp=Form.FT_UINT64, value=0x100),
    'cGroup1': Form.ChkGroupControl(("rFilter", "rNormal")),
    'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
    'cApiChooser' : Form.EmbeddedChooserControl(self.apiChooser)
})
Beispiel #2
0
    def __init__(self, start_ea, end_ea):
        Form.__init__(
            self, r"""BUTTON YES* Import
Import data

{FormChangeCb}
<##Start EA   :{intStartEA}>
<##End EA     :{intEndEA}>

Import type:                    Patching options:
<hex string:{rHex}><##Trim to selection:{cSize}>{cGroup}>
<string literal:{rString}>
<binary file:{rFile}>{rGroup}>

<:{strPatch}>
<##Import BIN file:{impFile}>
""", {
                'intStartEA':
                Form.NumericInput(swidth=40, tp=Form.FT_ADDR, value=start_ea),
                'intEndEA':
                Form.NumericInput(swidth=40, tp=Form.FT_ADDR, value=end_ea),
                'cGroup':
                Form.ChkGroupControl(("cSize", )),
                'rGroup':
                Form.RadGroupControl(("rHex", "rString", "rFile")),
                'strPatch':
                Form.MultiLineTextControl(
                    swidth=80, flags=Form.MultiLineTextControl.TXTF_FIXEDFONT),
                'impFile':
                Form.FileInput(swidth=50, open=True),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
            })

        self.Compile()
Beispiel #3
0
    def __init__(self):
        Form.__init__(
            self, r"""STARTITEM 0
BUTTON YES* Save Settings
BUTTON CANCEL Cancel
Form Setup View

Debbuging:
<##Maximal function calls:   {iMaxFuncCall}>
<##Maximal dereference depth:{iDerefDepth}>


Debug Values:
<Raw:{rRaw}>
<Parse:{rParse}>
<Array:{rArray}>
<Containers:{rContainer}>
<Dereference:{rDeref}>
<Arguments:{rArgs}>{cDebugValues}>

""", {
                'cDebugValues':
                Form.ChkGroupControl(("rRaw", "rParse", "rArray", "rContainer",
                                      "rDeref", "rArgs")),
                'iMaxFuncCall':
                Form.NumericInput(tp=Form.FT_DEC),
                'iDerefDepth':
                Form.NumericInput(tp=Form.FT_DEC),
            })
Beispiel #4
0
    def __init__(self, start_ea, end_ea, org_file, bkp_file):
        Form.__init__(
            self, r"""Apply patches to input file

{FormChangeCb}
<##Start EA   :{intStartEA}>
<##End EA     :{intEndEA}>
<##Input file :{orgFile}>
<##Backup file:{bkpFile}>

<##Create backup:{rBackup}>
<##Restore original bytes:{rRestore}>{cGroup1}>
""", {
                'intStartEA':
                Form.NumericInput(swidth=40, tp=Form.FT_ADDR, value=start_ea),
                'intEndEA':
                Form.NumericInput(swidth=40, tp=Form.FT_ADDR, value=end_ea),
                'orgFile':
                Form.FileInput(swidth=50, open=True, value=org_file),
                'bkpFile':
                Form.FileInput(swidth=50, open=True, value=bkp_file),
                'cGroup1':
                Form.ChkGroupControl(("rBackup", "rRestore")),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
            })

        self.Compile()
Beispiel #5
0
    def __init__(self, engine, modules):
        Form.__init__(
            self, r"""STARTITEM {id:address}
BUTTON YES* OK
BUTTON CANCEL Cancel
Convert real address to IDB offset

{FormChangeCb}
<Module\: :{module}>
<##Real address\::{address}>
Module base: {mod_base}
<##IDB address\: :{idb_addr}>
""", {
                'module':
                Form.DropdownListControl(items=modules,
                                         readonly=True,
                                         selval=0,
                                         swidth=20,
                                         width=20),
                'address':
                Form.NumericInput(swidth=20, tp=Form.FT_HEX),
                'mod_base':
                Form.StringLabel("0x0", tp='A'),
                'idb_addr':
                Form.NumericInput(swidth=20, tp=Form.FT_HEX),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange)
            })
        self.engine = engine
Beispiel #6
0
 def __init__(self):
     Form.__init__(
         self, ("STARTITEM 0\n"
                "BUTTON YES* Save Settings\n"
                "BUTTON CANCEL Cancel\n"
                "Form Setup View\n"
                "\n"
                "Debbuging:\n"
                "<##Maximal function calls:{iMaxFuncCall}>\n"
                "<##Maximal dereference depth:{iDerefDepth}>\n"
                "\n"
                "\n"
                "Debug Values:\n"
                "<Step Into System Libraries:{rStepInSysLibs}>\n"
                "<New Function Analysis:{rFuncAnalysis}>\n"
                "<Add xrefs:{rAddXref}>\n"
                "<Raw:{rRaw}>\n"
                "<Parse:{rParse}>\n"
                "<Array:{rArray}>\n"
                "<Enum:{rEnum}>\n"
                "<Containers:{rContainer}>\n"
                "<Dereference:{rDeref}>\n"
                "<Arguments:{rArgs}>{cDebugValues}>\n"
                "\n"), {
                    'cDebugValues':
                    Form.ChkGroupControl(
                        ("rStepInSysLibs", "rAddXref", "rFuncAnalysis",
                         "rRaw", "rParse", "rArray", "rContainer", "rDeref",
                         "rArgs", "rEnum")),
                    'iMaxFuncCall':
                    Form.NumericInput(tp=Form.FT_DEC),
                    'iDerefDepth':
                    Form.NumericInput(tp=Form.FT_DEC),
                })
Beispiel #7
0
 def __init__(self):
     Form.__init__(
         self,
         ("STARTITEM 0\n"
          "BUTTON YES* Confirm\n"
          "BUTTON CANCEL Cancel\n"
          "VMAttack Settings\n"
          "\n"
          "VM Values:\n"
          "<Byte code start           :{iCodeStart}>\n"
          "<Byte code end             :{iCodeEnd}>\n"
          "<Jump table base address   :{iBaseAddr}>\n"
          "<VM function address       :{iVMAddr}>\n"
          "\n"
          "Clustering:\n"
          "<Show basic blocks:{rShowBB}>\n"
          "<Greedy clustering:{rGreedyCluster}>{cClusterValues}>\n"
          "<Cluster Heuristic         :{iClusterHeu}>\n"
          "\n"
          "Grading Automation:\n"
          "<Input/Output Importance   :{iInOut}>\n"
          "<Clustering Importance     :{iClu}>\n"
          "<Pattern Importance        :{iPaMa}>\n"
          "<Memory Usage Importance   :{iMeUs}>\n"
          "<Static Analysis Importance:{iSta}>\n"
          "\n"
          "\n"
          "Dynamic Analysis:\n"
          "<Step Into System Libraries :{rStepInSysLibs}>\n"
          '<Extract function parameters:{rFuncParams}>{cDynamicValues}>\n'),
         {
             'cClusterValues':
             Form.ChkGroupControl(("rShowBB", "rGreedyCluster")),
             'cDynamicValues':
             Form.ChkGroupControl(('rStepInSysLibs', 'rFuncParams')),
             'iClusterHeu':
             Form.NumericInput(tp=Form.FT_DEC),
             'iInOut':
             Form.NumericInput(tp=Form.FT_DEC),
             'iClu':
             Form.NumericInput(tp=Form.FT_DEC),
             'iPaMa':
             Form.NumericInput(tp=Form.FT_DEC),
             'iMeUs':
             Form.NumericInput(tp=Form.FT_DEC),
             'iSta':
             Form.NumericInput(tp=Form.FT_DEC),
             'iVMAddr':
             Form.NumericInput(tp=Form.FT_DEC),
             'iBaseAddr':
             Form.NumericInput(tp=Form.FT_DEC),
             'iCodeEnd':
             Form.NumericInput(tp=Form.FT_DEC),
             'iCodeStart':
             Form.NumericInput(tp=Form.FT_DEC),
         })
Beispiel #8
0
    def __init__(self):
        Form.__init__(
            self, r"""STARTITEM {id:log_addr}
BUTTON YES* Enter
BUTTON CANCEL Cancel
Rename Function by log
Log func address and new function name in located .
<##Address\::{log_addr}>
<##Index\::{new_name}>
""", {
                'log_addr': Form.NumericInput(swidth=20, tp=Form.FT_HEX),
                'new_name': Form.NumericInput(swidth=20, tp=Form.FT_DEC),
            })
Beispiel #9
0
    def __init__(self):
        Form.__init__(
            self, r"""STARTITEM {id:mem_addr}
BUTTON YES* Add
BUTTON CANCEL Cancel
Add Memory Range
Specify start address and size of new memory range.
<##Address\::{mem_addr}> <##Size\::{mem_size}>
<##Comment\::{mem_cmnt}>
""", {
                'mem_addr': Form.NumericInput(swidth=20, tp=Form.FT_HEX),
                'mem_size': Form.NumericInput(swidth=10, tp=Form.FT_DEC),
                'mem_cmnt': Form.StringInput(swidth=41)
            })
    def __init__(self):
        Form.__init__(self, r"""STARTITEM {id:host}
BUTTON YES* Save
BUTTON CANCEL Cancel
FridaLink Settings

<##Host\::{host}> <##Port\::{port}>

<##CPU context columns\::{cpuctx_cols}>
""", {
        'host': Form.StringInput(swidth=15),
        'port': Form.NumericInput(swidth=5, tp=Form.FT_DEC),
        'cpuctx_cols': Form.NumericInput(swidth=5, tp=Form.FT_DEC)
        })
    def __init__(self, start_ea, end_ea, fill_value):

        Form.__init__(self,
r"""BUTTON YES* Fill
Fill bytes
<##Start EA   :{intStartEA}>
<##End EA     :{intEndEA}>
<##Value      :{intPatch}>
""", {
        'intStartEA': Form.NumericInput(swidth=40,tp=Form.FT_ADDR,value=start_ea),
        'intEndEA': Form.NumericInput(swidth=40,tp=Form.FT_ADDR,value=end_ea),
        'intPatch': Form.NumericInput(swidth=40,tp=Form.FT_HEX,value=fill_value),
        })

        self.Compile()
Beispiel #12
0
 def __init__(self, names, packageName):
     idx = 0
     if packageName and packageName in names:
         idx = names.index(packageName)
     Form.__init__(
         self, ("STARTITEM 0\n"
                "BUTTON YES* Attach\n"
                "BUTTON CANCEL Cancel\n"
                "Attach android application\n"
                "\n"
                "<##   Package Name:{names}>\n"
                "<## IDA Debug Port:{idaDebugPort}>\n"
                "Launch Options"
                " <Debug Mode:{debug}>{launchOptions}>\n"
                "\n"), {
                    'names':
                    Form.DropdownListControl(
                        items=names, readonly=True, selval=idx),
                    'idaDebugPort':
                    Form.NumericInput(tp=Form.FT_DEC),
                    "launchOptions":
                    Form.ChkGroupControl(["debug"])
                })
     self.pns = names
     self.pn = packageName
Beispiel #13
0
    def __init__(self):
        """
        Arguments:
        Return Value:
        Description:
            -
        TODO:
            - Doc String
        """
        self.invert = False
        self.EChooser = TestEmbeddedChooserClass("E1", flags=Choose2.CH_MULTI)
        Form.__init__(self, r"""STARTITEM {id:rDiscardLazySolves}
Options
<Discard LAZY_SOLVES:{rDiscardLazySolves}>
<Immutable:{rImmutable}>
<Auto Load Libs:{rAutoLoadLibs}>{cGroup1}>

Symbolic stdin
<##Enter length of stdin:{iStdinLen}>
<Ending newline:{rNewline}>
<Allow Null:{rNull}>
<White Space:{rWhite}>
<Force ASCII:{rASCII}>{cGroup2}>
""", {
    'cGroup1': Form.ChkGroupControl(("rDiscardLazySolves", "rImmutable", "rAutoLoadLibs")),
    'iStdinLen':Form.NumericInput(),
    'cGroup2': Form.ChkGroupControl(("rNewline", "rNull", "rWhite", "rASCII"))
    })
Beispiel #14
0
    def __init__(self, api_db_folder):
        self.invert = False
        self.chosenValues = []
        self.apiDbChooser = ApiDbChooser("ApiDBs", api_db_folder, flags=Choose.CH_MULTI)
        Form.__init__(self, r"""STARTITEM {id:rNormal}
BUTTON YES* Run
BUTTON CANCEL Cancel
IDA ApiScout

{FormChangeCb}
Please select one or more API DBs from your apiscout/dbs folder:

<Available API DBs:{cApiDbChooser}>

or load a database from another location:

<#Select a file to open#:{iFileOpen}>

<##Ignore ASLR offsets:{rAslr}>{cGroup1}>
""", {
    'iAslrOffset': Form.NumericInput(tp=Form.FT_UINT64, value=0x0),
    'iFileOpen': Form.FileInput(swidth=40, open=True, value="*.*"),
    'cGroup1': Form.ChkGroupControl(("rAslr", "rNormal")),
    'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
    'cApiDbChooser' : Form.EmbeddedChooserControl(self.apiDbChooser)
})
Beispiel #15
0
    def __init__(self):
        Form.__init__(
            self, r"""STARTITEM {id:start_addr}
BUTTON YES* Enter
BUTTON CANCEL Cancel
Rename Function by log
Log func address and new function name in located .
<##StartEa\::{start_addr}>
<##EndEa\::{end_addr}>
<##off_func_addr\::{off_func_addr}>
<##off_next_new_name\::{off_new_name}>
""", {
                'start_addr': Form.NumericInput(swidth=20, tp=Form.FT_HEX),
                'end_addr': Form.NumericInput(swidth=20, tp=Form.FT_HEX),
                'off_new_name': Form.NumericInput(swidth=20, tp=Form.FT_DEC),
                'off_func_addr': Form.NumericInput(swidth=20, tp=Form.FT_DEC),
            })
Beispiel #16
0
    def __init__(self):
        Form.__init__(
            self, r"""STARTITEM {id:iAddr}
BUTTON YES* OK
BUTTON CANCEL Cancel
Get address and count for memory watch

{FormChangeCb}
<##Enter an address      :{iAddr}>
<##Enter count           :{iRawHex}>

""", {
                'iAddr': Form.NumericInput(tp=Form.FT_ADDR),
                'iRawHex': Form.NumericInput(tp=Form.FT_ADDR),
                'iButton1': Form.ButtonInput(self.OnButton1),
                'iButton2': Form.ButtonInput(self.OnButton2),
                'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
            })
Beispiel #17
0
    def __init__(self):
        Form.__init__(self, r"""STARTITEM {id:iRawHex}
BUTTON YES* OK
BUTTON CANCEL Cancel
Modify word

{FormChangeCb}
<##Enter hex value       :{iRawHex}>
<##Enter an address      :{iAddr}>
<##Enter an offset       :{iOffset}>

""", {
            'iRawHex': Form.NumericInput(tp=Form.FT_RAWHEX),
            'iAddr': Form.NumericInput(tp=Form.FT_ADDR),
            'iOffset': Form.NumericInput(tp=Form.FT_ADDR),
            'iButton1': Form.ButtonInput(self.OnButton1),
            'iButton2': Form.ButtonInput(self.OnButton2),
            'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
        })
Beispiel #18
0
 def __init__(self, functions):
     self.functions = functions
     Form.__init__(
         self, ("STARTITEM 0\n"
                "BUTTON YES* StartDIE\n"
                "BUTTON CANCEL Cancel\n"
                "Form Scope Chooser\n"
                "\n"
                "<Start Function :{cbStartFunction}>\n"
                "<End Function   :{cbEndFunction}>\n"), {
                    'iStartAddr':
                    Form.NumericInput(tp=Form.FT_ADDR),
                    'iEndAddr':
                    Form.NumericInput(tp=Form.FT_ADDR),
                    'cbStartFunction':
                    Form.DropdownListControl(
                        items=self.functions, readonly=True, selval=1),
                    'cbEndFunction':
                    Form.DropdownListControl(
                        items=self.functions, readonly=True, selval=1),
                })
Beispiel #19
0
    def __init__(self):
        """
        Arguments:
        Return Value:
        Description:
            -
        TODO:
            - Doc String
        """
        self.invert = False
        self.EChooser = TestEmbeddedChooserClass("E1", flags=Choose2.CH_MULTI)
        Form.__init__(self, r"""STARTITEM
Arguments 
<##Enter length of argument:{iArgLen}>
""", {
    'iArgLen':Form.NumericInput()
    })
Beispiel #20
0
    def __init__(self):
        Form.__init__(
            self, r"""STARTITEM {id:iAddr}
BUTTON YES* OK
BUTTON CANCEL Cancel
Modify memory with a string

{FormChangeCb}
<#Hint1#Enter string  :{iStr1}>
<##Enter an address      :{iAddr}>

""", {
                'iStr1': Form.StringInput(),
                'iAddr': Form.NumericInput(tp=Form.FT_ADDR),
                'iButton1': Form.ButtonInput(self.OnButton1),
                'iButton2': Form.ButtonInput(self.OnButton2),
                'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
            })
Beispiel #21
0
    def __init__(self):
        """
        Arguments:
        Return Value:
        Description:
            -
        TODO:
            - Doc String
        """
        self.invert = False
        self.EChooser = TestEmbeddedChooserClass("E1", flags=Choose2.CH_MULTI)
        Form.__init__(self, r"""STARTITEM {id:rDiscardLazySolves}
Options
<Discard LAZY_SOLVES:{rDiscardLazySolves}>
<Immutable:{rImmutable}>
<Auto Load Libs:{rAutoLoadLibs}>{cGroup1}>
<Time Limit:{iTimeLimit}>
""", {
    'cGroup1': Form.ChkGroupControl(("rDiscardLazySolves", "rImmutable", "rAutoLoadLibs")),
    'iTimeLimit':Form.NumericInput(),
    })
Beispiel #22
0
    def __init__(self):
        """
        Arguments:
        Return Value:
        Description:
            -
        TODO:
            - Doc String
        """
        self.invert = False
        self.EChooser = TestEmbeddedChooserClass("E1", flags=Choose2.CH_MULTI)
        Form.__init__(self, r"""STARTITEM
Symbolic stdin
<##Enter length of stdin:{iStdinLen}>
<Ending newline:{rNewline}>
<Allow Null:{rNull}>
<White Space:{rWhite}>
<Force ASCII:{rASCII}>{cGroup2}>
""", {
    'iStdinLen':Form.NumericInput(),
    'cGroup2': Form.ChkGroupControl(("rNewline", "rNull", "rWhite", "rASCII"))
    })
Beispiel #23
0
    def __init__(self):
        self.invert = False
        self.EChooser = TestEmbeddedChooserClass("E1", flags=Choose2.CH_MULTI)
        Form.__init__(
            self, r"""STARTITEM {id:rNormal}
BUTTON YES* Yeah
BUTTON NO Nope
BUTTON CANCEL Nevermind
Form Test

{FormChangeCb}
This is a string: +{cStr1}+
This is an address: +{cAddr1}+

Escape\{control}
This is a string: '{cStr2}'
This is a number: {cVal1}

<#Hint1#Enter name:{iStr1}>
<#Hint2#Select color:{iColor1}>
Browse test
<#Select a file to open#Browse to open:{iFileOpen}>
<#Select a file to save#Browse to save:{iFileSave}>
<#Select dir#Browse for dir:{iDir}>
Type
<#Select type#Write a type:{iType}>
Numbers
<##Enter a selector value:{iSegment}>
<##Enter a raw hex:{iRawHex}>
<##Enter a character:{iChar}>
<##Enter an address:{iAddr}>
Button test
<##Button1:{iButton1}> <##Button2:{iButton2}>

Check boxes:
<Error output:{rError}>
<Normal output:{rNormal}>
<Warnings:{rWarnings}>{cGroup1}>

Radio boxes:
<Green:{rGreen}>
<Red:{rRed}>
<Blue:{rBlue}>{cGroup2}>
<Embedded chooser:{cEChooser}>
The end!
""", {
                'cStr1': Form.StringLabel("Hello"),
                'cStr2': Form.StringLabel("StringTest"),
                'cAddr1': Form.NumericLabel(0x401000, Form.FT_ADDR),
                'cVal1': Form.NumericLabel(99, Form.FT_HEX),
                'iStr1': Form.StringInput(),
                'iColor1': Form.ColorInput(),
                'iFileOpen': Form.FileInput(open=True),
                'iFileSave': Form.FileInput(save=True),
                'iDir': Form.DirInput(),
                'iType': Form.StringInput(tp=Form.FT_TYPE),
                'iSegment': Form.NumericInput(tp=Form.FT_SEG),
                'iRawHex': Form.NumericInput(tp=Form.FT_RAWHEX),
                'iAddr': Form.NumericInput(tp=Form.FT_ADDR),
                'iChar': Form.NumericInput(tp=Form.FT_CHAR),
                'iButton1': Form.ButtonInput(self.OnButton1),
                'iButton2': Form.ButtonInput(self.OnButton2),
                'cGroup1': Form.ChkGroupControl(
                    ("rNormal", "rError", "rWarnings")),
                'cGroup2': Form.RadGroupControl(("rRed", "rGreen", "rBlue")),
                'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
                'cEChooser': Form.EmbeddedChooserControl(self.EChooser)
            })
Beispiel #24
0
    def __init__(self, modules, recentOnEnter, recentOnLeave):
        Form.__init__(
            self, r"""STARTITEM {id:module}
BUTTON YES* Save
BUTTON CANCEL Cancel
Arbitrary Hook

                        !!! MAKE SURE YOU KNOW WHAT YOU ARE DOING HERE !!!

<Module\: :{module}> <##Address\::{address}>
<##Comment\::{comment}>

<Instruction:{set_inst}><Function:{set_func}>{hook_type}><Once:{set_once}><Permanent:{set_perm}>{trigger}>

Recent onEnter script file:{src_file_enter}
<##onEnter script\::{script_enter}>
<##Load from file:{loadfile_enter}><##Update from file:{update_enter}>
Recent onLeave script file:{src_file_leave}
<##onLeave script\::{script_leave}>
<##Load from file:{loadfile_leave}><##Update from file:{update_leave}>
""", {
                'module':
                Form.DropdownListControl(items=modules,
                                         readonly=True,
                                         selval=0,
                                         swidth=20,
                                         width=20),
                'address':
                Form.NumericInput(swidth=20, tp=Form.FT_HEX),
                'comment':
                Form.StringInput(swidth=60),
                'hook_type':
                Form.RadGroupControl(
                    ("set_inst", "set_func"), secondary=False),
                'trigger':
                Form.RadGroupControl(("set_once", "set_perm"), secondary=True),
                'src_file_enter':
                Form.StringLabel(
                    recentOnEnter if recentOnEnter is not None else "",
                    tp='f'),
                'script_enter':
                Form.MultiLineTextControl(flags=self.textFlags,
                                          tabsize=self.textTab,
                                          width=200,
                                          swidth=200),
                'loadfile_enter':
                Form.ButtonInput(self.onLoadEnter),
                'update_enter':
                Form.ButtonInput(self.onUpdateEnter),
                'src_file_leave':
                Form.StringLabel(
                    recentOnLeave if recentOnLeave is not None else "",
                    tp='f'),
                'script_leave':
                Form.MultiLineTextControl(flags=self.textFlags,
                                          tabsize=self.textTab,
                                          width=200,
                                          swidth=200),
                'loadfile_leave':
                Form.ButtonInput(self.onLoadLeave),
                'update_leave':
                Form.ButtonInput(self.onUpdateLeave),
            })
        self.recentScriptFileEnter = recentOnEnter
        self.recentScriptFileLeave = recentOnLeave
Beispiel #25
0
    def __init__(self, idaropengine, select_list=None):

        self.engine = idaropengine
        self.select_list = select_list
        self.segments = SegmentView(self.engine)

        Form.__init__(
            self, r"""BUTTON YES* Search
Search ROP gadgets

{FormChangeCb}<Segments:{cEChooser}>

<Bad Chars        :{strBadChars}>     
Unicode Table    <ANSI:{rUnicodeANSI}><OEM:{rUnicodeOEM}><UTF7:{rUnicodeUTF7}><UTF8:{rUnicodeUTF8}>{radUnicode}>

<Max gadget size  :{intMaxRopSize}>      
<Max gadget offset:{intMaxRopOffset}>       <Search for ROP gadgets:{cRopSearch}>
<Max RETN imm16   :{intMaxRetnImm}>         <Search for JOP gadgets:{cJopSearch}>
<Max gadgets      :{intMaxRops}>            <Search for SYS gadgets:{cSysSearch}>{gadgetGroup}>

Others settings:
<Allow conditional jumps:{cRopAllowJcc}> <Do not allow bad bytes:{cRopNoBadBytes}>{ropGroup}>
""", {
                'cEChooser':
                Form.EmbeddedChooserControl(self.segments, swidth=110),
                'ropGroup':
                Form.ChkGroupControl(('cRopAllowJcc', 'cRopNoBadBytes')),
                'gadgetGroup':
                Form.ChkGroupControl(
                    ('cRopSearch', 'cJopSearch', 'cSysSearch')),
                'intMaxRopSize':
                Form.NumericInput(swidth=4,
                                  tp=Form.FT_DEC,
                                  value=self.engine.rop.maxRopSize),
                'intMaxRopOffset':
                Form.NumericInput(swidth=4,
                                  tp=Form.FT_DEC,
                                  value=self.engine.rop.maxRopOffset),
                'intMaxRops':
                Form.NumericInput(
                    swidth=4, tp=Form.FT_DEC, value=self.engine.rop.maxRops),
                'intMaxRetnImm':
                Form.NumericInput(swidth=4,
                                  tp=Form.FT_HEX,
                                  value=self.engine.rop.maxRetnImm),
                'intMaxJopImm':
                Form.NumericInput(
                    swidth=4, tp=Form.FT_HEX, value=self.engine.rop.maxJopImm),
                'strBadChars':
                Form.StringInput(swidth=92, tp=Form.FT_ASCII),
                'radUnicode':
                Form.RadGroupControl(("rUnicodeANSI", "rUnicodeOEM",
                                      "rUnicodeUTF7", "rUnicodeUTF8")),
                'strBadMnems':
                Form.StringInput(
                    swidth=92,
                    tp=Form.FT_ASCII,
                    value=
                    "into, in, out, loop, loope, loopne, lock, rep, repe, repz, repne, repnz"
                ),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
            })

        self.Compile()