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

Method write16

python/binaryview.py:10623–10638  ·  view source on GitHub ↗

``write16`` writes the lowest order two bytes from the integer ``value`` to the current offset, using internal endianness. :param int value: integer value to write. :param int address: offset to set the internal offset before writing :param bool except_on_relocation: (default True) raise e

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

Source from the content-addressed store, hash-verified

10621 return core.BNWrite8(self._handle, value)
10622
10623 def write16(self, value: int, address: Optional[int] = None, except_on_relocation=True) -> bool:
10624 """
10625 ``write16`` writes the lowest order two bytes from the integer ``value`` to the current offset, using internal endianness.
10626
10627 :param int value: integer value to write.
10628 :param int address: offset to set the internal offset before writing
10629 :param bool except_on_relocation: (default True) raise exception when write overlaps a relocation
10630 :return: boolean True on success, False on failure.
10631 :rtype: bool
10632 """
10633 if address is not None:
10634 self.seek(address)
10635
10636 if except_on_relocation and self._view.range_contains_relocation(self.offset, 2):
10637 raise RelocationWriteException("Attempting to write to a location which has a relocation")
10638 return core.BNWrite16(self._handle, value)
10639
10640 def write32(self, value: int, address: Optional[int] = None, except_on_relocation=True) -> bool:
10641 """

Callers

nothing calls this directly

Calls 3

seekMethod · 0.95

Tested by

no test coverage detected