Syntax: Select all
ptr: Pointer = ... # Size: 0x3749
from io import BytesIO
io = BytesIO()
# How can I write a pointer from memory to a file? Is there a better way?
for bi in range(0, ptr.size):
io.write(chr(ptr.get_uchar(bi)).encode())
buf = bytes(io.getbuffer())
f = open('ptr.bin', 'wb+')
f.write(buf)
f.close()