Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 11:40

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

Advertisement



Problem mit Memory auslesen..

Discussion on Problem mit Memory auslesen.. within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
MrBlubZ0r's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 72
Received Thanks: 26
Problem mit Memory auslesen..

Hallo,
Also mein Problem besteht darin, ich weiß nicht wie ich pointer wie z.B "nostaleX.dat"+Adresse auslesen kann.. Die normalen pointer sind kein Problem.
Ich möchte include nomadmemory behalten... Also keine pointer.au3

normalerweise trage ich es so ein...

Hoffe mir kann jemand helfen :3


EDIT: LOL wenn ihr den Thread ließt dann seht ihr in der ersten Zeile einen Fehler...
Reloaded die Page und der fehler ist weg :O
MrBlubZ0r is offline  
Old 08/04/2014, 15:00   #2
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
_MemoryModuleGetBaseAdress()

der satz ist schwachsin : "Ich möchte include nomadmemory behalten... Also keine pointer.au3"
YatoDev is offline  
Thanks
1 User
Old 08/04/2014, 15:22   #3
 
MrBlubZ0r's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 72
Received Thanks: 26
Wieso?...
Wenn ich #include NomadMemory.au3 habe kann ich keine #include Pointer.au3 haben...
Könntest du mir kurz Zeigen wie das mit dem _MemoryModuleGetBaseAdress() funktioniert mit dem Beispiel was ich im Spoiler habe?
MrBlubZ0r is offline  
Old 08/04/2014, 15:28   #4
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Natürlich kannst du die haben. Die OriginalNomadMemory hatte die Pointer-Funktionen noch nicht, deshalb ist sie überall mit den Pointer funktionen zu finden.
alpines is offline  
Thanks
1 User
Old 08/04/2014, 15:32   #5
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
Quote:
Originally Posted by alpines View Post
Natürlich kannst du die haben. Die OriginalNomadMemory hatte die Pointer-Funktionen noch nicht, deshalb ist sie überall mit den Pointer funktionen zu finden.
ob die datei nun pointer.au3 oder nomadmemory.au3 heist ist völlig egal. die funktionen wurden ja nur verbessert(bugfixes) und pointer funktionen hinzugefügt.

@TE
doppelklick auf die Memorywieauchimmer.au3 zur MemoryModuleGetBaseAdress funktion scrollen und lesen

Modul == z.B "nostaleX.dat"
YatoDev is offline  
Thanks
1 User
Old 08/04/2014, 16:04   #6
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Zu Debugzwecken kannst du die Standard-Imagebase nehmen oder nimm die Imagebase aus dem CE Debugger. Im Script musst du dann _MemoryModuleGetBaseAddress verwenden.
alpines is offline  
Thanks
1 User
Old 08/04/2014, 16:24   #7
 
MrBlubZ0r's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 72
Received Thanks: 26
Okay ich versuch einfach mal DD
Ich guck mir jetzt erstmal die NomadMemory an ob meine schon die Function hat
Sou Dankeschön schonmal

also ich habe in meiner nomadmemory.au3 keine function wie _MemoryModuleGetBaseAddress
naja Wenn ihr wollt stelle ich mal für kurze zeit mein Script online...
und ihr könnt mir sagen ob ich das so lassen kann wenn ich die nomadmemory durch eine pointer.au3 ersetze..
MrBlubZ0r is offline  
Old 08/04/2014, 16:50   #8
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
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
alpines is offline  
Thanks
1 User
Old 08/04/2014, 17:17   #9
 
MrBlubZ0r's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 72
Received Thanks: 26
Code

Genial Danke.
Eine Frage hab ich noch auf Lager..
Kann ich jetzt dein Script einfach in meine NomadMemory.au3 kopieren?
Super Forum hier.

Naja richtig mieß...
Ich bekomme es einfach nicht hin..

Könnte mir jemand ein Beispiel machen?..
MrBlubZ0r is offline  
Old 08/04/2014, 18:04   #10
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Hier mal für Solitaire.

Code:
#include <NomadMemory.au3>
#AutoIt3Wrapper_UseX64=y
#RequireAdmin
#include <Array.au3>

$iPID = ProcessExists("solitaire.exe")
Local $aOffsets[3] = [0, 0x50, 0x14]

$hOpen = _MemoryOpen($iPID)
$sBase = _MemoryModuleGetBaseAddress($iPID, "solitaire.exe")
$a = _MemoryPointerRead($sBase + 0xBAFA8, $hOpen, $aOffsets)
_ArrayDisplay($a)
_MemoryClose($hOpen)

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

