• Welcome to Valhalla Legends Archive.
 

Re: 0x51 with d2xp

Started by Arta, February 26, 2003, 04:03 AM

Previous topic - Next topic

Arta

It's almost certainly one of:

- Out of date hashfiles
- Incorrect version byte
- Broken hash implementation
- Hashing incorrect data

FyRe

I also tryed the same and it just sits there... It looks like I'm missing a case statement for a particular packet, but I don't know which...  ::)

[23:34:00] Connecting to bnls.valhallalegends.com:9367
[23:34:00] Sending Packet: 0x0E FyRe\0
[23:34:00] Sending Packet: 0x0F REMOVED
[23:34:00] Received Packet: 0x00 \0ðSÝ.
[23:34:01] Sending Packet: 0x10 \0\0\0
[23:34:01] Received Packet: 0x00 \0\0\0\0\0
[23:34:01] Connecting to use-bna-chat06.battle.net:6112
[23:34:01] Received Packet: 0x00 \0\0\0\0      \0\0\0
[23:34:01] Sending Packet: 0x50 \0\0\0\068XIPX2D      \0\0\0\0\0\0\0\0\0\0\0¤\0\03\0\03\0\0USA\0United States\0
[23:34:01] Sending Packet: 0x09 \0\0\0\0\0\0A=478890547 B=522450060 C=776564164 4 A=A^S B=B^C C=C^A A=A^B\0\0
[23:34:01] Received Packet: 0x50 ÿPc\0\0\0\0\0[?}j;\0\0<[¥cèÀIX86ver2.mpq\0A=478890547 B=522450060 C=776564164 4 A=A^S B=B^C C=C^A A=A^B\0
[23:34:01] Sending Packet: 0x0C \0\0\0\0\0\0\0[?}MYD2CDKEYWASHERE\0MYLODCDKEYWASHERE\0
[23:34:01] Received Packet: 0x00 1\0      \0\0\0\0      \0&#8224;üÆGame.exe 11/30/01 04:00:18 448675\0
[23:34:01] Sending Packet: 0x51 .áË&#402;\0      \0&#8224;üÆ\0\0\0\0\0\0\0\0\0\0\0\0\0Rà\0\0\0\0\0P&#8225;9ýâ?Ã=z&frac34;?&cedil;M&#732;5d~ThÈ\0\0\0\0\0\0fP\0\0\0\0\0       d&cedil;ê
 OÒ&#8216;¨0>ÍÎ?Game.exe 11/30/01 04:00:18 448675\0FyReBoT v0.6\0
[23:34:01] Received Packet: 0x00 ]\0 \0\0\0\0\0\0\0.áË&#402;\0\0\0\0\0\0Rà\0\0\0\0\0P&#8225;9ýâ?Ã=z&frac34;?&cedil;M&#732;5d~ThÈ.áË&#402;\0\0\0\0\0\0fP\0\0\0\0\0       d&cedil;ê
 OÒ&#8216;¨0>ÍÎ?
[23:34:01] Received Packet: 0x51 ÿQ\0\0\0FyReBoT v0.6\0

The line: Sending Packet: 0x0F REMOVED
and
MYD2CDKEYWASHERE\0MYLODCDKEYWASHERE\0
were changed for security reasons.
Eventually the bot just times out.

Thanks.

Edit: I can load D2DV fine.

Skywing

#2
QuoteI also tryed the same and it just sits there... It looks like I'm missing a case statement for a particular packet, but I don't know which...  ::)

