[AutoIt] Help with reading memory menu

User Tag List

Results 1 to 3 of 3
  1. #1
    naiki94's Avatar Member
    Reputation
    1
    Join Date
    Aug 2013
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [AutoIt] Help with reading memory

    Hello.

    I'm trying to read memory with a pointer using NomadMemory.au3

    This is what my code looks like atm.
    Code:
    #RequireAdmin
    
    #Include <NomadMemory.au3>
    #include <ButtonConstants.au3> 
    #include <GUIConstantsEx.au3> 
    #include <WindowsConstants.au3> 
    
    Global $hMemory ;A global variable 
    
    #Region ### START Koda GUI section ### 
    $hGUI = GUICreate("Read Memory", 259, 150, 192, 124) 
    $hAttach = GUICtrlCreateButton("Attach", 8, 8, 75, 25, $WS_GROUP) 
    $hDetach = GUICtrlCreateButton("Detach", 88, 8, 83, 25, $WS_GROUP) 
    GUICtrlSetState($hDetach, $GUI_DISABLE) 
    $hTEST = GUICtrlCreateButton("Get Value", 88, 50) 
    GUISetState(@SW_SHOW) 
    #EndRegion ### END Koda GUI section ### 
    
    While 1 
       Switch GUIGetMsg() 
          Case $hAttach 
             $hMemory = _MemoryOpen(ProcessExists("TERA.exe")) 
    		 GUICtrlSetState($hDetach,$GUI_ENABLE) 
    		 GUICtrlSetState($hAttach,$GUI_DISABLE)
          Case $hDetach 
             _MemoryClose($hMemory) 
    		 GUICtrlSetState($hAttach,$GUI_ENABLE) 
    		 GUICtrlSetState($hDetach,$GUI_DISABLE)
    	  Case $hTEST
    		 Dim $hOffset[2] = [0, 0x78]
    		 $label1 = _MemoryPointerRead (0x74CD4738, $hMemory, $hOffset)
    		 ;$label2 = _MemoryRead ($label1, $hMemory)
    		 GUICtrlCreateLabel($label1, 100, 100)
          Case $GUI_EVENT_CLOSE 
             Exit 
       EndSwitch 
    WEnd
    I'm able to read addresses directly but when I try to use a pointer it returns nothing. I've seen some ppl using AutoIt here on the forum, maybe someone will be able to help.

    Any help much appreciated.

    [AutoIt] Help with reading memory
  2. #2
    injectionz01's Avatar Private
    Reputation
    1
    Join Date
    Jan 2014
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your code seems to be correct, i have the same problem as you, .. I'm abble to read adresses directly it give me the base+offset form but, when i insert that pointer i need to find each time,
    it returns me a **** 0. haha i know my pointer address and offset is right, do you know if i have current hp, do i need hpmax ?

  3. #3
    insomniac420's Avatar Private
    Reputation
    1
    Join Date
    Feb 2014
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    This might help

    I know this is a old post but i see there isn't really a good answer for you so here, this is my work around to make nomad memory work on 64bit system and also read pointers correct. I'm not gonna explain it in depth but it kinda explains itself, sorry if its a little ugly but it works.
    Code:
    #RequireAdmin
    #include "[Includes]\NomadMemory.au3"
    #include "[Includes]\String.au3"
    #include "[Includes]\misc.au3"
    
    SetPrivilege("SeDebugPrivilege", 1)
    
    $ProcModual="Game.exe"
    $PID = WinGetProcess("WindowTitle")
    $OpenProcMemory = _MemoryOpen($pid)
    $CurHPOffset="240"
    $MaxHPOffset="238"
    $MYhpCurBaseOffset="0007520C"
    $MYhpCurBaseOffset1="388"
    $MYhpCurBaseOffset2="364"
    $MYhpCurBaseOffset3="214"
    $MYhpCurBaseOffset4="324"
    $BaseAddress="0x"&StringRight(hex(_MemoryModuleGetBaseAddress($pid, $ProcModual) + dec($MYhpCurBaseOffset)),8)
    $ReadBaseAddress="0x"&hex(_MemoryRead($BaseAddress, $OpenProcMemory))
    $ReadBaseAddress="0x"&StringRight($ReadBaseAddress,8)
    $ReadAddress="0x"&hex(_MemoryRead($ReadBaseAddress+dec($MYhpCurBaseOffset1), $OpenProcMemory))
    $ReadAddress="0x"&StringRight($ReadAddress,8)
    $ReadAddress="0x"&hex(_MemoryRead($ReadAddress+dec($MYhpCurBaseOffset2), $OpenProcMemory))
    $ReadAddress="0x"&StringRight($ReadAddress,8)
    $ReadAddress="0x"&hex(_MemoryRead($ReadAddress+dec($MYhpCurBaseOffset3), $OpenProcMemory))
    $ReadAddress="0x"&StringRight($ReadAddress,8)
    $ReadAddress="0x"&hex(_MemoryRead($ReadAddress+dec($MYhpCurBaseOffset4), $OpenProcMemory))
    $MYhpBaseAddress="0x"&StringRight($ReadAddress,8)
    
    $TargetMaxValue=_MemoryRead($MYhpBaseAddress+dec($MaxHPOffset), $OpenProcMemory)
    $TargetCurValue=_MemoryRead($MYhpBaseAddress+dec($CurHPOffset), $OpenProcMemory)
    
    MsgBox(0,"Test","Target HP= "&$TargetCurValue&"/"&$TargetMaxValue,-1,"")
    _MemoryClose($pid)
    Exit
    
    #region                                                                         MemoryModuleGetBaseAddress
    
    	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
    
    #endregion

Similar Threads

  1. [AutoIt] Help with some pixelsearch reverse
    By Gissel in forum Programming
    Replies: 1
    Last Post: 11-26-2012, 05:31 PM
  2. [C#]Need help with some memory reading
    By jazerix in forum Programming
    Replies: 1
    Last Post: 10-29-2010, 09:49 AM
  3. [C#/CE help] Need help with memory reading
    By dididii in forum Programming
    Replies: 0
    Last Post: 10-07-2010, 12:26 PM
  4. [Autoit] Problem with Memory reading for looting *resolved*
    By spudstar99 in forum WoW Memory Editing
    Replies: 4
    Last Post: 05-15-2009, 10:26 PM
  5. [c++] problem with reading memory
    By Lucani in forum WoW Memory Editing
    Replies: 3
    Last Post: 05-08-2008, 03:41 AM
All times are GMT -5. The time now is 03:35 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search