Hello, i'm making a hack for Nostale, but i need the 'basseAdress'. The pointers are taked from the ce:
"nostalex.dat"+003D5980
As the get?
"nostalex.dat"+003D5980
As the get?
Process p = Process.GetProcessesByName("nostalex.dat")[0];
IntPtr baseAddr = p.MainModule.BaseAddress;
I have that codeQuote:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Code:Process p = Process.GetProcessesByName("nostalex.dat")[0]; IntPtr baseAddr = p.MainModule.BaseAddress;
Dim p As Process = Process.GetProcessesByName("nostalex.dat")(0)
Dim basse = p.MainModule.BaseAddress.ToInt32
Dim ti = basse + &H1C6 + &H80 + &H7C
Public Function GetBaseAddr(ByVal ProcName As String, ByVal ModuleName As String)
Dim BaseAddress As Int32
For Each PM As ProcessModule In Process.GetProcessesByName(ProcName)(0).Modules
If ModuleName.ToLower = PM.ModuleName.ToLower Then
BaseAddress = PM.BaseAddress
End If
Next
Return BaseAddress
End Function
Dim BaseAddy as Int32 = GetBaseAddr("Nostalex.dat","Nostalex.dat/dll")
Dim PlayerPtr as Int32 = BaseAddy + &H003D5980
Public Sub WriteInteger(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Integer, Optional ByVal nsize As Integer = 4)
If ProcessName.EndsWith(".exe") Then
ProcessName = ProcessName.Replace(".exe", "")
End If
Dim MyP As Process() = Process.GetProcessesByName(ProcessName)
If MyP.Length = 0 Then
MessageBox.Show(ProcessName & " ist nicht geöffnet!")
Exit Sub
End If
Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
If hProcess = IntPtr.Zero Then
MessageBox.Show("Fehler beim öffnen des Prozess: " & ProcessName & "!")
Exit Sub
End If
Dim hAddress, vBuffer As Integer
hAddress = Address
vBuffer = Value
WriteProcessMemory1(hProcess, hAddress, CInt(vBuffer), nsize, 0)
End Sub
Public Function WritePointerInt(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Integer, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean
Try
Dim lvl As Integer = Address
For i As Integer = 1 To Level
lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1)
Next
WriteInteger(Process, lvl, Value, nsize)
Return True
Catch ex As Exception
Return False
End Try
End Function
In WriterPointerInt, what are 'level'? And...Quote:
Mit dieser Funktion ist das auch elegant gelößt!
Im grunde ist es das Selbe wie oben schon erwähnt. Nur persönlich finde ich es schöner einfach immer dies zu schreiben :Code:Public Function GetBaseAddr(ByVal ProcName As String, ByVal ModuleName As String) Dim BaseAddress As Int32 For Each PM As ProcessModule In Process.GetProcessesByName(ProcName)(0).Modules If ModuleName.ToLower = PM.ModuleName.ToLower Then BaseAddress = PM.BaseAddress End If Next Return BaseAddress End Function
Und dann schreibst du in den gewünschten Speicher :)Code:Dim BaseAddy as Int32 = GetBaseAddr("Nostalex.dat","Nostalex.dat/dll") Dim PlayerPtr as Int32 = BaseAddy + &H003D5980
Edit : Ich seh gerade, dass du versuchst einen Pointer zu schreiben!
Benutze dafür diese Funktion! Damit hast du ganz einfach die Möglichkeit Pointer zu schreiben!
Da machst du dir folgende Funktionen! Die unterste ist die fürs schreiben deiner Pointer! Die obere für einen normalen Integer Wert!
Code:Public Sub WriteInteger(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Integer, Optional ByVal nsize As Integer = 4) If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " ist nicht geöffnet!") Exit Sub End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Fehler beim öffnen des Prozess: " & ProcessName & "!") Exit Sub End If Dim hAddress, vBuffer As Integer hAddress = Address vBuffer = Value WriteProcessMemory1(hProcess, hAddress, CInt(vBuffer), nsize, 0) End SubIch hoffe, dass dies dir etwas weitergeholfen hat!Code:Public Function WritePointerInt(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Integer, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean Try Dim lvl As Integer = Address For i As Integer = 1 To Level lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1) Next WriteInteger(Process, lvl, Value, nsize) Return True Catch ex As Exception Return False End Try End Function