mcevil
Junior Member-
Content count
5 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout mcevil

-
Rank
Newbie
-
This is how the code looks by now. (at the bottom) I went from _MemoryGetBaseAddress to _MemoryModuleGetBaseAddress. (func at the bottom too) I erased some minor mistakes and added a "non-hex" output to make sure that the Hex() isnt messing up anything. But I still get a 0 for the $Base. 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#include <NomadMemory.au3>#RequireAdminSetPrivilege("SeDebugPrivilege", 1)$ModuleName = "Wow.exe"$pid = ProcessExists($ModuleName)Global $BaseOffset = 0x00A29D28Global $HPOffset[3] $HPOffset[0] = 0 $HPOffset[1] = 0x120 $HPOffset[2] = 0x40$handle = _MemoryOpen($pid)$Base = _MemoryModuleGetBaseAddress($pid, $ModuleName)$BaseAddr = $Base + $BaseOffset$BaseAddrHex = "0x" & Hex($Base + $BaseOffset)_MemoryClose($handle)MsgBox(0,"Test", "Modulname: " & $ModuleName & @CRLF & "Base: " & $Base & @CRLF & "BaseAddr: " & $BaseAddr & @CRLF & "BaseAdrrHex: " & $BaseAddrHex)
-
It's 2.4.3.8606 But isnt this more an autoit related question? Does the patch matter for the function of _MemoryGetBaseAddress ?
-
Like I stated in the first post. I'm using 2.4.3
-
Hi, some days ago I decided to give autoit a shot. I havent been into programming yet. As a first goal I want to create a simple GUI that shows character stats like health, mana, gold, position, etc. (BTW it's for a 2.4.3 Server) So I got into memory reading and started to get familiar with NomadMemory. I managed to read some static adresses like the choords and the player name. I now want to read from pointers and im struggling to get wow's base adress. I wanted to start with the health and this is the pointer I want to use: So the base offset is 00A29D28. For the base I found this function (see at the bottom). I'd be really thankful if someone could tell me, why _MemoryGetBaseAdress is returning 0. (see code at the bottom) I'm running Win7 32Bit to prevent any 64Bit Problems. ;===================================================================================================; Function........: _MemoryGetBaseAddress($ah_Handle, $iHD);; Description.....: Reads the 'Allocation Base' from the open process.;; Parameter(s)....: $ah_Handle - An array containing the Dll handle and the handle of the open; process as returned by _MemoryOpen().; $iHD - Return type:; |0 = Hex (Default); |1 = Dec;; Requirement(s)..: A valid process ID.;; Return Value(s).: On Success - Returns the 'allocation Base' address and sets @Error to 0.; On Failure - Returns 0 and sets @Error to:; |1 = Invalid $ah_Handle.; |2 = Failed to find correct allocation address.; |3 = Failed to read from the specified process.;; Author(s).......: Nomad. Szhlopp.; URL.............: http://www.autoitscript.com/forum/index.php?showtopic=78834; Note(s).........: Go to Www.CheatEngine.org for the latest version of CheatEngine.;===================================================================================================Func _MemoryGetBaseAddress($ah_Handle, $iHexDec = 0) Local $iv_Address = 0x00100000 Local $v_Buffer = DllStructCreate('dword;dword;dword;dword;dword;dword;dword') Local $vData Local $vType If Not IsArray($ah_Handle) Then SetError(1) Return 0 EndIf DllCall($ah_Handle[0], 'int', 'VirtualQueryEx', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer)) If Not @Error Then $vData = Hex(DllStructGetData($v_Buffer, 2)) $vType = Hex(DllStructGetData($v_Buffer, 3)) While $vType <> "00000080" DllCall($ah_Handle[0], 'int', 'VirtualQueryEx', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer)) $vData = Hex(DllStructGetData($v_Buffer, 2)) $vType = Hex(DllStructGetData($v_Buffer, 3)) If Hex($iv_Address) = "01000000" Then ExitLoop $iv_Address += 65536 WEnd If $vType = "00000080" Then SetError(0) If $iHexDec = 1 Then Return Dec($vData) Else Return $vData EndIf Else SetError(2) Return 0 EndIf Else SetError(3) Return 0 EndIfEndFunc ;==>_MemoryGetBaseAddress#include <NomadMemory.au3>#RequireAdminSetPrivilege("SeDebugPrivilege", 1)$ModuleName = "Wow.exe"$pid = ProcessExists($ModuleName)Global $BaseOffset = "00A29D28"Global $HPOffset[3] $HPOffset[0] = 0 $HPOffset[1] = 120 $HPOffset[2] = 40$handle = _MemoryOpen($pid)$Base = _MemoryGetBaseAddress($handle, 1); + $BaseOffset$BaseAddr = "0x" & Hex($Base + $BaseOffset)_MemoryClose($handle)MsgBox(0,"Test", "Modulname: " & $ModuleName & @CRLF & "Base: " & $Base & @CRLF & "Playerbase: " & $BaseAddr)