MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / get_reasons

Method get_reasons

python/basedetection.py:255–275  ·  view source on GitHub ↗

``get_reasons`` returns a list of reasons that can be used to determine why a base address is a candidate :param int base_address: base address to get reasons for :return: list of reasons for the specified base address :rtype: list[BaseAddressDetectionReason]

(self, base_address: int)

Source from the content-addressed store, hash-verified

253 core.BNAbortBaseAddressDetection(self._handle)
254
255 def get_reasons(self, base_address: int) -> list[BaseAddressDetectionReason]:
256 """
257 ``get_reasons`` returns a list of reasons that can be used to determine why a base address is a candidate
258
259 :param int base_address: base address to get reasons for
260 :return: list of reasons for the specified base address
261 :rtype: list[BaseAddressDetectionReason]
262 """
263
264 count = ctypes.c_size_t()
265 reasons = core.BNGetBaseAddressDetectionReasons(self._handle, base_address, ctypes.byref(count))
266 if count.value == 0:
267 return []
268
269 try:
270 result = list()
271 for i in range(count.value):
272 result.append(BaseAddressDetectionReason(reasons[i].Pointer, reasons[i].POIOffset, reasons[i].POIType))
273 return result
274 finally:
275 core.BNFreeBaseAddressDetectionReasons(reasons)
276
277 def _get_data_hits_by_type(self, base_address: int, poi_type: int) -> int:
278 reasons = self.get_reasons(base_address)

Callers 2

mainFunction · 0.95

Calls 2

appendMethod · 0.45

Tested by

no test coverage detected