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

Method read16le

python/binaryview.py:10318–10338  ·  view source on GitHub ↗

``read16le`` returns a two byte little endian integer from offset incrementing the offset by two. :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) >>> hex(

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

Source from the content-addressed store, hash-verified

10316 return result.value
10317
10318 def read16le(self, address: Optional[int] = None) -> Optional[int]:
10319 """
10320 ``read16le`` returns a two byte little endian integer from offset incrementing the offset by two.
10321
10322 :param int address: offset to set the internal offset before reading
10323 :return: a two byte integer at offset.
10324 :rtype: int, or None on failure
10325 :Example:
10326
10327 >>> br.seek(0x100000000)
10328 >>> hex(br.read16le())
10329 '0xfacf'
10330 >>>
10331 """
10332 if address is not None:
10333 self.seek(address)
10334
10335 result = self.read(2)
10336 if (result is None) or (len(result) != 2):
10337 return None
10338 return struct.unpack("<H", result)[0]
10339
10340 def read32le(self, address: Optional[int] = None) -> Optional[int]:
10341 """

Callers

nothing calls this directly

Calls 2

seekMethod · 0.95
readMethod · 0.95

Tested by

no test coverage detected