Unhidden Content - Enjoy The View!
ก่อนอื่นเลย ใส่ Private ก่อนนะครับ มี Code ดังนี้
Code:
Private Declare Function ReadProcessMemory Lib "KERNEL32" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Long, ByVal Size As Integer, ByRef BytesWritten As Integer) As Long
Private Declare Function WriteProcessMemory Lib "KERNEL32" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Long, ByVal Size As Integer, ByRef BytesWritten As Integer) As Long
ก่อน อื้นเลย มาลอง ReadProcessmemory กันก่อน ให้สร้าง คำสั่ง ดังนี้ ใน ปุ่มกด หรือ Timer ก้ได้นะ
*ควรจะสร้าง Textbox หรือ Label มาด้วยนะครับ ใช้ แสดง ค่า Value นะ
ใส่ Code ดังนี้ ใน ปุ่มกด หรือ Timer นะครับ
Code:
Dim Open = Process.GetProcessesByName("Game") 'ใน วงเล็บนั้น คือ ชื่อ โปรแกรมที่ Process นะครับ โดยไม่ต้องใส่ .exe
If Open.Length = 1 Then 'จะทำงานเมื่อโปรแกรมนั้น ออนไลน์ อยู่
Dim Value As Long
ReadProcessMemory(Open(0).Handle, &H(address), Value, 4, 0) ' ตรง &H(address) ให้ใส่ Address ต่อ &H ไปเลย เช่น &H1E51211
Textbox1.text = value ' Value นั้น คือ ค่า Value ของ Address ที่เรากำหนดไว้ ไปให้แสดงที่ Textbox1 นะครับ
End If
ต่อไปเราก้ลองมา WriteProcessMemory นะครับ
ใส่ Code ดังนี้ภายในปุ่ม กด หรือ Timer นะครับ
Code:
Dim open = Process.GetProcessesByName("Game")'ใน วงเล็บนั้น คือ ชื่อ โปรแกรมที่ Process นะครับ โดยไม่ต้องใส่ .exe
If Open.Length = 1 Then 'จะทำงานเมื่อโปรแกรมนั้น ออนไลน์ อยู่
WriteProcessMemory(Open(0).Handle, &H(address), 99999, 4, 0) '&H นั้นคำอธิบายเหมือน Read ด่านบนนะ สวน 99999 ตรงตำแหน่ง Value นั้นเป็น Value ที่เรา ส่งเข้าไปใหม่ นะครับ
End if
ยังงัยก้ลอง ศีกษาดูนะครับ เริ่ม ๆ อาจจะยากซะหน่อย แต่พอ ใช้จน ชิน ๆ เดียวก้เป็นครับ