Clee12 Posted June 8, 2009 Share Posted June 8, 2009 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 -- 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 More sharing options...
Inverted Posted June 8, 2009 Share Posted June 8, 2009 (edited) 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 June 9, 2009 by Inverted Link to comment Share on other sites More sharing options...
Clee12 Posted June 9, 2009 Author Share Posted June 9, 2009 @error = 1 So as you said - Invalid $ah_Handle. How would I go about trouble shooting this? Thanks. Link to comment Share on other sites More sharing options...
Inverted Posted June 9, 2009 Share Posted June 9, 2009 (edited) Why do you have 2 _MemoryOpen ? Use only one and check/show its return and @error , if any. In fact, I'd get rid of that Dim and Global crap Edited June 9, 2009 by Inverted Link to comment Share on other sites More sharing options...
Clee12 Posted June 9, 2009 Author Share Posted June 9, 2009 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 More sharing options...
Inverted Posted June 9, 2009 Share Posted June 9, 2009 (edited) #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 June 9, 2009 by Inverted Link to comment Share on other sites More sharing options...
Clee12 Posted June 9, 2009 Author Share Posted June 9, 2009 Oh ok thank you. However I just tried it and got result = 0. So no error was reported but it isn't seeing any values damn it. Link to comment Share on other sites More sharing options...
Inverted Posted June 9, 2009 Share Posted June 9, 2009 (edited) 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 @errorNomadMemory.au3 Edited June 9, 2009 by Inverted Link to comment Share on other sites More sharing options...
Clee12 Posted June 9, 2009 Author Share Posted June 9, 2009 Brilliant! So replaced my Nomad with yours and got @error = 6. Interesting so ReadProcessMemory is the problem? Link to comment Share on other sites More sharing options...
Inverted Posted June 9, 2009 Share Posted June 9, 2009 (edited) 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 June 9, 2009 by Inverted Link to comment Share on other sites More sharing options...
Clee12 Posted June 9, 2009 Author Share Posted June 9, 2009 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 More sharing options...
Rorka Posted June 9, 2009 Share Posted June 9, 2009 Login to wow, and try this... Its no finished, but i was just messing arround. expandcollapse popup#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 More sharing options...
Seventis Posted May 9, 2021 Share Posted May 9, 2021 Sorry for refreshing 12 years ago thread but I have that same propblem and can't solve it autoit does not return correct value, @error = 6 like Clee12 say... Help please Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 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. 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Seventis Posted May 9, 2021 Share Posted May 9, 2021 No from other game but everything looks the same as in this case Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts