Valhalla Legends Forums Archive | Battle.net Bot Development | [vb] 0x12 Help

AuthorMessageTime
Spilled[DW]
Im trying to write a war2 connection and ive searched and studied UserLoser's post on &H12 and i tried to work that sub into my program but its been unsuccessful and reviewing bnetdoc's it says alot of &H12 has been incorporated into 0x50 so is it possible to use 0x50 on a war2 connection instead of &H12? and if its not could i get some help sending &H12? heres the information ive gathered:

[code]
Public Declare Function GetTimeZoneInformation Lib "kernel32" (lpTimeZoneInformation As Time_Zone_information) As Long
Public Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Public Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Public Declare Function GetSystemDefaultLangID Lib "kernel32" () As Integer
Public Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Public Declare Function GetUserDefaultLCID Lib "kernel32" () As Long
Public Declare Function GetUserDefaultLangID Lib "kernel32" () As Integer

Public Type Time_Zone_information
    Bias As Long
End Type

Public Sub SendLocalShit()
Dim TimeZoneInformation As Time_Zone_information
Dim sysTime1 As SYSTEMTIME, sysTime2 As SYSTEMTIME
Dim FileTime1 As FILETIME, FileTime2 As FILETIME
Dim TimeZoneBias As Long, SystemDefaultLCID As Long, UserDefaultLCID As Long, UserDefaultLangID As Long
Dim LCData1 As String, LCData2 As String, LCData3 As String, LCData4 As String

   Call GetTimeZoneInformation(TimeZoneInformation)
   Call GetSystemTime(sysTime1)
   Call GetLocalTime(sysTime2)
   Call SystemTimeToFileTime(sysTime1, FileTime1)
   Call SystemTimeToFileTime(sysTime2, FileTime2)
   
   TimeZoneBias = TimeZoneInformation.Bias
   SystemDefaultLCID = GetSystemDefaultLCID()
   UserDefaultLCID = GetUserDefaultLCID()
   UserDefaultLangID = (GetUserDefaultLangID() And &HFFFF)
   
   LCData1 = String(&H40, vbNullChar): LCData2 = String(&H40, vbNullChar)
   LCData3 = String(&H40, vbNullChar): LCData4 = String(&H40, vbNullChar)

   Call GetLocaleInfo(LANG_USER_DEFAULT, LOCALE_SABBREVLANGNAME, LCData1, &H40)
   Call GetLocaleInfo(LANG_USER_DEFAULT, LOCALE_ICOUNTRY, LCData2, &H40)
   Call GetLocaleInfo(LANG_USER_DEFAULT, LOCALE_SABBREVCTRYNAME, LCData3, &H40)
   Call GetLocaleInfo(LANG_USER_DEFAULT, LOCALE_SENGCOUNTRY, LCData4, &H40)
   
   LCData1 = Left$(LCData1, InStr(1, LCData1, vbNullChar) - 1)
   LCData2 = Left$(LCData2, InStr(1, LCData2, vbNullChar) - 1)
   LCData3 = Left$(LCData3, InStr(1, LCData3, vbNullChar) - 1)
   LCData4 = Left$(LCData4, InStr(1, LCData4, vbNullChar) - 1)

    Connection.InsertDWORD FileTime1.dwLowDateTime
    Connection.InsertDWORD FileTime1.dwHighDateTime
    Connection.InsertDWORD FileTime2.dwLowDateTime
    Connection.InsertDWORD FileTime2.dwHighDateTime
    Connection.InsertDWORD TimeZoneBias
    Connection.InsertDWORD SystemDefaultLCID
    Connection.InsertDWORD UserDefaultLCID
    Connection.InsertDWORD UserDefaultLangID
    Connection.InsertNTString LCData1
    Connection.InsertNTString LCData2
    Connection.InsertNTString LCData3
    Connection.InsertNTString LCData4
        Connection.SendPacket &H12
End Sub
[/code]

Ideas anyone?

(UserLoser will get credit also)
March 2, 2005, 4:53 PM
UserLoser.
[quote author=Spilled[DW] link=topic=10777.msg102203#msg102203 date=1109782392]
is it possible to use 0x50 on a war2 connection instead of &H12?
[/quote]

yes
March 2, 2005, 7:38 PM
R.a.B.B.i.T
[quote author=UserLoser link=topic=10777.msg102208#msg102208 date=1109792325]
[quote author=Spilled[DW] link=topic=10777.msg102203#msg102203 date=1109782392]
is it possible to use 0x50 on a war2 connection instead of &H12?
[/quote]

yes
[/quote]*but Battle.Net will know it's not a client connection.  That's the only drawback (if you can call it that) to using 0x50 for W2BN.
March 2, 2005, 11:38 PM
LoRd
[quote author=rabbit link=topic=10777.msg102224#msg102224 date=1109806729]
[quote author=UserLoser link=topic=10777.msg102208#msg102208 date=1109792325]
[quote author=Spilled[DW] link=topic=10777.msg102203#msg102203 date=1109782392]
is it possible to use 0x50 on a war2 connection instead of &H12?
[/quote]

yes
[/quote]*but Battle.Net will know it's not a client connection.  That's the only drawback (if you can call it that) to using 0x50 for W2BN.
[/quote]

If it's not a client connection, what is it?  A server connection?
March 2, 2005, 11:41 PM
R.a.B.B.i.T
A bot connection.  I meant client as in the actual game, not just the protocol for logins.
March 2, 2005, 11:43 PM
Quarantine
Do they really care?
March 2, 2005, 11:49 PM
Spilled[DW]
Obviously not because they wouldn't allow it if they did, correct me if im wrong.
March 3, 2005, 1:07 AM
Quarantine
No, I mean with rabbits comment's about Battle.net possibly recognizing you are using a Bot rather than the official client. My question is do they care enough to do something like that.
March 3, 2005, 1:21 AM
Spilled[DW]
I highly doubt it.
March 3, 2005, 1:27 AM
R.a.B.B.i.T
Well people who are trying to make their bot emulate Battle.Net clients (I don't count bots as clients) completely, it will matter.
March 3, 2005, 2:01 AM
LoRd
[quote author=rabbit link=topic=10777.msg102248#msg102248 date=1109815295]
Well people who are trying to make their bot emulate Battle.Net clients (I don't count bots as clients) completely, it will matter.
[/quote]

Perhaps you should refer to the official Blizzard client as an official Blizzard client because there are only two types of TCP/IP applications: a client and a server thus making every Battle.net bot a Battle.net client.
March 3, 2005, 2:14 AM
LoRd
[quote author=Warrior link=topic=10777.msg102237#msg102237 date=1109812904]
No, I mean with rabbits comment's about Battle.net possibly recognizing you are using a Bot rather than the official client. My question is do they care enough to do something like that.
[/quote]

If they cared, they'd disable WarCraft II's ability to use the newer protocol.

Personally, I'd use the old protocol by default, but give users the option for a "Fast Connect" which would use the new protocol.
March 3, 2005, 2:19 AM
HdxBmx27
Officially, Blizzard still cares about War2 because it is one of there products, they BNET still supports.
BHut they pay next to zero attention to it because they have 2 more products that make them A LOT more money (War3 & WoW)
And they don't care eunf to check for protocall breaks. (witch would be easy if they were smart)
BUT! It is better to make a bot that is true to the acuall client(official). And follows the same protocall. Trust me, it's not hard. If you have to emulate somthing it's always better to emulate it to the best of your abilities.
~-~(HDX)~-~
March 3, 2005, 2:36 AM
JoeTheOdd
Sif!

[code]If (Product == "W2BN") && (PacketID = 0x50)
{

    // Do some kinda disconnect thingy here

}[/code]
March 3, 2005, 3:07 AM
Spilled[DW]
Hey, im recieving a bad product response from 0x51 when i send it, im adding war2 support to it, was wondering if anyone could spot the error.

Heres the sub:

[code]
Public Sub SendPacket51()
    Dim CheckRev As Long
    Dim ClientToken As Long
    Dim ProductID As Long
    Dim Val1 As Long
    Dim Val2 As Long
    Dim cRev As Long
    AddChat vbYellow, "Sending packet 0x51"
Hashing.ExeInfo = Space(256)
    Select Case strProduct
        Case "PX2D"
            CheckRev = z(Files & "Game.exe", Files & "Bnclient.dll", Files & "D2Client.dll", Hashing.Hash, Hashing.VersionID, Hashing.Checksum, Hashing.ExeInfo, Hashing.MpqName)
        Case "VD2D"
            CheckRev = z(Files & "Game.exe", Files & "Bnclient.dll", Files & "D2Client.dll", Hashing.Hash, Hashing.VersionID, Hashing.Checksum, Hashing.ExeInfo, Hashing.MpqName)
        Case "PXES", "RATS"
            CheckRev = CheckRevision(Files & "starcraft.exe", Files & "storm.dll", Files & "battle.snp", Hashing.Hash, Hashing.VersionID, Hashing.Checksum, Hashing.ExeInfo, Hashing.MpqName)
        Case "NB2W"
            CheckRev = CheckRevision(Files & "Warcraft II BNE.exe", Files & "storm.dll", Files & "battle.snp", Hashing.Hash, Hashing.VersionID, Hashing.Checksum, Hashing.ExeInfo, Hashing.MpqName)
    End Select
                If CheckRev = 0 Then
                    AddChat vbRed, "CheckRevion Failed!"
                        CloseConnection
                    Exit Sub
                End If
                    Connection.NullTruncString Hashing.ExeInfo
                    ClientToken = GetTickCount()
                   
                InsertDWORD ClientToken
                InsertDWORD Hashing.VersionID
                InsertDWORD Hashing.Checksum
            If strProduct = "PX2D" Then
                InsertDWORD &H2 'If exp, &H2 for 2 keys
            Else
                InsertDWORD &H1 'Else 1 key being sent
            End If
                InsertDWORD &H0
               
                'First Key
                    Call Connection.DecodeCDKey(strKey, ProductID, Val1, Val2)
                    Hashing.HashedData = String(20, vbNullChar)
                    cRev = C(Hashing.HashedData, Hashing.ServerToken, ProductID, Val1, Val2, ClientToken)
                InsertDWORD Len(strKey)
                InsertDWORD ProductID
                InsertDWORD Val1
                InsertDWORD &H0
                InsertNonNTString Hashing.HashedData
               
                'Second Key if EXP
                If strProduct = "PX2D" Then
                    Call Connection.DecodeCDKey(strExpKey, ProductID, Val1, Val2)
                        Hashing.HashedData = String(20, vbNullChar)
                    cRev = C(Hashing.HashedData, Hashing.ServerToken, ProductID, Val1, Val2, ClientToken)
                    InsertDWORD Len(strExpKey)
                    InsertDWORD ProductID
                    InsertDWORD Val1
                    InsertDWORD &H0
                    InsertNonNTString Hashing.HashedData
                End If
               
                    InsertNTString Hashing.ExeInfo
                    InsertNTString "Violent Chat v1.0"
                    SendPacket &H51
End Sub
[/code]


Heres the Packet log:


[code]
1  Hide  Hide  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 4E 42 32    ..P:.....68XINB2
0010  57 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00    WO..............
0020  00 00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69    .........USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                  ted States.

2  Hide  Hide  107  Recv 
0000  FF 25 08 00 35 60 AA 9E FF 50 63 00 00 00 00 00    .%..5`...Pc.....
0010  AA 93 CD 68 E7 63 4E 00 00 AC 41 43 25 0B C5 01    ...h.cN...AC%...
0020  49 58 38 36 76 65 72 34 2E 6D 70 71 00 41 3D 31    IX86ver4.mpq.A=1
0030  39 35 36 36 39 33 30 32 20 42 3D 39 30 39 36 34    95669302 B=90964
0040  38 37 32 35 20 43 3D 33 34 33 37 39 35 39 37 35    8725 C=343795975
0050  20 34 20 41 3D 41 2D 53 20 42 3D 42 5E 43 20 43    4 A=A-S B=B^C C
0060  3D 43 2B 41 20 41 3D 41 2D 42 00                  =C+A A=A-B.

3  Hide  Hide  123  Send 
0000  FF 51 7B 00 58 07 56 1F 00 02 00 02 F0 17 5B E2    .Q{.X.V.......[.
0010  01 00 00 00 00 00 00 00 10 00 00 00 24 00 00 00    ............$...
0020  6A F8 23 00 00 00 00 00 AE C7 06 17 8F 20 87 5B    j.#.......... .[
0030  D5 E3 C7 43 1A 06 48 6A 93 3B E4 75 57 61 72 63    ...C..Hj.;.uWarc
0040  72 61 66 74 20 49 49 20 42 4E 45 2E 65 78 65 20    raft II BNE.exe
0050  30 35 2F 31 36 2F 30 31 20 30 30 3A 35 33 3A 32    05/16/01 00:53:2
0060  30 20 37 31 32 37 30 34 00 56 69 6F 6C 65 6E 74    0 712704.Violent
0070  20 43 68 61 74 20 76 31 2E 30 00                    Chat v1.0.

4  Hide  Hide  9  Recv 
0000  FF 51 09 00 03 02 00 00 00                        .Q.......
[/code]


Any ideas people? Thanks in Advance
March 3, 2005, 5:39 AM
Kp
[quote author=JoeTheOdd link=topic=10777.msg102270#msg102270 date=1109819237][code]If (Product == "W2BN") && (PacketID = 0x50)
{

    // Do some kinda disconnect thingy here

}[/code][/quote]

Nice job breaking the BNCS source tree. ;)  Product cannot be directly compared to a string constant (or if it can, it'll require some ugly magic that really shouldn't be present).  Next, any time a war2 client connects, you're going to drop it, since you assigned to PacketID instead of testing it.  Also, your parentheses are unbalanced. :)

[quote author=Spilled[DW] link=topic=10777.msg102303#msg102303 date=1109828373]
[code]
1  Hide  Hide  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 4E 42 32    ..P:.....68XINB2
0010  57 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00    WO..............
0020  00 00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69    .........USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                  ted States.

2  Hide  Hide  107  Recv 
0000  FF 25 08 00 35 60 AA 9E FF 50 63 00 00 00 00 00    .%..5`...Pc.....
0010  AA 93 CD 68 E7 63 4E 00 00 AC 41 43 25 0B C5 01    ...h.cN...AC%...
0020  49 58 38 36 76 65 72 34 2E 6D 70 71 00 41 3D 31    IX86ver4.mpq.A=1
0030  39 35 36 36 39 33 30 32 20 42 3D 39 30 39 36 34    95669302 B=90964
0040  38 37 32 35 20 43 3D 33 34 33 37 39 35 39 37 35    8725 C=343795975
0050  20 34 20 41 3D 41 2D 53 20 42 3D 42 5E 43 20 43    4 A=A-S B=B^C C
0060  3D 43 2B 41 20 41 3D 41 2D 42 00                  =C+A A=A-B.

3  Hide  Hide  123  Send 
0000  FF 51 7B 00 58 07 56 1F 00 02 00 02 F0 17 5B E2    .Q{.X.V.......[.
0010  01 00 00 00 00 00 00 00 10 00 00 00 24 00 00 00    ............$...
0020  6A F8 23 00 00 00 00 00 AE C7 06 17 8F 20 87 5B    j.#.......... .[
0030  D5 E3 C7 43 1A 06 48 6A 93 3B E4 75 57 61 72 63    ...C..Hj.;.uWarc
0040  72 61 66 74 20 49 49 20 42 4E 45 2E 65 78 65 20    raft II BNE.exe
0050  30 35 2F 31 36 2F 30 31 20 30 30 3A 35 33 3A 32    05/16/01 00:53:2
0060  30 20 37 31 32 37 30 34 00 56 69 6F 6C 65 6E 74    0 712704.Violent
0070  20 43 68 61 74 20 76 31 2E 30 00                    Chat v1.0.

4  Hide  Hide  9  Recv 
0000  FF 51 09 00 03 02 00 00 00                        .Q.......
[/code][/quote]
Well, the first and most obvious error I see is that you're using War2 on a message where it doesn't belong. ;)  Beyond that, I'd speculate that you're computing the version checksum wrong.  Have you verified that it produces the correct result for a specific input formula?
March 3, 2005, 3:08 PM
Spilled[DW]
hrmm could you be more specific on that using war2 message where it dont belong? and yes checkrevision is correct as i can see, ill go over that again but on the other hand can you be more specific?
March 3, 2005, 3:39 PM
Spilled[DW]
i checked my checkrevision and everything seems fine, the values are fine, still having the same problem (bad product) any more ideas Kp or anyone? still dont get what you mean by war2 message where it dont belong? Any help is welcome and appreciated thanks in advance!
March 4, 2005, 7:48 AM
NetNX
Well im writing and oldschool War2 Connection :-) The real way not 0x50...

Instant message me on aim and ill help u out but im using BNCSUtil so you might have to rewrite some of the checkrevision stuff but i could use some help out with my bnls coding maybe we could trade :)

And well if someone wants to respond too this i have a question about jbnls is there a website for it ?  :-X
March 8, 2005, 7:04 PM
QwertyMonster
[/sarcasm]
Trade for it? Trade?!  Trade coding? ... Lol.


"Man1: Hey ive got a good peice of coding here, ill give u it for ur good bit too"
"Man2: Eh, sure!"
"Man1: Only if u go first!"
"Man2: Scammer!"

Haha.
[/sarcasm]


I do doubt Spilled would want to rewrite his CheckRevision things without first finding the problem of whats wrong now. Correct me if im wrong Spilled!  :P
March 8, 2005, 7:08 PM
Quarantine
Why wouldn't he want to use a Library with CheckRevision including the SRP and CDKey Decode needed to logon to Warcraft III!
March 8, 2005, 7:16 PM
NetNX
trading is good :-X save myself alota mental frustration if i get to look at how someone else did it ~_^
March 8, 2005, 11:18 PM

Search