Created
June 13, 2019 14:43
-
-
Save lucasg/2fe0e9a15c31925a8fd15bd681f6df1a to your computer and use it in GitHub Desktop.
Read memory as GUID via IDA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ida_bytes | |
import binascii | |
def get_guid(address): | |
data1 = ida_bytes.get_dword(address) | |
data2 = ida_bytes.get_word(address + 4) | |
data3 = ida_bytes.get_word(address + 6) | |
data4 = ida_bytes.get_bytes(address + 8, 8) | |
return "%08x-%04x-%04x-%s" % (data1, data2, data3, binascii.hexlify(data4)) | |
def get_alt_guid(address): | |
data1 = ida_bytes.get_dword(address) | |
data2 = ida_bytes.get_word(address + 4) | |
data3 = ida_bytes.get_word(address + 6) | |
data4 = ida_bytes.get_word(address + 8) | |
data5 = ida_bytes.get_bytes(address + 10, 6) | |
return "{%08x-%04x-%04x-%04x-%s}" % (data1, data2, data3, data4, binascii.hexlify(data5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment