``read32be`` returns a four byte big endian integer from offset incrementing the offset by four. :param int address: offset to set the internal offset before reading :return: a four byte integer at offset. :rtype: int, or None on failure :Example: >>> br.seek(0x100000000) >>> hex(
(self, address: Optional[int] = None)
| 10404 | return struct.unpack(">H", result)[0] |
| 10405 | |
| 10406 | def read32be(self, address: Optional[int] = None) -> Optional[int]: |
| 10407 | """ |
| 10408 | ``read32be`` returns a four byte big endian integer from offset incrementing the offset by four. |
| 10409 | |
| 10410 | :param int address: offset to set the internal offset before reading |
| 10411 | :return: a four byte integer at offset. |
| 10412 | :rtype: int, or None on failure |
| 10413 | :Example: |
| 10414 | |
| 10415 | >>> br.seek(0x100000000) |
| 10416 | >>> hex(br.read32be()) |
| 10417 | '0xcffaedfe' |
| 10418 | """ |
| 10419 | if address is not None: |
| 10420 | self.seek(address) |
| 10421 | |
| 10422 | result = self.read(4) |
| 10423 | if (result is None) or (len(result) != 4): |
| 10424 | return None |
| 10425 | return struct.unpack(">I", result)[0] |
| 10426 | |
| 10427 | def read64be(self, address: Optional[int] = None) -> Optional[int]: |
| 10428 | """ |