mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-12-15 17:38:36 +00:00
python: add new API cs_version_bind() to return binding's version (might differ from core's)
This commit is contained in:
parent
4ef1668834
commit
b77d1f298e
@ -1 +1 @@
|
||||
from capstone import Cs, CsError, cs_disasm_quick, cs_disasm_lite, cs_version, cs_support, CS_API_MAJOR, CS_API_MINOR, CS_ARCH_ARM, CS_ARCH_ARM64, CS_ARCH_MIPS, CS_ARCH_X86, CS_ARCH_PPC, CS_ARCH_ALL, CS_MODE_LITTLE_ENDIAN, CS_MODE_ARM, CS_MODE_THUMB, CS_OPT_SYNTAX, CS_OPT_SYNTAX_DEFAULT, CS_OPT_SYNTAX_INTEL, CS_OPT_SYNTAX_ATT, CS_OPT_SYNTAX_NOREGNAME, CS_OPT_DETAIL, CS_OPT_ON, CS_OPT_OFF, CS_MODE_16, CS_MODE_32, CS_MODE_64, CS_MODE_BIG_ENDIAN, CS_MODE_MICRO, CS_MODE_N64, CS_SUPPORT_DIET
|
||||
from capstone import Cs, CsError, cs_disasm_quick, cs_disasm_lite, cs_version, cs_version_bind, cs_support, CS_API_MAJOR, CS_API_MINOR, CS_ARCH_ARM, CS_ARCH_ARM64, CS_ARCH_MIPS, CS_ARCH_X86, CS_ARCH_PPC, CS_ARCH_ALL, CS_MODE_LITTLE_ENDIAN, CS_MODE_ARM, CS_MODE_THUMB, CS_OPT_SYNTAX, CS_OPT_SYNTAX_DEFAULT, CS_OPT_SYNTAX_INTEL, CS_OPT_SYNTAX_ATT, CS_OPT_SYNTAX_NOREGNAME, CS_OPT_DETAIL, CS_OPT_ON, CS_OPT_OFF, CS_MODE_16, CS_MODE_32, CS_MODE_64, CS_MODE_BIG_ENDIAN, CS_MODE_MICRO, CS_MODE_N64, CS_SUPPORT_DIET
|
||||
|
@ -8,6 +8,7 @@ __all__ = [
|
||||
|
||||
'cs_disasm_quick',
|
||||
'cs_version',
|
||||
'cs_version_bind',
|
||||
'cs_support',
|
||||
|
||||
'CS_API_MAJOR',
|
||||
@ -222,6 +223,7 @@ class CsError(Exception):
|
||||
return _cs.cs_strerror(self.errno)
|
||||
|
||||
|
||||
# return the core's version
|
||||
def cs_version():
|
||||
major = ctypes.c_int()
|
||||
minor = ctypes.c_int()
|
||||
@ -229,6 +231,11 @@ def cs_version():
|
||||
return (major.value, minor.value, combined)
|
||||
|
||||
|
||||
# return the binding's version
|
||||
def cs_version_bind():
|
||||
return (CS_API_MAJOR, CS_API_MINOR, (CS_API_MAJOR << 8) + CS_API_MINOR)
|
||||
|
||||
|
||||
def cs_support(query):
|
||||
return _cs.cs_support(query)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user