Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 17:01

  • Please register to post and access all features, it's quick, easy and FREE!

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.

Reply
 
Old 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.
jacky919 is offline  
Old 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
Masterscripter is offline  
Old 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?
jacky919 is offline  
Old 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.
Masterscripter is offline  
Old 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 
jacky919 is offline  
Old 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.
Masterscripter is offline  
Old 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
jacky919 is offline  
Old 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
Masterscripter is offline  
Old 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.
jacky919 is offline  
Old 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?
Masterscripter is offline  
Old 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
jacky919 is offline  
Old 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
Masterscripter is offline  
Old 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.
jacky919 is offline  
Old 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?
Masterscripter is offline  
Old 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.
jacky919 is offline  
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.