Code:
#include-once
#include <GUIConstants.au3>
#include-once
#include <nomadmemory.au3>
;===================================================================================================
; 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
EndIf
EndFunc
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 541, 710, 193, 133)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 521, 129)
GUICtrlSetData(-1, "Edit1")
$Edit2 = GUICtrlCreateEdit("", 8, 152, 521, 129)
GUICtrlSetData(-1, "Edit2")
$Edit3 = GUICtrlCreateEdit("", 8, 296, 521, 129)
GUICtrlSetData(-1, "Edit3")
$Edit4 = GUICtrlCreateEdit("", 8, 432, 521, 129)
GUICtrlSetData(-1, "Edit4")
$Edit5 = GUICtrlCreateEdit("", 8, 569, 521, 129)
GUICtrlSetData(-1, "Edit5")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{Space}", "chat")
HotKeySet("{F4}", "exitg")
$pid = WinGetProcess("World of Warcraft") ; hier besorge ich die PID
$hProcess = _MemoryOpen($pid) ; ich öffne den Wert mit dem oben herausbekommenen PID
$wowbase = _MemoryGetBaseAddress($hProcess, 1)
If @Error Then
MsgBox (16, "", "Error getting base address: " & $pid & " [ code: " & @error & "]")
Exit
EndIf
Func chat()
MsgBox(0, "TEst", "texte")
$x = 0
GUICtrlSetData($Edit1, "")
GUICtrlSetData($Edit2, "")
GUICtrlSetData($Edit3, "")
GUICtrlSetData($Edit4, "")
dim $chat[1000], $name[1], $msg[1]
GUICtrlSetData($Edit5, "all other msg's like channels,emotes,etc are here")
Do
$chat[$x] = _BMReadASCIIString($hProcess,$wowbase + 0x00983358 + 0x3c + (0x17C0 * $x), 1000)
$type = _StringBetween($chat[$x], "Type: [", "],")
If $chat[$x] = "" Then
$x = 1000
Else
If $type[0] = 1 Then ;say
$guis3 = GUICtrlRead($Edit1)
$name = _StringBetween($chat[$x], "Player Name: [", "]")
$msg = _StringBetween($chat[$x], "Text: [", "]")
EndIf
If $type[0] = 2 Then ;party
$guis3 = GUICtrlRead($Edit2)
$name = _StringBetween($chat[$x], "Player Name: [", "]")
$msg = _StringBetween($chat[$x], "Text: [", "]")
EndIf
If $type[0] = 7 Then ;whisper
$guis3 = GUICtrlRead($Edit3)
$name = _StringBetween($chat[$x], "Player Name: [", "]")
$msg = _StringBetween($chat[$x], "Text: [", "]")
EndIf
If $type[0] = 4 Then ;guild
$guis4 = GUICtrlRead($Edit4)
$name = _StringBetween($chat[$x], "Player Name: [", "]")
$msg = _StringBetween($chat[$x], "Text: [", "]")
Else ;other
$guis5 = GUICtrlRead($Edit5)
$name = _StringBetween($chat[$x], "Player Name: [", "]")
$msg = _StringBetween($chat[$x], "Text: [", "]")
EndIf
$x = $x + 1
EndIf
Until $x >= 59
EndFunc ;==>chat
Func exitg ()
Exit
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd