Exemple #1
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"))
    })
    def __init__(self, manager, disable_param=False):

        self.disable_param = disable_param

        self.all_funcs = IDAUtils.get_all_ida_funcs()
        self.funcList = FunctionListView("asm",
                                         flags=Choose.CH_MULTI,
                                         all_funcs=self.all_funcs)
        self.selected_funcs = []

        self.configuration = manager.configuration
        apps = self.configuration['apps'].keys()
        default_app = self.configuration['default-app']
        if self.configuration['default-app'] is not None:
            default_index = apps.index(default_app)
        else:
            default_index = 0
        self.selected_app_key = default_app

        self.threshold = self.configuration['default-threshold']
        self.topk = self.configuration['default-topk']
        self.avoidSameBinary = self.configuration['default-avoidSameBinary']

        Form.__init__(
            self, r"""BUTTON YES* Continue
BUTTON CANCEL Cancel
Kam1n0
{FormChangeCb}
Select Function:
<(Use ctrl/shift + click to select multiple functions):{fvChooser}>
<Select all functions:{chkSearchAll}><Skip library functions:{chkSkipLib}>{adSearchGroup}>
Configuration
<Threshold:{txtSim}>
<TopK     :{txtTopK}>
<Avoid Same Binary  :{chkSameBin}>{chkGroup}>
<App   :{dpServer}>
""", {
                'adSearchGroup':
                Form.ChkGroupControl(["chkSearchAll", "chkSkipLib"]),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
                'txtSim':
                Form.StringInput(
                    swidth=25, tp=Form.FT_ASCII, value=str(self.threshold)),
                'txtTopK':
                Form.StringInput(
                    swidth=25, tp=Form.FT_ASCII, value=str(self.topk)),
                'chkGroup':
                Form.ChkGroupControl(("chkSameBin", "")),
                'dpServer':
                Form.DropdownListControl(swidth=45,
                                         width=45,
                                         selval=default_index,
                                         items=apps,
                                         readonly=True),
                'fvChooser':
                Form.EmbeddedChooserControl(self.funcList)
            })
        self.Compile()
Exemple #3
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),
         })
Exemple #4
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)
})
Exemple #5
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
Exemple #6
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)
})
Exemple #7
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()
Exemple #8
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()
Exemple #9
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),
            })
Exemple #10
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),
                })
Exemple #11
0
    def __init__(self, lines, prompt):
        self.prompt = prompt
        print("in okTextForm init")
        if prompt:
            Form.__init__(
                self, r"""STARTITEM 0
BUTTON YES* OK
BUTTON NO NONE
BUTTON CANCEL NONE
CGC Ida Client Help

{FormChangeCb}
<Don't show help at startup:{nShow}>{cGroup1}>

{cStr1}
{cStr2}

""", {
                    'cStr1': Form.StringLabel(lines['overview']),
                    'cStr2': Form.StringLabel(lines['hotkeys']),
                    'cGroup1': Form.ChkGroupControl(("nShow", "")),
                    'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
                })

        else:
            Form.__init__(
                self, r"""STARTITEM 0
BUTTON YES* OK
BUTTON NO NONE
BUTTON CANCEL NONE
CGC Ida Client Help

{FormChangeCb}
{cStr1}

""", {
                    'cStr1': Form.StringLabel(lines['overview']),
                    'cStr2': Form.StringLabel(lines['hotkeys']),
                    'cGroup1': Form.ChkGroupControl(("nShow", "")),
                    'FormChangeCb': Form.FormChangeCb(self.OnFormChange),
                })
    def __init__(self, manager):
        global funcListG
        self.funcList = FunctionListView("asm", flags=Choose2.CH_MULTI)
        self.funcs = []

        self.cnn = manager.connector

        self.Kconf = manager.Kconf
        dpItems = self.Kconf['cnns'].keys()
        if self.Kconf['default-cnn'] is not None:
            defaultIndex = self.Kconf['cnns'].keys().index(
                self.Kconf['default-cnn'])

        else:
            defaultIndex = 0

        self.threshold = self.Kconf['default-threshold']
        self.topk = self.Kconf['default-topk']

        Form.__init__(
            self, r"""BUTTON YES* Search
BUTTON CANCEL Cancel
Kam1n0
{FormChangeCb}
Select Function to be searched
<(Use ctrl/shift + click to select multiple functions):{fvChooser}>
<Select all functions:{chkSearchAll}><Skip library functions:{chkSkipLib}>{adSearchGroup}>
Search configuration
<Threshold:{txtSim}>
<TopK     :{txtTopK}>
<Server   :{dpServer}>

""", {
                'adSearchGroup':
                Form.ChkGroupControl(["chkSearchAll", "chkSkipLib"]),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
                'txtSim':
                Form.StringInput(
                    swidth=25, tp=Form.FT_ASCII, value=str(self.threshold)),
                'txtTopK':
                Form.StringInput(
                    swidth=25, tp=Form.FT_ASCII, value=str(self.topk)),
                'dpServer':
                Form.DropdownListControl(swidth=45,
                                         width=45,
                                         selval=defaultIndex,
                                         items=dpItems,
                                         readonly=True),
                'fvChooser':
                Form.EmbeddedChooserControl(self.funcList)
            })
        self.Compile()
    def __init__(self, manager):
        self.allFuncs = [GetFunction(x) for x in GetFunctions()]
        self.funcList = FunctionListView("asm",
                                         allFuncs=self.allFuncs,
                                         flags=Choose2.CH_MULTI)
        self.funcs = []

        self.cnn = manager.connector
        self.Kconf = manager.Kconf
        dpItems = self.Kconf['cnns'].keys()
        if self.Kconf['default-cnn'] is not None:
            defaultIndex = self.Kconf['cnns'].keys().index(
                self.Kconf['default-cnn'])
        else:
            defaultIndex = 0

        Form.__init__(
            self, r"""BUTTON YES* Index
BUTTON CANCEL Cancel
Kam1n0
{FormChangeCb}
Select Function to be indexed
<(Use ctrl/shift + click to select multiple functions):{fvChooser}>
<Select all functions:{chkSearchAll}>
<Select all library functions:{chkOnlyLib}>
<Select all but not library functions:{chkSkipLib}>{adSearchGroup}>
Index configuration
<Server   :{dpServer}>
""", {
                'adSearchGroup':
                Form.ChkGroupControl(
                    ["chkSearchAll", "chkSkipLib", "chkOnlyLib"]),
                'FormChangeCb':
                Form.FormChangeCb(self.OnFormChange),
                'txtSim':
                Form.StringInput(swidth=25, tp=Form.FT_ASCII, value='0.5'),
                'dpServer':
                Form.DropdownListControl(swidth=45,
                                         width=45,
                                         selval=defaultIndex,
                                         items=dpItems,
                                         readonly=True),
                'fvChooser':
                Form.EmbeddedChooserControl(self.funcList)
            })
        self.Compile()
        self.activated = False