[23:34:00] Connecting to bnls.valhallalegends.com:9367
[23:34:00] Sending Packet: 0x0E FyRe\0
[23:34:00] Sending Packet: 0x0F REMOVED
[23:34:00] Received Packet: 0x00 \0ðSÝ.
[23:34:01] Sending Packet: 0x10 \0\0\0
[23:34:01] Received Packet: 0x00 \0\0\0\0\0
[23:34:01] Connecting to use-bna-chat06.battle.net:6112
[23:34:01] Received Packet: 0x00 \0\0\0\0      \0\0\0
[23:34:01] Sending Packet: 0x50 \0\0\0\068XIPX2D      \0\0\0\0\0\0\0\0\0\0\0¤\0\03\0\03\0\0USA\0United States\0
[23:34:01] Sending Packet: 0x09 \0\0\0\0\0\0A=478890547 B=522450060 C=776564164 4 A=A^S B=B^C C=C^A A=A^B\0\0
[23:34:01] Received Packet: 0x50 ÿPc\0\0\0\0\0[?}j;\0\0<[¥cèÀIX86ver2.mpq\0A=478890547 B=522450060 C=776564164 4 A=A^S B=B^C C=C^A A=A^B\0
[23:34:01] Sending Packet: 0x0C \0\0\0\0\0\0\0[?}MYD2CDKEYWASHERE\0MYLODCDKEYWASHERE\0
[23:34:01] Received Packet: 0x00 1\0      \0\0\0\0      \0&#8224;üÆGame.exe 11/30/01 04:00:18 448675\0
[23:34:01] Sending Packet: 0x51 .áË&#402;\0      \0&#8224;üÆ\0\0\0\0\0\0\0\0\0\0\0\0\0Rà\0\0\0\0\0P&#8225;9ýâ?Ã=z&frac34;?&cedil;M&#732;5d~ThÈ\0\0\0\0\0\0fP\0\0\0\0\0       d&cedil;ê
 OÒ&#8216;¨0>ÍÎ?Game.exe 11/30/01 04:00:18 448675\0FyReBoT v0.6\0
[23:34:01] Received Packet: 0x00 ]\0 \0\0\0\0\0\0\0.áË&#402;\0\0\0\0\0\0Rà\0\0\0\0\0P&#8225;9ýâ?Ã=z&frac34;?&cedil;M&#732;5d~ThÈ.áË&#402;\0\0\0\0\0\0fP\0\0\0\0\0       d&cedil;ê
 OÒ&#8216;¨0>ÍÎ?
[23:34:01] Received Packet: 0x51 ÿQ\0\0\0FyReBoT v0.6\0

The line: Sending Packet: 0x0F REMOVED
and
MYD2CDKEYWASHERE\0MYLODCDKEYWASHERE\0
were changed for security reasons.
Eventually the bot just times out.

Thanks.

Edit: I can load D2DV fine.
Those hex dumps are really difficult to read.  I'd strongly suggest splitting a hex and ascii dump up like most conventional hex dumps do (and for a good reason).

Anyways, it looks like you're just not responding to SID_AUTH_CHECK completing...?

Yoni

#3
Quote[23:34:01] Received Packet: 0x51 ÿQ\0\0\0FyReBoT v0.6\0
As Skywing said, that's really unreadable.
But that probably means one of the CD-keys is in use, by user "FyReBoT v0.6".

FyRe

Yoni:
[11:50:29] Received Packet: 0x00 ]\0 \0\0\0\0\0\0\0ÝÄn&#8224;\0\0\0\0\0\0Rà\0\0\0\0\0uçÂÂ.V&uml;`o£~O&#8224;9rL~&#8212;Ú&#8218;ÝÄn&#8224;\0\0\0\0\0\0fP\0\0\0\0\0 ·ú*ìûN³×ù&acute;?Ó4&#8482;d¼&frac34;
[11:50:29] Received Packet: 0x201 - Your CD-Key is in use by FyRe

Actually it would result to something like that.

