当前位置: 首页>>代码示例>>Python>>正文


Python idaapi.idadir方法代码示例

本文整理汇总了Python中idaapi.idadir方法的典型用法代码示例。如果您正苦于以下问题:Python idaapi.idadir方法的具体用法?Python idaapi.idadir怎么用?Python idaapi.idadir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在idaapi的用法示例。


在下文中一共展示了idaapi.idadir方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import idadir [as 别名]
def __init__(self):
        self.is_windows = sys.platform.startswith('win')
        self.is_ida64 = GetIdbPath().endswith(".i64")  # hackhackhack - check if we're ida64 or ida32
        logger.debug("[+] is_windows: %r" % self.is_windows)
        logger.debug("[+] is_ida64: %r" % self.is_ida64)
        self.my_path = os.path.abspath(__file__)
        self.temp_path = None
        self._init_target()
        # settings (form)
        # todo: load from configfile if available.
        self.output_path = None
        self.chk_annotate_stackvar_size = False
        self.chk_annotate_xrefs = False
        self.chk_decompile_imports = False
        self.chk_decompile_imports_recursive = False
        self.chk_decompile_alternative = False
        # self.ida_home = idaapi.idadir(".")
        self.ida_home = GetIdaDirectory()
        # wait for ida analysis to finish
        self.wait_for_analysis_to_finish()
        if not idaapi.init_hexrays_plugin():
            logger.warning("forcing hexrays to load...")
            self.load_plugin_decompiler()
        if not idaapi.init_hexrays_plugin():
            raise Exception("hexrays decompiler is not available :(") 
开发者ID:tintinweb,项目名称:ida-batch_decompile,代码行数:27,代码来源:ida_batch_decompile.py

示例2: _ida_lib

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import idadir [as 别名]
def _ida_lib():
    ea_name = 'ida64' if idc.__EA64__ else 'ida'
    if sys.platform == 'win32':
        functype = ctypes.WINFUNCTYPE
        lib = ctypes.WinDLL(ea_name)
    elif sys.platform == 'darwin':
        functype = ctypes.CFUNCTYPE
        lib = ctypes.CDLL(idaapi.idadir("lib" + ea_name + ".dylib"))
    else:
        functype = ctypes.CFUNCTYPE
        lib = ctypes.CDLL('lib' + ea_name + '.so')
    return functype, lib 
开发者ID:zyantific,项目名称:IDASkins,代码行数:14,代码来源:clrapplier.py

示例3: set_config_path

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import idadir [as 别名]
def set_config_path(self):
        """
        Set the JSON configuration file path.
        """
        # Get the path of the config file
        # plugins_path = idaapi.idadir(idaapi.PLG_SUBDIR)
        # ghida_plugin_path = os.path.join(
        #     plugins_path, "ghida_plugin", "config")
        # self.__config_path = os.path.join(ghida_plugin_path, CONFIG_FILENAME)

        self.__config_path = os.path.join(
            tempfile.gettempdir(), CONFIG_FILENAME) 
开发者ID:Cisco-Talos,项目名称:GhIDA,代码行数:14,代码来源:config.py

示例4: loadAllPythonPlugins

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import idadir [as 别名]
def loadAllPythonPlugins():
    plugins_dir = idaapi.idadir('plugins')
    print("idascript: loading all .py plugins in %s" % plugins_dir)
    files = [f for f in os.listdir(plugins_dir) if re.match(r'.*\.py', f)]
    for path in files:
        idaapi.load_plugin(path) 
开发者ID:devttys0,项目名称:idascript,代码行数:8,代码来源:idascript.py

示例5: popeye

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import idadir [as 别名]
def popeye(self):
        g = globals()
        idahome = idaapi.idadir("plugins\\Code editor")
        IDAPython_ExecScript(idahome +  "\\pyeditor.py", g) 
开发者ID:techbliss,项目名称:Python_editor,代码行数:6,代码来源:Python_editor.py

示例6: __load_ida_native_version

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import idadir [as 别名]
def __load_ida_native_version():
    sysdir = _os.path.dirname(idaapi.idadir(idaapi.CFG_SUBDIR))
    exe_name = 'ida' if ea == 32 else 'ida64'
    if os == 'win':
        path = _os.path.join(sysdir, exe_name + '.exe')
        with open(path, 'rb') as f:
            data = f.read()
            needle = b'F\0i\0l\0e\0V\0e\0r\0s\0i\0o\0n\0\0\0\0\0'
            offset = data.rfind(needle) + len(needle)
            offset2 = data.find(b'\0\0', offset) + 1
            version_str = data[offset:offset2].decode('utf16')

            version_str = version_str[:version_str.rfind(
                '.')] + version_str[version_str.rfind('.') + 1:]
    elif os == 'mac':
        path = _os.path.join(sysdir, exe_name)
        with open(path, 'rb') as f:
            data = f.read()
            needle = b'<key>CFBundleShortVersionString</key>'
            offset = data.rfind(needle)
            offset = data.find(b'<string>', offset) + 8
            offset2 = data.find(b'</string', offset)
            version_str = data[offset:offset2].decode('utf8')

    result = version_info_cls._make(int(_) for _ in version_str.split('.'))
    return result 
开发者ID:Jinmo,项目名称:idapkg,代码行数:28,代码来源:env.py


注:本文中的idaapi.idadir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。