Code is written but can't fix errors pls help

Posts 1–13 of 13 · Page 1 of 1
Code is written but can't fix errors pls help
THIS IS VB !!!!!!

Public Const PROCESS_VM_READ = &H10
Public Const PROCESS_VM_WRITE = (&H20)
Public Const PROCESS_VM_OPERATION = (&H8)
Public Const PROCESS_QUERY_INFORMATION = (&H400)
Public Const PROCESS_READ_WRITE_QUERY = PROCESS_VM_READ + PROCESS_VM_WRITE + PROCESS_VM_OPERATION + PROCESS_QUERY_INFORMATION
Public Const PROCESS_ALL_ACCESS = &H1F0FFF
Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Int32, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Byte(), ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByVal lpBuffer() As Byte, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
Public Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As UInteger, ByVal bInheritHandle As Integer, ByVal dwProcessId As UInteger) As IntPtr
Public Declare Function CloseHandle Lib "kernel32.dll" (ByVal hHandle As IntPtr) As Boolean
Public Function Game_Hwnd() As Int32
Dim i As Int32 : Dim foundit As Boolean = False
For Each p As Process In Process.GetProcessesByName("Crossfire") ' Replace that with the games window text
i = p.Id
foundit = True : Exit For
Next
If foundit = True Then
Return i
Else
Return 0
End If
End Function

#Region "Memory reading/Writing"
Private Sub Label9_Click(ByVal Address As Integer, ByVal Value As Integer, ByVal Size As Integer, ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click
Try
Dim GameReadWrite As Integer
Dim PID As Integer = Game_Hwnd()
GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

Dim bytArray() As Byte
bytArray = BitConverter.GetBytes(Value)
WriteProcessMemory(GameReadWrite, Address, bytArray, Size, 0)

CloseHandle(GameReadWrite)
Catch Ex As Exception
'ShowError(Ex)
End Try
End Sub
#End Region



and the error is :Error 1 Method 'Private Sub Label9_Click(Address As Integer, Value As Integer, Size As Integer, sender As Object, e As System.EventArgs)' cannot handle event 'Public Event Click(sender As Object, e As System.EventArgs)' because they do not have a compatible signature. C:\Documents and Settings\Antonia\my documents\visual studio 2010\Projects\CF_ShArKs CrossFire NA Mega Hack\CF_ShArKs CrossFire NA Mega Hack\Form3.vb 42 178 CF_ShArKs CrossFire NA Mega Hack

pls help
This?

Code:
Public Const PROCESS_VM_READ = &H10
 Public Const PROCESS_VM_WRITE = (&H20)
 Public Const PROCESS_VM_OPERATION = (&H8)
 Public Const PROCESS_QUERY_INFORMATION = (&H400)
 Public Const PROCESS_READ_WRITE_QUERY = PROCESS_VM_READ + PROCESS_VM_WRITE + PROCESS_VM_OPERATION + PROCESS_QUERY_INFORMATION
 Public Const PROCESS_ALL_ACCESS = &H1F0FFF
 Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Int32, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
 Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Byte(), ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
 Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByVal lpBuffer() As Byte, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
 Public Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As UInteger, ByVal bInheritHandle As Integer, ByVal dwProcessId As UInteger) As IntPtr
 Public Declare Function CloseHandle Lib "kernel32.dll" (ByVal hHandle As IntPtr) As Boolean
 Public Function Game_Hwnd() As Int32
 Dim i As Int32 : Dim foundit As Boolean = False
 For Each p As Process In Process.GetProcessesByName("Crossfire") ' Replace that with the games window text
 i = p.Id
 foundit = True : Exit For
 Next
 If foundit = True Then
 Return i
 Else
 Return 0
 End If
 End Function

 
#Region "Memory reading/Writing"
 Private Sub Label9_Click(ByVal Address As Integer, ByVal Value As Integer, ByVal Size As Integer, ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click
 Try
 Dim GameReadWrite As Integer
 Dim PID As Integer = Game_Hwnd()
 GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

 
Dim bytArray() As Byte
 bytArray = BitConverter.GetBytes(Value)
 WriteProcessMemory(GameReadWrite, Address, bytArray, Size, 0)

 
CloseHandle(GameReadWrite)
 Catch Ex As Exception
 'ShowError(Ex)
 End Try
 End Sub
 #End Region
i cant edit anymore so i will leave it
he told you to make it like abel did to be easily readable
I'm do not know VB so i can not help you , but ask @Code[VB] he can help you
Quote Originally Posted by Ryuesi View Post
I'm do not know VB so i can not help you , but ask @Code[VB] he can help you
Stop spamming plz

@kmanev073
try copying the data between private sub ....... etc and end sub
then delete this part and double click on the label again to see if there is mistakes...
@giniyat101 i tried but it wnat declarations that i can only declare in the private sub so i write this topic
@kmanev073
the error on this line:
Code:
Private Sub Label9_Click(Address As Integer, Value As Integer, Size As Integer, sender As Object, e As System.EventArgs)
change to:
Code:
Private Sub Label9_Click(sender As Object, e As System.EventArgs
done!
yea but in that way i can define the value and these this make other mistakes
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?