Source code for binaryninja.warp._warpcore

import binaryninja
import ctypes, os

from typing import Optional
from . import warp_enums
# Load core module
import platform
core = None
core_platform = platform.system()

from binaryninja import Settings
if Settings().get_bool("corePlugins.warp"):
    from binaryninja._binaryninjacore import BNGetBundledPluginDirectory
    if core_platform == "Darwin":
        _base_path = BNGetBundledPluginDirectory()
        core = ctypes.CDLL(os.path.join(_base_path, "libwarp_ninja.dylib"))

    elif core_platform == "Linux":
        _base_path = BNGetBundledPluginDirectory()
        core = ctypes.CDLL(os.path.join(_base_path, "libwarp_ninja.so"))

    elif (core_platform == "Windows") or (core_platform.find("CYGWIN_NT") == 0):
        _base_path = BNGetBundledPluginDirectory()
        core = ctypes.CDLL(os.path.join(_base_path, "warp_ninja.dll"))
    else:
        raise Exception("OS not supported")
else:
    from binaryninja._binaryninjacore import BNGetUserPluginDirectory
    if core_platform == "Darwin":
        _base_path = BNGetUserPluginDirectory()
        core = ctypes.CDLL(os.path.join(_base_path, "libwarp_ninja.dylib"))

    elif core_platform == "Linux":
        _base_path = BNGetUserPluginDirectory()
        core = ctypes.CDLL(os.path.join(_base_path, "libwarp_ninja.so"))

    elif (core_platform == "Windows") or (core_platform.find("CYGWIN_NT") == 0):
        _base_path = BNGetUserPluginDirectory()
        core = ctypes.CDLL(os.path.join(_base_path, "warp_ninja.dll"))
    else:
        raise Exception("OS not supported")

