• Welcome to Valhalla Legends Archive.
 

Invalid Version, Help!

Started by Smarter, October 04, 2007, 12:03 PM

Previous topic - Next topic

Smarter

For some reason, I keep getting 0x101 Invalid Version, to my SID_AUTH_CHECK, here is a packet log:



0000  ca 5c 20 00 02 00 02 00 02 00 00 00 08 00 45 00   .\ ...........E.
0010  00 2f 3d 3a 40 00 80 06 97 91 ac 87 7b 56 40 b7   ./=:@.......{V@.
0020  bd 68 05 66 24 97 0e 19 80 ce 39 c4 ec fd 50 18   .h.f$.....9...P.
0030  45 10 4e 0d 00 00 07 00 10 04 00 00 00            E.N..........


0000  02 00 02 00 00 00 ca 5c 20 00 02 00 08 00 45 00   .......\ .....E.
0010  00 33 19 0a 40 00 70 06 cb bd 40 b7 bd 68 ac 87   [email protected][email protected]..
0020  7b 56 24 97 05 66 39 c4 ec fd 0e 19 80 d5 50 18   {V$..f9.......P.
0030  ff f8 8f 0e 00 00 0b 00 10 04 00 00 00 0b 00 00   ................
0040  00                                                .


0000  ca 5c 20 00 02 00 02 00 02 00 00 00 08 00 45 00   .\ ...........E.
0010  00 29 3d 3e 40 00 80 06 02 bb ac 87 7b 56 3f f1   .)=>@.......{V?.
0020  53 07 05 67 17 e0 08 45 3a 43 b7 f2 29 1d 50 18   S..g...E:C..).P.
0030  45 10 6e 06 00 00 01                              E.n....


0000  ca 5c 20 00 02 00 02 00 02 00 00 00 08 00 45 00   .\ ...........E.
0010  00 62 3d 3f 40 00 80 06 02 81 ac 87 7b 56 3f f1   .b=?@.......{V?.
0020  53 07 05 67 17 e0 08 45 3a 44 b7 f2 29 1d 50 18   S..g...E:D..).P.
0030  45 10 dc bb 00 00 ff 50 3a 00 00 00 00 00 36 38   E......P:.....68
0040  58 49 56 44 32 44 0b 00 00 00 00 00 00 00 00 00   XIVD2D..........
0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 53   ..............US
0060  41 00 55 6e 69 74 65 64 20 53 74 61 74 65 73 00   A.United States.


0000  02 00 02 00 00 00 ca 5c 20 00 02 00 08 00 45 00   .......\ .....E.
0010  00 30 8e d2 00 00 6c 06 05 20 3f f1 53 07 ac 87   .0....l.. ?.S...
0020  7b 56 17 e0 05 67 b7 f2 29 1d 08 45 3a 7e 50 18   {V...g..)..E:~P.
0030  ff c4 a2 71 00 00 ff 25 08 00 db a3 2e d4         ...q...%......


0000  02 00 02 00 00 00 ca 5c 20 00 02 00 08 00 45 00   .......\ .....E.
0010  00 90 8e d3 00 00 6c 06 04 bf 3f f1 53 07 ac 87   ......l...?.S...
0020  7b 56 17 e0 05 67 b7 f2 29 25 08 45 3a 7e 50 18   {V...g..)%.E:~P.
0030  ff c4 bb 0e 00 00 ff 50 68 00 00 00 00 00 32 80   .......Ph.....2.
0040  b9 74 62 4c 19 00 00 20 58 7d 99 cb c6 01 76 65   .tbL... X}....ve
0050  72 2d 49 58 38 36 2d 32 2e 6d 70 71 00 41 3d 32   r-IX86-2.mpq.A=2
0060  31 31 39 31 33 34 31 32 31 20 42 3d 31 30 36 37   119134121 B=1067
0070  37 39 31 31 30 30 20 43 3d 31 32 38 34 36 32 37   791100 C=1284627
0080  35 39 33 20 34 20 41 3d 41 5e 53 20 42 3d 42 2d   593 4 A=A^S B=B-
0090  43 20 43 3d 43 2b 41 20 41 3d 41 2d 42 00         C C=C+A A=A-B.


0000  ca 5c 20 00 02 00 02 00 02 00 00 00 08 00 45 00   .\ ...........E.
0010  00 40 3d 43 40 00 80 06 97 77 ac 87 7b 56 40 b7   .@[email protected]..{V@.
0020  bd 68 05 66 24 97 0e 19 80 d5 39 c4 ed 08 50 18   .h.f$.....9...P.
0030  45 05 3e e9 00 00 18 00 01 32 80 b9 74 42 48 46   E.>......2..tXXX
0040  42 43 47 39 36 54 4e 56 56 42 39 32 32 00         XXXXXXXXXXXXX.


Frame (101 bytes):

0000  02 00 02 00 00 00 ca 5c 20 00 02 00 08 00 45 00   .......\ .....E.
0010  00 57 19 23 40 00 70 06 cb 80 40 b7 bd 68 ac 87   .W.#@[email protected]..
0020  7b 56 24 97 05 66 39 c4 ed 08 0e 19 80 ed 50 18   {V$..f9.......P.
0030  ff e0 40 e8 00 00 2f 00 01 01 00 00 00 38 f1 a6   ..@.../......8..
0040  7b 10 00 00 00 06 00 00 00 b9 f7 9c 00 00 00 00   {...............
0050  00 d4 79 d3 8b 7e 94 a6 89 fb d2 84 22 3f b8 27   ..y..~......"?.'
0060  ed be 0e 47 06                                    ...G.

Reassembled TCP (58 bytes):

0000  0b 00 10 04 00 00 00 0b 00 00 00 2f 00 01 01 00   .........../....
0010  00 00 38 f1 a6 7b 10 00 00 00 06 00 00 00 b9 f7   ..8..{..........
0020  9c 00 00 00 00 00 d4 79 d3 8b 7e 94 a6 89 fb d2   .......y..~.....
0030  84 22 3f b8 27 ed be 0e 47 06                     ."?.'...G.


0000  ca 5c 20 00 02 00 02 00 02 00 00 00 08 00 45 00   .\ ...........E.
0010  00 74 3d 44 40 00 80 06 97 42 ac 87 7b 56 40 b7   [email protected]..{V@.
0020  bd 68 05 66 24 97 0e 19 80 ed 39 c4 ed 37 50 18   .h.f$.....9..7P.
0030  44 d6 d4 3d 00 00 4c 00 09 04 00 00 00 02 00 00   D..=..L.........
0040  00 41 3d 32 31 31 39 31 33 34 31 32 31 20 42 3d   .A=2119134121 B=
0050  31 30 36 37 37 39 31 31 30 30 20 43 3d 31 32 38   1067791100 C=128
0060  34 36 32 37 35 39 33 20 34 20 41 3d 41 5e 53 20   4627593 4 A=A^S
0070  42 3d 42 2d 43 20 43 3d 43 2b 41 20 41 3d 41 2d   B=B-C C=C+A A=A-
0080  42 00                                             B.


0000  02 00 02 00 00 00 ca 5c 20 00 02 00 08 00 45 00   .......\ .....E.
0010  00 5a 19 2d 40 00 70 06 cb 73 40 b7 bd 68 ac 87   [email protected]@..h..
0020  7b 56 24 97 05 66 39 c4 ed 37 0e 19 81 39 50 18   {V$..f9..7...9P.
0030  ff 94 7f 84 00 00 32 00 09 01 00 00 00 00 0b 00   ......2.........
0040  01 55 59 0f 71 47 61 6d 65 2e 65 78 65 20 30 38   .UY.qGame.exe 08
0050  2f 31 37 2f 30 35 20 30 31 3a 31 31 3a 34 33 20   /17/05 01:11:43
0060  32 31 32 35 38 32 34 00                           2125824.


0000  ca 5c 20 00 02 00 02 00 02 00 00 00 08 00 45 00   .\ ...........E.
0010  00 93 3d 45 40 00 80 06 02 4a ac 87 7b 56 3f f1   [email protected]..{V?.
0020  53 07 05 67 17 e0 08 45 3a 7e b7 f2 29 8d 50 18   S..g...E:~..).P.
0030  44 a0 84 60 00 00 ff 51 6b 00 01 00 00 00 01 00   D..`...Qk.......
0040  00 00 00 0b 00 01 01 00 00 00 00 00 00 00 38 f1   ..............8.
0050  a6 7b 10 00 00 00 06 00 00 00 b9 f7 9c 00 00 00   .{..............
0060  00 00 d4 79 d3 8b 7e 94 a6 89 fb d2 84 22 3f b8   ...y..~......"?.
0070  27 ed 55 59 0f 71 47 61 6d 65 2e 65 78 65 20 30   '.UY.qGame.exe 0
0080  38 2f 31 37 2f 30 35 20 30 31 3a 31 31 3a 34 33   8/17/05 01:11:43
0090  20 32 31 32 35 38 32 34 00 53 6d 61 72 74 65 72    2125824.Smarter
00a0  00                                                .


0000  02 00 02 00 00 00 ca 5c 20 00 02 00 08 00 45 00   .......\ .....E.
0010  00 31 95 7a 00 00 6c 06 fe 76 3f f1 53 07 ac 87   .1.z..l..v?.S...
0020  7b 56 17 e0 05 67 b7 f2 29 8d 08 45 3a e9 50 18   {V...g..)..E:.P.
0030  ff 59 aa 4b 00 00 ff 51 09 00 01 01 00 00 00      .Y.K...Q.......


(Yeah, I know I left my key in there, hopefully I can trust anyone who is smart enough to be able to read it ;)).

It seems to be in order, in my program, but if someone see's something I don't?
Since '99

BrutalNet.Net

devcode


Camel

#2
Smart enough? It's in plain text. I didn't have any trouble logging in with your CD key. :P

[14:12:32] (VersionCheck) Requesting latest version from http://www.clanbnu.ws/bnubot/version.php?svn=725&release=Development
[14:12:37] (Settings) Setting general_packetLog=true
[14:12:37] (Settings) Writing settings.ini
[14:12:37] Connecting to jbls.org/72.36.180.162:9367.
[14:12:37] (BNLSPacket) SEND
0000   07 00 10 04-00 00 00                              .......
[14:12:37] (BNLSPacketReader) RECV
0000   0b 00 10 04-00 00 00 0b-00 00 00                  ...........
[14:12:37] (MirrorSelector) Searching for fastest of 12 hosts for useast.battle.net
[14:12:38] Connecting to useast.battle.net/63.240.202.131:6112.
[14:12:38] (BNCSPacket) SEND
0000   ff 50 3a 00-00 00 00 00-36 38 58 49-56 44 32 44   .P:.....68XIVD2D
0010   0b 00 00 00-53 55 6e 65-00 00 00 00-f0 00 00 00   ....SUne........
0020   09 04 00 00-09 04 00 00-55 53 41 00-55 6e 69 74   ........USA.Unit
0030   65 64 20 53-74 61 74 65-73 00                     ed States.
[14:12:38] (BNCSPacketReader) RECV
0000   ff 25 08 00-96 ff d3 44                           .%.....D
[14:12:38] (BNCSPacket) SEND
0000   ff 25 08 00-96 ff d3 44                           .%.....D
[14:12:38] (BNCSPacketReader) RECV
0000   ff 50 66 00-00 00 00 00-be ea 9e 72-f6 8f 13 00   .Pf........r....
0010   00 4d 89 7e-99 cb c6 01-76 65 72 2d-49 58 38 36   .M.~....ver-IX86
0020   2d 36 2e 6d-70 71 00 42-3d 31 30 35-35 38 32 30   -6.mpq.B=1055820
0030   39 38 38 20-41 3d 32 32-39 35 30 35-36 30 31 20   988 A=229505601
0040   43 3d 33 35-35 38 32 37-37 39 39 20-34 20 41 3d   C=355827799 4 A=
0050   41 5e 53 20-42 3d 42 5e-43 20 43 3d-43 2d 41 20   A^S B=B^C C=C-A
0060   41 3d 41 2d-42 00                                 A=A-B.
[14:12:38] (BNCSConnection) MPQ: ver-IX86-6.mpq
[14:12:38] (BNLSPacket) SEND
0000   65 00 1a 04-00 00 00 00-00 00 00 00-00 00 00 00   e...............
0010   4d 89 7e 99-cb c6 01 76-65 72 2d 49-58 38 36 2d   M.~....ver-IX86-
0020   36 2e 6d 70-71 00 42 3d-31 30 35 35-38 32 30 39   6.mpq.B=10558209
0030   38 38 20 41-3d 32 32 39-35 30 35 36-30 31 20 43   88 A=229505601 C
0040   3d 33 35 35-38 32 37 37-39 39 20 34-20 41 3d 41   =355827799 4 A=A
0050   5e 53 20 42-3d 42 5e 43-20 43 3d 43-2d 41 20 41   ^S B=B^C C=C-A A
0060   3d 41 2d 42-00                                    =A-B.
[14:12:38] (BNLSPacketReader) RECV
0000   3a 00 1a 01-00 00 00 00-0b 00 01 46-2b c8 9a 67   :..........F+..g
0010   61 6d 65 2e-65 78 65 20-30 36 2f 31-38 2f 30 37   ame.exe 06/18/07
0020   20 31 36 3a-31 31 3a 34-34 20 32 31-32 35 38 32    16:11:44 212582
0030   34 00 00 00-00 00 0b 00-00 00                     4.........
[14:12:38] Recieved version check from BNLS.
[14:12:38] (BNCSPacket) SEND
0000   ff 51 69 00-ec 1e 5c 4e-00 0b 00 01-46 2b c8 9a   .Qi...\N....F+..
0010   01 00 00 00-00 00 00 00-10 00 00 00-06 00 00 00   ................
0020   b9 f7 9c 00-00 00 00 00-a5 b0 fd 21-fe 08 93 75   ...........!...u
0030   43 a3 70 9d-80 26 29 5e-e3 d4 51 a9-67 61 6d 65   C.p..&)^..Q.game
0040   2e 65 78 65-20 30 36 2f-31 38 2f 30-37 20 31 36   .exe 06/18/07 16
0050   3a 31 31 3a-34 34 20 32-31 32 35 38-32 34 00 42   :11:44 2125824.B
0060   4e 55 2d 43-61 6d 65 6c-00                        NU-Camel.
[14:12:38] (BNCSPacketReader) RECV
0000   ff 51 09 00-00 00 00 00-00                        .Q.......
[14:12:38] Passed CD key challenge and CheckRevision.


In any event, what I usually do when I get stuck like this is take a packet log of the actual client logging in, and then trying to reproduce the results through your codebase.

Hdx

It has nothing to do with your cdkey. You're parsing the values BNLS sends you completely wrong.
2f 00 01 /.. - Header
01 00 00 00 .... -Result
38 f1 a6 7b 8..{ -Client
10 00 00 00 .... -Length
06 00 00 00 .... -Product
b9 f7 9c 00 .... -Public
00 00 00 00 .... -Unknown(0)
d4 79 d3 8b .y.. -Hash[0]
7e 94 a6 89 ~... -Hash[1]
fb d2 84 22 ..." -Hash[2]
3f b8 27 ed ?.'. -Hash[3]
be 0e 47 06 ..G. -Hash[4]



32 00 09 2.. -Header
01 00 00 00 .... -Success
00 0b 00 01 .... -Version
55 59 0f 71 UY.q -Checksum
47 61 6d 65 2e 65 78 65 20 30 38 2f 31 37 2f 30 35 20 30 31 3a 31 31 3a 34 33 20 32 31 32 35 38 32 34 00
Game.exe 08/17/05 01:11:43 2125824. -Statstring

                                                           
ff 51 6b 00 .Qk. -Header
01 00 00 00 .... -Client token... bad
01 00 00 00 .... -Version ... Bad
00 0b 00 01 .... -Checksum ... Bad
01 00 00 00 .... -Number of keys
00 00 00 00 .... -Spawn
38 f1 a6 7b 8..{ -Key length 0.o bad
10 00 00 00 .... -Key Product ... Bad
06 00 00 00 .... -Key Public ... Bad
b9 f7 9c 00 .... -Unknown(0) ... Bad
00 00 00 00 .... -Hash[0] ... Bad
d4 79 d3 8b .y.. -Hash[1] ... Bad
7e 94 a6 89 ~... -Hash[2] ... Bad
fb d2 84 22 ..." -Hash[3] ... Bad
3f b8 27 ed ?.'. -Hash[4] ... Bad
55 59 0f 71 47 61 6d 65 2e 65 78 65 20 30 38 2f 31 37 2f 30 35 20 30 31 3a 31 31 3a 34 33 20 32 31 32 35 38 32 34 00
UY.qGame.exe 08/17/05 01:11:43 2125824. -Exe Info ... bad
53 6d 61 72 74 65 72 00 Smarter. -Key Owner


You're doing something horribly wrong. Also, I would suggest switching to 0x1a for your Checkrevision stuff.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Smarter

#4
Here are all my BNLS Recieves:


       public void HandelPacket(byte id, byte[] data, int len)
        {
            DataReader rdr = new DataReader(data);

            switch (id)
            {
                case (byte)BNLS_Packet.BNLS_REQUESTVERSIONBYTE:
                    int productID = rdr.ReadInt32();
                    c.verByte = rdr.ReadInt32();
                    c.AddChat("[BNLS] Recieved Version Byte! VerByte: " + c.verByte, Color.LightGreen);
                    c.send0x50();
                    break;
                case (byte)BNLS_Packet.BNLS_CDKEY:
                    bool success = rdr.ReadBoolean();
                    c.clientKey = rdr.ReadInt32();
                    c.keyData = rdr.ReadInt32Array(9);
                    c.AddChat("[BNLS] Recieved CDKey Information.", Color.LightGreen);
                    c.sendBNLS_VERSIONCHECK();
                    break;
                case (byte)BNLS_Packet.BNLS_VERSIONCHECK:
                    bool verchksuccess = rdr.ReadBoolean();
                    c.retVersion = rdr.ReadInt32();
                    c.checksum = rdr.ReadInt32().ToString();
                    c.verStatString = rdr.ReadCString();
                    c.AddChat("[BNLS] Recieved Version Check Information.", Color.LightGreen);
                    c.send0x51();
                    break;
            }
        }


They are correct from what I know, as I read in the BNLSProtocolSpec.txt .... ?
Since '99

BrutalNet.Net

Hdx

Looks right, My only thought could be that 1) you're not correctly removing headers
2) your reader isnt actually removing the 'boolean' use ReadInt32()
And learn how to view/debug your packet logs.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Smarter

#6
Well, here's my listener:


        public void Listener()
        {
            while (sck.Connected)
            {
                byte packetID;
                int dataLength;
                byte[] packetData;

                try
                {
                    byte[] header = Recieve(3);
                    packetID = header[2];
                    dataLength = BitConverter.ToInt16(header, 0) - 3;
                    packetData = Recieve(dataLength);
                    HandelPacket(packetID, packetData, dataLength);
                }
                catch (SocketException se)
                {
                    //chatModule.AddChat("Error: " + se.Message, Color.Red);
                }

            }
        }


I don't believe i'm having a problem with the reciving however, because my RequestVerbyte works flawlessly, and I'll see if the Bool helps, but I recently changed that, after I was having the problem... anyone else have any ideas?

Edit: Well, Hdx, you have deduced my problem! It was the boolean, for some reason it wasn't reading correctly, a simple change to ReadInt32(), and Version Check Passed! :-D Thanks.
Since '99

BrutalNet.Net