MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / get_qword_from_data

Method get_qword_from_data

pythonmemorymodule/pefile.py:6891–6903  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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&#x27;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.

Callers 2

get_qword_at_rvaMethod · 0.95
get_qword_from_offsetMethod · 0.95

Calls 1

unpackMethod · 0.45

Tested by

no test coverage detected