Convert eight bytes of data to a word (little endian) 'offset' is assumed to index into a word array. So setting it to N will return a dword out of the data starting at offset N*8. Returns None if the data can't be turned into a quad word.
(self, data, offset)
| 6889 | return struct.pack("<Q", word) |
| 6890 | |
| 6891 | def get_qword_from_data(self, data, offset): |
| 6892 | """Convert eight bytes of data to a word (little endian) |
| 6893 | |
| 6894 | 'offset' is assumed to index into a word array. So setting it to |
| 6895 | N will return a dword out of the data starting at offset N*8. |
| 6896 | |
| 6897 | Returns None if the data can't be turned into a quad word. |
| 6898 | """ |
| 6899 | |
| 6900 | if (offset + 1) * 8 > len(data): |
| 6901 | return None |
| 6902 | |
| 6903 | return struct.unpack("<Q", data[offset * 8 : (offset + 1) * 8])[0] |
| 6904 | |
| 6905 | def get_qword_at_rva(self, rva): |
| 6906 | """Return the quad-word value at the given RVA. |
no test coverage detected