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

Method get_previous_data_var_before

python/binaryview.py:7498–7519  ·  view source on GitHub ↗

``get_previous_data_var_before`` retrieves the previous :py:class:`DataVariable`, or None. :param int addr: the virtual address to start looking from. :return: the previous :py:class:`DataVariable` :rtype: DataVariable :Example: >>> bv.get_previous_data_var_before(0x1000003c) <var

(self, addr: int)

Source from the content-addressed store, hash-verified

7496 return core.BNGetPreviousDataBeforeAddress(self.handle, addr)
7497
7498 def get_previous_data_var_before(self, addr: int) -> Optional['DataVariable']:
7499 """
7500 ``get_previous_data_var_before`` retrieves the previous :py:class:`DataVariable`, or None.
7501
7502 :param int addr: the virtual address to start looking from.
7503 :return: the previous :py:class:`DataVariable`
7504 :rtype: DataVariable
7505 :Example:
7506
7507 >>> bv.get_previous_data_var_before(0x1000003c)
7508 <var 0x10000000: int16_t>
7509 >>>
7510 """
7511 prev_data_var_start = core.BNGetPreviousDataVariableStartBeforeAddress(self.handle, addr)
7512 if prev_data_var_start == addr:
7513 return None
7514 var = core.BNDataVariable()
7515 if not core.BNGetDataVariableAtAddress(self.handle, prev_data_var_start, var):
7516 return None
7517 result = DataVariable.from_core_struct(var, self)
7518 core.BNFreeDataVariable(var)
7519 return result
7520
7521 def get_previous_data_var_start_before(self, addr: int) -> int:
7522 """

Callers

nothing calls this directly

Calls 1

from_core_structMethod · 0.45

Tested by

no test coverage detected