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

Method query_metadata

python/binaryview.py:9733–9754  ·  view source on GitHub ↗

`query_metadata` retrieves a metadata associated with the given key stored in the current BinaryView. :param str key: key to query :rtype: metadata associated with the key :Example: >>> bv.store_metadata("integer", 1337) >>> bv.query_metadata("integer") 1337L >>> bv.store_meta

(self, key: str)

Source from the content-addressed store, hash-verified

9731 core.BNApplyDebugInfo(self.handle, value.handle)
9732
9733 def query_metadata(self, key: str) -> 'metadata.MetadataValueType':
9734 """
9735 `query_metadata` retrieves a metadata associated with the given key stored in the current BinaryView.
9736
9737 :param str key: key to query
9738 :rtype: metadata associated with the key
9739 :Example:
9740
9741 >>> bv.store_metadata("integer", 1337)
9742 >>> bv.query_metadata("integer")
9743 1337L
9744 >>> bv.store_metadata("list", [1,2,3])
9745 >>> bv.query_metadata("list")
9746 [1L, 2L, 3L]
9747 >>> bv.store_metadata("string", "my_data")
9748 >>> bv.query_metadata("string")
9749 'my_data'
9750 """
9751 md_handle = core.BNBinaryViewQueryMetadata(self.handle, key)
9752 if md_handle is None:
9753 raise KeyError(key)
9754 return metadata.Metadata(handle=md_handle).value
9755
9756 def store_metadata(self, key: str, md: metadata.MetadataValueType, isAuto: bool = False) -> None:
9757 """

Callers 1

librariesMethod · 0.95

Calls 1

MetadataMethod · 0.80

Tested by

no test coverage detected