Overwrite, with the given string, the bytes at the file offset corresponding to the given RVA. Return True if successful, False otherwise. It can fail if the offset is outside the file's boundaries.
(self, rva, data)
| 6935 | ## |
| 6936 | |
| 6937 | def set_bytes_at_rva(self, rva, data): |
| 6938 | """Overwrite, with the given string, the bytes at the file offset corresponding |
| 6939 | to the given RVA. |
| 6940 | |
| 6941 | Return True if successful, False otherwise. It can fail if the |
| 6942 | offset is outside the file's boundaries. |
| 6943 | """ |
| 6944 | |
| 6945 | if not isinstance(data, bytes): |
| 6946 | raise TypeError("data should be of type: bytes") |
| 6947 | |
| 6948 | offset = self.get_physical_by_rva(rva) |
| 6949 | if not offset: |
| 6950 | return False |
| 6951 | |
| 6952 | return self.set_bytes_at_offset(offset, data) |
| 6953 | |
| 6954 | def set_bytes_at_offset(self, offset, data): |
| 6955 | """Overwrite the bytes at the given file offset with the given string. |
no test coverage detected