當前位置: 首頁>>代碼示例>>Python>>正文


Python idaapi.Form方法代碼示例

本文整理匯總了Python中idaapi.Form方法的典型用法代碼示例。如果您正苦於以下問題:Python idaapi.Form方法的具體用法?Python idaapi.Form怎麽用?Python idaapi.Form使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在idaapi的用法示例。


在下文中一共展示了idaapi.Form方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import Form [as 別名]
def __init__(self):
        """Create the starting configuration form."""
        # dialog content
        dialog_content = """%s
                            Please insert the path to configuration directory that holds the *.json files
                            to match against the current binary.

                            <#Select a *.json configs directory for %s exported libraries       #Configs Directory    :{_config_path}>
                            <#Enable this option for binaries compiled for Windows              #Is Windows binary    :{_is_windows}>{_check_group}>
                          """ % (LIBRARY_NAME, LIBRARY_NAME)
        # argument parsing
        args = {
                '_config_path': idaapi.Form.DirInput(swidth=65),
                '_check_group': idaapi.Form.ChkGroupControl(("_is_windows",)),
               }
        idaapi.Form.__init__(self, dialog_content, args) 
開發者ID:CheckPointSW,項目名稱:Karta,代碼行數:18,代碼來源:ida_api.py

示例2: __init__

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import Form [as 別名]
def __init__(self, expr):
        "@expr: Expr instance"

        # Init
        self.languages = list(Translator.available_languages())
        self.expr = expr

        # Initial translation
        text = Translator.to_language(self.languages[0]).from_expr(self.expr)

        # Create the Form
        idaapi.Form.__init__(self, r"""STARTITEM 0
Python Expression
{FormChangeCb}
<Language:{cbLanguage}>
<Translation:{result}>
""", {
            'result': idaapi.Form.MultiLineTextControl(text=text,
                                                       flags=translatorForm.flags),
            'cbLanguage': idaapi.Form.DropdownListControl(
                    items=self.languages,
                    readonly=True,
                    selval=0),
            'FormChangeCb': idaapi.Form.FormChangeCb(self.OnFormChange),
        }) 
開發者ID:cea-sec,項目名稱:miasm,代碼行數:27,代碼來源:utils.py

示例3: __init__

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import Form [as 別名]
def __init__(self, ioctl, driver):
        idaapi.Form.__init__(
                        self,
                        """Send IOCTL
                        {form_change}
                        <#Input Buffer#~I~nput Buffer:{in_buf}>
                        <#Input Buffer Size#~I~nput Buffer Size:{in_size}>
                        <#Output Buffer#~O~utput Buffer:{out_buf}>
                        <#Output Buffer Size#~O~utput Buffer Size:{out_size}>
                        <#Send IOCTL#~S~end IOCTL:{sendIOCTL}>
                        """, {
                            "form_change": idaapi.Form.FormChangeCb(self.form_change),
                            "in_buf": idaapi.Form.MultiLineTextControl(),
                            "out_buf": idaapi.Form.MultiLineTextControl(),
                            "in_size": idaapi.Form.NumericInput(),
                            "out_size": idaapi.Form.NumericInput(),
                            "sendIOCTL": idaapi.Form.ButtonInput(self.send_ioctl)
                        }
        )
        self.driver = driver
        global ioctl_tracker
        for inst in ioctl_tracker.ioctl_locs:
            value = get_operand_value(inst)
            function = ioctl_decoder.get_function(value)
            if function == int(ioctl[1],16):
                self.ioctl = value
        self.Compile()
        self.in_size.value = 0x20
        self.out_size.value = 0x20
        self.in_buf.value = "\\x41" * 0x20
        self.Execute() 
開發者ID:FSecureLABS,項目名稱:win_driver_plugin,代碼行數:33,代碼來源:create_tab_table.py

示例4: __init__

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import Form [as 別名]
def __init__( self, title, chooser ):

        self.chooser = chooser
        template_instance = PLUGIN_CHOOSER_FORM_TEMPLATE % title
        Form.__init__(self, template_instance, {
            'Chooser' : Form.EmbeddedChooserControl(chooser)
        })


# ------------------------------------------------------------------------------ 
開發者ID:darx0r,項目名稱:Reef,代碼行數:12,代碼來源:Reef.py

示例5: prompt_for_segment

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import Form [as 別名]
def prompt_for_segment():
    ''' :returns: a Segment instance, or raises BadInputError '''
    class MyForm(idaapi.Form):
        def __init__(self):
            idaapi.Form.__init__(self, """STARTITEM 0
add segment by buffer

<##buffer path:{path}>
<##segment name:{name}>
<##segment start address:{addr}>
""",
                                 {
                                     'path': idaapi.Form.FileInput(open=True),
                                     'name': idaapi.Form.StringInput(),
                                     'addr': idaapi.Form.NumericInput(tp=Form.FT_ADDR),
                                 })

        def OnFormChange(self, fid):
            return 1

    f = MyForm()
    f.Compile()
    f.path.value = ""
    f.name.value = ""
    f.addr.value = 0x0
    ok = f.Execute()
    if ok != 1:
        raise BadInputError('user cancelled')

    path = f.path.value
    if path == "" or path is None:
        raise BadInputError('bad path provided')

    if not os.path.exists(path):
        raise BadInputError('file doesn\'t exist')

    name = f.name.value
    if name == "" or name is None:
        raise BadInputError('bad name provided')

    addr = f.addr.value
    f.Free()
    return Segment(path, name, addr) 
開發者ID:williballenthin,項目名稱:idawilli,代碼行數:45,代碼來源:add_segment.py

示例6: kernelcache_find_virtual_method_overrides

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import Form [as 別名]
def kernelcache_find_virtual_method_overrides(classname=None, method=None):
    import idc
    import idaapi
    import ida_kernelcache as kc

    # Define the form to ask for the arguments.
    class MyForm(idaapi.Form):
        def __init__(self):
            swidth = 40
            idaapi.Form.__init__(self, r"""STARTITEM 0
Find virtual method overrides

<#The class#Class :{classname}>
<#The virtual method#Method:{method}>""", {
                'classname': idaapi.Form.StringInput(tp=idaapi.Form.FT_IDENT, swidth=swidth),
                'method':    idaapi.Form.StringInput(tp=idaapi.Form.FT_IDENT, swidth=swidth),
            })
        def OnFormChange(self, fid):
            return 1

    kc.collect_class_info()

    if any(arg is None for arg in (classname, method)):
        f = MyForm()
        f.Compile()
        f.classname.value = classname or ''
        f.method.value    = method    or ''
        ok = f.Execute()
        if ok != 1:
            print 'Cancelled'
            return False
        classname = f.classname.value
        method    = f.method.value
        f.Free()

    if classname not in kc.class_info:
        print 'Not a valid class: {}'.format(classname)
        return False

    print 'Subclasses of {} that override {}:'.format(classname, method)
    baseinfo = kc.class_info[classname]
    found = False
    for classinfo in baseinfo.descendants():
        for _, override, _ in kc.vtable.class_vtable_overrides(classinfo, superinfo=baseinfo,
                methods=True):
            name = idc.NameEx(idc.BADADDR, override)
            demangled = idc.Demangle(name, idc.GetLongPrm(idc.INF_SHORT_DN))
            name = demangled if demangled else name
            if method in name:
                print '{:#x}  {}'.format(override, classinfo.classname)
                found = True
    if not found:
        print 'No subclass of {} overrides {}'.format(classname, method)
    return found 
開發者ID:bazad,項目名稱:ida_kernelcache,代碼行數:56,代碼來源:find_virtual_method_overrides.py


注:本文中的idaapi.Form方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。