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

Method write8

python/binaryview.py:10599–10621  ·  view source on GitHub ↗

``write8`` lowest order byte from the integer ``value`` to the current offset. :param str value: bytes to be written at current offset :param int address: offset to set the internal offset before writing :param bool except_on_relocation: (default True) raise exception when write overlaps a

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

Source from the content-addressed store, hash-verified

10597 return core.BNWriteData(self._handle, buf, len(value))
10598
10599 def write8(self, value: int, address: Optional[int] = None, except_on_relocation=True) -> bool:
10600 """
10601 ``write8`` lowest order byte from the integer ``value`` to the current offset.
10602
10603 :param str value: bytes to be written at current offset
10604 :param int address: offset to set the internal offset before writing
10605 :param bool except_on_relocation: (default True) raise exception when write overlaps a relocation
10606 :return: boolean
10607 :rtype: bool
10608 :Example:
10609
10610 >>> bw.write8(0x42)
10611 True
10612 >>> br.read(1)
10613 'B'
10614 >>>
10615 """
10616 if address is not None:
10617 self.seek(address)
10618
10619 if except_on_relocation and self._view.range_contains_relocation(self.offset, 1):
10620 raise RelocationWriteException("Attempting to write to a location which has a relocation")
10621 return core.BNWrite8(self._handle, value)
10622
10623 def write16(self, value: int, address: Optional[int] = None, except_on_relocation=True) -> bool:
10624 """

Callers

nothing calls this directly

Calls 3

seekMethod · 0.95

Tested by

no test coverage detected