Jump to content

Can't read memory using autoit


Recommended Posts

I have been asking for help on another topic but I'm almost certain the problem wasn't being caused by NomadMemory.au3 as I first suspected. On that note I decided to open a topic for this specific problem.

I'm trying to read WoW memory and I'm obviously having trouble(Always displays 00000 ). I can read memory from any other application other than WoW. I was wondering if anyone here has used autoit to read WoW memory and how they went about it. Anything would be helpful. Thanks a lot.

Here is one of the many scripts I've been trying to use + a lot of unneeded includes :D --

CODE
#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <TabConstants.au3>

#include <WindowsConstants.au3>

#include <NomadMemory.au3>

#include <string.au3>

SETPRIVILEGE("SeDebugPrivilege", 1)

Dim $ProPID = WinGetProcess("Wow.exe")

Global $HPROCESS = _MemoryOpen($ProPID)

$HPROCESS = _MemoryOpen($ProPID)

$Health = _MemoryRead(0x012EB558,$HPROCESS)

If $Health = 0 Then

MsgBox(1,"No!","Value not found")

Else

MsgBox(1,"Yes!",$Health)

EndIf

Link to comment
Share on other sites

Check the @error (if any) after MemoryRead

; @Error - 0 = No error.

; 1 = Invalid $ah_Handle.

; 2 = $sv_Type was not a string.

; 3 = $sv_Type is an unknown data type.

; 4 = Failed to allocate the memory needed for the DllStructure.

; 5 = Error allocating memory for $sv_Type.

; 6 = Failed to read from the specified process.

I suggest

MsgBox(1,"No!","Value not found, error code is : " & @error)

Edited by Inverted
Link to comment
Share on other sites

Haven't coded in a while and I'm not positive I know what you're asking me to do but here is the code I just ran.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
#include <string.au3>
SETPRIVILEGE("SeDebugPrivilege", 1)
 $ProPID = WinGetProcess("Wow.exe")
 $HPROCESS = _MemoryOpen($ProPID)
 $Health = _MemoryRead(0x012EB558,$HPROCESS)
If @error Then
    MsgBox(4096,"Error", @error)
Else
    MsgBox(4096, "Result", $Health)
EndIf

Results was - @error = 1, $Health = 0.

Is this what you were asking?

Link to comment
Share on other sites

#include <NomadMemory.au3>

SETPRIVILEGE("SeDebugPrivilege", 1)
$ProPID = ProcessExists ("wow.exe")
$HPROCESS = _MemoryOpen($ProPID)
If @error <>0 Then
    MsgBox (0, "Error", "An error occured opening or finding the process, code : " & @error)
    Exit
EndIf

$Health = _MemoryRead(0x012EB558,$HPROCESS)
If @error Then
    MsgBox(4096,"Error", @error)
Else
    MsgBox(4096, "Result", $Health)
EndIf

WinGetProcess was the wrong funciton to use, you never got the right pid. Check mine, tell me what happens.

Edited by Inverted
Link to comment
Share on other sites

Can you backup your NomadMemory.au3 and use my own ? I've made sure that if ReadProcessMemory fails, then @error is set (to 6)

Then can you confirm that :

using correct memory addresses in normal apps = returns correct reads with no @error

using wrong memory addresses in normal apps = returns 0 with @error

using correct memory addresses in Wow = returns 0 with @error

NomadMemory.au3

Edited by Inverted
Link to comment
Share on other sites

So, we have confirmed that there is something different about WoW that makes ReadProcessMemory fail (at least on your PC), since it works for other proggies, right ?

Also, we got rid of the @error bug, I was gettring tired of the damn 0 return + 0 @error.

But now, what ? I'm not gonna download WoW to test myself, hehe. Is anyone else reading that has WoW installed ?

What OS are you using btw ?

Edited by Inverted
Link to comment
Share on other sites

So, we have confirmed that there is something different about WoW that makes ReadProcessMemory fail (at least on your PC), since it works for other proggies, right ?

Also, we got rid of the @error bug, I was gettring tired of the damn 0 return + 0 @error.

But now, what ? I'm not gonna download WoW to test myself, hehe. Is anyone else reading that has WoW installed ?

What OS are you using btw ?

Yeah it works fine with all other programs. I'm running XP with SP2. What is weird is that I have ran an autoit based program that reads WoW's memory. I tried to modify some other users scripts to display some of my addresses but nothing seems to work. There is no .dll or system based dependencies? I also tried this on my laptop running vista yesterday and had the exact same problem. Frustrating knowing that people know a way around this problem but won't look at this post. My guess is its something rather simple and I'm going to cause harm to myself after realizing just how easy it really is. Thanks for your help though.

Link to comment
Share on other sites

Login to wow, and try this...

Its no finished, but i was just messing arround.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>

;settings -----------------
$Playerbase = 0x010BD5F4
$Playername = 0x01139FB8
$Playerx = 0x798
$Playery = 0x79C
$Playerz = 0x7A0
$Playerrotation = 0x7A8
$Playerlevel = 0x18AC
$PlayerCurHP = 0xF90
$PlayerMaxHP = 0x1854
$PlayerCurMP = 0x094
$PlayerMaxMP = 0x1858
$PlayerExp = 0x980
$PlayerMaxExp = 0x984
$Off1=0x34
$Off2=0x24

