*DELETED*

Please post any questions about developing your plugin here. Please use the search function before posting!
Sam
Senior Member
Posts: 100
Joined: Tue Jul 03, 2018 3:00 pm
Location: *DELETED*
Contact:

[H] Write Pointer to file

Postby Sam » Fri May 01, 2020 1:01 pm

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()
Last edited by Sam on Fri May 01, 2020 1:20 pm, edited 1 time in total.
InvisibleSoldiers
Senior Member
Posts: 114
Joined: Fri Mar 15, 2019 6:08 am

Re: [H] Write Pointer to file

Postby InvisibleSoldiers » Fri May 01, 2020 1:41 pm

> Write Pointer to file

Syntax: Select all

with open('test.data', 'wb') as f:
b = struct.pack('i', ptr.address)
f.write(b)

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 44 guests