• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Jaquio

#1
Battle.net Bot Development / D2 Logon
February 06, 2007, 09:59 PM
Alright, well I am wondering..

What exactly is the correct logon sequence? I know it is posted on BNetDocs, but it doesn't say which BNLS packets to send with it. So could someone tell me that exact packets to send including BNLS packets?
#2
Web Development / Making a PHP Bot
November 05, 2006, 03:29 AM
I seen a topic on here, and the source page to download is down. So I went ahead and almost started making one, but then already ran into a problem. You know how some packet parsers in Visual Basic use the copymemory(Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal numbytes As Long)) well would you really need to do that in PHP to do things like make a dword an such? Or would there be another way of doing it? I am converting this to php.


Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal numbytes As Long)

Public Function Clear()
    strBuffer = vbNullString
End Function

Public Function ClearData()
    strBuff = vbNullString
End Function

Public Function GetData() As String
     GetData = strBuff
End Function

Public Function InsertATString(Data As String)
    strBuffer = strBuffer & Data & Chr(&HA)
End Function

Public Function InsertBYTE(Data As Integer)
    strBuffer = strBuffer & Chr(Data)
End Function

Public Function InsertBytes(Data As String)
    Dim i As Long
    Dim enqueueer As String
   
    For i = 1 To Len(Data) Step 3
        enqueueer = enqueueer & Chr(Val("&h0" & Mid(Data, i, 2)))
    Next i
    strBuffer = strBuffer & enqueueer
End Function

Public Function InsertData(Data As String)
    strBuffer = strBuffer & Data
End Function

Public Function InsertDWORD(Data As Long)
    strBuffer = strBuffer & MakeDWORD(Data)
End Function

Public Function InsertDWORDArray(Data() As Long)
    Dim i As Integer
    For i = LBound(Data) To UBound(Data) Step 1
        strBuffer = strBuffer & MakeDWORD(Data(i))
    Next i
End Function

Public Function InsertNonNTString(Data As String)
    strBuffer = strBuffer & Data
End Function

Public Function InsertNonNTStringArray(Data() As String)
    Dim i As Integer
    For i = LBound(Data) To UBound(Data) Step 1
        strBuffer = strBuffer & Data(i)
    Next i
End Function

Public Function InsertNTString(Data As String)
    strBuffer = strBuffer & Data & Chr(0)
End Function

Public Function InsertWORD(Data As Integer)
    strBuffer = strBuffer & MakeWORD(Data)
End Function

Public Function MakeDWORD(Value As Long) As String
    Dim Result As String * 4
    CopyMemory ByVal Result, Value, 4
    MakeDWORD = Result
End Function

Function MakeWORD(Value As Integer) As String
    Dim Result As String * 2
    CopyMemory ByVal Result, Value, 2
    MakeWORD = Result
End Function

Public Function rATString() As String
    On Error Resume Next
    rATString = Left(strBuff, InStr(strBuff, Chr(&HA)) - 1)
    strBuff = Mid(strBuff, Len(rATString) + 2)
End Function

Public Function rBYTE() As Byte
    rBYTE = Asc(Left(strBuff, 1))
    strBuff = Mid(strBuff, 2)
End Function

Public Function rDWORD() As Long
    Dim lReturn As Long, strTMP As String
    strTMP = Left(strBuff, 4)
    Call CopyMemory(lReturn, ByVal strTMP, 4)
    rDWORD = lReturn
    strBuff = Mid(strBuff, 5)
End Function

Public Function rFILETIME(Optional QWORD As Boolean = False) As String
    Dim strFT() As String, strTMP As String
    If Not QWORD Then
        strFT = Split(rNTString & Space(1), Space(1))
        If strFT(0) > 2147483647 Then strFT(0) = (strFT(0) - 4294967296#)
        If strFT(1) > 2147483647 Then strFT(1) = (strFT(1) - 4294967296#)
    Else
        ReDim strFT(0 To 1)
        strFT(1) = rDWORD
        strFT(0) = rDWORD
    End If
    rFILETIME = strFT(0) & Space(1) & strFT(1)
End Function

Public Function rNonNTString() As String
    rNonNTString = Left(strBuff, 4)
    strBuff = Mid(strBuff, 5)
End Function

Public Function rNTString() As String
    On Error Resume Next
    rNTString = Left(strBuff, InStr(strBuff, Chr(&H0)) - 1)
    strBuff = Mid(strBuff, Len(rNTString) + 2)
End Function

Public Function rVOID(Leng As Integer) As String
    If Len(strBuff) < Leng Then Leng = Len(strBuff)
    rVOID = Left(strBuff, Leng)
    strBuff = Mid(strBuff, Leng + 1)
End Function

Public Function rWORD() As Long
    Dim lReturn As Long, strTMP As String
    strTMP = Left(strBuff, 2)
    Call CopyMemory(lReturn, ByVal strTMP, 2)
    rWORD = lReturn
    strBuff = Mid(strBuff, 3)
End Function

Public Function SendBNCSPacket(PacketID As Byte)
If frmMain.wskBNet.State <> sckConnected Then: Exit Function
    Debug.Print "Sent:" & GetPacketName(PacketID, "BNCS") & "(" & Hex(PacketID) & ")"
    frmMain.wskBNet.SendData Chr(&HFF) & Chr(PacketID) & MakeWORD(Len(strBuffer) + 4) & strBuffer

    Clear
End Function

Public Function SendBNLSPacket(PacketID As Byte)
If frmMain.wskBNLS.State <> sckConnected Then: Exit Function
    frmMain.wskBNLS.SendData MakeWORD(Len(strBuffer) + 3) & Chr(PacketID) & strBuffer

    Clear
End Function

Public Function SendRPacket(PacketID As Byte)
If frmMain.wskRealm.State <> sckConnected Then: Exit Function
    frmMain.wskRealm.SendData MakeWORD(Len(strBuffer) + 3) & Chr(PacketID) & strBuffer

    Clear
End Function

Public Function SetData(Data As String)
    strBuff = Data
End Function
#3
Lol, whenever you click on the printable version link on bnetdocs it always goes to 'Packet not found' someone should fix that.. o_O
#4
Alright, EVERYTIME I create an account using my bot, when I try to logon I get 'Invalid' password, any idea why? This is a packetlog from trying to create an account using War3.


15  71.124.70.4:4753  63.161.183.205:9367  27  Send 
0000  1B 00 02 49 6D 41 55 73 65 72 6E 61 6D 65 00 49    ...ImAUsername.I
0010  6D 41 50 61 73 73 77 6F 72 64 00                   mAPassword.

16  63.161.183.205:9367  71.124.70.4:4753  35  Recv 
0000  23 00 02 B9 8D B0 B3 8E F4 F0 35 90 E7 81 7C BF    #.........5...|.
0010  A3 FD C9 4E 33 34 57 EC B7 2C 6F 29 71 53 F5 B4    ...N34W..,o)qS..
0020  46 9F 7F                                           F..

17  71.124.70.4:4754  211.233.0.54:6112  48  Send 
0000  FF 53 30 00 B9 8D B0 B3 8E F4 F0 35 90 E7 81 7C    .S0........5...|
0010  BF A3 FD C9 4E 33 34 57 EC B7 2C 6F 29 71 53 F5    ....N34W..,o)qS.
0020  B4 46 9F 7F 49 6D 41 55 73 65 72 6E 61 6D 65 00    .F..ImAUsername.

18  211.233.0.54:6112  71.124.70.4:4754  72  Recv 
0000  FF 53 48 00 01 00 00 00 00 00 00 00 00 00 00 00    .SH.............
0010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0040  00 00 00 00 00 00 00 00                            ........

19  71.124.70.4:4753  63.161.183.205:9367  27  Send 
0000  1B 00 04 49 4D 41 55 53 45 52 4E 41 4D 45 00 49    ...IMAUSERNAME.I
0010  4D 41 50 41 53 53 57 4F 52 44 00                   MAPASSWORD.

20  63.161.183.205:9367  71.124.70.4:4753  67  Recv 
0000  43 00 04 21 BF 3F D5 2F 3F 4E 94 4B 75 BE 0F C2    C..!.?./?N.Ku...
0010  86 EE 9B E9 AB 00 27 8C 02 82 2A 95 C1 C7 1E 78    ......'...*....x
0020  B9 8B 5F FF 73 51 9D F0 29 A8 1B 49 9B 51 47 4D    .._.sQ..)..I.QGM
0030  A1 2A C4 DD 54 F3 A4 B5 B8 82 C0 93 D4 61 78 B6    .*..T........ax.
0040  AE DC 79                                           ..y

21  71.124.70.4:4754  211.233.0.54:6112  80  Send 
0000  FF 52 50 00 21 BF 3F D5 2F 3F 4E 94 4B 75 BE 0F    .RP.!.?./?N.Ku..
0010  C2 86 EE 9B E9 AB 00 27 8C 02 82 2A 95 C1 C7 1E    .......'...*....
0020  78 B9 8B 5F FF 73 51 9D F0 29 A8 1B 49 9B 51 47    x.._.sQ..)..I.QG
0030  4D A1 2A C4 DD 54 F3 A4 B5 B8 82 C0 93 D4 61 78    M.*..T........ax
0040  B6 AE DC 79 49 6D 41 55 73 65 72 6E 61 6D 65 00    ...yImAUsername.

22  211.233.0.54:6112  71.124.70.4:4754  8  Recv 
0000  FF 52 08 00 00 00 00 00                            .R......


I get account created successfully but when I logon, invalid password.. Any idea why? I do not have a problem creating an account on the other products. Just War3 An TFT..
#5
For some reason EVERYTIME I connect to bnet on my bot, it has a latency of like.. 400-500ms.. Any idea why? Because when I connect of any other bot it's 50-75ms.. An I cannot figure out why..

Again, it's something that didn't happen on the other bot I made(was outdated needed to start anew), but is happening on this one.. I am sending everything the same.. But not sure why..

Also, when I connect to BNet of anything else other then Starcraft I get invalid version.. Any idea on that? I am using BNLS to get all the information.. Works with starcraft an not anything else.. Again, I think I am sending everything correctly but who knows.. It worked on my other bot an it's the same exact setup(was testing to see if it was my code but it wasn't)..
#6

