Python ida_kernwin.Form() Examples

The following are 9 code examples of ida_kernwin.Form(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module ida_kernwin , or try the search function .
Example #1
Source File: plugin_loader.py    From vt-ida-plugin with Apache License 2.0 5 votes vote down vote up
def __init__(self):
    self.invert = False
    ida_kernwin.Form.__init__(self, r"""STARTITEM 0
BUTTON YES Ok
BUTTON NO*  No
BUTTON Cancel Cancel
VirusTotal Plugin for IDA Pro 7

Welcome to the Beta Version of the VirusTotal IDA Pro Plugin !

Auto uploads of samples is enabled by default. By submitting 
your file to VirusTotal you are asking VirusTotal to share 
your submission with the security community and agree to our 
Terms of Service and Privacy Policy. 

For further information click on the following links:
- {cHtml1}
- {cHtml2}

Press "Ok" to agree, "No" to disable uploads or "Cancel"
to stop using this plugin.
 
""", {
    'cHtml1': ida_kernwin.Form.StringLabel(
        '<a href=\"https://support.virustotal.com/hc/en-us/articles/115002145529-Terms-of-Service\">Terms of Service</a>',
        tp=ida_kernwin.Form.FT_HTML_LABEL
    ),
    'cHtml2': ida_kernwin.Form.StringLabel(
        '<a href=\"https://support.virustotal.com/hc/en-us/articles/115002168385-Privacy-Policy\">Privacy Policy</a>',
        tp=ida_kernwin.Form.FT_HTML_LABEL
    )
}) 
Example #2
Source File: find.py    From Sibyl with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):

        addr = idc.ScreenEA()
        func = idaapi.get_func(addr)

        tests_choice = "\n".join(map(lambda x: "<%s:{r%s}>" % (x, x), AVAILABLE_TESTS))
        ida_kernwin.Form.__init__(self,
r"""BUTTON YES* Launch
BUTTON CANCEL NONE
Sibyl Settings

{FormChangeCb}
Apply on:
<One function:{rOneFunc}>
<All functions:{rAllFunc}>{cMode}>

<Targeted function:{cbFunc}>

Testsets to use:
%s{cTest}>

""" % tests_choice, {
    'FormChangeCb': ida_kernwin.Form.FormChangeCb(self.OnFormChange),
    'cMode': ida_kernwin.Form.RadGroupControl(("rOneFunc", "rAllFunc")),
    'cTest': ida_kernwin.Form.ChkGroupControl(map(lambda x: "r%s" % x,
                                      AVAILABLE_TESTS),
                                  value=(1 << len(AVAILABLE_TESTS)) - 1),
    'cbFunc': ida_kernwin.Form.DropdownListControl(
        items=self.available_funcs,
        readonly=False,
        selval="0x%x" % func.startEA),
}
        )

        self.Compile() 
Example #3
Source File: ui.py    From GhIDA with Apache License 2.0 5 votes vote down vote up
def __init__(self, address, current_name):
        """
        Display a Pop-Up and get a new name for the symbol
        """
        self.invert = False
        rename_form_dict = {
            'cAddr': ida_kernwin.Form.NumericLabel(address,
                                                   ida_kernwin.Form.FT_ADDR),
            'cLbl': ida_kernwin.Form.StringLabel(current_name),
            'iStr': ida_kernwin.Form.StringInput(),
        }
        ida_kernwin.Form.__init__(self, RENAME_FORM_TEXT, rename_form_dict) 
Example #4
Source File: ui.py    From GhIDA with Apache License 2.0 5 votes vote down vote up
def __init__(self, text):
        """
        Display a Pop-Up and get a new name for the symbol
        """
        self.invert = False
        comment_form_dict = {
            'iStr': ida_kernwin.Form.MultiLineTextControl(
                text=text,
                swidth=125,
                flags=ida_kernwin.Form.MultiLineTextControl.TXTF_FIXEDFONT)
        }
        ida_kernwin.Form.__init__(self,
                                  COMMENT_FORM_TEXT,
                                  comment_form_dict) 
Example #5
Source File: ui.py    From GhIDA with Apache License 2.0 5 votes vote down vote up
def __init__(self):
        dd = {
            'FormChangeCall': ida_kernwin.Form.FormChangeCb(self.OnFormChange),
            'cGroup': ida_kernwin.Form.ChkGroupControl(("GLocal", "GRe")),
            'GhidraInstallationPath': ida_kernwin.Form.DirInput(),
            'GhidraaasURL': ida_kernwin.Form.StringInput(),
            'cGroup1': ida_kernwin.Form.ChkGroupControl(("GLocal1", "GRe1")),
            'cGroup2': ida_kernwin.Form.ChkGroupControl(("GLocal2", "GRe2"))
        }
        ida_kernwin.Form.__init__(self, SETTINGS_FORM_TEXT, dd)
        self.ghidraaas_selected = False
        self.save_cache = True
        self.show_dialog = True 
Example #6
Source File: stackstring_static.py    From ida_haru with Apache License 2.0 5 votes vote down vote up
def __init__(self):
        ida_kernwin.Form.__init__(self,
r"""BUTTON YES* Run
BUTTON CANCEL Cancel
stackstring_static

{FormChangeCb}
<current function only:{cCurrentOnly}>
<enable debug messages:{cDebug}>
<enable xor decoding:{cDecode}>{cGroup}>
""",
        {
            'FormChangeCb': ida_kernwin.Form.FormChangeCb(self.OnFormChange),
            'cGroup': ida_kernwin.Form.ChkGroupControl(("cCurrentOnly", "cDebug", "cDecode")),
        }) 
Example #7
Source File: graph_ir.py    From miasm with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self):
        ida_kernwin.Form.__init__(
            self,
            r"""BUTTON YES* Launch
BUTTON CANCEL NONE
Graph IR Settings

{FormChangeCb}
Analysis:
<Graph IR :{rGraphIR}>
<Graph IR + SSA :{rGraphIRSSA}>
<Graph IR + SSA + UnSSA :{rGraphIRSSAUNSSA}>{cScope}>

Options:
<Simplify code:{rCodeSimplify}>
<Subcalls dont change stack:{rDontModStack}>
<Load static memory:{rLoadMemInt}>{cOptions}>
""",
            {
                'FormChangeCb': ida_kernwin.Form.FormChangeCb(self.OnFormChange),
                'cScope': ida_kernwin.Form.RadGroupControl(
                    (
                        "rGraphIR",
                        "rGraphIRSSA",
                        "rGraphIRSSAUNSSA"
                    )
                ),
                'cOptions': ida_kernwin.Form.ChkGroupControl(
                    (
                        "rCodeSimplify",
                        "rDontModStack",
                        "rLoadMemInt"
                    )
                ),
            }
        )
        form, _ = self.Compile()
        form.rCodeSimplify.checked = True
        form.rDontModStack.checked = False
        form.rLoadMemInt.checked = False 
