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

Method read16

python/binaryview.py:10252–10272  ·  view source on GitHub ↗

``read16`` returns a two byte integer from offset incrementing the offset by two, using specified endianness. :param int address: offset to set the internal offset before reading :return: a two byte integer at offset. :rtype: int, or None on failure :Example: >>> br.seek(0x100000000)

(self, address: Optional[int] = None)

Source from the content-addressed store, hash-verified

10250 return result.value
10251
10252 def read16(self, address: Optional[int] = None) -> Optional[int]:
10253 """
10254 ``read16`` returns a two byte integer from offset incrementing the offset by two, using specified endianness.
10255
10256 :param int address: offset to set the internal offset before reading
10257 :return: a two byte integer at offset.
10258 :rtype: int, or None on failure
10259 :Example:
10260
10261 >>> br.seek(0x100000000)
10262 >>> hex(br.read16())
10263 '0xfacf'
10264 >>>
10265 """
10266 if address is not None:
10267 self.seek(address)
10268
10269 result = ctypes.c_ushort()
10270 if not core.BNRead16(self._handle, result):
10271 return None
10272 return result.value
10273
10274 def read32(self, address: Optional[int] = None) -> Optional[int]:
10275 """

Callers

nothing calls this directly

Calls 1

seekMethod · 0.95

Tested by

no test coverage detected