Cheat Engine Pointer einbauen

01/06/2013 20:19 EasyFarm#1
Hi

Ich habe folgende Frage:

Wie kann ich per Autoit einen Pointer von einem Spiel verändern?

So sieht der Pointer aus:

[Only registered and activated users can see links. Click Here To Register...]

Im Oberen Teil des Bildes ist er nach dem Suchlauf.

So sieht er aus in meiner Liste: Im unteren Teil des Bildes.


Wie baue ich ihn in meinen Code ein?:

Quote:
#RequireAdmin
#include <Pointer.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Beispielhack 1.3", 389, 38, 192, 124)
$Input1 = GUICtrlCreateInput("", 8, 8, 241, 21)
$Button1 = GUICtrlCreateButton("On", 256, 8, 57, 17, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Off", 320, 8, 57, 17, $WS_GROUP)
GUISetState(@SW_SHOW)

Dim $Speedhack[3] = [0, 0x420, 0x66A]
$Base = 0x002ED9B0
$Handle = _MemoryOpen(ProcessExists("metin2.bin"))

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_MemoryPointerWrite($Base, $Handle, $Speedhack,GuiCtrlRead($Input1))
Case $Button2
_MemoryPointerWrite($Base, $Handle, $Speedhack,16230)
EndSwitch
Wend
Habe ja 2 offsets, aber er verändert es bei mir nicht..

Weiss einer Rat?

Und wie schaffe ich es, dass ich das Byte verändern kann?

Mfg. EasyFarm
01/07/2013 03:28 BladeTiger12#2
Code:
#RequireAdmin
#include <Pointer.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Dim $Speedhack[2] = [0x554, 0x16D]
$Process = ProcessExists("metin2.bin")
$Module = _MemoryModuleGetBaseAddress($Process , "metin2.bin")
$Pointer = $Module + 0x0001A70C
$Handle = _MemoryOpen($Process)

$Form1 = GUICreate("Beispielhack 1.3", 389, 38, 192, 124)
$Input1 = GUICtrlCreateInput("", 8, 8, 241, 21)
$Button1 = GUICtrlCreateButton("On", 256, 8, 57, 17, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Off", 320, 8, 57, 17, $WS_GROUP)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			For $i = 0 To UBound($Speedhack) -1
				$Read = _MemoryRead($Pointer , $Handle) + $Speedhack[$i]
			Next
			_MemoryWrite($Read , $Handle , GUICtrlRead($Input1))
		Case $Button2
			For $i = 0 To UBound($Speedhack) -1
				$Read = _MemoryRead($Pointer , $Handle) + $Speedhack[$i]
			Next
			_MemoryWrite($Read , $Handle , 16230)
	EndSwitch
Wend

Func _MemoryModuleGetBaseAddress($iPID, $sModule)
    If Not ProcessExists($iPID) Then Return SetError(1, 0, 0)

    If Not IsString($sModule) Then Return SetError(2, 0, 0)

    Local   $PSAPI = DllOpen("psapi.dll")

    ;Get Process Handle
    Local   $hProcess
    Local   $PERMISSION = BitOR(0x0002, 0x0400, 0x0008, 0x0010, 0x0020) ; CREATE_THREAD, QUERY_INFORMATION, VM_OPERATION, VM_READ, VM_WRITE

    If $iPID > 0 Then
        Local $hProcess = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", $PERMISSION, "int", 0, "dword", $iPID)
        If $hProcess[0] Then
            $hProcess = $hProcess[0]
        EndIf
    EndIf

    ;EnumProcessModules
    Local   $Modules = DllStructCreate("ptr[1024]")
    Local   $aCall = DllCall($PSAPI, "int", "EnumProcessModules", "ptr", $hProcess, "ptr", DllStructGetPtr($Modules), "dword", DllStructGetSize($Modules), "dword*", 0)
    If $aCall[4] > 0 Then
        Local   $iModnum = $aCall[4] / 4
        Local   $aTemp
        For $i = 1 To $iModnum
            $aTemp =  DllCall($PSAPI, "dword", "GetModuleBaseNameW", "ptr", $hProcess, "ptr", Ptr(DllStructGetData($Modules, 1, $i)), "wstr", "", "dword", 260)
            If $aTemp[3] = $sModule Then
                DllClose($PSAPI)
                Return Ptr(DllStructGetData($Modules, 1, $i))
            EndIf
        Next
    EndIf

    DllClose($PSAPI)
    Return SetError(-1, 0, 0)

EndFunc
Meinst du es so?
01/07/2013 07:34 KDeluxe#3
Beide Scripts sind unbrauchbar... Vor allem das von BladeTiger12.

Code:
For $i = 0 To UBound($Speedhack) -1
	$Read = _MemoryRead($Pointer , $Handle) + $Speedhack[$i]
Next
_MemoryWrite($Read , $Handle , GUICtrlRead($Input1))
Macht nichts anderes als:
Code:
$Read = _MemoryRead($Pointer , $Handle) + $Speedhack[UBound($Speedhack) -1]
_MemoryWrite($Read , $Handle , GUICtrlRead($Input1))
Würde bei einem Offset noch funktionieren, in diesem Fall sind es aber zwei und es funktioniert nicht.



Behalte einfach die "_MemoryPointer...()" Funktionen bei. Beim letzten Parameter gibst du den Datentyp an.
[Only registered and activated users can see links. Click Here To Register...] (1 Byte = 8 Bit)

Eine Frage meinerseits: Wieso weicht das Script vollständig vom Screenshot ab?
01/07/2013 14:01 EasyFarm#4
So habs nun so probiert:

Quote:
#RequireAdmin
#include <Pointer.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Beispielhack 1.0", 389, 38, 192, 124)
$Input1 = GUICtrlCreateInput("", 8, 8, 241, 21)
$Button1 = GUICtrlCreateButton("On", 256, 8, 57, 17, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Off", 320, 8, 57, 17, $WS_GROUP)
GUISetState(@SW_SHOW)

Dim $Speedhack[3] = [0, 0x169, 0x554]
$Base = 0x0001A70C
$Handle = _MemoryOpen(ProcessExists("Engine.exe"))

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_MemoryPointerWrite($Base, $Handle, $Speedhack,GuiCtrlRead($Input1))
Case $Button2
_MemoryPointerWrite($Base, $Handle, $Speedhack,16230)
EndSwitch
Wend
Geht nicht.

Bei Bladetigers Code ein Fehler:
Quote:
Func _MemoryModuleGetBaseAddress($iPID, $sModule)
Hilfe nochmal bitte.
Mfg. Easy
01/07/2013 14:26 BladeTiger12#5
Code:
#RequireAdmin
#include <Pointer.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Dim $Speedhack[2] = [0x554, 0x16D]
$Process = ProcessExists("metin2.bin")
$Module = _MemoryModuleGetBaseAddress($Process , "metin2.bin")
$Pointer = $Module + 0x0001A70C
$Handle = _MemoryOpen($Process)

$Form1 = GUICreate("Beispielhack 1.3", 389, 38, 192, 124)
$Input1 = GUICtrlCreateInput("", 8, 8, 241, 21)
$Button1 = GUICtrlCreateButton("On", 256, 8, 57, 17, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Off", 320, 8, 57, 17, $WS_GROUP)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			$Read = _MemoryRead($Pointer , $Handle) + $Speedhack[0]
                        $Read = _MemoryRead($Pointer , $Handle) + $Speedhack[1]
			_MemoryWrite($Read , $Handle , GUICtrlRead($Input1))
		Case $Button2
			$Read = _MemoryRead($Pointer , $Handle) + $Speedhack[0]
                        $Read = _MemoryRead($Pointer , $Handle) + $Speedhack[1]
			_MemoryWrite($Read , $Handle , 16230)
	EndSwitch
Wend

Func _MemoryModuleGetBaseAddress($iPID, $sModule)
    If Not ProcessExists($iPID) Then Return SetError(1, 0, 0)

    If Not IsString($sModule) Then Return SetError(2, 0, 0)

    Local   $PSAPI = DllOpen("psapi.dll")

    ;Get Process Handle
    Local   $hProcess
    Local   $PERMISSION = BitOR(0x0002, 0x0400, 0x0008, 0x0010, 0x0020) ; CREATE_THREAD, QUERY_INFORMATION, VM_OPERATION, VM_READ, VM_WRITE

    If $iPID > 0 Then
        Local $hProcess = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", $PERMISSION, "int", 0, "dword", $iPID)
        If $hProcess[0] Then
            $hProcess = $hProcess[0]
        EndIf
    EndIf

    ;EnumProcessModules
    Local   $Modules = DllStructCreate("ptr[1024]")
    Local   $aCall = DllCall($PSAPI, "int", "EnumProcessModules", "ptr", $hProcess, "ptr", DllStructGetPtr($Modules), "dword", DllStructGetSize($Modules), "dword*", 0)
    If $aCall[4] > 0 Then
        Local   $iModnum = $aCall[4] / 4
        Local   $aTemp
        For $i = 1 To $iModnum
            $aTemp =  DllCall($PSAPI, "dword", "GetModuleBaseNameW", "ptr", $hProcess, "ptr", Ptr(DllStructGetData($Modules, 1, $i)), "wstr", "", "dword", 260)
            If $aTemp[3] = $sModule Then
                DllClose($PSAPI)
                Return Ptr(DllStructGetData($Modules, 1, $i))
            EndIf
        Next
    EndIf

    DllClose($PSAPI)
    Return SetError(-1, 0, 0)

EndFunc