|
You last visited: Today at 14:46
Advertisement
[Help] GetBasseAdres
Discussion on [Help] GetBasseAdres within the .NET Languages forum part of the Coders Den category.
08/09/2012, 12:45
|
#1
|
elite*gold: 20
Join Date: Jan 2012
Posts: 766
Received Thanks: 645
|
[Help] GetBasseAdres
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?
|
|
|
08/09/2012, 15:04
|
#2
|
elite*gold: 258
Join Date: May 2010
Posts: 847
Received Thanks: 3,938
|
|
|
|
08/09/2012, 15:27
|
#3
|
elite*gold: 20
Join Date: Jan 2012
Posts: 766
Received Thanks: 645
|
Quote:
Originally Posted by -PinkiWinki-
|
I have that code
Code:
Dim p As Process = Process.GetProcessesByName("nostalex.dat")(0)
Dim basse = p.MainModule.BaseAddress.ToInt32
Dim ti = basse + &H1C6 + &H80 + &H7C
Don't Work >.o
|
|
|
08/11/2012, 14:55
|
#4
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,913
Received Thanks: 25,413
|
You have to add 3D5980 to the base address and then you have to read the value at that address.
The first offset is added to that value and then you read again at the resulting address to get the next base address and so forth, until you added the last offset.
The result is the address where you find your desired value.
|
|
|
08/13/2012, 21:55
|
#5
|
elite*gold: 0
Join Date: Jan 2009
Posts: 194
Received Thanks: 86
|
Mit dieser Funktion ist das auch elegant gelößt!
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
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:
Dim BaseAddy as Int32 = GetBaseAddr("Nostalex.dat","Nostalex.dat/dll")
Dim PlayerPtr as Int32 = BaseAddy + &H003D5980
Und dann schreibst du in den gewünschten Speicher
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 Sub
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
Ich hoffe, dass dies dir etwas weitergeholfen hat!
|
|
|
08/15/2012, 15:37
|
#6
|
elite*gold: 20
Join Date: Jan 2012
Posts: 766
Received Thanks: 645
|
Quote:
Originally Posted by DXStriker
Mit dieser Funktion ist das auch elegant gelößt!
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
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:
Dim BaseAddy as Int32 = GetBaseAddr("Nostalex.dat","Nostalex.dat/dll")
Dim PlayerPtr as Int32 = BaseAddy + &H003D5980
Und dann schreibst du in den gewünschten Speicher
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 Sub
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
Ich hoffe, dass dies dir etwas weitergeholfen hat!
|
In WriterPointerInt, what are 'level'? And...
How I make the array of offsets?
|
|
|
08/15/2012, 18:05
|
#7
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,913
Received Thanks: 25,413
|
Level specifies the amount of offsets.
|
|
|
08/16/2012, 23:26
|
#8
|
elite*gold: 0
Join Date: Jan 2009
Posts: 194
Received Thanks: 86
|
You can do it like this :
WritePointerInt("yourgame", Base + &hBAFA8,{&h0,&hF4,&h3C}, Value, 3)
____________
3 offsets = level 3
|
|
|
All times are GMT +2. The time now is 14:47.
|
|