``get_data_offset_for_address`` returns the file offset that maps to the given virtual address, if possible. If `address` falls within a bss segment or an external segment, for example, no mapping is possible, and `None` will be returned. :param int address: virtual address :return: the f
(self, address: int)
| 9565 | return address.value |
| 9566 | |
| 9567 | def get_data_offset_for_address(self, address: int) -> Optional[int]: |
| 9568 | """ |
| 9569 | ``get_data_offset_for_address`` returns the file offset that maps to the given virtual address, if possible. |
| 9570 | |
| 9571 | If `address` falls within a bss segment or an external segment, for example, no mapping is possible, and `None` will be returned. |
| 9572 | |
| 9573 | :param int address: virtual address |
| 9574 | :return: the file location that is mapped to the given virtual address, or None if no such mapping is possible |
| 9575 | :rtype: Int |
| 9576 | """ |
| 9577 | segment = self.get_segment_at(address) |
| 9578 | if segment is not None and segment.start <= address < segment.end: |
| 9579 | offset = address - segment.start |
| 9580 | if offset < segment.data_length: |
| 9581 | return offset + segment.data_offset |
| 9582 | return None |
| 9583 | |
| 9584 | def add_auto_section( |
| 9585 | self, name: str, start: int, length: int, |
no test coverage detected