Python源码示例:idaapi.get_kernel_version()

示例1
def is_ida_version_supported():
    """
    Check which IDA version is supported
    """
    major, minor = map(int, idaapi.get_kernel_version().split("."))
    if major >= 7:
        return True
    print("GhIDA:: [!] IDA Pro 7.xx supported only")
    return False 
示例2
def _init_version(self):

        # retrieve IDA's version #
        disassembler_version = idaapi.get_kernel_version()
        major, minor = map(int, disassembler_version.split("."))

        # save the version number components for later use
        self._version_major = major
        self._version_minor = minor
        self._version_patch = 0

    #--------------------------------------------------------------------------
    # Properties
    #-------------------------------------------------------------------------- 
示例3
def __version__():
    # api doesn't exist, go back to a crazy version.
    if not hasattr(idaapi, 'get_kernel_version'):
        return 6, 0, 6.0

    import math
    res = str(idaapi.get_kernel_version())      # force it to a str because IDA 7.0 "fixed" it
    major, minor = map(int, res.split('.', 2))
    minor = int("{:<02d}".format(minor))
    if minor > 0:
        count = math.floor(math.log(minor) / math.log(10) + 1)
        return major, minor, float(major) + minor/10**count
    return major, minor, float(major)

## inject the version info into idaapi