;=================================================================================================
; Function:   _MemoryPointerRead ($iv_Address, $ah_Handle, $av_Offset[, $sv_Type])
; Description:    Reads a chain of pointers and returns an array containing the destination
;               address and the data at the 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.
;               $sv_Type - (optional) The "Type" of data you intend to read 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 an array containing the destination address and the value
;                         located at the address.
;               On Failure - Returns 0
;               @Error - 0 = No error.
;                      1 = $av_Offset is not an array.
;                      2 = Invalid $ah_Handle.
;                      3 = $sv_Type is not a string.
;                      4 = $sv_Type is an unknown data type.
;                      5 = Failed to allocate the memory needed for the DllStructure.
;                      6 = Error allocating memory for $sv_Type.
;                      7 = Failed to read from the specified process.
; Author(s):        Nomad
; Note(s):      Values returned are in Decimal format, unless a 'char' type is selected.
;               Set $av_Offset like this:
;               $av_Offset[0] = NULL (not used)
;               $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 _MemoryPointerRead($iv_Address, $ah_Handle, $av_Offset, $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_Data[2], $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 + 2)
                Return 0
            EndIf

            $iv_Address = '0x' & Hex($iv_Data[1] + $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(7)
                Return 0
            EndIf

            $iv_Data[1] = DllStructGetData($v_Buffer, 1)

        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(7)
                Return 0
            EndIf

            $iv_Data[1] = DllStructGetData($v_Buffer, 1)

        Else
            $iv_Address = '0x' & Hex($iv_Data[1] + $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(7)
                Return 0
            EndIf

            $iv_Data[1] = DllStructGetData($v_Buffer, 1)

        EndIf

    Next

    $iv_Data[0] = $iv_Address

    Return $iv_Data

EndFunc   ;==>_MemoryPointerRead
alpines is offline  
Thanks
1 User
Old 08/04/2014, 18:19   #11
 
MrBlubZ0r's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 72
Received Thanks: 26
Wenn ich das so versuche auszuführen bekomme ich folgenden Error:

error: _MemoryModulGetBaseAddress() already defined.

Hab jetzt _MemoryModulGetBaseAddress() wieder aus meiner Nomadmemory gelöscht jetzt funzt das ...
MrBlubZ0r is offline  
Old 08/04/2014, 18:20   #12
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Dann nimm die ausm Script raus, die ist vermutlich schon in deiner NomadMemory.au3 drinne.
Errorhandling ist bei dir fehl am Platze oder?
alpines is offline  
Thanks
1 User
Old 08/04/2014, 18:34   #13
 
MrBlubZ0r's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 72
Received Thanks: 26

Super jetzt wird schonmal mein Level ausgelesen
Die 40 EGold hast du dir schonmal verdient
Mach bitte eine Treasure auf die 40 EGOLD kostet
naja ich habs ja grade selbst geregelt ohne deine nachricht zu lesen
MrBlubZ0r is offline  
Old 08/08/2014, 13:03   #14
 
MrBlubZ0r's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 72
Received Thanks: 26
Kann geclosed werden.
MrBlubZ0r is offline  
Reply


Similar Threads Similar Threads
[Memory Read] Monster HP auslesen
04/02/2012 - AutoIt - 7 Replies
Ich versuche im Moment herauszufinden, wie ich die HP eines Monsters auslesen kann. Wie man hier an dem Bild sehen kann, steht leider keine HP Zahl im Balken, weswegen ich mit Cheat engine per unknown initial value versucht habe, den Wert auszulesen: http://www9.picfront.org/picture/K3rbobWJdKL/thb/ HP.jpg Da dies aber nicht funktioniert hat, bzw. ich nur einen Wert rausbekomme, der sich nach dem Tot des Monsters in eine irrsinnige Zahl ändert, frage ich hier um Rat. Hat vielleicht einer...
C++ String aus Memory auslesen
05/08/2010 - C/C++ - 1 Replies
Hallo zusammen ;) Ich probiere mich derzeit ein wenig mit dem auslesen des Memory in C++. Hab mir da auch schon ne DLL gebastelt und injected... usw. Nun habe ich ein Problem: Ich möchte gerne den Namen meines Charakters auslesen. Mit Cheatengine klappt das ja wunderbar und wird auch richtig angezeigt, nur wenn ich mittels der DLL versuche aus der Addresse meinen Namen auszulesen bekomm ich immer nur 1 Zeichen und das stimmt nicht einmal mit dem 1. Buchstaben meines Namens überein. Hier...
AutoIt Monster HP Memory auslesen
04/07/2010 - Last Chaos - 7 Replies
Ich wollte fragen ob ich diesen Code benutzen kann, das wenn die HP des Monster 0 sind TAB gedrückt wird. Offset hab ich schon. Func Monster HP() $ID=_MemoryOpen(0x0000043C) <== Nksp.exe $Address=0x"Monster HP Offset" $CurrentMonsterHP=_MemoryRead($Address,$ID) If $CurrentMonsterHP < 0 Then ControlSend("{TAB}") <== Ziel wechseln(erstmal nicht wichtig) EndIf
PostMessage und Memory auslesen in C++
12/19/2009 - C/C++ - 13 Replies
Heyho, ich versuche im moment mit DevC++ ein Programm zu programmieren, was mir die Flaggenanzahl von Minesweeper ausgibt. Allerdings kriege ich immer den error, dass es der falsche Datentyp sei. ich hab auf dem pc gerad kein DevC++, weshalb ich das Problem net genauer beschreiben kann. int *pointer; pointer = 0xF745879 //irgendeine Speicheradresse cout << *pointer << endl; Irgendwie so war der code^^ €dit: Die Speicheradresse war ne normale integer-Adresse (also 4-Byte). Aber, wie...
Fragen Zur Memory!!!(Auslesen von Spawn/Memory)
12/31/2008 - Guild Wars - 3 Replies
hey leute, ich wollte mal einen bot schreiben und nun bin ich ganz verwirrt. könnte mir jmd bitte schritt für schritt erklären wie das mit Memory auslesen, benutzen und der Spawnpointer funktioniert. Ich wär sehr dankbar wenn jmd kontakt mit mir aufnehmen würde... und sobald der bot fertig ist bekommt der ihn natürlicherweise umsonst:D ICQ: 481799773 oder hier im forum



All times are GMT +2. The time now is 11:40.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.