Convert four bytes of data to a double word (little endian) 'offset' is assumed to index into a dword array. So setting it to N will return a dword out of the data starting at offset N*4. Returns None if the data can't be turned into a double word.
(self, data, offset)
| 6789 | return struct.pack("<L", dword & 0xFFFFFFFF) |
| 6790 | |
| 6791 | def get_dword_from_data(self, data, offset): |
| 6792 | """Convert four bytes of data to a double word (little endian) |
| 6793 | |
| 6794 | 'offset' is assumed to index into a dword array. So setting it to |
| 6795 | N will return a dword out of the data starting at offset N*4. |
| 6796 | |
| 6797 | Returns None if the data can't be turned into a double word. |
| 6798 | """ |
| 6799 | |
| 6800 | if (offset + 1) * 4 > len(data): |
| 6801 | return None |
| 6802 | |
| 6803 | return struct.unpack("<I", data[offset * 4 : (offset + 1) * 4])[0] |
| 6804 | |
| 6805 | def get_dword_at_rva(self, rva): |
| 6806 | """Return the double word value at the given RVA. |
no test coverage detected