[Tutor] I want to learn how memory works!
Michael C
mysecretrobotfactory at gmail.com
Fri Sep 29 14:47:31 EDT 2017
Hi all, after 1 week of on and off hacking, I realized I simply don't know
enough about how memory works fundamentally!
Could you point me to a source of information about all the things someone
should know before he starts writing a memory scanner? Attached is my
current code, which doesn't work and can't figure out why. That's where I
am at.
> code starts.
import ctypes
User32 = ctypes.WinDLL('User32', use_last_error=True)
Kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
PID = 5924
PROCESS_QUERY_INFORMATION = 0x0400
PROCESS_VM_READ = 0x0010
Process = Kernel32.OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,
False, PID)
ReadProcessMemory = Kernel32.ReadProcessMemory
buffer = ctypes.create_string_buffer(4)
bufferSize = (ctypes.sizeof(buffer))
# I think instead of using 1000000000, I should use the size of the total
# memory used. but I don't know how to find this value.
for n in range(1000000000):
if ReadProcessMemory(Process, n, buffer, bufferSize, None):
print('buffer: ',buffer)
else:
print('something is wrong!')
print('Done.')
More information about the Tutor
mailing list