[docs] def cstr(var) -> Optional[ctypes.c_char_p]: if var is None: return None if isinstance(var, bytes): return var return var.encode("utf-8")
[docs] def pyNativeStr(arg): if isinstance(arg, str): return arg else: return arg.decode('utf8')
[docs] def free_string(value:ctypes.c_char_p) -> None: BNFreeString(ctypes.cast(value, ctypes.POINTER(ctypes.c_byte)))
from binaryninja._binaryninjacore import BNFreeString # Type definitions from binaryninja._binaryninjacore import BNArchitecture, BNArchitectureHandle from binaryninja._binaryninjacore import BNBasicBlock, BNBasicBlockHandle from binaryninja._binaryninjacore import BNBinaryView, BNBinaryViewHandle from binaryninja._binaryninjacore import BNDataBuffer, BNDataBufferHandle from binaryninja._binaryninjacore import BNFunction, BNFunctionHandle from binaryninja._binaryninjacore import BNLowLevelILFunction, BNLowLevelILFunctionHandle from binaryninja._binaryninjacore import BNPlatform, BNPlatformHandle
[docs] class BNProject(ctypes.Structure): pass
BNProjectHandle = ctypes.POINTER(BNProject)
[docs] class BNProjectFile(ctypes.Structure): pass
BNProjectFileHandle = ctypes.POINTER(BNProjectFile) from binaryninja._binaryninjacore import BNSymbol, BNSymbolHandle from binaryninja._binaryninjacore import BNType, BNTypeHandle
[docs] class BNWARPChunk(ctypes.Structure): pass
BNWARPChunkHandle = ctypes.POINTER(BNWARPChunk)
[docs] class BNWARPConstraint(ctypes.Structure): pass
BNWARPConstraintHandle = ctypes.POINTER(BNWARPConstraint)
[docs] class BNWARPContainer(ctypes.Structure): pass
BNWARPContainerHandle = ctypes.POINTER(BNWARPContainer)
[docs] class BNWARPContainerSearchItem(ctypes.Structure): pass
BNWARPContainerSearchItemHandle = ctypes.POINTER(BNWARPContainerSearchItem) WARPContainerSearchItemKindEnum = ctypes.c_int
[docs] class BNWARPContainerSearchQuery(ctypes.Structure): pass
BNWARPContainerSearchQueryHandle = ctypes.POINTER(BNWARPContainerSearchQuery)
[docs] class BNWARPContainerSearchResponse(ctypes.Structure): pass
BNWARPContainerSearchResponseHandle = ctypes.POINTER(BNWARPContainerSearchResponse)
[docs] class BNWARPFile(ctypes.Structure): pass
BNWARPFileHandle = ctypes.POINTER(BNWARPFile)
[docs] class BNWARPFunction(ctypes.Structure): pass
BNWARPFunctionHandle = ctypes.POINTER(BNWARPFunction)
[docs] class BNWARPFunctionComment(ctypes.Structure): @property def text(self): return pyNativeStr(self._text) @text.setter def text(self, value): self._text = cstr(value)
BNWARPFunctionCommentHandle = ctypes.POINTER(BNWARPFunctionComment)
[docs] class BNWARPProcessor(ctypes.Structure): pass
BNWARPProcessorHandle = ctypes.POINTER(BNWARPProcessor) WARPProcessorIncludedDataEnum = ctypes.c_int WARPProcessorIncludedFunctionsEnum = ctypes.c_int
[docs] class BNWARPProcessorState(ctypes.Structure): pass
BNWARPProcessorStateHandle = ctypes.POINTER(BNWARPProcessorState)
[docs] class BNWARPTarget(ctypes.Structure): pass
BNWARPTargetHandle = ctypes.POINTER(BNWARPTarget)
[docs] class BNWARPType(ctypes.Structure): pass
BNWARPTypeHandle = ctypes.POINTER(BNWARPType)
[docs] class BNWARPUUID(ctypes.Structure): pass
BNWARPUUIDHandle = ctypes.POINTER(BNWARPUUID) # Structure definitions BNWARPBasicBlockGUID = BNWARPUUID BNWARPBasicBlockGUIDHandle = BNWARPUUIDHandle BNWARPConstraintGUID = BNWARPUUID BNWARPConstraintGUIDHandle = BNWARPUUIDHandle BNWARPContainerSearchResponse._fields_ = [ ("count", ctypes.c_ulonglong), ("items", ctypes.POINTER(ctypes.POINTER(BNWARPContainerSearchItem))), ("offset", ctypes.c_ulonglong), ("total", ctypes.c_ulonglong), ] BNWARPFunctionComment._fields_ = [ ("_text", ctypes.c_char_p), ("offset", ctypes.c_longlong), ] BNWARPFunctionGUID = BNWARPUUID BNWARPFunctionGUIDHandle = BNWARPUUIDHandle BNWARPProcessorState._fields_ = [ ("cancelled", ctypes.c_bool), ("unprocessedFilesCount", ctypes.c_ulonglong), ("processedFilesCount", ctypes.c_ulonglong), ("analyzingFiles", ctypes.POINTER(ctypes.c_char_p)), ("analyzingFilesCount", ctypes.c_ulonglong), ("processingFiles", ctypes.POINTER(ctypes.c_char_p)), ("processingFilesCount", ctypes.c_ulonglong), ] BNWARPSource = BNWARPUUID BNWARPSourceHandle = BNWARPUUIDHandle BNWARPTypeGUID = BNWARPUUID BNWARPTypeGUIDHandle = BNWARPUUIDHandle BNWARPUUID._fields_ = [ ("uuid", ctypes.c_ubyte * 16), ] BNWARPConstraint._fields_ = [ ("guid", BNWARPConstraintGUID), ("offset", ctypes.c_longlong), ] # Function definitions # ------------------------------------------------------- # _BNWARPAddContainer _BNWARPAddContainer = core.BNWARPAddContainer _BNWARPAddContainer.restype = ctypes.POINTER(BNWARPContainer) _BNWARPAddContainer.argtypes = [ ctypes.c_char_p, ] # noinspection PyPep8Naming
[docs] def BNWARPAddContainer( name: Optional[str] ) -> Optional[ctypes.POINTER(BNWARPContainer)]: result = _BNWARPAddContainer(cstr(name)) if not result: return None return result
# ------------------------------------------------------- # _BNWARPChunkGetFunctions _BNWARPChunkGetFunctions = core.BNWARPChunkGetFunctions _BNWARPChunkGetFunctions.restype = ctypes.POINTER(ctypes.POINTER(BNWARPFunction)) _BNWARPChunkGetFunctions.argtypes = [ ctypes.POINTER(BNWARPChunk), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPChunkGetFunctions( chunk: ctypes.POINTER(BNWARPChunk), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(ctypes.POINTER(BNWARPFunction))]: result = _BNWARPChunkGetFunctions(chunk, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPChunkGetTarget _BNWARPChunkGetTarget = core.BNWARPChunkGetTarget _BNWARPChunkGetTarget.restype = ctypes.POINTER(BNWARPTarget) _BNWARPChunkGetTarget.argtypes = [ ctypes.POINTER(BNWARPChunk), ] # noinspection PyPep8Naming
[docs] def BNWARPChunkGetTarget( chunk: ctypes.POINTER(BNWARPChunk) ) -> Optional[ctypes.POINTER(BNWARPTarget)]: result = _BNWARPChunkGetTarget(chunk) if not result: return None return result
# ------------------------------------------------------- # _BNWARPChunkGetTypes _BNWARPChunkGetTypes = core.BNWARPChunkGetTypes _BNWARPChunkGetTypes.restype = ctypes.POINTER(ctypes.POINTER(BNWARPType)) _BNWARPChunkGetTypes.argtypes = [ ctypes.POINTER(BNWARPChunk), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPChunkGetTypes( chunk: ctypes.POINTER(BNWARPChunk), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(ctypes.POINTER(BNWARPType))]: result = _BNWARPChunkGetTypes(chunk, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerAddFunctions _BNWARPContainerAddFunctions = core.BNWARPContainerAddFunctions _BNWARPContainerAddFunctions.restype = ctypes.c_bool _BNWARPContainerAddFunctions.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPTarget), ctypes.POINTER(BNWARPSource), ctypes.POINTER(ctypes.POINTER(BNWARPFunction)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPContainerAddFunctions( container: ctypes.POINTER(BNWARPContainer), target: ctypes.POINTER(BNWARPTarget), source: ctypes.POINTER(BNWARPSource), functions: ctypes.POINTER(ctypes.POINTER(BNWARPFunction)), count: int ) -> bool: return _BNWARPContainerAddFunctions(container, target, source, functions, count)
# ------------------------------------------------------- # _BNWARPContainerAddSource _BNWARPContainerAddSource = core.BNWARPContainerAddSource _BNWARPContainerAddSource.restype = ctypes.c_bool _BNWARPContainerAddSource.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.c_char_p, ctypes.POINTER(BNWARPSource), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerAddSource( container: ctypes.POINTER(BNWARPContainer), sourcePath: Optional[str], result: ctypes.POINTER(BNWARPSource) ) -> bool: return _BNWARPContainerAddSource(container, cstr(sourcePath), result)
# ------------------------------------------------------- # _BNWARPContainerAddTypes _BNWARPContainerAddTypes = core.BNWARPContainerAddTypes _BNWARPContainerAddTypes.restype = ctypes.c_bool _BNWARPContainerAddTypes.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ctypes.POINTER(ctypes.POINTER(BNWARPType)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPContainerAddTypes( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource), types: ctypes.POINTER(ctypes.POINTER(BNWARPType)), count: int ) -> bool: return _BNWARPContainerAddTypes(container, source, types, count)
# ------------------------------------------------------- # _BNWARPContainerCommitSource _BNWARPContainerCommitSource = core.BNWARPContainerCommitSource _BNWARPContainerCommitSource.restype = ctypes.c_bool _BNWARPContainerCommitSource.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerCommitSource( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource) ) -> bool: return _BNWARPContainerCommitSource(container, source)
# ------------------------------------------------------- # _BNWARPContainerFetchFunctions _BNWARPContainerFetchFunctions = core.BNWARPContainerFetchFunctions _BNWARPContainerFetchFunctions.restype = None _BNWARPContainerFetchFunctions.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPTarget), ctypes.POINTER(ctypes.c_char_p), ctypes.c_ulonglong, ctypes.POINTER(BNWARPFunctionGUID), ctypes.c_ulonglong, ctypes.POINTER(BNWARPConstraintGUID), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPContainerFetchFunctions( container: ctypes.POINTER(BNWARPContainer), target: ctypes.POINTER(BNWARPTarget), sourceTags: ctypes.POINTER(ctypes.c_char_p), sourceTagCount: int, guids: ctypes.POINTER(BNWARPFunctionGUID), count: int, constraints: ctypes.POINTER(BNWARPConstraintGUID), constraintCount: int ) -> None: return _BNWARPContainerFetchFunctions(container, target, sourceTags, sourceTagCount, guids, count, constraints, constraintCount)
# ------------------------------------------------------- # _BNWARPContainerGetFunctionsWithGUID _BNWARPContainerGetFunctionsWithGUID = core.BNWARPContainerGetFunctionsWithGUID _BNWARPContainerGetFunctionsWithGUID.restype = ctypes.POINTER(ctypes.POINTER(BNWARPFunction)) _BNWARPContainerGetFunctionsWithGUID.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPTarget), ctypes.POINTER(BNWARPSource), ctypes.POINTER(BNWARPFunctionGUID), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetFunctionsWithGUID( container: ctypes.POINTER(BNWARPContainer), target: ctypes.POINTER(BNWARPTarget), source: ctypes.POINTER(BNWARPSource), guid: ctypes.POINTER(BNWARPFunctionGUID), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(ctypes.POINTER(BNWARPFunction))]: result = _BNWARPContainerGetFunctionsWithGUID(container, target, source, guid, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerGetName _BNWARPContainerGetName = core.BNWARPContainerGetName _BNWARPContainerGetName.restype = ctypes.POINTER(ctypes.c_byte) _BNWARPContainerGetName.argtypes = [ ctypes.POINTER(BNWARPContainer), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetName( container: ctypes.POINTER(BNWARPContainer) ) -> Optional[Optional[str]]: result = _BNWARPContainerGetName(container) if not result: return None string = str(pyNativeStr(ctypes.cast(result, ctypes.c_char_p).value)) BNFreeString(result) return string
# ------------------------------------------------------- # _BNWARPContainerGetSourcePath _BNWARPContainerGetSourcePath = core.BNWARPContainerGetSourcePath _BNWARPContainerGetSourcePath.restype = ctypes.POINTER(ctypes.c_byte) _BNWARPContainerGetSourcePath.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetSourcePath( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource) ) -> Optional[Optional[str]]: result = _BNWARPContainerGetSourcePath(container, source) if not result: return None string = str(pyNativeStr(ctypes.cast(result, ctypes.c_char_p).value)) BNFreeString(result) return string
# ------------------------------------------------------- # _BNWARPContainerGetSources _BNWARPContainerGetSources = core.BNWARPContainerGetSources _BNWARPContainerGetSources.restype = ctypes.POINTER(BNWARPSource) _BNWARPContainerGetSources.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetSources( container: ctypes.POINTER(BNWARPContainer), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(BNWARPSource)]: result = _BNWARPContainerGetSources(container, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerGetSourcesWithFunctionGUID _BNWARPContainerGetSourcesWithFunctionGUID = core.BNWARPContainerGetSourcesWithFunctionGUID _BNWARPContainerGetSourcesWithFunctionGUID.restype = ctypes.POINTER(BNWARPSource) _BNWARPContainerGetSourcesWithFunctionGUID.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPTarget), ctypes.POINTER(BNWARPFunctionGUID), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetSourcesWithFunctionGUID( container: ctypes.POINTER(BNWARPContainer), target: ctypes.POINTER(BNWARPTarget), guid: ctypes.POINTER(BNWARPFunctionGUID), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(BNWARPSource)]: result = _BNWARPContainerGetSourcesWithFunctionGUID(container, target, guid, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerGetSourcesWithTypeGUID _BNWARPContainerGetSourcesWithTypeGUID = core.BNWARPContainerGetSourcesWithTypeGUID _BNWARPContainerGetSourcesWithTypeGUID.restype = ctypes.POINTER(BNWARPSource) _BNWARPContainerGetSourcesWithTypeGUID.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPTypeGUID), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetSourcesWithTypeGUID( container: ctypes.POINTER(BNWARPContainer), guid: ctypes.POINTER(BNWARPTypeGUID), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(BNWARPSource)]: result = _BNWARPContainerGetSourcesWithTypeGUID(container, guid, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerGetTypeGUIDsWithName _BNWARPContainerGetTypeGUIDsWithName = core.BNWARPContainerGetTypeGUIDsWithName _BNWARPContainerGetTypeGUIDsWithName.restype = ctypes.POINTER(BNWARPTypeGUID) _BNWARPContainerGetTypeGUIDsWithName.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ctypes.c_char_p, ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetTypeGUIDsWithName( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource), name: Optional[str], count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(BNWARPTypeGUID)]: result = _BNWARPContainerGetTypeGUIDsWithName(container, source, cstr(name), count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerGetTypeWithGUID _BNWARPContainerGetTypeWithGUID = core.BNWARPContainerGetTypeWithGUID _BNWARPContainerGetTypeWithGUID.restype = ctypes.POINTER(BNWARPType) _BNWARPContainerGetTypeWithGUID.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ctypes.POINTER(BNWARPTypeGUID), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerGetTypeWithGUID( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource), guid: ctypes.POINTER(BNWARPTypeGUID) ) -> Optional[ctypes.POINTER(BNWARPType)]: result = _BNWARPContainerGetTypeWithGUID(container, source, guid) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerIsSourceUncommitted _BNWARPContainerIsSourceUncommitted = core.BNWARPContainerIsSourceUncommitted _BNWARPContainerIsSourceUncommitted.restype = ctypes.c_bool _BNWARPContainerIsSourceUncommitted.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerIsSourceUncommitted( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource) ) -> bool: return _BNWARPContainerIsSourceUncommitted(container, source)
# ------------------------------------------------------- # _BNWARPContainerIsSourceWritable _BNWARPContainerIsSourceWritable = core.BNWARPContainerIsSourceWritable _BNWARPContainerIsSourceWritable.restype = ctypes.c_bool _BNWARPContainerIsSourceWritable.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerIsSourceWritable( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource) ) -> bool: return _BNWARPContainerIsSourceWritable(container, source)
# ------------------------------------------------------- # _BNWARPContainerRemoveFunctions _BNWARPContainerRemoveFunctions = core.BNWARPContainerRemoveFunctions _BNWARPContainerRemoveFunctions.restype = ctypes.c_bool _BNWARPContainerRemoveFunctions.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPTarget), ctypes.POINTER(BNWARPSource), ctypes.POINTER(ctypes.POINTER(BNWARPFunction)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPContainerRemoveFunctions( container: ctypes.POINTER(BNWARPContainer), target: ctypes.POINTER(BNWARPTarget), source: ctypes.POINTER(BNWARPSource), functions: ctypes.POINTER(ctypes.POINTER(BNWARPFunction)), count: int ) -> bool: return _BNWARPContainerRemoveFunctions(container, target, source, functions, count)
# ------------------------------------------------------- # _BNWARPContainerRemoveTypes _BNWARPContainerRemoveTypes = core.BNWARPContainerRemoveTypes _BNWARPContainerRemoveTypes.restype = ctypes.c_bool _BNWARPContainerRemoveTypes.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPSource), ctypes.POINTER(BNWARPTypeGUID), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPContainerRemoveTypes( container: ctypes.POINTER(BNWARPContainer), source: ctypes.POINTER(BNWARPSource), types: ctypes.POINTER(BNWARPTypeGUID), count: int ) -> bool: return _BNWARPContainerRemoveTypes(container, source, types, count)
# ------------------------------------------------------- # _BNWARPContainerSearch _BNWARPContainerSearch = core.BNWARPContainerSearch _BNWARPContainerSearch.restype = ctypes.POINTER(BNWARPContainerSearchResponse) _BNWARPContainerSearch.argtypes = [ ctypes.POINTER(BNWARPContainer), ctypes.POINTER(BNWARPContainerSearchQuery), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerSearch( container: ctypes.POINTER(BNWARPContainer), query: ctypes.POINTER(BNWARPContainerSearchQuery) ) -> Optional[ctypes.POINTER(BNWARPContainerSearchResponse)]: result = _BNWARPContainerSearch(container, query) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerSearchItemGetFunction _BNWARPContainerSearchItemGetFunction = core.BNWARPContainerSearchItemGetFunction _BNWARPContainerSearchItemGetFunction.restype = ctypes.POINTER(BNWARPFunction) _BNWARPContainerSearchItemGetFunction.argtypes = [ ctypes.POINTER(BNWARPContainerSearchItem), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerSearchItemGetFunction( item: ctypes.POINTER(BNWARPContainerSearchItem) ) -> Optional[ctypes.POINTER(BNWARPFunction)]: result = _BNWARPContainerSearchItemGetFunction(item) if not result: return None return result
# ------------------------------------------------------- # _BNWARPContainerSearchItemGetKind _BNWARPContainerSearchItemGetKind = core.BNWARPContainerSearchItemGetKind _BNWARPContainerSearchItemGetKind.restype = WARPContainerSearchItemKindEnum _BNWARPContainerSearchItemGetKind.argtypes = [ ctypes.POINTER(BNWARPContainerSearchItem), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerSearchItemGetKind( item: ctypes.POINTER(BNWARPContainerSearchItem) ) -> WARPContainerSearchItemKindEnum: return _BNWARPContainerSearchItemGetKind(item)
# ------------------------------------------------------- # _BNWARPContainerSearchItemGetName _BNWARPContainerSearchItemGetName = core.BNWARPContainerSearchItemGetName _BNWARPContainerSearchItemGetName.restype = ctypes.POINTER(ctypes.c_byte) _BNWARPContainerSearchItemGetName.argtypes = [ ctypes.POINTER(BNWARPContainerSearchItem), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerSearchItemGetName( item: ctypes.POINTER(BNWARPContainerSearchItem) ) -> Optional[Optional[str]]: result = _BNWARPContainerSearchItemGetName(item) if not result: return None string = str(pyNativeStr(ctypes.cast(result, ctypes.c_char_p).value)) BNFreeString(result) return string
# ------------------------------------------------------- # _BNWARPContainerSearchItemGetSource _BNWARPContainerSearchItemGetSource = core.BNWARPContainerSearchItemGetSource _BNWARPContainerSearchItemGetSource.restype = BNWARPSource _BNWARPContainerSearchItemGetSource.argtypes = [ ctypes.POINTER(BNWARPContainerSearchItem), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerSearchItemGetSource( item: ctypes.POINTER(BNWARPContainerSearchItem) ) -> BNWARPSource: return _BNWARPContainerSearchItemGetSource(item)
# ------------------------------------------------------- # _BNWARPContainerSearchItemGetType _BNWARPContainerSearchItemGetType = core.BNWARPContainerSearchItemGetType _BNWARPContainerSearchItemGetType.restype = ctypes.POINTER(BNWARPType) _BNWARPContainerSearchItemGetType.argtypes = [ ctypes.POINTER(BNWARPContainerSearchItem), ] # noinspection PyPep8Naming
[docs] def BNWARPContainerSearchItemGetType( item: ctypes.POINTER(BNWARPContainerSearchItem) ) -> Optional[ctypes.POINTER(BNWARPType)]: result = _BNWARPContainerSearchItemGetType(item) if not result: return None return result
# ------------------------------------------------------- # _BNWARPFileGetChunks _BNWARPFileGetChunks = core.BNWARPFileGetChunks _BNWARPFileGetChunks.restype = ctypes.POINTER(ctypes.POINTER(BNWARPChunk)) _BNWARPFileGetChunks.argtypes = [ ctypes.POINTER(BNWARPFile), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPFileGetChunks( file: ctypes.POINTER(BNWARPFile), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(ctypes.POINTER(BNWARPChunk))]: result = _BNWARPFileGetChunks(file, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPFileToDataBuffer _BNWARPFileToDataBuffer = core.BNWARPFileToDataBuffer _BNWARPFileToDataBuffer.restype = ctypes.POINTER(BNDataBuffer) _BNWARPFileToDataBuffer.argtypes = [ ctypes.POINTER(BNWARPFile), ] # noinspection PyPep8Naming
[docs] def BNWARPFileToDataBuffer( file: ctypes.POINTER(BNWARPFile) ) -> Optional[ctypes.POINTER(BNDataBuffer)]: result = _BNWARPFileToDataBuffer(file) if not result: return None return result
# ------------------------------------------------------- # _BNWARPFreeChunkList _BNWARPFreeChunkList = core.BNWARPFreeChunkList _BNWARPFreeChunkList.restype = None _BNWARPFreeChunkList.argtypes = [ ctypes.POINTER(ctypes.POINTER(BNWARPChunk)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeChunkList( chunks: ctypes.POINTER(ctypes.POINTER(BNWARPChunk)), count: int ) -> None: return _BNWARPFreeChunkList(chunks, count)
# ------------------------------------------------------- # _BNWARPFreeChunkReference _BNWARPFreeChunkReference = core.BNWARPFreeChunkReference _BNWARPFreeChunkReference.restype = None _BNWARPFreeChunkReference.argtypes = [ ctypes.POINTER(BNWARPChunk), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeChunkReference( chunk: ctypes.POINTER(BNWARPChunk) ) -> None: return _BNWARPFreeChunkReference(chunk)
# ------------------------------------------------------- # _BNWARPFreeConstraintList _BNWARPFreeConstraintList = core.BNWARPFreeConstraintList _BNWARPFreeConstraintList.restype = None _BNWARPFreeConstraintList.argtypes = [ ctypes.POINTER(BNWARPConstraint), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeConstraintList( constraints: ctypes.POINTER(BNWARPConstraint), count: int ) -> None: return _BNWARPFreeConstraintList(constraints, count)
# ------------------------------------------------------- # _BNWARPFreeContainerList _BNWARPFreeContainerList = core.BNWARPFreeContainerList _BNWARPFreeContainerList.restype = None _BNWARPFreeContainerList.argtypes = [ ctypes.POINTER(ctypes.POINTER(BNWARPContainer)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeContainerList( containers: ctypes.POINTER(ctypes.POINTER(BNWARPContainer)), count: int ) -> None: return _BNWARPFreeContainerList(containers, count)
# ------------------------------------------------------- # _BNWARPFreeContainerReference _BNWARPFreeContainerReference = core.BNWARPFreeContainerReference _BNWARPFreeContainerReference.restype = None _BNWARPFreeContainerReference.argtypes = [ ctypes.POINTER(BNWARPContainer), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeContainerReference( container: ctypes.POINTER(BNWARPContainer) ) -> None: return _BNWARPFreeContainerReference(container)
# ------------------------------------------------------- # _BNWARPFreeContainerSearchItemList _BNWARPFreeContainerSearchItemList = core.BNWARPFreeContainerSearchItemList _BNWARPFreeContainerSearchItemList.restype = None _BNWARPFreeContainerSearchItemList.argtypes = [ ctypes.POINTER(ctypes.POINTER(BNWARPContainerSearchItem)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeContainerSearchItemList( items: ctypes.POINTER(ctypes.POINTER(BNWARPContainerSearchItem)), count: int ) -> None: return _BNWARPFreeContainerSearchItemList(items, count)
# ------------------------------------------------------- # _BNWARPFreeContainerSearchItemReference _BNWARPFreeContainerSearchItemReference = core.BNWARPFreeContainerSearchItemReference _BNWARPFreeContainerSearchItemReference.restype = None _BNWARPFreeContainerSearchItemReference.argtypes = [ ctypes.POINTER(BNWARPContainerSearchItem), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeContainerSearchItemReference( item: ctypes.POINTER(BNWARPContainerSearchItem) ) -> None: return _BNWARPFreeContainerSearchItemReference(item)
# ------------------------------------------------------- # _BNWARPFreeContainerSearchQueryReference _BNWARPFreeContainerSearchQueryReference = core.BNWARPFreeContainerSearchQueryReference _BNWARPFreeContainerSearchQueryReference.restype = None _BNWARPFreeContainerSearchQueryReference.argtypes = [ ctypes.POINTER(BNWARPContainerSearchQuery), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeContainerSearchQueryReference( query: ctypes.POINTER(BNWARPContainerSearchQuery) ) -> None: return _BNWARPFreeContainerSearchQueryReference(query)
# ------------------------------------------------------- # _BNWARPFreeContainerSearchResponse _BNWARPFreeContainerSearchResponse = core.BNWARPFreeContainerSearchResponse _BNWARPFreeContainerSearchResponse.restype = None _BNWARPFreeContainerSearchResponse.argtypes = [ ctypes.POINTER(BNWARPContainerSearchResponse), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeContainerSearchResponse( response: ctypes.POINTER(BNWARPContainerSearchResponse) ) -> None: return _BNWARPFreeContainerSearchResponse(response)
# ------------------------------------------------------- # _BNWARPFreeFileReference _BNWARPFreeFileReference = core.BNWARPFreeFileReference _BNWARPFreeFileReference.restype = None _BNWARPFreeFileReference.argtypes = [ ctypes.POINTER(BNWARPFile), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeFileReference( file: ctypes.POINTER(BNWARPFile) ) -> None: return _BNWARPFreeFileReference(file)
# ------------------------------------------------------- # _BNWARPFreeFunctionCommentList _BNWARPFreeFunctionCommentList = core.BNWARPFreeFunctionCommentList _BNWARPFreeFunctionCommentList.restype = None _BNWARPFreeFunctionCommentList.argtypes = [ ctypes.POINTER(BNWARPFunctionComment), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeFunctionCommentList( comments: ctypes.POINTER(BNWARPFunctionComment), count: int ) -> None: return _BNWARPFreeFunctionCommentList(comments, count)
# ------------------------------------------------------- # _BNWARPFreeFunctionList _BNWARPFreeFunctionList = core.BNWARPFreeFunctionList _BNWARPFreeFunctionList.restype = None _BNWARPFreeFunctionList.argtypes = [ ctypes.POINTER(ctypes.POINTER(BNWARPFunction)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeFunctionList( functions: ctypes.POINTER(ctypes.POINTER(BNWARPFunction)), count: int ) -> None: return _BNWARPFreeFunctionList(functions, count)
# ------------------------------------------------------- # _BNWARPFreeFunctionReference _BNWARPFreeFunctionReference = core.BNWARPFreeFunctionReference _BNWARPFreeFunctionReference.restype = None _BNWARPFreeFunctionReference.argtypes = [ ctypes.POINTER(BNWARPFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeFunctionReference( function: ctypes.POINTER(BNWARPFunction) ) -> None: return _BNWARPFreeFunctionReference(function)
# ------------------------------------------------------- # _BNWARPFreeProcessor _BNWARPFreeProcessor = core.BNWARPFreeProcessor _BNWARPFreeProcessor.restype = None _BNWARPFreeProcessor.argtypes = [ ctypes.POINTER(BNWARPProcessor), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeProcessor( processor: ctypes.POINTER(BNWARPProcessor) ) -> None: return _BNWARPFreeProcessor(processor)
# ------------------------------------------------------- # _BNWARPFreeProcessorState _BNWARPFreeProcessorState = core.BNWARPFreeProcessorState _BNWARPFreeProcessorState.restype = None _BNWARPFreeProcessorState.argtypes = [ BNWARPProcessorState, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeProcessorState( processorState: BNWARPProcessorState ) -> None: return _BNWARPFreeProcessorState(processorState)
# ------------------------------------------------------- # _BNWARPFreeTargetReference _BNWARPFreeTargetReference = core.BNWARPFreeTargetReference _BNWARPFreeTargetReference.restype = None _BNWARPFreeTargetReference.argtypes = [ ctypes.POINTER(BNWARPTarget), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeTargetReference( target: ctypes.POINTER(BNWARPTarget) ) -> None: return _BNWARPFreeTargetReference(target)
# ------------------------------------------------------- # _BNWARPFreeTypeList _BNWARPFreeTypeList = core.BNWARPFreeTypeList _BNWARPFreeTypeList.restype = None _BNWARPFreeTypeList.argtypes = [ ctypes.POINTER(ctypes.POINTER(BNWARPType)), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeTypeList( types: ctypes.POINTER(ctypes.POINTER(BNWARPType)), count: int ) -> None: return _BNWARPFreeTypeList(types, count)
# ------------------------------------------------------- # _BNWARPFreeTypeReference _BNWARPFreeTypeReference = core.BNWARPFreeTypeReference _BNWARPFreeTypeReference.restype = None _BNWARPFreeTypeReference.argtypes = [ ctypes.POINTER(BNWARPType), ] # noinspection PyPep8Naming
[docs] def BNWARPFreeTypeReference( ty: ctypes.POINTER(BNWARPType) ) -> None: return _BNWARPFreeTypeReference(ty)
# ------------------------------------------------------- # _BNWARPFreeUUIDList _BNWARPFreeUUIDList = core.BNWARPFreeUUIDList _BNWARPFreeUUIDList.restype = None _BNWARPFreeUUIDList.argtypes = [ ctypes.POINTER(BNWARPUUID), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPFreeUUIDList( uuids: ctypes.POINTER(BNWARPUUID), count: int ) -> None: return _BNWARPFreeUUIDList(uuids, count)
# ------------------------------------------------------- # _BNWARPFunctionApply _BNWARPFunctionApply = core.BNWARPFunctionApply _BNWARPFunctionApply.restype = None _BNWARPFunctionApply.argtypes = [ ctypes.POINTER(BNWARPFunction), ctypes.POINTER(BNFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionApply( function: ctypes.POINTER(BNWARPFunction), analysisFunction: ctypes.POINTER(BNFunction) ) -> None: return _BNWARPFunctionApply(function, analysisFunction)
# ------------------------------------------------------- # _BNWARPFunctionGetComments _BNWARPFunctionGetComments = core.BNWARPFunctionGetComments _BNWARPFunctionGetComments.restype = ctypes.POINTER(BNWARPFunctionComment) _BNWARPFunctionGetComments.argtypes = [ ctypes.POINTER(BNWARPFunction), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionGetComments( function: ctypes.POINTER(BNWARPFunction), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(BNWARPFunctionComment)]: result = _BNWARPFunctionGetComments(function, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPFunctionGetConstraints _BNWARPFunctionGetConstraints = core.BNWARPFunctionGetConstraints _BNWARPFunctionGetConstraints.restype = ctypes.POINTER(BNWARPConstraint) _BNWARPFunctionGetConstraints.argtypes = [ ctypes.POINTER(BNWARPFunction), ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionGetConstraints( function: ctypes.POINTER(BNWARPFunction), count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(BNWARPConstraint)]: result = _BNWARPFunctionGetConstraints(function, count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPFunctionGetGUID _BNWARPFunctionGetGUID = core.BNWARPFunctionGetGUID _BNWARPFunctionGetGUID.restype = BNWARPFunctionGUID _BNWARPFunctionGetGUID.argtypes = [ ctypes.POINTER(BNWARPFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionGetGUID( function: ctypes.POINTER(BNWARPFunction) ) -> BNWARPFunctionGUID: return _BNWARPFunctionGetGUID(function)
# ------------------------------------------------------- # _BNWARPFunctionGetSymbol _BNWARPFunctionGetSymbol = core.BNWARPFunctionGetSymbol _BNWARPFunctionGetSymbol.restype = ctypes.POINTER(BNSymbol) _BNWARPFunctionGetSymbol.argtypes = [ ctypes.POINTER(BNWARPFunction), ctypes.POINTER(BNFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionGetSymbol( function: ctypes.POINTER(BNWARPFunction), analysisFunction: ctypes.POINTER(BNFunction) ) -> Optional[ctypes.POINTER(BNSymbol)]: result = _BNWARPFunctionGetSymbol(function, analysisFunction) if not result: return None return result
# ------------------------------------------------------- # _BNWARPFunctionGetSymbolName _BNWARPFunctionGetSymbolName = core.BNWARPFunctionGetSymbolName _BNWARPFunctionGetSymbolName.restype = ctypes.POINTER(ctypes.c_byte) _BNWARPFunctionGetSymbolName.argtypes = [ ctypes.POINTER(BNWARPFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionGetSymbolName( function: ctypes.POINTER(BNWARPFunction) ) -> Optional[Optional[str]]: result = _BNWARPFunctionGetSymbolName(function) if not result: return None string = str(pyNativeStr(ctypes.cast(result, ctypes.c_char_p).value)) BNFreeString(result) return string
# ------------------------------------------------------- # _BNWARPFunctionGetType _BNWARPFunctionGetType = core.BNWARPFunctionGetType _BNWARPFunctionGetType.restype = ctypes.POINTER(BNWARPType) _BNWARPFunctionGetType.argtypes = [ ctypes.POINTER(BNWARPFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionGetType( function: ctypes.POINTER(BNWARPFunction) ) -> Optional[ctypes.POINTER(BNWARPType)]: result = _BNWARPFunctionGetType(function) if not result: return None return result
# ------------------------------------------------------- # _BNWARPFunctionsEqual _BNWARPFunctionsEqual = core.BNWARPFunctionsEqual _BNWARPFunctionsEqual.restype = ctypes.c_bool _BNWARPFunctionsEqual.argtypes = [ ctypes.POINTER(BNWARPFunction), ctypes.POINTER(BNWARPFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPFunctionsEqual( functionA: ctypes.POINTER(BNWARPFunction), functionB: ctypes.POINTER(BNWARPFunction) ) -> bool: return _BNWARPFunctionsEqual(functionA, functionB)
# ------------------------------------------------------- # _BNWARPGetAnalysisFunctionGUID _BNWARPGetAnalysisFunctionGUID = core.BNWARPGetAnalysisFunctionGUID _BNWARPGetAnalysisFunctionGUID.restype = ctypes.c_bool _BNWARPGetAnalysisFunctionGUID.argtypes = [ ctypes.POINTER(BNFunction), ctypes.POINTER(BNWARPFunctionGUID), ] # noinspection PyPep8Naming
[docs] def BNWARPGetAnalysisFunctionGUID( analysisFunction: ctypes.POINTER(BNFunction), result: ctypes.POINTER(BNWARPFunctionGUID) ) -> bool: return _BNWARPGetAnalysisFunctionGUID(analysisFunction, result)
# ------------------------------------------------------- # _BNWARPGetBasicBlockGUID _BNWARPGetBasicBlockGUID = core.BNWARPGetBasicBlockGUID _BNWARPGetBasicBlockGUID.restype = ctypes.c_bool _BNWARPGetBasicBlockGUID.argtypes = [ ctypes.POINTER(BNBasicBlock), ctypes.POINTER(BNWARPBasicBlockGUID), ] # noinspection PyPep8Naming
[docs] def BNWARPGetBasicBlockGUID( basicBlock: ctypes.POINTER(BNBasicBlock), result: ctypes.POINTER(BNWARPBasicBlockGUID) ) -> bool: return _BNWARPGetBasicBlockGUID(basicBlock, result)
# ------------------------------------------------------- # _BNWARPGetContainers _BNWARPGetContainers = core.BNWARPGetContainers _BNWARPGetContainers.restype = ctypes.POINTER(ctypes.POINTER(BNWARPContainer)) _BNWARPGetContainers.argtypes = [ ctypes.POINTER(ctypes.c_ulonglong), ] # noinspection PyPep8Naming
[docs] def BNWARPGetContainers( count: ctypes.POINTER(ctypes.c_ulonglong) ) -> Optional[ctypes.POINTER(ctypes.POINTER(BNWARPContainer))]: result = _BNWARPGetContainers(count) if not result: return None return result
# ------------------------------------------------------- # _BNWARPGetFunction _BNWARPGetFunction = core.BNWARPGetFunction _BNWARPGetFunction.restype = ctypes.POINTER(BNWARPFunction) _BNWARPGetFunction.argtypes = [ ctypes.POINTER(BNFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPGetFunction( analysisFunction: ctypes.POINTER(BNFunction) ) -> Optional[ctypes.POINTER(BNWARPFunction)]: result = _BNWARPGetFunction(analysisFunction) if not result: return None return result
# ------------------------------------------------------- # _BNWARPGetMatchedFunction _BNWARPGetMatchedFunction = core.BNWARPGetMatchedFunction _BNWARPGetMatchedFunction.restype = ctypes.POINTER(BNWARPFunction) _BNWARPGetMatchedFunction.argtypes = [ ctypes.POINTER(BNFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPGetMatchedFunction( analysisFunction: ctypes.POINTER(BNFunction) ) -> Optional[ctypes.POINTER(BNWARPFunction)]: result = _BNWARPGetMatchedFunction(analysisFunction) if not result: return None return result
# ------------------------------------------------------- # _BNWARPGetTarget _BNWARPGetTarget = core.BNWARPGetTarget _BNWARPGetTarget.restype = ctypes.POINTER(BNWARPTarget) _BNWARPGetTarget.argtypes = [ ctypes.POINTER(BNPlatform), ] # noinspection PyPep8Naming
[docs] def BNWARPGetTarget( platform: ctypes.POINTER(BNPlatform) ) -> Optional[ctypes.POINTER(BNWARPTarget)]: result = _BNWARPGetTarget(platform) if not result: return None return result
# ------------------------------------------------------- # _BNWARPGetType _BNWARPGetType = core.BNWARPGetType _BNWARPGetType.restype = ctypes.POINTER(BNWARPType) _BNWARPGetType.argtypes = [ ctypes.POINTER(BNType), ctypes.c_ubyte, ] # noinspection PyPep8Naming
[docs] def BNWARPGetType( analysisType: ctypes.POINTER(BNType), confidence: int ) -> Optional[ctypes.POINTER(BNWARPType)]: result = _BNWARPGetType(analysisType, confidence) if not result: return None return result
# ------------------------------------------------------- # _BNWARPIsLiftedInstructionBlacklisted _BNWARPIsLiftedInstructionBlacklisted = core.BNWARPIsLiftedInstructionBlacklisted _BNWARPIsLiftedInstructionBlacklisted.restype = ctypes.c_bool _BNWARPIsLiftedInstructionBlacklisted.argtypes = [ ctypes.POINTER(BNLowLevelILFunction), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPIsLiftedInstructionBlacklisted( liftedFunction: ctypes.POINTER(BNLowLevelILFunction), idx: int ) -> bool: return _BNWARPIsLiftedInstructionBlacklisted(liftedFunction, idx)
# ------------------------------------------------------- # _BNWARPIsLiftedInstructionVariant _BNWARPIsLiftedInstructionVariant = core.BNWARPIsLiftedInstructionVariant _BNWARPIsLiftedInstructionVariant.restype = ctypes.c_bool _BNWARPIsLiftedInstructionVariant.argtypes = [ ctypes.POINTER(BNLowLevelILFunction), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPIsLiftedInstructionVariant( liftedFunction: ctypes.POINTER(BNLowLevelILFunction), idx: int ) -> bool: return _BNWARPIsLiftedInstructionVariant(liftedFunction, idx)
# ------------------------------------------------------- # _BNWARPIsLowLevelInstructionComputedVariant _BNWARPIsLowLevelInstructionComputedVariant = core.BNWARPIsLowLevelInstructionComputedVariant _BNWARPIsLowLevelInstructionComputedVariant.restype = ctypes.c_bool _BNWARPIsLowLevelInstructionComputedVariant.argtypes = [ ctypes.POINTER(BNLowLevelILFunction), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPIsLowLevelInstructionComputedVariant( llilFunction: ctypes.POINTER(BNLowLevelILFunction), idx: int ) -> bool: return _BNWARPIsLowLevelInstructionComputedVariant(llilFunction, idx)
# ------------------------------------------------------- # _BNWARPNewChunkReference _BNWARPNewChunkReference = core.BNWARPNewChunkReference _BNWARPNewChunkReference.restype = ctypes.POINTER(BNWARPChunk) _BNWARPNewChunkReference.argtypes = [ ctypes.POINTER(BNWARPChunk), ] # noinspection PyPep8Naming
[docs] def BNWARPNewChunkReference( chunk: ctypes.POINTER(BNWARPChunk) ) -> Optional[ctypes.POINTER(BNWARPChunk)]: result = _BNWARPNewChunkReference(chunk) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewContainerReference _BNWARPNewContainerReference = core.BNWARPNewContainerReference _BNWARPNewContainerReference.restype = ctypes.POINTER(BNWARPContainer) _BNWARPNewContainerReference.argtypes = [ ctypes.POINTER(BNWARPContainer), ] # noinspection PyPep8Naming
[docs] def BNWARPNewContainerReference( container: ctypes.POINTER(BNWARPContainer) ) -> Optional[ctypes.POINTER(BNWARPContainer)]: result = _BNWARPNewContainerReference(container) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewContainerSearchItemReference _BNWARPNewContainerSearchItemReference = core.BNWARPNewContainerSearchItemReference _BNWARPNewContainerSearchItemReference.restype = ctypes.POINTER(BNWARPContainerSearchItem) _BNWARPNewContainerSearchItemReference.argtypes = [ ctypes.POINTER(BNWARPContainerSearchItem), ] # noinspection PyPep8Naming
[docs] def BNWARPNewContainerSearchItemReference( item: ctypes.POINTER(BNWARPContainerSearchItem) ) -> Optional[ctypes.POINTER(BNWARPContainerSearchItem)]: result = _BNWARPNewContainerSearchItemReference(item) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewContainerSearchQuery _BNWARPNewContainerSearchQuery = core.BNWARPNewContainerSearchQuery _BNWARPNewContainerSearchQuery.restype = ctypes.POINTER(BNWARPContainerSearchQuery) _BNWARPNewContainerSearchQuery.argtypes = [ ctypes.c_char_p, ctypes.POINTER(ctypes.c_ulonglong), ctypes.POINTER(ctypes.c_ulonglong), ctypes.POINTER(BNWARPSource), ctypes.POINTER(ctypes.c_char_p), ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPNewContainerSearchQuery( query: Optional[str], offset: ctypes.POINTER(ctypes.c_ulonglong), limit: ctypes.POINTER(ctypes.c_ulonglong), source: ctypes.POINTER(BNWARPSource), sourceTags: ctypes.POINTER(ctypes.c_char_p), sourceTagCount: int ) -> Optional[ctypes.POINTER(BNWARPContainerSearchQuery)]: result = _BNWARPNewContainerSearchQuery(cstr(query), offset, limit, source, sourceTags, sourceTagCount) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewContainerSearchQueryReference _BNWARPNewContainerSearchQueryReference = core.BNWARPNewContainerSearchQueryReference _BNWARPNewContainerSearchQueryReference.restype = ctypes.POINTER(BNWARPContainerSearchQuery) _BNWARPNewContainerSearchQueryReference.argtypes = [ ctypes.POINTER(BNWARPContainerSearchQuery), ] # noinspection PyPep8Naming
[docs] def BNWARPNewContainerSearchQueryReference( query: ctypes.POINTER(BNWARPContainerSearchQuery) ) -> Optional[ctypes.POINTER(BNWARPContainerSearchQuery)]: result = _BNWARPNewContainerSearchQueryReference(query) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewFileFromPath _BNWARPNewFileFromPath = core.BNWARPNewFileFromPath _BNWARPNewFileFromPath.restype = ctypes.POINTER(BNWARPFile) _BNWARPNewFileFromPath.argtypes = [ ctypes.c_char_p, ] # noinspection PyPep8Naming
[docs] def BNWARPNewFileFromPath( path: Optional[str] ) -> Optional[ctypes.POINTER(BNWARPFile)]: result = _BNWARPNewFileFromPath(cstr(path)) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewFileReference _BNWARPNewFileReference = core.BNWARPNewFileReference _BNWARPNewFileReference.restype = ctypes.POINTER(BNWARPFile) _BNWARPNewFileReference.argtypes = [ ctypes.POINTER(BNWARPFile), ] # noinspection PyPep8Naming
[docs] def BNWARPNewFileReference( file: ctypes.POINTER(BNWARPFile) ) -> Optional[ctypes.POINTER(BNWARPFile)]: result = _BNWARPNewFileReference(file) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewFunctionReference _BNWARPNewFunctionReference = core.BNWARPNewFunctionReference _BNWARPNewFunctionReference.restype = ctypes.POINTER(BNWARPFunction) _BNWARPNewFunctionReference.argtypes = [ ctypes.POINTER(BNWARPFunction), ] # noinspection PyPep8Naming
[docs] def BNWARPNewFunctionReference( function: ctypes.POINTER(BNWARPFunction) ) -> Optional[ctypes.POINTER(BNWARPFunction)]: result = _BNWARPNewFunctionReference(function) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewProcessor _BNWARPNewProcessor = core.BNWARPNewProcessor _BNWARPNewProcessor.restype = ctypes.POINTER(BNWARPProcessor) _BNWARPNewProcessor.argtypes = [ WARPProcessorIncludedDataEnum, WARPProcessorIncludedFunctionsEnum, ctypes.c_ulonglong, ] # noinspection PyPep8Naming
[docs] def BNWARPNewProcessor( includedData: WARPProcessorIncludedDataEnum, includedFunctions: WARPProcessorIncludedFunctionsEnum, workerCount: int ) -> Optional[ctypes.POINTER(BNWARPProcessor)]: result = _BNWARPNewProcessor(includedData, includedFunctions, workerCount) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewTargetReference _BNWARPNewTargetReference = core.BNWARPNewTargetReference _BNWARPNewTargetReference.restype = ctypes.POINTER(BNWARPTarget) _BNWARPNewTargetReference.argtypes = [ ctypes.POINTER(BNWARPTarget), ] # noinspection PyPep8Naming
[docs] def BNWARPNewTargetReference( target: ctypes.POINTER(BNWARPTarget) ) -> Optional[ctypes.POINTER(BNWARPTarget)]: result = _BNWARPNewTargetReference(target) if not result: return None return result
# ------------------------------------------------------- # _BNWARPNewTypeReference _BNWARPNewTypeReference = core.BNWARPNewTypeReference _BNWARPNewTypeReference.restype = ctypes.POINTER(BNWARPType) _BNWARPNewTypeReference.argtypes = [ ctypes.POINTER(BNWARPType), ] # noinspection PyPep8Naming
[docs] def BNWARPNewTypeReference( ty: ctypes.POINTER(BNWARPType) ) -> Optional[ctypes.POINTER(BNWARPType)]: result = _BNWARPNewTypeReference(ty) if not result: return None return result
# ------------------------------------------------------- # _BNWARPProcessorAddBinaryView _BNWARPProcessorAddBinaryView = core.BNWARPProcessorAddBinaryView _BNWARPProcessorAddBinaryView.restype = None _BNWARPProcessorAddBinaryView.argtypes = [ ctypes.POINTER(BNWARPProcessor), ctypes.POINTER(BNBinaryView), ] # noinspection PyPep8Naming
[docs] def BNWARPProcessorAddBinaryView( processor: ctypes.POINTER(BNWARPProcessor), view: ctypes.POINTER(BNBinaryView) ) -> None: return _BNWARPProcessorAddBinaryView(processor, view)
# ------------------------------------------------------- # _BNWARPProcessorAddPath _BNWARPProcessorAddPath = core.BNWARPProcessorAddPath _BNWARPProcessorAddPath.restype = None _BNWARPProcessorAddPath.argtypes = [ ctypes.POINTER(BNWARPProcessor), ctypes.c_char_p, ] # noinspection PyPep8Naming
[docs] def BNWARPProcessorAddPath( processor: ctypes.POINTER(BNWARPProcessor), path: Optional[str] ) -> None: return _BNWARPProcessorAddPath(processor, cstr(path))
# ------------------------------------------------------- # _BNWARPProcessorAddProject _BNWARPProcessorAddProject = core.BNWARPProcessorAddProject _BNWARPProcessorAddProject.restype = None _BNWARPProcessorAddProject.argtypes = [ ctypes.POINTER(BNWARPProcessor), ctypes.POINTER(BNProject), ] # noinspection PyPep8Naming
[docs] def BNWARPProcessorAddProject( processor: ctypes.POINTER(BNWARPProcessor), project: ctypes.POINTER(BNProject) ) -> None: return _BNWARPProcessorAddProject(processor, project)
# ------------------------------------------------------- # _BNWARPProcessorAddProjectFile _BNWARPProcessorAddProjectFile = core.BNWARPProcessorAddProjectFile _BNWARPProcessorAddProjectFile.restype = None _BNWARPProcessorAddProjectFile.argtypes = [ ctypes.POINTER(BNWARPProcessor), ctypes.POINTER(BNProjectFile), ] # noinspection PyPep8Naming
[docs] def BNWARPProcessorAddProjectFile( processor: ctypes.POINTER(BNWARPProcessor), projectFile: ctypes.POINTER(BNProjectFile) ) -> None: return _BNWARPProcessorAddProjectFile(processor, projectFile)
# ------------------------------------------------------- # _BNWARPProcessorCancel _BNWARPProcessorCancel = core.BNWARPProcessorCancel _BNWARPProcessorCancel.restype = None _BNWARPProcessorCancel.argtypes = [ ctypes.POINTER(BNWARPProcessor), ] # noinspection PyPep8Naming
[docs] def BNWARPProcessorCancel( processor: ctypes.POINTER(BNWARPProcessor) ) -> None: return _BNWARPProcessorCancel(processor)
# ------------------------------------------------------- # _BNWARPProcessorGetState _BNWARPProcessorGetState = core.BNWARPProcessorGetState _BNWARPProcessorGetState.restype = BNWARPProcessorState _BNWARPProcessorGetState.argtypes = [ ctypes.POINTER(BNWARPProcessor), ] # noinspection PyPep8Naming
[docs] def BNWARPProcessorGetState( processor: ctypes.POINTER(BNWARPProcessor) ) -> BNWARPProcessorState: return _BNWARPProcessorGetState(processor)
# ------------------------------------------------------- # _BNWARPProcessorStart _BNWARPProcessorStart = core.BNWARPProcessorStart _BNWARPProcessorStart.restype = ctypes.POINTER(BNWARPFile) _BNWARPProcessorStart.argtypes = [ ctypes.POINTER(BNWARPProcessor), ] # noinspection PyPep8Naming
[docs] def BNWARPProcessorStart( processor: ctypes.POINTER(BNWARPProcessor) ) -> Optional[ctypes.POINTER(BNWARPFile)]: result = _BNWARPProcessorStart(processor) if not result: return None return result
# ------------------------------------------------------- # _BNWARPRunMatcher _BNWARPRunMatcher = core.BNWARPRunMatcher _BNWARPRunMatcher.restype = None _BNWARPRunMatcher.argtypes = [ ctypes.POINTER(BNBinaryView), ] # noinspection PyPep8Naming
[docs] def BNWARPRunMatcher( view: ctypes.POINTER(BNBinaryView) ) -> None: return _BNWARPRunMatcher(view)
# ------------------------------------------------------- # _BNWARPTypeGetAnalysisType _BNWARPTypeGetAnalysisType = core.BNWARPTypeGetAnalysisType _BNWARPTypeGetAnalysisType.restype = ctypes.POINTER(BNType) _BNWARPTypeGetAnalysisType.argtypes = [ ctypes.POINTER(BNArchitecture), ctypes.POINTER(BNWARPType), ] # noinspection PyPep8Naming
[docs] def BNWARPTypeGetAnalysisType( arch: ctypes.POINTER(BNArchitecture), ty: ctypes.POINTER(BNWARPType) ) -> Optional[ctypes.POINTER(BNType)]: result = _BNWARPTypeGetAnalysisType(arch, ty) if not result: return None return result
# ------------------------------------------------------- # _BNWARPTypeGetConfidence _BNWARPTypeGetConfidence = core.BNWARPTypeGetConfidence _BNWARPTypeGetConfidence.restype = ctypes.c_ubyte _BNWARPTypeGetConfidence.argtypes = [ ctypes.POINTER(BNWARPType), ] # noinspection PyPep8Naming
[docs] def BNWARPTypeGetConfidence( ty: ctypes.POINTER(BNWARPType) ) -> int: return _BNWARPTypeGetConfidence(ty)
# ------------------------------------------------------- # _BNWARPTypeGetName _BNWARPTypeGetName = core.BNWARPTypeGetName _BNWARPTypeGetName.restype = ctypes.POINTER(ctypes.c_byte) _BNWARPTypeGetName.argtypes = [ ctypes.POINTER(BNWARPType), ] # noinspection PyPep8Naming
[docs] def BNWARPTypeGetName( ty: ctypes.POINTER(BNWARPType) ) -> Optional[Optional[str]]: result = _BNWARPTypeGetName(ty) if not result: return None string = str(pyNativeStr(ctypes.cast(result, ctypes.c_char_p).value)) BNFreeString(result) return string
# ------------------------------------------------------- # _BNWARPUUIDEqual _BNWARPUUIDEqual = core.BNWARPUUIDEqual _BNWARPUUIDEqual.restype = ctypes.c_bool _BNWARPUUIDEqual.argtypes = [ ctypes.POINTER(BNWARPUUID), ctypes.POINTER(BNWARPUUID), ] # noinspection PyPep8Naming
[docs] def BNWARPUUIDEqual( a: ctypes.POINTER(BNWARPUUID), b: ctypes.POINTER(BNWARPUUID) ) -> bool: return _BNWARPUUIDEqual(a, b)
# ------------------------------------------------------- # _BNWARPUUIDFromString _BNWARPUUIDFromString = core.BNWARPUUIDFromString _BNWARPUUIDFromString.restype = ctypes.c_bool _BNWARPUUIDFromString.argtypes = [ ctypes.c_char_p, ctypes.POINTER(BNWARPUUID), ] # noinspection PyPep8Naming
[docs] def BNWARPUUIDFromString( str: Optional[str], uuid: ctypes.POINTER(BNWARPUUID) ) -> bool: return _BNWARPUUIDFromString(cstr(str), uuid)
# ------------------------------------------------------- # _BNWARPUUIDGetString _BNWARPUUIDGetString = core.BNWARPUUIDGetString _BNWARPUUIDGetString.restype = ctypes.POINTER(ctypes.c_byte) _BNWARPUUIDGetString.argtypes = [ ctypes.POINTER(BNWARPUUID), ] # noinspection PyPep8Naming
[docs] def BNWARPUUIDGetString( uuid: ctypes.POINTER(BNWARPUUID) ) -> Optional[Optional[str]]: result = _BNWARPUUIDGetString(uuid) if not result: return None string = str(pyNativeStr(ctypes.cast(result, ctypes.c_char_p).value)) BNFreeString(result) return string
# Helper functions
[docs] def handle_of_type(value, handle_type): if isinstance(value, ctypes.POINTER(handle_type)) or isinstance(value, ctypes.c_void_p): return ctypes.cast(value, ctypes.POINTER(handle_type)) raise ValueError('expected pointer to %s' % str(handle_type))