本文整理汇总了Python中idaapi.get_kernel_version方法的典型用法代码示例。如果您正苦于以下问题:Python idaapi.get_kernel_version方法的具体用法?Python idaapi.get_kernel_version怎么用?Python idaapi.get_kernel_version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idaapi
的用法示例。
在下文中一共展示了idaapi.get_kernel_version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: is_ida_version_supported
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_kernel_version [as 别名]
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: _init_version
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_kernel_version [as 别名]
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: __version__
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_kernel_version [as 别名]
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