Example #8
Source File: idaxml.py    From GhIDA with Apache License 2.0 4 votes vote down vote up
def get_options(self, display):
        """
        Displays the options menu and retrieves the option settings. 
        """
        fmt = "HELP\n"
        fmt += "XML PROGRAM loader/importer plugin (Python)\n"
        fmt += "IDA SDK: " + str(IDA_SDK_VERSION) + "\n\n"
        fmt += "The XML PROGRAM loader loads elements from a "
        fmt += "XML <PROGRAM> document to create an idb database.\n\n"
        fmt += "ENDHELP\n"
        fmt += "Import from XML PROGRAM document...."
        fmt += "\n <##Options##Code Blocks:{CodeBlocks}>"
        fmt += "\n <Entry Points:{EntryPoints}>"
        fmt += "\n <Segment Register Value Ranges:{RegisterValues}>"
        fmt += "\n <Data Types:{DataTypes}>"
        fmt += "\n <Data Definitions:{DataDefinitions}>"
        fmt += "\n <Symbols:{Symbols}>"
        fmt += "\n <Comments:{Comments}>"
        fmt += "\n <Bookmarks:{Bookmarks}>"
        fmt += "\n <Functions:{Functions}>"
        fmt += "\n <Memory References:{MemoryReferences}>"
        fmt += "\n <Equate/Enum References:{EquateReferences}>"
        fmt += "\n <Manual Instructions/Operands:{Manual}>{cGroup1}>"
        fmt += "\n\n"

        Opts = {'cGroup1': ida_kernwin.Form.ChkGroupControl((
            "CodeBlocks",
            "EntryPoints",
            "RegisterValues",
            "DataTypes",
            "DataDefinitions",
            "Symbols",
            "Comments",
            "Bookmarks",
            "Functions",
            "MemoryReferences",
            "EquateReferences",
            "Manual"
        ))}

        self.options = ida_kernwin.Form(fmt, Opts)
        self.options.Compile()

        self.options.CodeBlocks.checked = True
        self.options.EntryPoints.checked = True
        self.options.RegisterValues.checked = True
        self.options.DataTypes.checked = True
        self.options.DataDefinitions.checked = True
        self.options.Symbols.checked = True
        self.options.Functions.checked = True
        self.options.Comments.checked = True
        self.options.Bookmarks.checked = True
        self.options.MemoryReferences.checked = True
        self.options.EquateReferences.checked = True
        self.options.Manual.checked = True

        if display == True:
            ok = self.options.Execute()
            if (ok == 0):
                raise Cancelled 
Example #9
Source File: fn_fuzzy.py    From ida_haru with Apache License 2.0 4 votes vote down vote up
def __init__(self):
        ida_kernwin.Form.__init__(self,
r"""BUTTON YES* Run
BUTTON CANCEL Cancel
fn_fuzzy

{FormChangeCb}
General Options
<DB file path:{iDBSave}>
<minimum function code size:{iMinBytes}>
<exclude library/thunk functions:{cLibthunk}>
<enable debug messages:{cDebug}>{cGroup}>

<##Commands##Export:{rExport}>
<Compare:{rCompare}>{rGroup}>

Export Options
<update the DB records:{cUpdate}>
<store flags as analyzed functions:{cAnaExp}>{cEGroup}>
<analyzed function name prefix/suffix (regex):{iPrefix}>

Compare Options
<compare with only analyzed functions:{cAnaCmp}>
<compare with only IDBs in the specified folder:{cFolCmp}>{cCGroup}>
<the folder path:{iFolder}>
<function code size comparison criteria (0-100):{iRatio}>
<function similarity score threshold (0-100) without CFG match:{iSimilarity}>
<function similarity score threshold (0-100) with CFG match:{iSimilarityCFG}>
<function code size threshold evaluated by only CFG match:{iMaxBytesForScore}>
""",
        {
            'FormChangeCb': ida_kernwin.Form.FormChangeCb(self.OnFormChange),
            'cGroup': ida_kernwin.Form.ChkGroupControl(("cLibthunk", "cDebug")),
            'iDBSave': ida_kernwin.Form.FileInput(save=True),
            'iMinBytes': ida_kernwin.Form.NumericInput(tp=ida_kernwin.Form.FT_HEX),
            'rGroup': ida_kernwin.Form.RadGroupControl(("rCompare", "rExport")),
            'cEGroup': ida_kernwin.Form.ChkGroupControl(("cUpdate", "cAnaExp")),
            'iPrefix': ida_kernwin.Form.StringInput(),
            'cCGroup': ida_kernwin.Form.ChkGroupControl(("cAnaCmp", "cFolCmp")),
            'iFolder': ida_kernwin.Form.DirInput(),
            'iRatio': ida_kernwin.Form.NumericInput(tp=ida_kernwin.Form.FT_DEC),
            'iSimilarity': ida_kernwin.Form.NumericInput(tp=ida_kernwin.Form.FT_DEC),
            'iSimilarityCFG': ida_kernwin.Form.NumericInput(tp=ida_kernwin.Form.FT_DEC),
            'iMaxBytesForScore': ida_kernwin.Form.NumericInput(tp=ida_kernwin.Form.FT_HEX),            
        })