Bonjour,
j'ai refait mon code mais j'arrive pas avoir le mème offset comme cheat engine :
Voici en image en dessous,
Comment faire par rapport a mon code avoir le mème offset comme cheat engine?
Merci de votre aide,
j'ai refait mon code mais j'arrive pas avoir le mème offset comme cheat engine :
Code:
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 ReadProcessMemory4 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Byte, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Byte
Public Function FindPattern(ByVal Process As String, ByVal HEXA As String) As Long
For dwCurrentAddress As Long = &H1000000 To &H7FFFFFFF Step 1
If Compare(Process, dwCurrentAddress, HEXA) Then
Return dwCurrentAddress
End If
Next
Return -1
End Function
Private Function Compare(Process As String, Address As Long, HEXA As String) As Boolean
Dim pTemp As Byte = Nothing
For i As Integer = 0 To HEXA.Length - 1 Step 1
pTemp = ReadByte(Process, (Address + i), 4)
If pTemp = Nothing Then
Return False
End If
Next
Return True
End Function
Public Function ReadByte(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Byte
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!")
End If
Dim hProcess As IntPtr = OpenProcess(&H10, 0, MyP(0).Id)
If hProcess = IntPtr.Zero Then
MessageBox.Show("Failed to open " & ProcessName & "!")
End If
Dim hAddress As Integer
Dim vBuffer As Byte = Nothing
hAddress = Address
ReadProcessMemory4(hProcess, hAddress, vBuffer, nsize, 0)
Return vBuffer
End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim HEXA As String = "54 3D 6A 10 00 24 B9 03 8C 48 C9 03 5A 00 00 00"
Dim MonAddress As Long = FindPattern("Template", HEXA)
TextBox1.Text = MonAddress.ToString("X8")
End Sub
Voici en image en dessous,
Comment faire par rapport a mon code avoir le mème offset comme cheat engine?
Merci de votre aide,