Python Memory Read

Python la memory read deniyorum ornek kaynak ararken kod buldum ama tam anlayamadim bu konuda yardimci olabilir misiniz? PROCESS_ALL_ACCESS, pid, address,buffer ozellikle bu bolumleri anlamadim.

from ctypes import *
from ctypes.wintypes import *

OpenProcess = windll.kernel32.OpenProcess
ReadProcessMemory = windll.kernel32.ReadProcessMemory
CloseHandle = windll.kernel32.CloseHandle

PROCESS_ALL_ACCESS = 0x1F0FFF

pid = 4044   # I assume you have this from somewhere.
address = 0x1000000  # Likewise; for illustration I'll get the .exe header.

buffer = c_char_p("The data goes here")
bufferSize = len(buffer.value)
bytesRead = c_ulong(0)

processHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
if ReadProcessMemory(processHandle, address, buffer, bufferSize, byref(bytesRead)):
    print "Success:", buffer
else:
    print "Failed."

CloseHandle(processHandle)

Merhaba.

├çok bilgim yok ama anlad─▒─č─▒m kadar─▒yla birka├ž yorum yazd─▒m; umar─▒m i┼činize yarar:

from ctypes import *
from ctypes.wintypes import *

# Buradaki OpenProcess, ReadProcessMemory ve CloseHandle, Windows API'─▒n─▒n fonksiyonlar─▒d─▒r.
# ctypes mod├╝l├╝ ile bunlar─▒ kullanabiliyoruz.
OpenProcess = windll.kernel32.OpenProcess
ReadProcessMemory = windll.kernel32.ReadProcessMemory
CloseHandle = windll.kernel32.CloseHandle

# Olu┼čturulacak process'e her ┼čekilde eri┼čilebilece─čini belirten sabit
PROCESS_ALL_ACCESS = 0x1F0FFF

# process ID
pid = 4044   # I assume you have this from somewhere.
# Process'in okunacak adresi; a┼ča─č─▒daki yorumda .exe header'─▒n─▒n yer ald─▒─č─▒ yaz─▒yor.
address = 0x1000000  # Likewise; for illustration I'll get the .exe header.

# Okunan verinin tutulaca─č─▒ haf─▒za konumu olarak d├╝┼č├╝nebilirsiniz.
# Alt─▒nda da bu haf─▒zan─▒n b├╝y├╝kl├╝─č├╝ yer al─▒yor.
# bytesRead de─či┼čkeni ise, okuma i┼čleminden sonra okunan byte say─▒s─▒n─▒ tutacak.
buffer = c_char_p("The data goes here")
bufferSize = len(buffer.value)
bytesRead = c_ulong(0)

# Process'i olu┼čtur.
processHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
# Okuma i┼člemini yap.
# Okuma ba┼čar─▒l─▒ ise, "Success: <buffer>" yazd─▒r.
# De─čilse, "Failed." yazd─▒r.
if ReadProcessMemory(processHandle, address, buffer, bufferSize, byref(bytesRead)):
    print "Success:", buffer
else:
    print "Failed."

# Process'i kapat.
CloseHandle(processHandle)

─░yi ├žal─▒┼čmalar.

1 Be─čeni

Te┼čekk├╝r ederim bilgi i├žin.

1 Be─čeni