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

Method get_data_var_at

python/binaryview.py:5057–5077  ·  view source on GitHub ↗

``get_data_var_at`` returns the data type at a given virtual address. :param int addr: virtual address to get the data type from :return: returns the DataVariable at the given virtual address, None on error :rtype: DataVariable :Example: >>> t = bv.parse_type_string("int foo") >>>

(self, addr: int)

Source from the content-addressed store, hash-verified

5055 core.BNUndefineUserDataVariable(self.handle, addr)
5056
5057 def get_data_var_at(self, addr: int) -> Optional['DataVariable']:
5058 """
5059 ``get_data_var_at`` returns the data type at a given virtual address.
5060
5061 :param int addr: virtual address to get the data type from
5062 :return: returns the DataVariable at the given virtual address, None on error
5063 :rtype: DataVariable
5064 :Example:
5065
5066 >>> t = bv.parse_type_string("int foo")
5067 >>> bv.define_data_var(bv.entry_point, t[0])
5068 >>> bv.get_data_var_at(bv.entry_point)
5069 <var 0x100001174: int32_t>
5070
5071 """
5072 var = core.BNDataVariable()
5073 if not core.BNGetDataVariableAtAddress(self.handle, addr, var):
5074 return None
5075 result = DataVariable.from_core_struct(var, self)
5076 core.BNFreeDataVariable(var)
5077 return result
5078
5079 def get_functions_containing(self, addr: int,
5080 plat: Optional['_platform.Platform'] = None) -> List['_function.Function']:

Callers 3

define_user_data_varMethod · 0.95
_get_current_data_varFunction · 0.80
__init__Method · 0.80

Calls 1

from_core_structMethod · 0.45

Tested by

no test coverage detected