ดูให้ทีครับ ว่าผิดตรงไหน
รันแล้วไม่มีไรเกินขึ่นเลย
รันแล้วไม่มีไรเกินขึ่นเลย
แก้ไขล่าสุดโดย beer02 เมื่อ 23/01/12, 01:03 pm, ทั้งหมด 8 ครั้ง
#cs
การอ่านและเขียนค่าลงพ้อยเตอร์แบบชั้นเดียว
ค่าพ้อยเตอร์จะเป็นตัวชี้ไปยังตำแหน่งแอดเดรสที่มีการเปลี่ยนแปลง
ซึ่งแอดเดรสดังกล่าวจะเปลี่ยนไปทุกครั้งที่มีการเปิดโปรแกรมขึ้นมาใหม่
การใช้ค่าพ้อยเตอร์แบบชั้นเดียวต้องอาศัย ค่าแอดเดรส กับ ค่าออฟเซ็ต เพื่อชี้ไปยังตำแหน่งที่ต้องการจะอ่านหรือเขียนค่าลงไป
#ce
#AutoIt3Wrapper_UseX64=n
#RequireAdmin
#include <NomadMemoryPSsix.au3>
Global $address = "0x6D4E0EA0" ;ค่าพ้อยเตอร์ที่ต้องนำไปใช้คู่กับค่าออฟเซ็ต
Global $Offset[5]
$Offset[0] = 0 ; ใส่ 0 เป็นค่าเริ่ต้นทุกทครั้ง
$Offset[1] = 0x70
$Offset[2] = 0x40
$Offset[3] = 0x34
$Offset[4] = 0x290
$memopen = _MEMORYOPEN(ProcessExists("amped.exe")) ;เปลี่ยนชื่อไฟล์เกมส์
If $memopen = 0 Then
ConsoleWrite('ผิดพลาดไม่มีโปรแกรม =' & $memopen & @CRLF)
Exit
EndIf
$value = _MemoryPointerRead($address, $memopen, $Offset) ; อ่านค่าจากพ้อยเตอร์จะเก็บไว้ในตัวแปร $value[1]
ConsoleWrite('ค่าที่อ่านได้จากแอดเดรส ' & $value[0] & ' = ' & $value[1] & @CRLF)
_MemoryPointerWrite($address, $memopen, $Offset, "666666") ;เขียนค่า
ConsoleWrite('เปลี่ยนแปลงค่าเป็น 666666 เรียบร้อยแล้ว ' & @CRLF)
_MEMORYCLOSE($memopen) ;ปิดการอ่านหน่วยความจำ นำไปวางไว้ท้ายสุดเมื่อไม่ต้องการอ่านหรือเขียนแล้ว เช่น ตอนปิดโปรแกรม
#AutoIt3Wrapper_UseX64=n
#RequireAdmin
#include <NomadMemoryPSsix.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Opt("GUIOnEventMode", 1)
Global $address = "0x6D4E0EA0" ;ค่าพ้อยเตอร์ที่ต้องนำไปใช้คู่กับค่าออฟเซ็ต
Global $Offset[5]
$Offset[0] = 0 ; ใส่ 0 เป็นค่าเริ่ต้นทุกทครั้ง
$Offset[1] = 0x70 ;ล่างสุด
$Offset[2] = 0x40 ;ถัดจากล่างขึ้นไปหนึ่งชั้น
$Offset[3] = 0x34 ;ถัดจากล่างขึ้นไปหนึ่งชั้น
$Offset[4] = 0x290 ;บนสุด
$memopen = _MEMORYOPEN(ProcessExists("amped.exe")) ;เปลี่ยนชื่อไฟล์เกมส์
If $memopen = 0 Then
ConsoleWrite('ผิดพลาดไม่มีโปรแกรม =' & $memopen & @CRLF)
Exit
EndIf
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("PSsix", 264, 102, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("เขียนค่า", 176, 16, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
$Label1 = GUICtrlCreateLabel("Label1", 8, 16, 163, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(1000)
$value = _MemoryPointerRead($address, $memopen, $Offset,"float")
ConsoleWrite('ค่าที่อ่านได้จากแอดเดรส ' & $value[0] & ' = ' & $value[1] & @CRLF)
GUICtrlSetData($Label1,$value[1])
WEnd
Func Button1Click()
_MemoryPointerWrite($address, $memopen, $Offset,"8","float")
EndFunc
Func Form1Close()
_MEMORYCLOSE($memopen)
Exit
EndFunc
#AutoIt3Wrapper_UseX64=n
#RequireAdmin
#include <NomadMemoryPSsix.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Opt("GUIOnEventMode", 1)
Global $address = "0x6D4E0EA0" ;ค่าพ้อยเตอร์ที่ต้องนำไปใช้คู่กับค่าออฟเซ็ต
Global $Offset[5]
$Offset[0] = 0 ; ใส่ 0 เป็นค่าเริ่ต้นทุกทครั้ง
$Offset[1] = 0x70 ;ล่างสุด
$Offset[2] = 0x40 ;ถัดจากล่างขึ้นไปหนึ่งชั้น
$Offset[3] = 0x34 ;ถัดจากล่างขึ้นไปหนึ่งชั้น
$Offset[4] = 0x290 ;บนสุด
$memopen = _MEMORYOPEN(ProcessExists("amped.exe")) ;เปลี่ยนชื่อไฟล์เกมส์
If $memopen = 0 Then
ConsoleWrite('ผิดพลาดไม่มีโปรแกรม =' & $memopen & @CRLF)
Exit
EndIf
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("PSsix", 264, 102, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("เขียนค่า", 176, 16, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
$Label1 = GUICtrlCreateLabel("Label1", 8, 16, 163, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(1000)
$value = _MemoryPointerRead($address, $memopen, $Offset)
ConsoleWrite('ค่าที่อ่านได้จากแอดเดรส ' & $value[0] & ' = ' & $value[1] & @CRLF)
GUICtrlSetData($Label1,$value[1])
WEnd
Func Button1Click()
_MemoryPointerWrite($address, $memopen, $Offset,"20")
EndFunc
Func Form1Close()
_MEMORYCLOSE($memopen)
Exit
EndFunc
|
|