SETPRIVILEGE("SeDebugPrivilege", 1)
Dim $ProPID = WinGetProcess("World of Warcraft");--------FIX THIS---------@SW_MINIMIZE
$wowprocess = _MemoryOpen($ProPID)

HotKeySet("{F5}", "_Getpointers")
TrayTip("Tip:", "Press F5 to refresh", 5)

#Region ### START Koda GUI section ### Form=
$MainGUI = GUICreate("WoW Info", 190, 312)
$plrname = GUICtrlCreateLabel("Player name:", 16, 16, 190, 17)
$plrx = GUICtrlCreateLabel("Player x:", 16, 40, 190, 17)
$plry = GUICtrlCreateLabel("Player y:", 16, 64, 190, 17)
$plrz = GUICtrlCreateLabel("Player z:", 16, 88, 190, 17)
$plrrot = GUICtrlCreateLabel("Player Rotation:", 16, 112, 190, 17)
$plrlevel = GUICtrlCreateLabel("Player Level:", 16, 136, 190, 17)
$plrnowhp = GUICtrlCreateLabel("Player current hp:", 16, 160, 190, 17)
$plrmaxhp = GUICtrlCreateLabel("Player max hp:", 16, 184, 190, 17)
$plrnowmp = GUICtrlCreateLabel("Player current mana:", 16, 208, 190, 17)
$plrmaxmp = GUICtrlCreateLabel("Player max mana:", 16, 232, 190, 17)
$plrnowxp = GUICtrlCreateLabel("Player xp:", 16, 256, 190, 17)
$plrmaxxp = GUICtrlCreateLabel("Player max xp:", 16, 280, 190, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

    
    
Func _Getpointers()
    Global $LVL1POINTER = _MemoryRead($Playerbase, $wowprocess, "ptr")
    Global $LVL2POINTER = _MemoryRead(($LVL1POINTER + $Off1), $wowprocess, "ptr")
    Global $PlayerMEM = _MemoryRead(($LVL2POINTER+ $Off2), $wowprocess, "ptr")
    Global $Plrxread = $PlayerMEM + $Playerx
    Global $Plryread = $PlayerMEM + $Playery
    Global $Plrzread = $PlayerMEM + $Playerz
    Global $Rotationread = $PlayerMEM + $Playerrotation
    Global $Plrlevelread = $PlayerMEM + $Playerlevel
    Global $Plrnowhpread = $PlayerMEM + $PlayerCurHP
    Global $Plrmaxhpread = $PlayerMEM + $PlayerMaxHP
    Global $Plrnowmpread = $PlayerMEM + $PlayerCurMP
    Global $Plrmaxmpread = $PlayerMEM + $PlayerMaxMP
    Global $Plrnowxpread = $PlayerMEM + $PlayerExp
    Global $Plrmaxxpread = $PlayerMEM + $PlayerMaxExp
    Global $Plrnameread = "Player name: " & _MEMORYREAD($Playername, $wowprocess, "char[12]")

    
    
    Update()
EndFunc

Func Update()
GUICtrlSetData($plrname, $Plrnameread)
GUICtrlSetData($plrx, "Player x: " & _MEMORYREAD($Plrxread, $wowprocess, "float"))
GUICtrlSetData($plry, "Player y: " & _MEMORYREAD($Plryread, $wowprocess, "float"))
GUICtrlSetData($plrz, "Player z: " & _MEMORYREAD($Plrzread, $wowprocess, "float"))
GUICtrlSetData($plrrot, "Player Rotation: " & _MEMORYREAD($Rotationread, $wowprocess, "float"))
GUICtrlSetData($plrlevel, "Player Level: " & _MEMORYREAD($Plrlevelread, $wowprocess, "int"))
GUICtrlSetData($plrnowhp, "Player current hp: " & _MEMORYREAD($Plrnowhpread, $wowprocess, "int"))
GUICtrlSetData($plrmaxhp, "Player max hp: " & _MEMORYREAD($Plrmaxhpread, $wowprocess, "int"))
GUICtrlSetData($plrnowmp, "Player current mana: " & _MEMORYREAD($Plrnowmpread, $wowprocess, "int"))
GUICtrlSetData($plrmaxmp, "Player max mana: " & _MEMORYREAD($Plrmaxmpread, $wowprocess, "int"))
GUICtrlSetData($plrnowxp, "Player xp: " & _MEMORYREAD($Plrnowxpread, $wowprocess, "int"))
GUICtrlSetData($plrmaxxp, "Player max xp: " & _MEMORYREAD($Plrmaxxpread, $wowprocess, "int"))
EndFunc

Let me know what happens?

Link to comment
Share on other sites

  • 11 years later...
  • Moderators

Seventis,

Are you also trying to read WoW memory?

M23

P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out.

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Seventis,

Quote

from other game

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...