bonsoir,
Je veux savoir comment rechercher un texte en unicode en vb.net?
j'ai recopier ce code dans ce lien : http://www.cheat-gam3.com/showthread.php?p=1471414
voici le code :
avez-vous une autre solution pour rechercher offset de "vaultLevel91"?
voici en image en dessous.
Merci d'avance de votre réponse,
Je veux savoir comment rechercher un texte en unicode en vb.net?
j'ai recopier ce code dans ce lien : http://www.cheat-gam3.com/showthread.php?p=1471414
voici le code :
Code:
Imports System.Runtime.InteropServices
Public Class Form1
Private Declare Function CloseHandle Lib "kernel32" (tHandle As IntPtr)
Private Declare Function OpenProcess Lib "kernel32" (dwDesiredAccess As Integer, bInheritHandle As Boolean, dwProcessId As Integer) As IntPtr
Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (hProcess As IntPtr, lpBaseAddress As Integer, <Out()> lpBuffer As Byte(), nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Byte
Private Const PROCESS_VM_READ = &H10
Public Function ReadByte(hProcess As IntPtr, Address As Integer, Optional ByVal nsize As Integer = 4) As Byte()
Dim vBuffer(nsize - 1) As Byte
Dim lpNumberOfBytesWritten As Integer
ReadProcessMemory(hProcess, Address, vBuffer, nsize, lpNumberOfBytesWritten)
Return vBuffer
End Function
Public Function Compare(hProcess As IntPtr, Address As Long, Pattern As Byte(), Mask As String) As Boolean
Dim pTemp As Byte
For i = 0 To Mask.Length - 1 Step 1
If Mask(i) = "x" Then
Continue For
End If
pTemp = ReadByte(hProcess, (Address + i), 1)(0)
If pTemp = Nothing Then
Return False
End If
If pTemp <> Pattern(i) Then
Return False
End If
Next
Return True
End Function
Public Function FindPattern(AProcess As String, Pattern As Byte(), Mask As String) As Long
Dim proc = Process.GetProcessesByName(AProcess).FirstOrDefault()
If proc Is Nothing Then
Return -1
End If
Dim hProc = OpenProcess(PROCESS_VM_READ, False, proc.Id)
If hProc = IntPtr.Zero Then
Return -1
End If
Try
For dwCurrentAddress As Long = &H3000000 To &H7FFFFFFFF Step 1
If Compare(hProc, dwCurrentAddress, Pattern, Mask) Then
Return dwCurrentAddress
End If
Next
Return -1
Finally
CloseHandle(hProc)
End Try
End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim Pattern As Byte() = Array.ConvertAll("vaultLevel91".ToCharArray(), Function(c) CType(Asc(c), Byte))
Dim MonAddress As Long = FindPattern("Template.exe", Pattern, "xxxxxxxxxxxx")
If MonAddress Then
TextBox1.Text = "0X" & MonAddress.ToString("X8")
Else
MessageBox.Show("No Found!")
End If
End Sub
voici en image en dessous.
Merci d'avance de votre réponse,