Exemple #14
0
  def __init__(self):
    s = r"""Pigaios
  Please select the path to the exported source code SQLite database to diff against the current
  binary database.

  <#Select an exported source code SQLite database                                           #Database           :{iFileOpen}>
  <#Enter the command line for indenting sources and pseudo-codes (leave blank to ignore it) #Indent command     :{iIndentCommand}>
  <#Minimum ratio to consider a match good enough (set to zero to automatically calculate it)#Calculations ratio :{iMinLevel}>
  <#Minimum ratio for a match to be displayed (set to zero to automatically calculate it)    #Display ratio      :{iMinDisplayLevel}>
   <Use the decompiler if available:{rUseDecompiler}>{cGroup1}>"""
    args = {'iFileOpen'       : Form.FileInput(open=True, swidth=45),
            'iIndentCommand'  : Form.StringInput(swidth=45),
            'iMinLevel'       : Form.StringInput(swidth=10),
            'iMinDisplayLevel': Form.StringInput(swidth=10),
            'cGroup1'  : Form.ChkGroupControl(("rUseDecompiler",))
            }
    Form.__init__(self, s, args)
Exemple #15
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(),
    })
Exemple #16
0
    def __init__(self):
        Form.__init__(
            self, r"""Marx IDA Import Script

<#Select a hierarchy file to open#    Hierarchy File:{iHierarchyFileOpen}>
<#Select a new operators file to open#New Operators File:{iNewOpFileOpen}>
<#Select a vcalls file to open#       Vcalls File:{iVcallFileOpen}>
<#Select a Vtables file to open#      Vtables File:{iVTablesFileOpen}>
Class hierarchies <Allow hierarchies with only one class:{rAllowSingleClassHierarchies}>{cHierarchies}>
""", {
                'iHierarchyFileOpen':
                Form.FileInput(open=True, value="*.hierarchy"),
                'iNewOpFileOpen':
                Form.FileInput(open=True, value="*.new_operators"),
                'iVcallFileOpen':
                Form.FileInput(open=True, value="*.vcalls_extended"),
                'iVTablesFileOpen':
                Form.FileInput(open=True, value="*_vtables.txt"),
                'cHierarchies':
                Form.ChkGroupControl(("rAllowSingleClassHierarchies", ))
            })
Exemple #17
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"))
    })
Exemple #18
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 #19
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)
            })