{Frage}Multipointer einbinden aber wie?

09/01/2010 18:15 maxi39#1
Tach,
ich wollte fragen wie ich einen multipointer einbinden kann in einen autoit script, meine ersten anfänge sehen so aus:


Code:
#include NomadMemory

$GamePid1 = ProcessExists ("mc2.exe")
$GameHandle1 = _MemoryOpen($GamePid1)
$BaseAdresse1 = 0x0174D81

Dim $nitrofr[6]
$nitrofr[0]=0
$nitrofr[1]= 0x10
$nitrofr[2]= 0x1d0
$nitrofr[3]= 0x0
$nitrofr[4]= 0x10
$nitrofr[5]= 0x0


 _MemoryPointerWrite($BaseAdresse1,$GameHandle1,$nitrofr, $BaseAdresse1)
der Pointer in CE sieht so aus:
[Only registered and activated users can see links. Click Here To Register...]


Gelöst :


PHP Code:
#RequireAdmin 
#include <Pointer.au3> 

HotKeySet("{F1}""_Read"

$PID ProcessExists("mc2.exe"
If 
$PID 0 Then 
    $Handle 
_MemoryOpen($PID
    
$Address _MemoryModuleGetBaseAddress(ProcessExists("mc2.exe"), "mc2.exe"
    
$Address "0x" Hex($Address Dec("174D81")) 
    
Dim $Offset[6] = [000x1000x1D00x10
Else 
    Exit 
EndIf 

While 
True 
    Sleep
(10
WEnd 

Func _Read
() 
    
$Read _MemoryPointerRead($Address$Handle$Offset"float"
    
MsgBox(0""$Read[1]) 
EndFunc 

und das script in die pointer.au3 udf einfügen:

PHP Code:
Func _MemoryModuleGetBaseAddress($iPID$sModule)
If 
Not ProcessExists($iPIDThen Return SetError(100)
If 
Not IsString($sModuleThen Return SetError(200)
Local $PSAPI DllOpen("psapi.dll")
Local $hProcess
Local $PERMISSION 
BitOR(0x00020x04000x00080x00100x0020)
If 
$iPID 0 Then
Local $hProcess 
DllCall("kernel32.dll""ptr""OpenProcess""dword"$PERMISSION"int"0"dword"$iPID)
If 
$hProcess[0Then
$hProcess 
$hProcess[0]
EndIf
EndIf
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($Modules1$i)), "wstr""""dword"260)
If 
$aTemp[3] = $sModule Then
DllClose
($PSAPI)
Return 
Ptr(DllStructGetData($Modules1$i))
EndIf
Next
EndIf
DllClose($PSAPI)
Return 
SetError(-100)
EndFunc 
09/01/2010 18:28 omer36#2
PHP Code:
Global $nitrofr[6] = [00x100x1d00x00x100x0
€ wenn ich mich recht erinnere, sollte manns von unten nach oben machen,bin mir aber nicht mehr sicher...
also:
PHP Code:
Global $nitrofr[6] = [00x00x100x00x1D00x10
09/01/2010 18:41 maxi39#3
funktioniert beides nicht, in CE verändert sich der wert nicht
09/01/2010 18:51 omer36#4
Quote:
Originally Posted by maxi39 View Post
funktioniert beides nicht, in CE verändert sich der wert nicht
kann so auch nicht wirklich was bringen, da du hiernach:
PHP Code:
 _MemoryPointerWrite($BaseAdresse1,$GameHandle1,$nitrofr, [U]$BaseAdresse1[/U]) 
nichts änderst


versuchs mal so:

PHP Code:
HotKeySet("{F1}""_start")

WinWaitActive("[CLASS:mc2.exe]")
$GameHandle1 _MemoryOpen(ProcessExists("mc2.exe"))
If @
error Then MsgBox(4096"Fehler""Das richtige Fenster konnte nicht gefunden werden")

$BaseAdresse1 0x0174D81
Global $nitrofr[6] = [00x00x100x00x1D00x10]

Func _start()
 
_MemoryPointerWrite($BaseAdresse1,$GameHandle1,$nitrofr"hier der neue wert")
EndFunc 
09/01/2010 19:03 maxi39#5
ich habs so gestartet

Code:
#include <NomadMemory.au3>
#RequireAdmin
HotKeySet("{F1}", "_start")

WinWaitActive("[CLASS:mc2.exe]")
$GameHandle1 = _MemoryOpen(ProcessExists("mc2.exe"))
If @error Then MsgBox(4096, "Fehler", "Das richtige Fenster konnte nicht gefunden werden")

$BaseAdresse1 = 0x0174D81
Global $nitrofr[6] = [0, 0x0, 0x10, 0x0, 0x1D0, 0x10]

Func _start()
 _MemoryPointerWrite($BaseAdresse1,$GameHandle1,$nitrofr, 3)
EndFunc
das einzige was passiert ist das der wert gleich bleibt und sich das script schließt.
09/01/2010 19:06 maxi39#6
wenn ich mit Cheat engine einen trainer erstelle und da den multipointer einfüge klappt das, aber irwi mit autoit nicht , liegt das an der UDF vieleicht?
09/01/2010 19:08 omer36#7
wenns sich direkt schließt, versuch mal ganz unten
while 1
sleep(100)
wend
zu schreiben, und die 3 mit anführungszeichen... "3"


€ oder:

PHP Code:
AdlibRegister(_MemoryPointerWrite($BaseAdresse1,$GameHandle1,$nitrofr"3"
09/01/2010 19:56 maxi39#8
funktioniert alles nicht...
sieht zur zeit so aus:

#RequireAdmin
#include <NomadMemory.au3>

HotKeySet("{F1}", "_start")


$GameHandle1 = _MemoryOpen(ProcessExists("mc2.exe"))
If @error Then MsgBox(4096, "Fehler", "Das richtige Fenster konnte nicht gefunden werden")

$BaseAdresse1 = 0x0174D81
Global $nitrofr[6] = [0, 0x0, 0x10, 0x0, 0xc, 0x34] ;hab andern pointer probiert, hab auch den alten benutzt

Func _start()
Beep(909,654)
AdlibRegister(_MemoryPointerWrite($BaseAdresse1,$G ameHandle1,$nitrofr, "3"))

EndFunc
While 1
Sleep(100)
WEnd

sollte ich vlt eine andere UDF benutzen pointer.au3 oder meomory.au3 ? oder hat der script noch irgendwelche fehler
09/01/2010 20:09 omer36#9
schau mal nach, ob deine nomadmemory die _memorypointerwrite function drin hatt...
und wenn die adressen stimmen, müsste es eig. gehen...
glaube nicht, das ich da nen fehler gemacht habe :/
09/01/2010 20:18 maxi39#10
ja hat sie:

Code:
;=================================================================================================
; Function:			_MemoryPointerWrite ($iv_Address, $ah_Handle, $av_Offset, $v_Data(, $sv_Type))
; Description:		Reads a chain of pointers and writes the data to the destination address.
; Parameter(s):		$iv_Address - The static memory address you want to start at. It must be in
;								  hex format (0x00000000).
;					$ah_Handle - An array containing the Dll handle and the handle of the open
;								 process as returned by _MemoryOpen().
;					$av_Offset - An array of offsets for the pointers.  Each pointer must have an
;								 offset.  If there is no offset for a pointer, enter 0 for that
;								 array dimension.
;					$v_Data - The data to be written.
;					$sv_Type - (optional) The "Type" of data you intend to write at the destination
;								 address.  This is set to 'dword'(32bit(4byte) signed integer) by
;								 default.  See the help file for DllStructCreate for all types.
; Requirement(s):	The $ah_Handle returned from _MemoryOpen.
; Return Value(s):	On Success - Returns the destination address.
;					On Failure - Returns 0.
;					@Error - 0 = No error.
;							 1 = $av_Offset is not an array.
;							 2 = Invalid $ah_Handle.
;							 3 = Failed to read from the specified process.
;							 4 = $sv_Type is not a string.
;							 5 = $sv_Type is an unknown data type.
;							 6 = Failed to allocate the memory needed for the DllStructure.
;							 7 = Error allocating memory for $sv_Type.
;							 8 = $v_Data is not in the proper format to be used with the
;								 "Type" selected for $sv_Type, or it is out of range.
;							 9 = Failed to write to the specified process.
; Author(s):		Nomad
; Note(s):			Data written is in Decimal format, unless a 'char' type is selected.
;					Set $av_Offset like this:
;					$av_Offset[0] = NULL (not used, doesn't matter what's entered)
;					$av_Offset[1] = Offset for pointer 1 (all offsets must be in Decimal)
;					$av_Offset[2] = Offset for pointer 2
;					etc...
;					(The number of array dimensions determines the number of pointers)
;=================================================================================================
Func _MemoryPointerWrite ($iv_Address, $ah_Handle, $av_Offset, $v_Data, $sv_Type = 'dword')

	If IsArray($av_Offset) Then
		If IsArray($ah_Handle) Then
			Local $iv_PointerCount = UBound($av_Offset) - 1
		Else
			SetError(2)
			Return 0
		EndIf
	Else
		SetError(1)
		Return 0
	EndIf

	Local $iv_StructData, $i
	Local $v_Buffer = DllStructCreate('dword')

	For $i = 0 to $iv_PointerCount
		If $i = $iv_PointerCount Then
			$v_Buffer = DllStructCreate($sv_Type)
			If @Error Then
				SetError(@Error + 3)
				Return 0
			EndIf

			DllStructSetData($v_Buffer, 1, $v_Data)
			If @Error Then
				SetError(8)
				Return 0
			EndIf

			$iv_Address = '0x' & hex($iv_StructData + $av_Offset[$i])
			DllCall($ah_Handle[0], 'int', 'WriteProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
			If @Error Then
				SetError(9)
				Return 0
			Else
				Return $iv_Address
			EndIf
		ElseIf $i = 0 Then
			DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
			If @Error Then
				SetError(3)
				Return 0
			EndIf

			$iv_StructData = DllStructGetData($v_Buffer, 1)

		Else
			$iv_Address = '0x' & hex($iv_StructData + $av_Offset[$i])
			DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
			If @Error Then
				SetError(3)
				Return 0
			EndIf

			$iv_StructData = DllStructGetData($v_Buffer, 1)

		EndIf
	Next

EndFunc
09/02/2010 00:13 CroSSiie#11
Ihr vernachlässig das "mc2.exe+174D81"
Ich bekomm das folgendermasen mit rein:

PHP Code:
$open _memoryopen(ProcessExists("mc2.exe"))
$baseaddr _MemoryGetBaseAddress($open1)
$static Dec("000174D81")
$adresse "0x" Hex($baseaddr $static
Dann noch die Offsets und am Ende schaut das so aus:

PHP Code:
#RequireAdmin
#include <Pointer.au3>

HotKeySet("{F1}""_start")


$open _memoryopen(ProcessExists("mc2.exe"))
$baseaddr _MemoryGetBaseAddress($open1)
$static Dec("000174D81")
$adresse "0x" Hex($baseaddr $static)
$offset[6] = [00Dec("10"), 0Dec("C"), Dec("34")]

Func _start()
Beep(909,654)
AdlibRegister(_MemoryPointerRead($adresse$open$offset'dword'"3"))

EndFunc

While 1
Sleep
(100)
WEnd 
wieso ich die in dec umgewandelt hatte weiß ich nimmer xD
ist schon alt das script xD
09/02/2010 00:57 maxi39#12
Wenn ich den code so ausführe:


PHP Code:
#RequireAdmin
#include <Pointer.au3>

HotKeySet("{F1}""_start")


$open _memoryopen(ProcessExists("mc2.exe"))
$baseaddr _MemoryGetBaseAddress($open1)
$static Dec("000174D81")
$adresse "0x" Hex($baseaddr $static)
$offset[6] = [00Dec("10"), 0Dec("C"), Dec("34")]

Func _start()
Beep(909,654)
AdlibRegister(_MemoryPointerRead($adresse$open$offset'dword'"3"))

EndFunc

While 1
Sleep
(100)
WEnd 

bekomme ich eine fehler meldung das bei den offsets was nicht stimmt:
PHP Code:
C:\Users\marcel\Desktop\meine CE\trainer.au3(11,14) : ERRORsyntax error
$offset
[6] = [
~~~~~~~~~~~~~^
C:\Users\marcel\Desktop\meine CE\trainer.au3(11,55) : WARNING$offset possibly not declared/created yet
$offset
[6] = [00Dec("10"), 0Dec("C"), Dec("34")]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\marcel\Desktop\meine CE\trainer.au3(15,72) : ERROR_MemoryPointerRead() called with wrong number of args.
AdlibRegister(_MemoryPointerRead($adresse$open$offset'dword'"3")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Program Files\AutoIt3\Include\Pointer.au3(250,82) : REFdefinition of _MemoryPointerRead().
Func _MemoryPointerRead ($iv_Address$ah_Handle$av_Offset$sv_Type 'dword')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\marcel\Desktop\meine CE\trainer.au3 2 error(s), 1 warning(s
09/02/2010 01:06 lolkop#13
setz halt ein Dim, Global, Local oda Const davor -.-
wenn du ein array definierst, musst du dem computer schon sagen das du da was definieren willst
09/02/2010 13:33 maxi39#14
ok hab ich :


PHP Code:
#RequireAdmin
#include <Pointer.au3>

HotKeySet("{F1}""_start")


 
$open _memoryopen(ProcessExists("mc2.exe"))
$baseaddr _MemoryGetBaseAddress($open1)
 
$static Dec("000174D81")
 
$adresse "0x" Hex($baseaddr $static)
Global 
$offset[6] = [00Dec("10"), 0Dec("C"), Dec("34")]

Func _start()
Beep(909,654)
AdlibRegister(_MemoryPointerRead($adresse$open$offset'dword'"3"))

EndFunc

While 1
Sleep
(100)
WEnd 







trotzdem fehler:

PHP Code:
C:\Users\marcel\Desktop\meine CE\trainer.au3(15,72) : ERROR_MemoryPointerRead() called with wrong number of args.
AdlibRegister(_MemoryPointerRead($adresse$open$offset'dword'"3")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Program Files\AutoIt3\Include\Pointer.au3(250,82) : REFdefinition of _MemoryPointerRead().
Func _MemoryPointerRead ($iv_Address$ah_Handle$av_Offset$sv_Type 'dword')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\marcel\Desktop\meine CE\trainer.au3 1 error(s), 0 warning(s
die funktion ist _memorypointeread ist auch in der udf vorhanden, muss es nicht _memorypointerwrite heißen?
09/02/2010 14:34 omer36#15
warum wurde denn aus _MemoryPointerWrite plötzlich _MemoryPointerRead ?
wenn du read machst, muss die 3 weg.
wenn du write machst, muss tdu erst 3 dann dword machen