Jump to content
Sign in to follow this  
Alek

WoW logon lager...

Recommended Posts

Alek

it started out as an experiment to create wow lager.

but then i discover that the it uses one port (3724) to login and another to play on.

not sure if its useful in any way but i thought it was a nice example :)

how it works:

[Client] <-> [script] <-> [server]

The client connects to the script and the script connects to the server.

so the client sends data to the script and the script sends it to the server and if the script gets data from the server then it sends it to the client.

also it logs the packets (WoW sends somewhat encrypted binary data)

start the script, set wows realmlist to 127.0.0.1

start wow and login.

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)

TCPStartup()
$File = FileOpen(@ScriptDir & '\Data_Log.txt',1)

Global $Client_Socket, $Client_Socket2, $Connect_Socket, $Lag_Timer, $Recv

;The server you want to connect to, set to EU blizz server (not sure how safe it is) :s
;Blizz EU = eu.logon.worldofwarcraft.com
;i have only tried it on private servers, not sure how safe it is to connect to a blizz server...
Global $Connect_Server = ''

Do
    $Client_Socket = TCPListen('127.0.0.1', 3724)
Until $Client_Socket > 0

Do
    $Client_Socket2 = TCPAccept($Client_Socket)
Until $Client_Socket2 <> -1

ConsoleWrite('Connected to Client' & @CRLF)

Do
    $Connect_Socket = TCPConnect(TCPNameToIP($Connect_Server),3724)
Until $Connect_Socket > 0


ConsoleWrite('Connected to Server' & @CRLF)

$Lag_Timer = TimerInit()
$Lag = 0

$Form1 = GUICreate('', 245, 35, -1,-1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
GUISetOnEvent($GUI_EVENT_CLOSE, 'OnAutoitExit')
$Slider1 = GUICtrlCreateSlider(5, 5, 190, 25)
$Label1 = GUICtrlCreateLabel("", 200, 5, 36, 17)
GUISetState(@SW_SHOW)

While 1
    If GUICtrlRead($Slider1) <> $Lag Then
        $Lag = GUICtrlRead($Slider1)
        GUICtrlSetData($Label1,$Lag)
    EndIf
    
    If $Lag = 0 Or TimerDiff($Lag_Timer) > $Lag*10 Then
        $Recv = TCPRecv($Connect_Socket,2048)
        If $Recv <> '' Then
            TCPSend($Client_Socket2,$Recv)
            FileWrite($File, 'To Client: ' & String($Recv) & @CRLF)
        EndIf
        
        $Recv = TCPRecv($Client_Socket2,2048)
        If $Recv <> '' Then
            TCPSend($Connect_Socket,$Recv)
            FileWrite($File, 'To Server: ' & String($Recv) & @CRLF)
        EndIf
        $Lag_Timer = TimerInit()
    EndIf
    
    If $Client_Socket4 = -1 Then
        $Client_Socket4 = TCPAccept($Client_Socket3)
        If $Client_Socket4 = -1 Then ContinueLoop
    EndIf
WEnd

Func OnAutoitExit()
    TCPCloseSocket($Connect_Socket)
    TCPCloseSocket($Client_Socket)
    TCPShutdown()
    FileClose($File)
    Exit
EndFunc

[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×