本文整理匯總了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