当前位置: 首页>>代码示例>>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;未经允许,请勿转载。