------wskBNet_DataArrival------
Data:ÿ% »-ÿPf     [a...Œ¾JÌb ØpÖ½ ÆIX86ver0.mpq A=1481262565 B=1172659121 C=1538349130 4 A=A+S B=B-C C=C+A A=A+B
Hexed: FF 25 08 00 0B 08 BB 2D FF 50 66 00 00 00 00 00 5B 61 85 8C BE 4A CC 62 20 D8 70 D6 BD 0C C6 01 49 58 38 36 76 65 72 30 2E 6D 70 71 00 41 3D 31 34 38 31 32 36 32 35 36 35 20 42 3D 31 31 37 32 36 35 39 31 32 31 20 43 3D 31 35 33 38 33 34 39 31 33 30 20 34 20 41 3D 41 2B 53 20 42 3D 42 2D 43 20 43 3D 43 2B 41 20 41 3D 41 2B 42 00
Bytes Total:110
------wskBNet_DataArrival------


See that? I am receiving 0x25 a 0x50 at the same time, so therefore I cannot parse anything correctly..

Is there a way at all I could fix that, I have tried a few attempts but it sorta made it worse an made it get stuck in other places..

Here is what I have tried..


  • Spliting the hex by 0xFF, but what if the data contains more then one 0x0FF I am screwed?
  • Sending 0x50 when I receive 0x25, but not sure if that is a good idea?

I didn't have this problem before why now? I did this just as I did my other bot(It's old an outdated needed to start anew). Not sure why it's happening.. Any ideas as to what could cause this?[/li]
#7
General Programming / YIM Packets
April 27, 2006, 12:35 AM
Alright, wasn't sure where to post this, but since it's general programming figured I would post it here..

I was wondering if anyone has any documentations for Yahoo Messenger Packets, preferably the new YIM. I have packet logged myself connecting an whatnot but can't make heads or tails from the log.. Was just wondering if anyone did have it... Or knew where I could find one, have tried google an found once for C/C++ but I am gonna do this in VB.

When I first connect to the server, I recieve nothing.. So I guess I have to send something first? Who knows, I have tried sending everything.. No idea what to do.


So yea, any ideas would be really great.. Thanks.
#8
Visual Basic Programming / Color Chooser?
March 10, 2006, 06:48 PM
Alright, how would I go about creating something along the lines of when you rightclick on a color for a custom color in VB6? I want it to return that color value.. How would I do this exactly?
#9
Umm, I was wondering what is the exact account create Sequence for War3/TFT and what is the Sequence for other games? I am using BNLS so  I would also need to know exactly which BNLS Pakcets I would have to send as well, thanks,
#10
Alright, as I said in another post I went through and re-did all my packets since I had a new class that would make it easier. Because I was using stuff like.. "Mid(Data, blah, blah)" the blahs were not numbers not actual blahs.  :P Anyways, Hdx had given me a class with removedword and such. So I re-did my packets using them, however after doing so my 0x3E quit working for some reason.. Could someone tell me exactly what is wrong with this..


1  70.106.238.227:1352  63.161.183.205:9367  17  Send 
0000  11 00 0E 4A 61 71 20 42 6F 74 20 76 31 2E 30 30    ...Jaq Bot v1.00
0010  00                                                 .

2  63.161.183.205:9367  70.106.238.227:1352  7  Recv 
0000  07 00 0E 73 32 EF C2                               ...s2..

3  70.106.238.227:1352  63.161.183.205:9367  7  Send 
0000  07 00 0F 37 17 56 D7                               ...7.V.

4  63.161.183.205:9367  70.106.238.227:1352  7  Recv 
0000  07 00 0F 01 00 00 00                               .......

5  70.106.238.227:1352  63.161.183.205:9367  7  Send 
0000  07 00 10 04 00 00 00                               .......

6  63.161.183.205:9367  70.106.238.227:1352  11  Recv 
0000  0B 00 10 04 00 00 00 0B 00 00 00                   ...........

7  70.106.238.227:1353  63.241.83.109:6112  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 56 44 32    ..P:.....68XIVD2
0010  44 0B 00 00 00 00 00 00 00 00 00 00 00 80 04 00    D...............
0020  00 33 10 00 00 33 10 00 00 55 53 41 00 55 6E 69    .3...3...USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                   ted States.

8  63.241.83.109:6112  70.106.238.227:1353  8  Recv 
0000  FF 25 08 00 3F 45 2F CC                            .%..?E/.

9  63.241.83.109:6112  70.106.238.227:1353  99  Recv 
0000  FF 50 63 00 00 00 00 00 F1 21 0F 2A 2B 80 0E 00    .Pc......!.*+...
0010  00 AC 41 43 25 0B C5 01 49 58 38 36 76 65 72 35    ..AC%...IX86ver5
0020  2E 6D 70 71 00 41 3D 32 36 34 34 33 38 36 37 36    .mpq.A=264438676
0030  20 42 3D 38 39 35 34 37 37 39 35 39 20 43 3D 32     B=895477959 C=2
0040  37 36 33 34 36 36 36 36 20 34 20 41 3D 41 5E 53    76346666 4 A=A^S
0050  20 42 3D 42 2B 43 20 43 3D 43 5E 41 20 41 3D 41     B=B+C C=C^A A=A
0060  5E 42 00                                           ^B.

10  70.106.238.227:1352  63.161.183.205:9367  73  Send 
0000  49 00 09 04 00 00 00 05 00 00 00 41 3D 32 36 34    I..........A=264
0010  34 33 38 36 37 36 20 42 3D 38 39 35 34 37 37 39    438676 B=8954779
0020  35 39 20 43 3D 32 37 36 33 34 36 36 36 36 20 34    59 C=276346666 4
0030  20 41 3D 41 5E 53 20 42 3D 42 2B 43 20 43 3D 43     A=A^S B=B+C C=C
0040  5E 41 20 41 3D 41 5E 42 00                         ^A A=A^B.

11  63.161.183.205:9367  70.106.238.227:1352  50  Recv 
0000  32 00 09 01 00 00 00 00 0B 00 01 83 62 5A 7F 47    2...........bZ.G
0010  61 6D 65 2E 65 78 65 20 30 38 2F 31 37 2F 30 35    ame.exe 08/17/05
0020  20 30 31 3A 31 31 3A 34 33 20 32 31 32 35 38 32     01:11:43 212582
0030  34 00                                              4.

