Valhalla Legends Forums Archive | Battle.net Bot Development | 0x51 result = 0x101 but why ?

AuthorMessageTime
PhoeNix_FasT
[CODE]SEND -> (0x01) Protocol Byte  1 Bytes sent
SEND -> (0x50) SID_AUTH_INFO  53 Bytes sent
RECV <- (0x25) : 8 Bytes received
RECV <- (0x50) : 232 Bytes received

0x50 Packet Content:
------------------------------------
m_loginType: 2
m_srvToken: 1572257005
m_udpVal: 13964044
m_mpqFiletime: 128013499540000000
m_verFilename: ver-IX86-5.mpq

MPQ Number = 5
crResult = 1864902118
exeVer = 65557

RECV <- (0x51) : 9 Bytes received


Packet 0x51 Content:
------------------------------
result : 0x101
extraInfo :

RECV <- (0x00) : 4 Bytes received[/CODE]


How to fix that 0x101 ?  ???
I've searched the forum already and i found that MPQNumber Problem which is fixed already
August 18, 2007, 10:18 AM
Barabajagal
101 is a failed version check. My question is what game are you connecting with that still uses a ver-IX86-X.mpq file? Everything uses lockdown now.
August 18, 2007, 10:29 AM
PhoeNix_FasT
I tried Diablo 2 and Warcraft 3 RoC

EDIT : Maybe it helps if i show the code too

[CODE]
        private void HandleAuthInfo(DataReader dr)
        {
            m_loginType = dr.ReadUInt32();
            m_srvToken = dr.ReadUInt32();
            m_udpVal = dr.ReadUInt32();
            m_mpqFiletime = dr.ReadInt64();
            m_verFilename = dr.ReadCString();
            m_valString = dr.ReadCString();

            richTextBox1.AppendText("\n0x50 Packet Content:\n");
            richTextBox1.AppendText("------------------------------------\n");
            richTextBox1.AppendText("m_loginType: " + m_loginType + "\n");
            richTextBox1.AppendText("m_srvToken: " + m_srvToken + "\n");
            richTextBox1.AppendText("m_udpVal: " + m_udpVal + "\n");
            richTextBox1.AppendText("m_mpqFiletime: " + m_mpqFiletime + "\n");
            richTextBox1.AppendText("m_verFilename: " + m_verFilename + "\n\n");
     
            int crResult, exeVer;
            string exeInfo = null;
            string strLocalGamePath = "C:\\Programme\\Warcraft III\\";
            string[] files = GetFileListForCheckRevision(strLocalGamePath, "WAR3");

            if (files == null)
                return;

            int mpqNum = Bot.CheckRevisionNew.ExtractMPQNumber(m_verFilename);
            richTextBox1.AppendText("\nMPQ Number = " + mpqNum +"\n");
            crResult = Bot.CheckRevisionNew.DoCheckRevision(m_valString, files, mpqNum);
            richTextBox1.AppendText("\ncrResult = " + crResult + "\n");
            exeVer = Bot.CheckRevisionNew.GetExeInfo(files[0], out exeInfo);
            richTextBox1.AppendText("\nexeVer = " + exeVer + "\n");

            CdKey key1, key2 = null;
            key1 = new CdKey("MY CODE HERE IN UPPERCASE WITHOUT DASHES"); // Warcraft III RoC

            m_clientToken = unchecked((uint)new Random().Next());

            BncsPacket pck0x51 = new BncsPacket((byte)0x51);
            pck0x51.Insert(m_clientToken);
            pck0x51.Insert(exeVer);
            pck0x51.Insert(crResult);
            pck0x51.Insert(1);
            pck0x51.Insert(false);
            pck0x51.Insert(key1.Key.Length);
            pck0x51.Insert(key1.Product);
            pck0x51.Insert(key1.Value1);
            pck0x51.Insert(0);
            pck0x51.Insert(key1.GetHash(m_clientToken, m_srvToken));
            pck0x51.InsertCString(exeInfo);
            pck0x51.InsertCString("Test Bot");

            m_clientSocket.Send(pck0x51.GetData(), SocketFlags.None);
        }

[/CODE]
August 18, 2007, 11:15 AM
Camel
Have you looked at a packet log of your bot connecting? It's possible that your packet buffer is messed up - you can mange 0x50 pretty bad without getting disconnected.
August 18, 2007, 4:30 PM
PhoeNix_FasT
[quote author=Camel link=topic=16960.msg171685#msg171685 date=1187454643]
Have you looked at a packet log of your bot connecting? It's possible that your packet buffer is messed up - you can mange 0x50 pretty bad without getting disconnected.
[/quote]

[CODE]
            public static byte[] Create0x50(String productID, byte versionByte)
            {
               

                CultureInfo ci = CultureInfo.CurrentCulture;
                RegionInfo ri = RegionInfo.CurrentRegion;
                TimeSpan ts = DateTime.UtcNow - DateTime.Now;

                BncsPacket pack = new BncsPacket((byte)BattleNet.PacketID.SID_AUTH_INFO);
                pack.Insert(0);
                pack.InsertDwordString(BattleNet.PlatformCodes.Intel_x86);
                pack.InsertDwordString(productID);
                pack.InsertByte(versionByte);
                pack.Insert(0);
                pack.Insert(0);
                pack.Insert((int)(-ts.TotalMinutes));
                pack.Insert(ci.LCID);
                pack.InsertDwordString(string.Format("{0}{1}", ci.TwoLetterISOLanguageName, ri.TwoLetterISORegionName));
                pack.InsertCString(ri.ThreeLetterWindowsRegionName);
                pack.InsertCString(ri.DisplayName);
                return pack.GetData();
            }
[/CODE]

That's my 0x50

and yes i noticed a big diffrence on 0x51

That is the Packet Log from Warcraft III

[CODE]
0000  00 15 0c bc 9f de 00 11  d8 60 88 97 08 00 45 00  ........ .`....E.
0010  00 b8 b3 6e 40 00 80 06  93 d4 c0 a8 b2 17 d5 f8  ...n@... ........
0020  6a 44 0e a9 17 e0 db 30  e3 65 fe 41 51 53 50 18  jD.....0 .e.AQSP.
0030  ff 10 b3 a7 00 00 ff 51  90 00 8f 3d db 01 77 00  .......Q ...=..w.
0040  15 01 68 b2 77 cc 02 00  00 00 00 00 00 00 1a 00  ..h.w... ........
0050  00 00 0e 00 00 00 50 98  2a 00 00 00 00 00 32 18  ......P. *.....2.
0060  db e3 58 91 37 8e c1 00  d7 da 6c 6c 4d ff 4a 6e  ..X.7... ..llM.Jn
0070  3d 5a 1a 00 00 00 12 00  00 00 67 e5 12 00 00 00  =Z...... ..g.....
0080  00 00 33 85 ba dc 19 9b  aa ec 00 f8 e4 ec 05 9d  ..3..... ........
0090  24 b9 2f 7a da 58 77 61  72 33 2e 65 78 65 20 31  $./z.Xwa r3.exe 1
00a0  32 2f 32 38 2f 30 36 20  32 30 3a 33 35 3a 32 31  2/28/06  20:35:21
00b0  20 31 35 37 32 33 30 37  00 50 68 6f 65 4e 69 78    1572307 .PhoeNix
00c0  5f 46 61 53 54 00                                  _FaST.
[/CODE]

And this is from my programm

[CODE]
0000  00 15 0c bc 9f de 00 11  d8 60 88 97 08 00 45 00  ........ .`....E.
0010  00 76 b2 a5 40 00 80 06  94 e0 c0 a8 b2 17 d5 f8  .v..@... ........
0020  6a 43 0e a7 17 e0 13 bb  e5 03 c4 0b 8d e9 50 18  jC...... ......P.
0030  ff 0f b3 64 00 00 ff 51  4e 00 a7 c9 dd 0e 15 00  ...d...Q N.......
0040  01 00 1a e2 65 8a 01 00  00 00 00 00 00 00 1a 00  ....e... ........
0050  00 00 0e 00 00 00 50 98  2a 00 00 00 00 00 8f ce  ......P. *.......
0060  c6 06 83 1b 00 66 95 19  ba 03 0a 83 f8 45 1b 0c  .....f.. .....E..
0070  a2 98 77 61 72 33 2e 65  78 65 00 54 65 73 74 20  ..war3.e xe.Test
0080  42 6f 74 00                                        Bot.
[/CODE]

So diffrent.... i'll try to work on it
August 18, 2007, 7:52 PM

Search