07/10/08 16:47
gianluca
ero intento a realizzare un mio addressFinder...
l'address finder mi servirebbe per trovare ed impostare gli address ke hanno un certo valore con un altro ke gli do io(tipo in un gioco per modificare dei parametri, risorse e quant'altro)!
mi servirebbe fare un programmino tipo ArtMoney! cioe ke quando gli do un valore da trovare, lui cerca nel processo tutti gli address ke hanno quell value e me li inserisce in una tabella!
il problema è ke non so come cercare i valori!... e non saprei poi inserire tutti quelli trovati un una tabella! aiuti?
so solo ke forse devo usare l'api ReadProcessMemory gisto? se si mi fate degli esempi su come usarla?
Ultima modifica effettuata da gianluca 08/10/08 14:26
aaa
08/10/08 14:31
gianluca
Ho trovato questo ke potrebbe aiutarmi! il problema è ke anke quando inserirso un address ke so ke porta un valore diverso da 0, mi restituisce 0! mi sapreste dire il perche'???
grazie!!!
Public Class Form1
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Private Declare Function WriteFloatMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Private Declare Function ReadFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByRef buffer As Single, ByVal size As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public RBuff As Long
Public Function ReadLong(ByVal Address As Integer)
Dim ProgramLookUp As Process() = Process.GetProcessesByName("sette_e_mezzo")
If ProgramLookUp.Length = 0 Then
End
End If
Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, ProgramLookUp(0).Id)
ReadProcessMemory(processHandle, Address, RBuff, 4, Nothing)
CloseHandle(processHandle)
Return RBuff
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox2.Text = ReadLong(&H28FC900)
End Sub
End Class
Ultima modifica effettuata da gianluca 08/10/08 14:31
aaa
08/10/08 15:10
gianluca
Errore! ho ftt quota invece di edita! sorry
Ultima modifica effettuata da gianluca 08/10/08 15:18
aaa
09/10/08 15:42
Il Totem
Ti ringrazio per la domanda! Ho avuto occasione di incontrare argomenti interessanti che non avevo ancora ben esplorato. Ecco cosa ha prodotto la mia ricerca:
Module Module1
Sub Main()
Console.WriteLine("Nome del processo:")
Dim P() As Process = Process.GetProcessesByName(Console.ReadLine)
If P.Length = 0 Then
Console.WriteLine("Nessun processo")
Else
Dim Handle As IntPtr = P(0).Handle
Dim BaseAddress As IntPtr = P(0).MainModule.BaseAddress
Dim Buffer(P(0).NonpagedSystemMemorySize64 - 1) As Byte
Dim GH As GCHandle = GCHandle.Alloc(Buffer, GCHandleType.Pinned)
Dim BufferPtr As IntPtr = GH.AddrOfPinnedObject()
Dim Read As IntPtr = Marshal.AllocHGlobal(4)
ReadProcessMemory(Handle, BaseAddress, BufferPtr, Buffer.Length, Read)
Dim ReadBytes As Int32 = Marshal.ReadInt32(Read)
Console.WriteLine(ReadBytes & " bytes letti:")
For I As Int16 = 0 To Buffer.Length - 1
Console.Write("{0:X2}", Buffer(I))
Next
End If
Console.ReadKey()
End Sub
End Module
Marshal è una classe di System.Runtime.InteropServices.
Ultima modifica effettuata da Il Totem 09/10/08 15:43
aaa
09/10/08 16:15
gianluca
GRAZIEEEEEE! comunque mi da un errore!
Dim ReadBytes As Int32 = Marshal.ReadInt32(Read)
mi dice "Tentativo di lettura o scrittura della memoria protetta. Spesso questa condizione indica che altre parti della memoria sono danneggiate."
come posso fare?????
Ultima modifica effettuata da gianluca 09/10/08 16:52
aaa
09/10/08 17:44
gianluca
l'ho impostato... ma mi da il solito mex d'errore!
come faccio a inizializzare il puntatore Read??
aaa