Advertisement
Guest User

Untitled

a guest
Mar 8th, 2012
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. ;--------------------------------------------------------------------------------
  2. ;Getting My Player GUID
  3. ;--------------------------------------------------------------------------------
  4. #include <NomadMemory.au3>
  5. #include <ButtonConstants.au3>
  6. #include <EditConstants.au3>
  7. #include <GUIConstantsEx.au3>
  8. #include <WindowsConstants.au3>
  9.  
  10. ;--------------------------------------------------------------------------------
  11. ; Offsets Object Manager
  12. ; Offset and Pointer for Wow 4.2.0 14333 (Rebase 06-28-2011)
  13. ;--------------------------------------------------------------------------------
  14. Global Const $ClientConnection = 0x97DA48 ;The first 2 are you create you manager from the baseaddress wow
  15. Global Const $CurrMgrOffset = 0x463C
  16. Global Const $FirstObjectOffset = 0xB4 ;The next one is to get the address of your first object ONLY
  17. Global Const $NextObjectOffset = 0x3C ;To cycle through the object you need this offset
  18. Global Const $localPlayerGUIDOffset = 0xB8
  19. Global Const $GameObjGUIDOffset = 0x30 ;This next one is to find the objects type : 1 to 7
  20. Global Const $GameObjTypeOffset = 0x14 ;And this one is to find the objects GUID
  21. Global Const $DescriptorOffset = 0x8
  22.  
  23. ;Open WoW Process to enable Memory Reading and Get the WoW Base Address
  24. $ProcessID = ProcessExists("wow.exe")
  25. $WowProcess = _MemoryOpen($ProcessID)
  26.  
  27. ;Getting WoWBase Address
  28. $WowBase = GetWoWBaseAddress($ProcessID)
  29.  
  30. ;1) Getting CurrentManager_Pre
  31. $currMgr_pre = _MemoryRead("0x" & Hex($WowBase + $ClientConnection), $WowProcess , "dword")
  32. ;2) Getting CurrentManager
  33. $currMgr = _MemoryRead("0x" & Hex($currMgr_pre + $CurrMgrOffset), $WowProcess , "dword")
  34.  
  35. ;Getting My Player GUID (Player Global Unique ID)
  36. $pGUID = _MemoryRead("0x" & Hex($currMgr + $localPlayerGUIDOffset), $WowProcess , "UINT64") ;Player Guid
  37.  
  38. $msgbox_text = "";
  39. $msgbox_text &= "$ProcessID: " & $ProcessID & @CRLF;
  40. $msgbox_text &= "$WowProcess: " & $WowProcess & @CRLF;
  41. $msgbox_text &= "$WowBase: " & $WowBase & @CRLF;
  42. $msgbox_text &= "$currMgr_pre: " & $currMgr_pre & @CRLF;
  43. $msgbox_text &= "$currMgr: " & $currMgr & @CRLF;
  44. $msgbox_text &= "$pGUID: " & $pGUID & @CRLF;
  45.  
  46. MsgBox(1,"Test",$msgbox_text)
  47.  
  48. ;MsgBox(4096,"Player Name", "PLAYER HEALTH ---> " & $pGUID)
  49.  
  50. Func GetWoWBaseAddress($ProcessID)
  51. $HSNAP = DllCall("Kernel32.dll", "HANDLE", "CreateToolhelp32Snapshot", "DWORD", 8, "DWORD", $ProcessID)
  52. $STMODULE = DllStructCreate("DWORD dwSize;DWORD th32ModuleID;DWORD th32ProcessID;" & "DWORD GlblcntUsage;DWORD ProccntUsage;ptr modBaseAddr;" & "DWORD modBaseSize;HANDLE hModule;WCHAR szModule[256];" & "WCHAR szExePath[260]")
  53. DllStructSetData($STMODULE, "dwSize", DllStructGetSize($STMODULE))
  54. $RET = DllCall("Kernel32.dll", "BOOLEAN", "Module32FirstW", "HANDLE", $HSNAP[0], "ptr", DllStructGetPtr($STMODULE))
  55.  
  56. IF ($RET[0] = False) Then
  57. DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $HSNAP[0])
  58. Return 0
  59. Else
  60. $RET[0] = True
  61. Do
  62. If DllStructGetData($STMODULE, "szModule") = "Wow.exe" Then
  63.  
  64. DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $HSNAP[0])
  65.  
  66. Return DllStructGetData($STMODULE, "modBaseAddr")
  67. EndIf
  68. $RET = DllCall("Kernel32.dll", "BOOLEAN", "Module32NextW", "HANDLE", $HSNAP[0], "ptr", DllStructGetPtr($STMODULE))
  69. Until $RET[0] = False
  70. EndIf
  71. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement