Exemple #1
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()
    def __init__(self):
        self.invert = False
        Form.__init__(
            self,
            r"""STARTITEM {id:cGoVers}
GoLoader

{FormChangeCb}
<##Try to detemine go version based on moduledata:{iButton1}>
<##Try to detemine go version based on version string:{iButton2}>
<##Rename functions:{iButton3}>
Go version:
<Go1.2:{r2}>
<Go1.4:{r4}>
<Go1.5:{r5}>
<Go1.6:{r6}>
<Go1.7:{r7}>
<Go1.8:{r8}>
<Go1.9:{r9}>
<Go1.10:{r10}>{cGoVers}>
<##Add standard go types:{iButton4}>
<##Parse types by moduledata:{iButton5}>
""",
            {
                "iButton1": Form.ButtonInput(self.OnButton1),
                "iButton2": Form.ButtonInput(self.OnButton2),
                "iButton3": Form.ButtonInput(self.OnButton3),
                "iButton4": Form.ButtonInput(self.OnButton4),
                "iButton5": Form.ButtonInput(self.OnButton5),
                "cGoVers": Form.RadGroupControl(("r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10")),
                "FormChangeCb": Form.FormChangeCb(self.OnFormChange),
            },
        )
Exemple #3
0
    def __init__(self, module, address, symbol, recentOnEnter, recentOnLeave):
        Form.__init__(
            self, r"""STARTITEM {id:script_enter}
BUTTON YES* Save
BUTTON CANCEL Cancel
Function Hook

{segment}  {address}:  {symbol} 

<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}>
""", {
                'segment':
                Form.StringLabel("[" + module + "]", tp='F'),
                'address':
                Form.StringLabel(address, tp='A'),
                'symbol':
                Form.StringLabel(symbol, tp='X'),
                'trigger':
                Form.RadGroupControl(("set_once", "set_perm")),
                '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
    def __init__(self):
        self.invert = False
        Form.__init__(
            self, r"""STARTITEM {id:cGoVers}
GoLoader

{FormChangeCb}
<##Try to detemine go version based on moduledata:{iButton1}>
<##Try to detemine go version based on version string:{iButton2}>
<##Rename functions:{iButton3}>
<##Rename structs:{iButton6}>
<##Save package info to txt:{iButton7}>
Go version:
<Go1.2:{r2}>
<Go1.4:{r4}>
<Go1.5:{r5}>
<Go1.6:{r6}>
<Go1.7:{r7}>
<Go1.8:{r8}>
<Go1.9:{r9}>
<Go1.10:{r10}>
<Go1.11:{r11}>
<Go1.12:{r12}>
<Go1.13:{r13}>{cGoVers}>
<##Add standard go types:{iButton4}>
<##Parse types by moduledata:{iButton5}>
""", {
                'iButton1':
                Form.ButtonInput(self.OnButton1),
                'iButton2':
                Form.ButtonInput(self.OnButton2),
                'iButton3':
                Form.ButtonInput(self.OnButton3),
                'iButton4':
                Form.ButtonInput(self.OnButton4),
                'iButton5':
                Form.ButtonInput(self.OnButton5),
                'iButton6':
                Form.ButtonInput(self.OnButton6),
                'iButton7':
                Form.ButtonInput(self.OnButton7),
                'cGoVers':
                Form.RadGroupControl(("r2", "r3", "r4", "r5", "r6", "r7", "r8",
                                      "r9", "r10", "r11", "r12", "r13")),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
            })
Exemple #5
0
    def __init__(self):
        self.invert = False
        Form.__init__(
            self, r"""STARTITEM {id:cGoVers}
GoLoader

{FormChangeCb}
<##Try to detemine go version based on moduledata:{iButton1}>
<##Try to detemine go version based on version string:{iButton2}>
<##Rename functions:{iButton3}>
Go version:
<Go1.2:{r2}>
<Go1.4:{r4}>
<Go1.5:{r5}>
<Go1.6:{r6}>
<Go1.7:{r7}>{cGoVers}>
<##Add standard go types:{iButton4}>
<##Parse types by moduledata:{iButton5}>
""", {
                'iButton1':
                Form.ButtonInput(self.OnButton1),
                'iButton2':
                Form.ButtonInput(self.OnButton2),
                'iButton3':
                Form.ButtonInput(self.OnButton3),
                'iButton4':
                Form.ButtonInput(self.OnButton4),
                'iButton5':
                Form.ButtonInput(self.OnButton5),
                'cGoVers':
                Form.RadGroupControl((
                    "r2",
                    "r3",
                    "r4",
                    "r5",
                    "r6",
                    "r7",
                )),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
            })
    def __init__(self, module, address, mnemonic, recentFile):
        Form.__init__(
            self, r"""STARTITEM {id:script}
BUTTON YES* Save
BUTTON CANCEL Cancel
Instruction Hook

{segment}  {address}:  {mnemonic} 

<Once:{set_once}>
<Permanent:{set_perm}>{trigger}>

Recent source file:{src_file}
<##Script source code\::{script}>
<##Load from file:{loadfile}><##Update from file:{update}>
""", {
                'segment':
                Form.StringLabel("[" + module + "]", tp='F'),
                'address':
                Form.StringLabel(address, tp='A'),
                'mnemonic':
                Form.StringLabel(mnemonic, tp='X'),
                'trigger':
                Form.RadGroupControl(("set_once", "set_perm")),
                'src_file':
                Form.StringLabel(recentFile if recentFile is not None else "",
                                 tp='f'),
                'script':
                Form.MultiLineTextControl(flags=self.textFlags,
                                          tabsize=self.textTab,
                                          width=200,
                                          swidth=200),
                'loadfile':
                Form.ButtonInput(self.onLoad),
                'update':
                Form.ButtonInput(self.onUpdate),
            })
        self.recentScriptFile = recentFile
    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)
            })
Exemple #8
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()
Exemple #9
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