Main Menu

help .. vb.net

Started by z0rg, April 03, 2008, 11:40:25 PM

Previous topic - Next topic

z0rg

                    Dim m_MpqFiletime As Long
                    Dim m_MpqFilename As String
                    Dim m_ValueString As Byte()

                    Dim ServerToken As UInteger
                    Dim ClientToken As UInteger

                    Debug.Print("SID_AUTH_INFO Received.")
                    Dim rec0x50 As New BncsReader(bytes)

                    Dim LogonType As Integer = rec0x50.ReadUInt32()

                    Dim strCDKEY As String = "mycdkey was here"

       
                    ClientToken = GetTickCount
                    ServerToken = rec0x50.ReadUInt32()
                    Debug.Print(StrToHex(ServerToken.ToString))
                    rec0x50.Seek(4)
                    m_MpqFiletime = rec0x50.ReadUInt64()
                    m_MpqFilename = rec0x50.ReadCString()
                    m_ValueString = rec0x50.ReadByteArray(16)

                    Debug.Print("VALUESTRING LENGTH: " & m_ValueString.Length)
                    Debug.Print(Hex(m_ValueString(0)) & " " & Hex(m_ValueString(15)))

                    'Dim m_ServerSig() As Byte = rec0x50.ReadByteArray(128) '-- For War3 only

                    If LogonType = &H0 Then
                        Debug.Print("Using Broken SHA-1 Login")
                    ElseIf &H2 Then
                        Debug.Print("Using New Login System Version 2.")
                    Else
                        Debug.Print("Unsupported Login Version System")
                    End If

                    m_MpqFilename = Replace(m_MpqFilename, ".mpq", ".dll")
                    Debug.Print(m_MpqFilename & " : " & m_MpqFilename.Length)

                    '-- BUILD 0x51 PACKET
                    Debug.Print("Building SID_AUTH_CHECK Packet")

                    Dim m_Files(2) As String
                    Dim sLockdownFile As String
                    Dim sImageFile As String

                    m_Files(0) = "N:\Documents\Programming\VB\prjz0rgBot\hashes\STAR\Starcraft.exe"
                    m_Files(1) = "N:\Documents\Programming\VB\prjz0rgBot\hashes\STAR\Storm.dll"
                    m_Files(2) = "N:\Documents\Programming\VB\prjz0rgBot\hashes\STAR\Battle.snp"

                    sLockdownFile = "N:\Documents\Programming\VB\prjz0rgBot\dll\" & m_MpqFilename

                    sImageFile = "N:\Documents\Programming\VB\prjz0rgBot\hashes\STAR\STAR.bin"

                    Dim m_EXEVer As Integer
                    Dim m_Checksum As Integer
                    Dim m_EXEINfo As Byte()

                    m_EXEINfo = CheckRevision.DoLockdownCheckRevision(m_ValueString, m_Files, sLockdownFile, sImageFile, m_EXEVer, m_Checksum)

                    Dim CDKeyDecoded As New MBNCSUtil.CdKey(strCDKEY)
                    Dim m_HashLength As Byte() = CDKeyDecoded.GetHash(ClientToken, ServerToken)

                    Dim dBytes As Byte() = m_EXEINfo
                    Dim str As String
                    Dim enc As New System.Text.ASCIIEncoding
                    str = enc.GetString(dBytes)

                    Dim C0x51 As New BncsPacket(&H51)
                    With C0x51
                        .InsertInt32(ClientToken)                        '-- ClientToken
                        .InsertInt32(m_EXEVer)                         '-- EXEVersion
                        .InsertInt32(m_Checksum)                          '-- Check Revision Result

                        .InsertInt32(1)                                '-- # of keys. Since SC then 1

                        .InsertBoolean(False)                              '-- Is it spawn?
                        .InsertInt32(CDKeyDecoded.Key.Length)            '-- length of cdkey
                        '.InsertInt32(CDKeyDecoded.Product)               '-- Product
                        .InsertInt32(1)
                        .InsertInt32(CDKeyDecoded.Value1)                '-- Value 1
                        .InsertInt32(0)
                        .InsertByteArray(m_HashLength)               '-- Keyhash
                        '.InsertCString(System.Text.ASCIIEncoding.ASCII.GetString(m_EXEINfo))               'EXE Info
                        .InsertByteArray(m_EXEINfo)
                        .InsertCString("ZeRGKoG")                'CDKey Owner
                    End With
                    Debug.Print(C0x51.ToString)


I GET INVALID VERSION .. any help.. thanks

Archangel

#1
This is from my bot.


pktb.InsertInt32(Connection.ClientToken);
pktb.InsertInt32(version);
pktb.InsertInt32(checksum);
pktb.InsertInt32(0x01);
pktb.InsertInt32(0x00);
pktb.InsertInt32(CdKey1.Key.Length);
pktb.InsertInt32(CdKey1.Product);
pktb.InsertInt32(CdKey1.Value1);
pktb.InsertInt32(0x00);
pktb.InsertByteArray(CdKey1.GetHash(Connection.ClientToken, ServerToken));
pktb.InsertByteArray(digest);
pktb.InsertByte(0x00);
pktb.InsertNTString("Unknown");

mm..


.InsertInt32(ClientToken)                       
.InsertInt32(m_EXEVer)                       
.InsertInt32(m_Checksum)                       
.InsertInt32(1)                               
.InsertBoolean(False)                         
.InsertInt32(CDKeyDecoded.Key.Length)     
.InsertInt32(CDKeyDecoded.Product)           
.InsertInt32(CDKeyDecoded.Value1)           
.InsertInt32(0)     
.InsertCString(System.Text.ASCIIEncoding.ASCII.GetString(m_EXEINfo)) 'This string should not end with a null byte.
.InsertByteArray(m_EXEINfo) 'Where is the null byte at the end?
.InsertCString("ZeRGKoG")


Note: You shouldnt be using the ASCIIEncoding, since it uses the seven lower bits in a byte and the way .NET represent strings is by unicode.

z0rg

hi arc..

i spent like 8 hours trying to figure this out. thanks

adding null byte at the end of digest solved my prob..