Autoitv3 WoW Chat auslesen

12/26/2010 16:46 matthgames#1
Hallo liebe Community!
Ich hoffe ihr könnt mir helfen:
Ich möchte ein kleines AFK Progrmmm für Wow erstellen und dafür muss der Chat ausgelesen werden. Aber als ich mit Cheat Engine die Adressen gefunden habe, waren sie beim nächsten mal schon wieder anders. Auch die im Forum hinterlegten Konstanten für 3.3.5a gehen nichtmehr. Bitte um Hilfe!:confused::confused::confused:
12/26/2010 20:13 Endecs#2
Quote:
Originally Posted by besianreci View Post
ich verteh euch nicht

ihr wollt jemanden bitten sich strafbar zumachen weil ihr einfach zu DUMM seit (sorry wegen bemerkung) um es selber auf die reihe zu kriegen :/
Es ist NICHT Illegal, wie oft soll man das denn noch erwähnen, dass Bots etc. Nicht Illegal sind.

Wenn du den Server von Blizzard Hackst dann ist es Illegal.
12/26/2010 20:40 matthgames#3
Ich hacke ja nicht die Server sondern lese nur die Variablen und außerdem ist es ja kein Bot sondern soll es ja nur wenn man afk ist einen ton von sich geben damit man weis , dass man gewispert wurde und antworten kann, z. B. wenn man grad ist oder TV sieht.

Hat jetzt wigwntlich noch jemand eine direkte Antwort auf meine Frage?
12/27/2010 10:59 halloman#4
wenn du nicht weist wie du diese Adressen bekommst bzw. selbst ausliest, dann wird das mit dem "bot" programmieren auch schlecht.
Einfach mal google benutzen ;)
12/27/2010 11:50 Bl@ze!#5
So leute das hagelt Infractions, ich kann es langsam nicht ab wie ihr immer andere Leute dumm anmacht, wenn die neu in dem Gebiet sind...

Zu deinem Post, matthgames..
wenn du nur einen Ton abspielen möchtest, empfehl ich dir die LUA Scripting API von WoW, die das ganze auch ermöglicht, was WESENTLICH leichter ist, da du dir keine Sorgen machen muss, wenn ein WoW Patch rauskommt.

Zu den Adressen, die sind beim nächsten Start wieder weg, weil sie im Arbeitsspeicher immer woanders liegen. Du brauchst statische Adressen, die immer gleich sind wenn man WoW neustartet.

Die Chatstruktur ist auch nicht ganz ohne und für einen Anfänger sehr schwer zu verstehen, allerdings wurde diese schon hier besprochen und eventuell solltest du mal nach dem Schlüsselwort suchen.

Aber wie gesagt: mit einem WoW AddOn viel leichter realisierbar (einen Ton abzuspielen bei einem Whisper)

# Thread aufgeräumt
12/27/2010 14:08 matthgames#6
Ok, danke für die Antwort und an halloman
Quote:
wenn du nicht weist wie du diese Adressen bekommst bzw. selbst ausliest, dann wird das mit dem "bot" programmieren auch schlecht.
Einfach mal google benutzen
es ist kein bot!
12/27/2010 14:59 Endecs#7
Also ich weis nicht ob du mit diesen schon versucht hast aber hier:
(3.3.5)
Code:
ChatBufferStart = 0x00B75A60,               
 NextMessage = 0x17C0,
Und 4.0.3
Code:
chatBufferStart = 0x992360,
            NextMessage = 0x17C0,
            msgFormatedChat = 0x3c,
            chatBufferPos = 0x9EB8F4,
(Sind von MMO)
Wenn es für 4.0.3 sein soll, dann bedenkt das WoW nun "ASLR" benutzt, und du die wow.exe + Offset rechnen musst.
Und es hilft uns nicht, wenn du nur die .exe in den Anhang tust.
Damit wir dir eigentlich weiter helfen können, bräuchten wir die .au3
12/31/2010 12:12 GordonGekko#8
Was ist denn "ASLR"? Kann mich da jemand aufklären?
12/31/2010 12:21 Bl@ze!#9
Address space layout randomization - Wikipedia, the free encyclopedia