14  70.106.238.227:1353  63.241.83.109:6112  110  Send 
0000  FF 25 08 00 00 00 00 00 FF 51 66 00 30 D1 E4 3D    .%.......Qf.0..=
0010  00 0B 00 01 83 62 5A 7F 01 00 00 00 00 00 00 00    .....bZ.........
0020  10 00 00 00 06 00 00 00 08 7B C1 00 00 00 00 00    .........{......
0030  89 1E 5A 9A 50 3A 20 AD 94 8F 91 E7 4C F6 2D C9    ..Z.P: .....L.-.
0040  7A DC EA B5 47 61 6D 65 2E 65 78 65 20 30 38 2F    z...Game.exe 08/
0050  31 37 2F 30 35 20 30 31 3A 31 31 3A 34 33 20 32    17/05 01:11:43 2
0060  31 32 35 38 32 34 00 4A 61 71 75 69 6F 00          125824.Jaquio.

15  63.241.83.109:6112  70.106.238.227:1353  9  Recv 
0000  FF 51 09 00 00 00 00 00 00                         .Q.......

16  70.106.238.227:1352  63.161.183.205:9367  28  Send 
0000  1C 00 0B 09 00 00 00 02 00 00 00 XX XX XX XX XX    ...........XXXXX
0010  XX XX XX XX 30 D1 E4 3D F1 21 0F 2A                XXXX0..=.!.*

17  63.161.183.205:9367  70.106.238.227:1352  23  Recv 
0000  17 00 0B D7 1B 2F 36 58 8B DC 81 DC 6A 9D E4 70    ...../6X....j..p
0010  E1 71 D3 67 4D 41 79                               .q.gMAy

18  70.106.238.227:1353  63.241.83.109:6112  51  Send 
0000  FF 14 08 00 74 65 6E 62 FF 2D 04 00 FF 3A 27 00    ....tenb.-...:'.
0010  30 D1 E4 3D F1 21 0F 2A D7 1B 2F 36 58 8B DC 81    0..=.!.*../6X...
0020  DC 6A 9D E4 70 E1 71 D3 67 4D 41 79 4A 61 71 75    .j..p.q.gMAyJaqu
0030  69 6F 00                                           io.

19  63.241.83.109:6112  70.106.238.227:1353  22  Recv 
0000  FF 2D 16 00 00 08 16 BF E9 50 C3 01 69 63 6F 6E    .-.......P..icon
0010  73 2E 62 6E 69 00                                  s.bni.

20  63.241.83.109:6112  70.106.238.227:1353  8  Recv 
0000  FF 3A 08 00 00 00 00 00                            .:......

21  70.106.238.227:1353  63.241.83.109:6112  4  Send 
0000  FF 40 04 00                                        .@..

22  63.241.83.109:6112  70.106.238.227:1353  51  Recv 
0000  FF 40 33 00 00 00 00 00 01 00 00 00 01 00 00 00    .@3.............
0010  55 53 57 65 73 74 00 52 65 61 6C 6D 20 66 6F 72    USWest.Realm for
0020  20 74 68 65 20 55 53 20 57 65 73 74 20 43 6F 61     the US West Coa
0030  73 74 00                                           st.

23  70.106.238.227:1352  63.161.183.205:9367  27  Send 
0000  1B 00 0B 08 00 00 00 02 00 00 00 70 61 73 73 77    ...........passw
0010  6F 72 64 30 D1 E4 3D F1 21 0F 2A                   ord0..=.!.*

24  63.161.183.205:9367  70.106.238.227:1352  23  Recv 
0000  17 00 0B 30 17 F9 02 8E 0F 2F 3A 98 E4 5C A9 30    ...0...../:..\.0
0010  D7 53 C3 31 44 31 5D                               .S.1D1]

25  70.106.238.227:1353  63.241.83.109:6112  31  Send 
0000  FF 3E 1F 00 30 17 F9 02 8E 0F 2F 3A 98 E4 5C A9    .>..0...../:..\.
0010  30 D7 53 C3 31 44 31 5D 55 53 57 65 73 74 00       0.S.1D1]USWest.

26  63.241.83.109:6112  70.106.238.227:1353  12  Recv 
0000  FF 3E 0C 00 30 17 F9 02 01 00 00 80                .>..0.......


That is a packet log of an attempt to log onto a realm.. If you need the code I will post it, but perhaps someone could tell me what is wrong with that..
#11
Ok, I came prepared this time! O_o. Here is my problem:

I send all the required packets and such to BNet. But once I send MCP_CHARLOGON(0x07) and then recv it back I get a message of "0x00" I think.. Which means 'Success'. But for some reason when I send SID_ENTERCHAT(0x0A) I get disconnected. Anyone know why?  :-\

Handling Recv'd MCP_CHARLOGON(0x07):

        Case &H7
        'debug.print "Recv'd:0x07"
            DB.SetData Data
            DB.StripRealmHeader
           
            Select Case DB.rDWORD
           
                Case &H0
                    AddChat D2Green, "Character logon was a success."
                            With PB
                                .InsertNTString BNET.Username
                                .InsertBYTE &H0
                                .SendPacket &HA
                                .InsertNonNTString strProduct
                                .SendPacket &HB
                            End With
                Case &H46
                    AddChat D2Red, "Player was not found!"
                Case &H7A
                    AddChat D2Red, "Logon has failed!"
                Case &H7B
                    AddChat D2Red, "Character has expired!"
                Case Else
                    AddChat D2Red, "Unknown Error!"
            End Select



Packet log:

1  192.168.1.47:2261  63.161.183.205:9367  17  Send 
0000  11 00 0E 4A 61 71 20 42 6F 74 20 76 31 2E 30 30    ...Jaq Bot v1.00
0010  00                                                 .

2  63.161.183.205:9367  192.168.1.47:2261  7  Recv 
0000  07 00 0E 12 78 E1 C6                               ....x..

3  192.168.1.47:2261  63.161.183.205:9367  7  Send 
0000  07 00 0F 6A 8A 43 CB                               ...j.C.

4  63.161.183.205:9367  192.168.1.47:2261  7  Recv 
0000  07 00 0F 01 00 00 00                               .......

5  192.168.1.47:2261  63.161.183.205:9367  7  Send 
0000  07 00 10 04 00 00 00                               .......

6  63.161.183.205:9367  192.168.1.47:2261  11  Recv 
0000  0B 00 10 04 00 00 00 0B 00 00 00                   ...........

7  192.168.1.47:2262  213.248.106.65:6112  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 56 44 32    ..P:.....68XIVD2
0010  44 0B 00 00 00 00 00 00 00 00 00 00 00 80 04 00    D...............
0020  00 33 10 00 00 33 10 00 00 55 53 41 00 55 6E 69    .3...3...USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                   ted States.

8  213.248.106.65:6112  192.168.1.47:2262  8  Recv 
0000  FF 25 08 00 54 A9 95 C3                            .%..T...

9  213.248.106.65:6112  192.168.1.47:2262  99  Recv 
0000  FF 50 63 00 00 00 00 00 99 96 E9 C6 9B CD 0C 00    .Pc.............
0010  00 AC 41 43 25 0B C5 01 49 58 38 36 76 65 72 35    ..AC%...IX86ver5
0020  2E 6D 70 71 00 41 3D 38 39 35 30 32 39 35 30 30    .mpq.A=895029500
0030  20 42 3D 39 35 37 36 39 34 30 35 39 20 43 3D 31     B=957694059 C=1
0040  32 33 39 30 30 32 38 32 20 34 20 41 3D 41 2D 53    23900282 4 A=A-S
0050  20 42 3D 42 2D 43 20 43 3D 43 5E 41 20 41 3D 41     B=B-C C=C^A A=A
0060  5E 42 00                                           ^B.

10  192.168.1.47:2261  63.161.183.205:9367  74  Send 
0000  4A 00 09 04 00 00 00 05 00 00 00 41 3D 38 39 35    J..........A=895
0010  30 32 39 35 30 30 20 42 3D 39 35 37 36 39 34 30    029500 B=9576940
0020  35 39 20 43 3D 31 32 33 39 30 30 32 38 32 20 34    59 C=123900282 4
0030  20 41 3D 41 2D 53 20 42 3D 42 2D 43 20 43 3D 43     A=A-S B=B-C C=C
0040  5E 41 20 41 3D 41 5E 42 00 00                      ^A A=A^B..

11  63.161.183.205:9367  192.168.1.47:2261  50  Recv 
0000  32 00 09 01 00 00 00 00 0B 00 01 99 FF 2F 59 47    2............/YG
0010  61 6D 65 2E 65 78 65 20 30 38 2F 31 37 2F 30 35    ame.exe 08/17/05
0020  20 30 31 3A 31 31 3A 34 33 20 32 31 32 35 38 32     01:11:43 212582
0030  34 00                                              4.

14  192.168.1.47:2262  213.248.106.65:6112  110  Send 
0000  FF 25 08 00 00 00 00 00 FF 51 66 00 99 60 6D 33    .%.......Qf..`m3
0010  00 0B 00 01 99 FF 2F 59 01 00 00 00 00 00 00 00    ....../Y........
0020  10 00 00 00 06 00 00 00 08 7B C1 00 00 00 00 00    .........{......
0030  5B BB 3C EC E0 A8 5E CA B0 18 48 3A 4C B7 C0 3E    [.<...^...H:L..>
0040  58 B4 2E AD 47 61 6D 65 2E 65 78 65 20 30 38 2F    X...Game.exe 08/
0050  31 37 2F 30 35 20 30 31 3A 31 31 3A 34 33 20 32    17/05 01:11:43 2
0060  31 32 35 38 32 34 00 4A 61 71 75 69 6F 00          125824.Jaquio.

15  213.248.106.65:6112  192.168.1.47:2262  9  Recv 
0000  FF 51 09 00 00 00 00 00 00                         .Q.......

16  192.168.1.47:2261  63.161.183.205:9367  20  Send 
0000  14 00 0B 09 00 00 00 00 00 00 00 XX XX XX XX XX    ...........XXXXX
0010  XX XX XX XX                                        XXXX

17  63.161.183.205:9367  192.168.1.47:2261  23  Recv 
0000  17 00 0B 12 19 01 03 52 7C DD 5A 65 BD FC AC 7B    .......R|.Ze...{
0010  95 B5 40 74 6A 6D 89                               ..@tjm.

18  192.168.1.47:2261  63.161.183.205:9367  39  Send 
0000  27 00 0B 1C 00 00 00 01 00 00 00 99 60 6D 33 99    '...........`m3.
0010  96 E9 C6 12 19 01 03 52 7C DD 5A 65 BD FC AC 7B    .......R|.Ze...{
0020  95 B5 40 74 6A 6D 89                               ..@tjm.

19  63.161.183.205:9367  192.168.1.47:2261  23  Recv 
0000  17 00 0B 53 08 22 8C CC C5 15 2C 93 AD 7B FC 9A    ...S."....,..{..
0010  C4 AC 9C A1 B9 0F EA                               .......

20  192.168.1.47:2262  213.248.106.65:6112  51  Send 
0000  FF 14 08 00 74 65 6E 62 FF 2D 04 00 FF 3A 27 00    ....tenb.-...:'.
0010  99 60 6D 33 99 96 E9 C6 53 08 22 8C CC C5 15 2C    .`m3....S."....,
0020  93 AD 7B FC 9A C4 AC 9C A1 B9 0F EA 4A 61 71 75    ..{.........Jaqu
0030  69 6F 00                                           io.

21  213.248.106.65:6112  192.168.1.47:2262  22  Recv 
0000  FF 2D 16 00 00 08 16 BF E9 50 C3 01 69 63 6F 6E    .-.......P..icon
0010  73 2E 62 6E 69 00                                  s.bni.

22  213.248.106.65:6112  192.168.1.47:2262  8  Recv 
0000  FF 3A 08 00 00 00 00 00                            .:......

23  192.168.1.47:2262  213.248.106.65:6112  4  Send 
0000  FF 40 04 00                                        .@..

24  213.248.106.65:6112  192.168.1.47:2262  40  Recv 
0000  FF 40 28 00 00 00 00 00 01 00 00 00 01 00 00 00    .@(.............
0010  45 75 72 6F 70 65 00 52 65 61 6C 6D 20 66 6F 72    Europe.Realm for
0020  20 45 75 72 6F 70 65 00                             Europe.

25  192.168.1.47:2261  63.161.183.205:9367  19  Send 
0000  13 00 0B 08 00 00 00 00 00 00 00 70 61 73 73 77    ...........passw
0010  6F 72 64                                           ord

26  63.161.183.205:9367  192.168.1.47:2261  23  Recv 
0000  17 00 0B EC C8 0D 1D 76 E7 58 C0 B9 DA 8C 25 FF    .......v.X....%.
0010  10 6A FF 8E 24 29 16                               .j..$).

27  192.168.1.47:2261  63.161.183.205:9367  39  Send 
0000  27 00 0B 1C 00 00 00 01 00 00 00 99 60 6D 33 99    '...........`m3.
0010  96 E9 C6 EC C8 0D 1D 76 E7 58 C0 B9 DA 8C 25 FF    .......v.X....%.
0020  10 6A FF 8E 24 29 16                               .j..$).

28  63.161.183.205:9367  192.168.1.47:2261  23  Recv 
0000  17 00 0B AF 31 0F 54 72 43 18 AF 60 4E 65 35 95    ....1.TrC..`Ne5.
0010  ED E7 77 E8 5B 99 9D                               ..w.[..

29  192.168.1.47:2262  213.248.106.65:6112  35  Send 
0000  FF 3E 23 00 99 60 6D 33 AF 31 0F 54 72 43 18 AF    .>#..`m3.1.TrC..
0010  60 4E 65 35 95 ED E7 77 E8 5B 99 9D 45 75 72 6F    `Ne5...w.[..Euro
0020  70 65 00                                           pe.

30  213.248.106.65:6112  192.168.1.47:2262  85  Recv 
0000  FF 3E 55 00 99 60 6D 33 55 23 53 37 D5 F8 6A 41    .>U..`m3U#S7..jA
0010  9B CD 0C 00 D5 F8 6A D0 17 E0 00 00 00 00 00 00    ......j.........
0020  08 7B C1 06 72 BD 9C C5 56 44 32 44 36 38 58 49    .{..r...VD2D68XI
0030  D5 F8 6A 41 33 10 00 00 9B 6B 40 B1 E5 C6 1C 00    ..jA3....k@.....
0040  C4 91 76 9D CE 5E BE 18 8A 19 53 76 4A 61 71 75    ..v..^....SvJaqu
0050  69 6F 00 00 FF                                     io...

31  192.168.1.47:2263  213.248.106.208:6112  75  Send 
0000  01 4A 00 01 99 60 6D 33 55 23 53 37 D5 F8 6A 41    .J...`m3U#S7..jA
0010  9B CD 0C 00 00 00 00 00 08 7B C1 06 72 BD 9C C5    .........{..r...
0020  56 44 32 44 36 38 58 49 D5 F8 6A 41 33 10 00 00    VD2D68XI..jA3...
0030  9B 6B 40 B1 E5 C6 1C 00 C4 91 76 9D CE 5E BE 18    [email protected]..^..
0040  8A 19 53 76 4A 61 71 75 69 6F 00                   ..SvJaquio.

32  213.248.106.208:6112  192.168.1.47:2263  7  Recv 
0000  07 00 01 00 00 00 00                               .......

33  192.168.1.47:2263  213.248.106.208:6112  7  Send 
0000  07 00 19 08 00 00 00                               .......

34  213.248.106.208:6112  192.168.1.47:2263  63  Recv 
0000  3F 00 19 08 00 01 00 00 00 01 00 26 2B 19 44 4C    ?..........&+.DL
0010  69 67 68 74 6E 69 6E 67 54 77 61 74 00 84 80 FF    ightningTwat....
0020  FF FF FF FF FF FF FF FF FF FF 02 FF FF FF FF FF    ................
0030  FF FF FF FF FF FF 01 E1 80 80 80 03 FF FF 00       ...............

35  192.168.1.47:2263  213.248.106.208:6112  17  Send 
0000  11 00 07 4C 69 67 68 74 6E 69 6E 67 54 77 61 74    ...LightningTwat
0010  00                                                 .

36  213.248.106.208:6112  192.168.1.47:2263  7  Recv 
0000  07 00 07 00 00 00 00                               .......

37  192.168.1.47:2262  213.248.106.65:6112  20  Send 
0000  FF 0A 0C 00 4A 61 71 75 69 6F 00 00 FF 0B 08 00    ....Jaquio......
0010  56 44 32 44                                        VD2D



If someone could look over that, and help with this. I am so close to finishing off all my connections. Realm connection has been a pain in the ass! The others were easy.. Also if you read this HdX, I have not yet made BNLS double hash the realm password it is still seperate. I will fix it when I get the connection working.  :P


Edit: A few spelling errors and fixed a code tag.
#12
Alright, I have gotten the bot able to Realm Connect but now when I send 0x19 and get it back, when I try to remove the proper info for MCP_CHARLOGON(0x07) I am only able to remove maybe 4-5 letters from my characters name.. I am using Joes 'Debuffer Class' to remove what I need and such. But it doesn't seem to be working properly could anyone help?
#13
Ok.. Again I have another problem that I cannot seem to fix and have no idea where to start so I will just state my problem and you guys can ask to see whatever portion of the code you need.

Problem: When I connect on War3 or TfT sometimes when I join the channel, my username is on the channel twice. It only happens sometimes, I can connect and it'll be there only once. I reconnect and it'll be on there twice I have went through and re-checked my code but something seems to be messing up.. As I said whatever you need to see I will post.
#14
Alright, I decided to add realm connection into my bot and am having alot of trouble with it. How exactly do connect to the realm? I have looked around the forums and seen people talking about extracting the IP from recv'd packet 0x3E then connecting to the realm with it.. I have no idea what I am doing wrong.. Here is my recv'd 0x3E case code.


        Case &H3E
        'Debug.Print "Recv'd:0x3E"

        Server = Mid(data, 17, 8)
        ServIP = Mid(Server, 5, 4)
        AddChat D2Green, "Current realm server: " & MakeServ(ServIP)
       
        Debug.Print "Server:" & Server
        Debug.Print "Server IP:" & ServIP
       
        frmMain.wsRealm.Close
        frmMain.wsRealm.Connect MakeServ(ServIP), 6112


Here is my MakeServ function.


Public Function MakeServ(data As String) As String
    Dim intIP1 As String, intIP2 As String, intIP3 As String, intIP4 As String
   
    intIP1 = CLng("&H" & ToHex(Mid(data, 1, 1)))
        Debug.Print "1:" & intIP1
    intIP2 = CLng("&H" & ToHex(Mid(data, 2, 1)))
        Debug.Print "2:" & intIP2
    intIP3 = CLng("&H" & ToHex(Mid(data, 3, 1)))
        Debug.Print "3:" & intIP3
    intIP4 = CLng("&H" & ToHex(Mid(data, 4, 1)))
        Debug.Print "4:" & intIP4
       
    MakeServer = intIP1 & "." & intIP2 & "." & intIP3 & "." & intIP4
End Function


With that function I get "Run-time error '13': Type mismatch" at "intIP1 = CLng("&H" & ToHex(Mid(data, 1, 1)))" and every other ip. Any ideas as to what I am doing wrong?
#15
Grr, I recently noticed that my bot when people leave the channel. Their Username sometimes stays on the list even though their not there.. Anyidea why exactly? Here is the Leave code..


Private Sub JaqBot_OnLeave(ByVal Username As String, ByVal Flags As Long)
'Debug.Print vbCrLf
'Debug.Print "------JaqBot_OnLeave------"
'Debug.Print "Username:" & Username
'Debug.Print "Flags:" & Flags
'Debug.Print "---------------------------"
On Error Resume Next

    With frmMain
        .lstChannel.ListItems.Remove .lstChannel.FindItem(Username).Index
        .lblChannelInfo.Caption = BNET.CurrentChan & " (" & .lstChannel.ListItems.Count & ")"
        .Caption = BotName & " v" & VerNum & " - Connected as " & BNET.Username & " in channel " & BNET.CurrentChan
    End With
   
    AddChat vbLtGreen, Username & " has left the channel."
End Sub


Now their username should go away.. But it's not..


Oh yea, this only happens when logged in on D2DV or D2XP.
#16
Ok, I need to hash the password for 0x3A and I am using BNetAuth.dll Which I have been told I shouldn't because it sucks, by a couple of people. But oh well this is what I am learning with, anyways my problem is you use it like this


Public Declare Function X Lib "BnetAuth.dll" (ByVal outbuf As String, ByVal Password As String) As Long
PassHash = X(PassHash, Password)


I think... but when I used it like this when it gets down to send 0x3A my bot crashes.. Any idea why at all?
#17
Ok, I downloaded Ethereal to log packet errors in my bot and stuff.. However.. I do not understand Ethereal to much, I got it where I know how to capture the packets sent/recv but.. How do I know exactly what packet I am looking at when I look at them? How do you tell >.<
#18
I was wondering what would cause my bot to disconnect after sending the packet 0x3A, here is the code I am using.


Public Function Send_0x01()
Select Case UCase(DB.Product)
    Case "D2DV", "VD2D"
        DB.Product = "VD2D"
        VerByte = "09"
        Executable = "Game.EXE"
    Case Else
        AC vbRed, "Unknown Product"
        Form1.Winsock1.Close
        Exit Function
End Select
HashPath = App.Path & "\D2DV\"
Form1.Winsock1.SendData Chr(1)
AC &HFFFFC0, "Sent 0x01"
End Function

Public Function Send_0x50()
On Error Resume Next
Packet.InsertDWORD &H0
Packet.InsertNonNTString "68XI"
Packet.InsertNonNTString DB.Product
Packet.InsertDWORD "&H" & VerByte
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertNTString "USA"
Packet.InsertNTString "United States"
Packet.SendPacket &H50
AC &HFFFFC0, "Sent 0x50"
End Function

Public Function Send_0x51(Data As String)
Dim Hash As String, MPQName As String, TempData As String
Dim EXEInfo As String, version As Long, CheckSum As Long, Result As Long
Dim dblProdID As Double, dblValue1 As Double, dblValue2 As Double
Dim lngProdID As Long, lngValue1 As Long, lngValue2 As Long
Dim AccountHash As String, TempString As String, dblKey As Long
Dim Servers As String
Token = Mid(Data, 9, 4)
MPQName = Mid(Data, InStr(Data, "I"), 12)
Hash = Mid(Mid(Data, 34), InStr(Mid(Data, 34), Chr(0)) + 1, InStr(Mid(Mid(Data, 34), InStr(Data, Chr(0)) + 1), Chr(0)))
Hash = Replace(Hash, Chr(0), "")
EXEInfo = Space(256)
dblKey = GetTickCount()
If DB.Product = "VD2D" Then
    Result = z(HashPath & Executable, HashPath & "BNClient.DLL", HashPath & "D2Client.DLL", Hash, version, CheckSum, EXEInfo, MPQName)
Else
    Result = z(HashPath & Executable, HashPath & "Storm.DLL", HashPath & "Battle.SNP", Hash, version, CheckSum, EXEInfo, MPQName)
End If
NullTruncString EXEInfo
DecodeCDKey DB.CDKey1, dblProdID, dblValue1, dblValue2
lngProdID = CLng(dblProdID)
lngValue1 = CLng(dblValue1)
lngValue2 = CLng(dblValue2)
Servers = CLng(Val("&h" & StrToHex(StrReverse(Token))))
AccountHash = String(5 * 4, vbNullChar)
TempString = c(AccountHash, Servers, lngProdID, lngValue1, lngValue2, dblKey)
If Result = 0 Then
    AC vbRed, "Hashing Failed"
    Form1.Winsock1.Close
    Exit Function
End If
Packet.InsertDWORD dblKey
Packet.InsertDWORD version
Packet.InsertDWORD CheckSum
Packet.InsertDWORD &H1
Packet.InsertDWORD "&H0"
Packet.InsertDWORD Len(DB.CDKey1)
Packet.InsertDWORD CLng(dblProdID)
Packet.InsertDWORD CLng(dblValue1)
Packet.InsertDWORD &H0
Packet.InsertNonNTString AccountHash
Packet.InsertNTString EXEInfo
Packet.InsertNTString DB.Username
Packet.SendPacket &H51
AC &HFFFFC0, "Sent Username & Password. "
End Function

Public Sub Send_0x3A()
Dim PD As String
PD = String(7 * 4, vbNullChar)
Packet.InsertNonNTString PD
Packet.InsertNTString DB.Username
Packet.SendPacket &H3A
AC &HFFFFC0, "Sent 0x3A"
End Sub

Public Function Send_0x14()
Packet.InsertNonNTString "tenb"
Packet.SendPacket &H14
AC &HFFFFC0, "Sent 0x14"
End Function

Public Function Send_0x0A()
Packet.InsertNTString DB.Username
Packet.InsertBYTE 0
Packet.SendPacket &HA
AC &HFFFFC0, "Sent 0x0A"
Packet.InsertNonNTString DB.Product
Packet.SendPacket &HB
AC &HFFFFC0, "Sent 0x0B"
Packet.InsertDWORD 2
Packet.InsertNTString DB.Home
Packet.SendPacket &HC
AC &HFFFFC0, "Sent 0x0C"
AC &HC0FFFF, "Attempting To Flood Channel [", False, False, vbWhite, DB.Home, False, False, &HC0FFFF, "]"
End Function

Public Function ParsePacket(Data As String)
Dim PacketID As String
PacketID = Asc(Mid(Data, 2, 1))
Select Case PacketID
    Case &H25
        Form1.Winsock1.SendData Data
    Case &H1
        AC &HC0FFC0, "Received 0x01"
    Case &H50
        AC &HC0FFC0, "Received 0x50"
        Send_0x51 Data
    Case &H51
        AC &HC0FFC0, "Received 0x51"
        Send_0x3A
    Case &H3A
        AC &HC0FFC0, "Received 0x3A"
        'Send_0x14
        Send_0x0A
    'Case &H14
        'AC &HC0FFC0, "Received 0x14"
        'Send_0x0A
    Case &HA
        AC &HC0FFC0, "Received 0x0A"
    Case &HF
        DispatchMessage Data
End Select
End Function


After it sends 0x3A I get disconnected and ipbanned, it sucks lol. I did the result thing and it gave me "1" meaning the account don't exist but it does because I just logged onto it. Any idea, why?
#19
Battle.net Bot Development / Wildcards?
January 26, 2004, 09:57 PM
I have got my bot up and running and people who have tested it said I need to add-in wildcards. Well seeing that I am just learning visual basic how would I do wildcards?
#20
Battle.net Bot Development / Is it my computer...?
January 24, 2004, 10:26 AM
Is it my computer or is everyone getting this error.

11:25:55 AM -  BNLS: Connecting...
11:25:55 AM -  BNLS: Connected!
11:25:55 AM -  BNLS: Authorized!
11:25:56 AM -  BNET: Connecting...
11:25:56 AM -  BNET: Connected!
11:25:56 AM -  BNLS: Error! Bad product version.


Thats what error my bot gives me, As well with stealths bot.