Skywing:
       Case &H51
        Cpass = False
            Select Case GetWORD(Mid(data, 5, 2))
                Case &H0
                    AddChat vbCyan, "Version Check passed"
                    AddChat vbCyan, "CDKey Check passed"
                    With PBuffer
                        If BNET.Product = "3RAW" Then
                            .InsertNTString BNET.username
                            .InsertNTString BNET.Password
                            .SendBNLSPacket &H2
                        Else
                            '"tenb" for Ping "bnet" for UDP
                            .InsertNonNTString "tenb"
                            .SendPacket &H14
                            .SendPacket &H2D
                            If Cpass = False Then
                                HType = 1
                                .InsertDWORD Len(BNET.Password)
                                .InsertDWORD &H0
                                .InsertNonNTString BNET.Password
                                .SendBNLSPacket &HB
                                SPass = True
                            Else
                                Cpass = False
                                HType = 3
                                .InsertDWORD Len(BNET.Password)
                                .InsertDWORD &H0
                                .InsertNonNTString BNET.Password
                                .SendBNLSPacket &HB
                            End If
                        End If
                    End With
                Case &H101
                    AddChat vbYellow, "Received Packet: 0x101 -", vbRed, " Invalid game version!"
                    frmMain.wsBnet.Close
                Case &H200
                    AddChat vbYellow, "Received Packet: 0x200 -", vbRed, " Invalid CD-Key!"
                    frmMain.wsBnet.Close
                Case &H100
                    AddChat vbYellow, "Received Packet: 0x100 -", vbRed, " Invalid game version!"
                    frmMain.wsBnet.Close
                Case &H203
                    AddChat vbYellow, "Received Packet: 0x203 -", vbRed, " Your CD-Key is for a different product!"
                    frmMain.wsBnet.Close
                Case &H202
                    AddChat vbYellow, "Received Packet: 0x202 -", vbRed, " Your CD-Key is banned by Battle.net!"
                    frmMain.wsBnet.Close
                Case &H201
                    AddChat vbYellow, "Received Packet: 0x201 -", vbRed, " Your CD-Key is in use by " & Mid(data, 9, Len(data) - 9)
                    frmMain.wsBnet.Close
            End Select

Is that accurate? I'll work on the clarity for now ;)
I think there is something wrong with how I am sending the 0x51.

Grok

#5
Two tiny changes I'd recommend, from a clean-code perspective.  (I didn't analyze the workings of your post)

#1-
Change:
    Select Case GetWORD(Mid(data, 5, 2))
to:
    pCmd = GetWORD(Mid(data, 5, 2))
    Select Case pCmd

Reason:  It puts the value into a variable you can easily set watches on, and during debugging it is simple to examine the value.

#2-
Your select does not have a default case.  Add "Case Else" after the other cases, and put a "Debug.Assert False" there so it breaks if it runs across a pCmd you didn't otherwise handle.  It won't affect your product once compiled, so you might also wish to add a line to your log or error file.

Camel

Quote[23:34:01] Received Packet: 0x51 ÿQ\0\0\0FyReBoT v0.6\0

a hexdump of that packet:

FF 51 15 00
13 02 00 00
46 79 52 65 42 6F 54 20 76 30 2E 36 00

0x213 is the response you are getting
if you are parsing that correctly, you shouls be able to tell from the 0x200 that it's a cd key problem. the 0x10 say sits the D2XP cd key and not the d2dv key. 0x3 means it's in use.

Case &H51 'cdkey and version check response
    Select Case CVL(Mid(strData, 5, 4))
        Case &H0 '0x000: Passed challenge
            Addtext ColInfo, "CDKey + Ver check (0x51) passed!" & vbCrLf, True
            GoTo SendPassVia0x29
        Case &H100 '0x100: Old game version (Additional info field supplies patch MPQ filename)
            Addtext ColAnError, "Game out of date! (" & NullTruncString(Mid(strData, 9)) & ")" & vbCrLf, True
        Case &H101 '0x101: Invalid version
            Addtext ColAnError, "Invalid game version!" & vbCrLf, True
        Case &H200, &H210 '0x200: Invalid CD key
            Addtext ColAnError, "CD key is invalid!" & vbCrLf, True
        Case &H201, &H211 '0x201: CD key in use (Additional info field supplies name of user)
            Addtext ColAnError, "CD key is in use by " & NullTruncString(Mid(strData, 9)) & vbCrLf, True
        Case &H202, &H212 '0x202: Banned key
            Addtext ColAnError, "Your CD key is banned!" & vbCrLf, True
        Case &H203, &H213 '0x203: Wrong Product
            Addtext ColAnError, "Your CD key is for the wrong product!" & vbCrLf, True

FyRe

#7
Well, I don't know what was happening yesterday with my LOD key.  I guess it was being used and I wasn't catching it right.  I fixed the problem and did Grok's suggestion.  I'm still working on Skys.  Thanks guys for the help!

:)

Noodlez

#8
btw, you should do GetDWORD not GetWORD