• Welcome to Valhalla Legends Archive.
 

[vb] 0x12 Help

Started by Spilled, March 02, 2005, 10:53 AM

Previous topic - Next topic

Spilled

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:


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


Ideas anyone?

(UserLoser will get credit also)

UserLoser.

Quote from: Spilled[DW] on March 02, 2005, 10:53 AM
is it possible to use 0x50 on a war2 connection instead of &H12?

yes

R.a.B.B.i.T

Quote from: UserLoser on March 02, 2005, 01:38 PM
Quote from: Spilled[DW] on March 02, 2005, 10:53 AM
is it possible to use 0x50 on a war2 connection instead of &H12?

yes
*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.

Eric

Quote from: rabbit on March 02, 2005, 05:38 PM
Quote from: UserLoser on March 02, 2005, 01:38 PM
Quote from: Spilled[DW] on March 02, 2005, 10:53 AM
is it possible to use 0x50 on a war2 connection instead of &H12?

yes
*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.

If it's not a client connection, what is it?  A server connection?

R.a.B.B.i.T

A bot connection.  I meant client as in the actual game, not just the protocol for logins.

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Spilled

Obviously not because they wouldn't allow it if they did, correct me if im wrong.

Warrior

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 from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Spilled


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.

Eric

Quote from: rabbit on March 02, 2005, 08:01 PM
Well people who are trying to make their bot emulate Battle.Net clients (I don't count bots as clients) completely, it will matter.

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.

Eric

#11
Quote from: Warrior on March 02, 2005, 07:21 PM
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.

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.

Hdx

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)~-~

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

Joe[x86]

Sif!

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

    // Do some kinda disconnect thingy here

}
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Spilled

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:


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



Heres the Packet log:



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.......



Any ideas people? Thanks in Advance