|
You last visited: Today at 17:01
Advertisement
[Memory read] Baseadresse mit Script rausfinden?
Discussion on [Memory read] Baseadresse mit Script rausfinden? within the AutoIt forum part of the Coders Den category.
03/17/2012, 15:58
|
#16
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Poste mal die Implementierung der _MemoryModuleGetBaseAddress Funktion.
|
|
|
03/17/2012, 16:02
|
#17
|
elite*gold: 0
Join Date: Oct 2010
Posts: 167
Received Thanks: 24
|
Code:
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
|
|
|
03/17/2012, 16:08
|
#18
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Was ist denn @error nach dem Aufruf der Funktion?
|
|
|
03/17/2012, 16:12
|
#19
|
elite*gold: 0
Join Date: Oct 2010
Posts: 167
Received Thanks: 24
|
Wenn beim Öffnen des Prozesses kein Fehler auftritt, dann macht er weiter. Das bedeutet das. Also wenn jetzt beispielsweise der Prozess noch nicht gestartet wurde, dann liest er auch nicht, weil eben ein Fehler aufgetreteten ist. Und wenn der Prozess vorhanden ist und kein Fehler auftritt, dann macht er weiter.
|
|
|
03/17/2012, 16:16
|
#20
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Nein ich meine:
PHP Code:
#RequireAdmin
#include <NoMadMemory.au3>
HotKeySet("{F1}", "_Read")
$PID = ProcessExists("aion.bin")
If $PID > 0 Then
$Handle = _MemoryOpen($PID)
$Address = _MemoryModuleGetBaseAddress(ProcessExists("aion.bin"), "Game.dll")
MsgBox(0, "error", @error)
$Address = "0x" & Hex($Address + Dec("9C01C"))
Dim $Offset[2] = [0,0x4]
Else
Exit
EndIf
While True
Sleep(10)
WEnd
Func _Read()
$Read = _PointerRead($Address, $Handle, $Offset, "float")
MsgBox(0, "", $Read[1])
EndFunc
|
|
|
03/17/2012, 16:20
|
#21
|
elite*gold: 0
Join Date: Oct 2010
Posts: 167
Received Thanks: 24
|
Code:
MsgBox(0, "error", @error)
Das steht doch garnich in meinem Script.
|
|
|
03/17/2012, 16:22
|
#22
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Deswegen sollst du es ja ausprobieren und mir sagen was ausgegeben wird
|
|
|
03/17/2012, 16:53
|
#23
|
elite*gold: 0
Join Date: Oct 2010
Posts: 167
Received Thanks: 24
|
Okay habs ausprobiert und dann kommt die Meldung:
"Error"
und in der Msgbox steht -1
|
|
|
03/17/2012, 17:06
|
#24
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Das Modul scheint nicht gefunden worden zu sein.
Code:
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
MsgBox(0, "process", "Process Handle = " & $hProcess[0])
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
$sModules = ""
For $i = 1 To $iModnum
$aTemp = DllCall($PSAPI, "dword", "GetModuleBaseNameW", "ptr", $hProcess, "ptr", Ptr(DllStructGetData($Modules, 1, $i)), "wstr", "", "dword", 260)
$sModules &= $aTemp[3] & @crlf
If $aTemp[3] = $sModule Then
DllClose($PSAPI)
Return Ptr(DllStructGetData($Modules, 1, $i))
EndIf
Next
MsgBox(0, "modules", $sModules)
EndIf
DllClose($PSAPI)
Return SetError(-1, 0, 0)
EndFunc
Guck mal was so ausgegeben wird und ob auch dein Modul ausgegeben wird.
|
|
|
03/17/2012, 17:10
|
#25
|
elite*gold: 0
Join Date: Oct 2010
Posts: 167
Received Thanks: 24
|
Okay. Tut mir leid, aber ich weiß nicht genau was ich jetzt machen soll. Wie meinst du das?
|
|
|
03/17/2012, 17:12
|
#26
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Ich habe ein wenig was an der _MemoryModuleGetBaseAddress verändert. Probier sie mal aus und berichte ir von den Ausgaben
|
|
|
03/17/2012, 17:16
|
#27
|
elite*gold: 0
Join Date: Oct 2010
Posts: 167
Received Thanks: 24
|
Hmm also jetzt kommt ne Fehlermeldung:
Uploaded with
|
|
|
03/17/2012, 17:24
|
#28
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Dann haben wir unseren Schuldigen gefunden
PHP Code:
Local $hProcess = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", $PERMISSION, "int", 0, "dword", $iPID)
DllCall sollte ein Array zurückgeben. Das erste Element ist der Rückgabewert der Funktion, die mit DllCall aufgerufen wurde. Folglich, davon ausgegangen, dass nicht auf das erste Element zugegriffen werden kann, ist etwas schief gegangen.
|
|
|
03/17/2012, 17:34
|
#29
|
elite*gold: 0
Join Date: Oct 2010
Posts: 167
Received Thanks: 24
|
Hmm okay. Und was nun? Gibt es irgendeine andere Möglichkeit?
|
|
|
03/17/2012, 18:05
|
#30
|
elite*gold: 50
Join Date: Mar 2010
Posts: 1,373
Received Thanks: 521
|
Lass dir mal @error nach dem Aufruf ausgeben.
|
|
|
 |
|
Similar Threads
|
[VB.NET] Read memory help
03/25/2011 - .NET Languages - 7 Replies
Ok so im looking for some one that can help me to read a procces memory from a game and show it on a label in vb.net so if the HP changes then the label will change.
Please help me here cant find anything on google, also how to send keys to the game
|
Suche Script für Memory Read
03/04/2011 - AutoIt - 1 Replies
Kann mir einer ein Script geben ohne GUI, mit NoMadMemory include wo ich die Read Memory Funktion nutzen kann?
Würde mich auch über ein VB Script freuen!
Möchte für 4Story Global ein Log Buch machen!
|
VB.NET Read Memory
11/08/2010 - .NET Languages - 1 Replies
jo Hi,
Ich suche eine ReadMemory Function. Hat einer eine da?
Danke
|
[VB]Write Memory bzw Read Memory
06/26/2010 - .NET Languages - 8 Replies
Hi
Ich hab das TuT von *Guidman* benütz um einen hack zu machen.
So aber nun hab ihc ein paar fragen könnte man memory teil kürzer machen und am besten wie kann man das selber machen weil ich will nihct immer C&P machen.
Und zu Read Memory kann man das auch machen das ein Label immer die Bestimmte Ahnzahl angiebt von dem Pointer?.(Wenn das Read Memory ist ?)
Bitte helf mir
Danke
|
Memory read and add value
06/20/2010 - AutoIt - 4 Replies
Im trying to read values with HexCode but i have no ide to do this. i want the porgress bar and the labels to show the curent value of the Adresses
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
|
All times are GMT +1. The time now is 17:02.
|
|