So I'm trying to make a name faker in Visual Basic, I already have all my WriteString, WriteBytes, WriteInt, ReadString (etc..) but I'm confused on how to find the address of the players name because it changes every start up
I've found a CheatTable that has this function
but i cant seem to do it in code.
Code:
Public Function FindAddress(ByVal ProcessName As String, ByVal BaseAddress As IntPtr, ByVal StaticPointer As IntPtr, ByVal Offsets() As IntPtr) As IntPtr
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 & " isn't open!")
Exit Function
End If
Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)
If hProcess = IntPtr.Zero Then
MessageBox.Show("Failed to open " & ProcessName & "!")
Exit Function
End If
' Crearemos un buffer de 4 bytes para sistema de32-bit o 8 bytes sobre un sistema de 64-bit .
Dim tmp(IntPtr.Size - 1) As Byte
Dim Address As IntPtr = BaseAddress
' Checaremos para 32-bit vs 64-bit.
If IntPtr.Size = 4 Then
Address = New IntPtr(Address.ToInt32 + StaticPointer.ToInt32)
Else
Address = New IntPtr(Address.ToInt64 + StaticPointer.ToInt64)
End If
' Loop de cada Offset hasta encontrar el Address
For i As Integer = 0 To Offsets.Length - 1
ReadProcessMemory4(hProcess, Address, tmp, IntPtr.Size, 0)
If IntPtr.Size = 4 Then
Address = BitConverter.ToInt32(tmp, 0) + Offsets(i).ToInt32()
Else
Address = BitConverter.ToInt64(tmp, 0) + Offsets(i).ToInt64()
End If
Next
Return Address
End Function
i tried using this function to find the address to read/write to but it doesnt return anything.
anyone able to help??