Bedeutet letzendlich, dass du beim Auslesen von Adressen die Adresse des WoW Moduls (Wow.exe) hinzuaddieren musst.
01/02/2011 01:29 seess#10
dafür muss der Chat ausgelesen werden?
es ist sehr schwierig. Lassen Sie mich nachdenken
01/07/2011 16:58 matthgames#11
Quote:
chatBufferStart = 0x992360,
NextMessage = 0x17C0,
msgFormatedChat = 0x3c,
chatBufferPos = 0x9EB8F4,
Ich weiß nicht, was ich falsch mache, aber mit diesen Adressen komme ich leider nicht weiter. Wenn ich die Adressen einfach so mit CE auslesen will kommt nichts richtiges raus und ich weiß leider auch nicht (bin neu mit autoit unc CE) was eben mit Next Message und so gemeint ist.
N00b bittet um Hilfe^^
01/09/2011 15:10 mickol#12
hab hier was, sollte dir weiterhelfen, glaub das es auch noch funktioniert musst nur die offsets ausbessern, hab selber viel mit autoit gemacht bin jetzt aber komplett auf c# umgestiegen, was ich nur empfehlen kann.


Code:
Func chat()
	$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
01/09/2011 19:07 matthgames#13
Hi, danke für den Code, aber ich kriegs irgendwie mit den nötigen includes nicht auf die Reihe, kannst du mir da vieleicht bitte helfen?
01/09/2011 19:30 matthgames#14
weil bei mir sieht das gerade noch so aus:
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
01/13/2011 20:31 mickol#15
Ich verwende die BlackMagic.AU3 damit ich im Speicher lesen kann, du hast auch vergessen dem Program Adminrechte zu geben so kannst du nicht auf den Speicher von Wow zugreifen.

Anbei ein Code mit dem du den Chat auslesen kannst (ordentlich abgespeckt), die BlackMagic.AU3 musst du dir besorgen, gibts glaub ich eh hier im Forum. Die Function mit der du die WowBae Adresse auslesen kannst hab ich dauch dazu geben, ist auch aus dem Forum hier. Jetzt solltest du ja weiterkommen.

der offset für den chattbufferstart war auch noch falsch!

Code:
#RequireAdmin
#include <GUIConstants.au3>
#include <BlackMagicAU3.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <String.au3>

Func GetWoWBaseAddress($PID = -1)
	If $PID = -1 Then
		$PID = WinGetProcess("World of Warcraft", "") 
	EndIf
		
	$hSnap = DllCall("Kernel32.dll", "HANDLE", "CreateToolhelp32Snapshot", "DWORD", 0x8, "DWORD", $PID)

	; Create MODULEENTRY32 structure
	$stModule = DllStructCreate("DWORD dwSize;DWORD th32ModuleID;DWORD th32ProcessID;" & _
								"DWORD GlblcntUsage;DWORD ProccntUsage;ptr modBaseAddr;" & _ 
								"DWORD modBaseSize;HANDLE hModule;WCHAR szModule[256];" & _
								"WCHAR szExePath[260]") 
	DllStructSetData($stModule, "dwSize", DllStructGetSize($stModule)) ; Set size

	$ret = DllCall("Kernel32.dll", "BOOLEAN", "Module32FirstW", "HANDLE", $hSnap[0], "ptr", DllStructGetPtr($stModule))

	If ($ret[0] = False) Then
		DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $hSnap[0])
		Return 0
	Else
		$ret[0] = True
		
		Do
			If DllStructGetData($stModule, "szModule") = "Wow.exe" Then
				DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $hSnap[0])
				Return DllStructGetData($stModule, "modBaseAddr")
			EndIf
			
			$ret = DllCall("Kernel32.dll", "BOOLEAN", "Module32NextW", "HANDLE", $hSnap[0], "ptr", DllStructGetPtr($stModule))
		Until $ret[0] = False
	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")

_BMInitialize()
;$dll = DllOpen("user32.dll")
Global $hWnd = WinGetHandle("World of Warcraft")
Global $hProcess = _BMOpenProcess($hWnd, False)
Global $WowBase = GetWoWBaseAddress()

If @Error Then
    MsgBox (16, "", "Error getting base address: " & $hWnd & " [ code: " & @error & "]")
    Exit
EndIf

Func chat()
	
	$x = 0
	dim $chat[1000], $name[1], $msg[1]
	
	Do

		$chat[$x] = _BMReadASCIIString($hProcess,$wowbase + 0x992360 + 0x3c + (0x17C0 * $x), 1000)
		msgbox(0,"Chat",$chat[$x])
		If $chat[$x] = "" Then
			$x = 1000
		EndIf
		$x = $x + 1
	Until $x >= 59
EndFunc   ;==>chat

Func exitg ()
	Exit
EndFunc

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

	EndSwitch
WEnd