• 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

Messages - Evan1993

#1
Heres my packet now, is it fixed?

ff 50 3a 00 ÿP:. - (DWORD) Header
00 00 00 00 .... - (DWORD) Protocol ID (0)
36 38 58 49 68XI - (DWORD) Platform ID
50 58 33 57 PX3W - (DWORD) Product ID
15 00 00 00 .... - (DWORD) Version Byte
53 55 6e 65 SUne - (DWORD) Product language
c0 a8 01 07 ˬ.. - (DWORD) Local IP for NAT compatibility*
f0 00 00 00 ð... - (DWORD) Time zone bias*
09 04 00 00 .... - (DWORD) Locale ID*
09 04 00 00 .... - (DWORD) Language ID*
55 53 41 00 USA. - (STRING) Country abreviation
55 6e 69 74 65 64 20 53 74 61 74 65  73 00 United States. - (STRING) Country



My timezone is 240 now, is that fixed?

        With AuthInfo
            .InsertInt32(&H0) 'Protocol ID
            .InsertDwordString("IX86") 'Platform ID
            .InsertDwordString(Product) 'Product ID
            .InsertInt32(CInt(MBNCSUtil.CheckRevision.GetVersionByte(Product))) 'Version Byte
            .InsertInt32(StringToHex(CultureInfo.CurrentCulture.Name.Remove(2, 1))) 'Product language
            .InsertInt32(inet_addr(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList(0).ToString)) 'Local IP (in network byte order)
            .InsertInt32(DateTime.UtcNow.Subtract(DateTime.Now).TotalMinutes) 'Timezone bias
            .InsertInt32(CultureInfo.CurrentCulture.LCID) 'MPQ Locale ID
            .InsertInt32(CultureInfo.CurrentCulture.LCID) 'Language ID
            .InsertCString(Globalization.RegionInfo.CurrentRegion.ThreeLetterWindowsRegionName) 'Country Abbreviation
            .InsertCString(Globalization.RegionInfo.CurrentRegion.NativeName) 'Country
           
            AddChat(.ToString)
        End With

#2
My packet still looks wrong, does it change any when sent? Becuase I'm not sending it yet.

    Public Sub SendSendAuthInfo(ByVal Product As String)
        Dim AuthInfo As New BncsPacket(SID_AUTH_INFO)
        Dim time As TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)

        With AuthInfo
            .InsertInt32(&H0) 'Protocol ID
            .InsertDwordString("IX86") 'Platform ID
            .InsertDwordString(Product) 'Product ID
            .InsertInt32(CInt(MBNCSUtil.CheckRevision.GetVersionByte(Product))) 'Version Byte
            .InsertInt32(StringToHex(CultureInfo.CurrentCulture.Name.Remove(2, 1))) 'Product language
            .InsertInt32(CultureInfo.CurrentCulture.LCID) 'MPQ Locale ID
            .InsertInt32(inet_addr(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList(0).ToString)) 'Local IP (in network byte order)
            .InsertInt32(time.TotalMinutes) 'Timezone bias
            .InsertInt32(CultureInfo.CurrentCulture.LCID) 'Language ID
            .InsertCString(Globalization.RegionInfo.CurrentRegion.ThreeLetterWindowsRegionName) 'Country Abbreviation
            .InsertCString(Globalization.RegionInfo.CurrentRegion.NativeName) 'Country
            AddChat(.ToString)
        End With

    End Sub


0 -Protocol ID
IX86 -Platform ID/code
W3XP -Product ID/code
21 -Product ID
enUS -Product language
1033 -MPQ Locale ID
117549248 -Local IP (in network byte order)
-240 -Timezone bias
1033 -Language ID
USA -Country Abbreviation
United States -Country


addchat shows:


0000   ff 50 3a 00 00 00 00 00  36 38 58 49 50 58 33 57    ÿP:.....68XIPX3W
0010   15 00 00 00 53 55 6e 65  09 04 00 00 c0 a8 01 07    ....SUne....À¨..
0020   10 ff ff ff 09 04 00 00  55 53 41 00 55 6e 69 74    .ÿÿÿ....USA.Unit
0030   65 64 20 53 74 61 74 65  73 00                      ed States.


Warcrafts..


0000  00 0f 66 30 22 b3 00 01  6c 19 d9 58 08 00 45 00   ..f0"... l..X..E.
0010  00 62 0f 71 40 00 80 06  00 00 c0 a8 01 07 3f f0   .b.q@... ......?.
0020  ca 83 0b 4f 17 e0 05 87  2d 03 de c1 e9 3f 50 18   ...O.... -....?P.
0030  ff ff cc 77 00 00 ff 50  3a 00 00 00 00 00 36 38   ...w...P :.....68
0040  58 49 50 58 33 57 15 00  00 00 53 55 6e 65 c0 a8   XIPX3W.. ..SUne..
0050  01 07 f0 00 00 00 09 04  00 00 09 04 00 00 55 53   ........ ......US
0060  41 00 55 6e 69 74 65 64  20 53 74 61 74 65 73 00   A.United  States.

#3
Quote from: Hdx on May 16, 2008, 09:56 PM
Convert it to a 32 bit int...
& 0xffffffff.
~Hdx
Well I was bing a retard again..
Public Declare Function inet_addr Lib "wsock32" (ByVal s As String) As Integer <--- was long before lolz

however i'm such a ninny that I don't get what you mean by "& 0xffffffff" do you mean
.InsertInt32(Integer.Parse(&HFFFFFFFF, NumberStyles.HexNumber))
?

#4
My IP in network byte order is 64 bits... how to I add it as a 32 bit integer?
#5
Oh, I saw he was using longs and in VB.net a long is 64 bits, sorry..

whats a better way to get a string to a hex(long)?

heres what I'm using right now.


Public Function StringToHex(ByRef Data As String) As Long
        'first take each charcter using substring.
        'then convert character into ascii.
        'then convert ascii value into Hex Format
        Dim sValue As String
        Dim sHex As String = ""
        Dim s As String = Data
        While s.Length > 0
            sValue = Conversion.Hex(Strings.Asc(s.Substring(0, 1).ToString()))
            s = s.Substring(1, s.Length - 1)
            sHex = sHex + sValue
        End While


        Return Long.Parse(sHex, NumberStyles.HexNumber)
    End Function
#6
I was being a retard is all... wasn't thinking for myself enough. Also what does the " AuthInfo.Finalize(this);" part of your code do?

Is my code correct now?

Public Sub SendSendAuthInfo(ByVal Product As String)
        Dim AuthInfo As New BncsPacket(SID_AUTH_INFO)
        Dim time As TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)
        Dim LanguageID As Integer = GetUserDefaultLangID()

        With AuthInfo
            .InsertInt64(0) 'Protocol ID
            .InsertInt64(StringToHex("IX86")) 'Platform ID
            .InsertInt64(StringToHex(Product)) 'Product ID
            .InsertInt64(Long.Parse(MBNCSUtil.CheckRevision.GetVersionByte(Product), NumberStyles.Number)) 'Version Byte
            .InsertInt64(StringToHex(CultureInfo.CurrentCulture.Name.Remove(2, 1))) 'Product language
            .InsertInt64(CultureInfo.CurrentCulture.LCID) 'MPQ Locale ID
            .InsertInt64(inet_addr(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList(0).ToString)) 'Local IP (in network byte order)
            .InsertInt64(time.TotalMinutes) 'Timezone bias
            .InsertInt64(GetUserDefaultLangID()) 'Language ID
            .InsertCString(Globalization.RegionInfo.CurrentRegion.ThreeLetterWindowsRegionName) 'Country Abbreviation
            .InsertCString(Globalization.RegionInfo.CurrentRegion.NativeName) 'Country
        End With
        AddChat(AuthInfo.ToString)
    End Sub




0000   ff 50 5e 00 00 00 00 00  00 00 00 00 36 38 58 49    ÿP^.........68XI
0010   00 00 00 00 33 52 41 57  00 00 00 00 15 00 00 00    ....3RAW........
0020   00 00 00 00 53 55 6e 65  00 00 00 00 09 04 00 00    ....SUne........
0030   00 00 00 00 c0 a8 01 07  07 00 00 00 10 ff ff ff    ....À¨.......ÿÿÿ
0040   ff ff ff ff 09 04 00 00  00 00 00 00 55 53 41 00    ÿÿÿÿ........USA.
0050   55 6e 69 74 65 64 20 53  74 61 74 65 73 00          United States.
#7
that won't work for me becuase "Conversion from string "IX86" to type 'Long' is not valid." ect ect.

What should I use instead?
#8
Like this?
.InsertDwordString("0") 'Protocol ID  :-\
#9
This is what I'm doing right now.


Dim LocalIP As Long = inet_addr(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList(0).ToString)
        Dim packet As New BncsPacket(SID_AUTH_INFO)
        Dim ProductLanguage As String = CultureInfo.CurrentCulture.Name.Remove(2, 1)
        Dim MPQLocaleID As Int16 = CultureInfo.CurrentCulture.LCID
        Dim time As TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)
        Dim CountryAbbreviation As String = Globalization.RegionInfo.CurrentRegion.ThreeLetterWindowsRegionName
        Dim Country As String = Globalization.RegionInfo.CurrentRegion.NativeName

        'Right now I only want to get warcraft connection working so Product ID and Version Byte are hard coded.
        With packet
            .InsertByte(0) 'Protocol ID
            .InsertDwordString("IX86") 'Platform ID
            .InsertDwordString("WAR3") 'Product ID
            .InsertByte(&H15) 'Version Byte

            .InsertDwordString(ProductLanguage) 'Product language
            .InsertInt16(MPQLocaleID) 'MPQ Locale ID
            .InsertInt64(LocalIP) 'Local IP (in network byte order)
            .InsertInt16(time.TotalMinutes) 'Timezone bias
            .InsertInt32(9503753) 'Language ID
            .InsertCString(CountryAbbreviation) 'Country Abbreviation
            .InsertCString(Country) 'Country
        End With
        AddChat(packet.ToString)


addchat shows:

0000   ff 50 34 00 00 36 38 58  49 33 52 41 57 15 53 55    ÿP4..68XI3RAW.SU
0010   6e 65 09 04 c0 a8 01 07  07 00 00 00 10 ff 09 04    ne..À¨.......ÿ..
0020   91 00 55 53 41 00 55 6e  69 74 65 64 20 53 74 61    ..USA.United Sta
0030   74 65 73 00                                         tes.


is every thing corrrect?
#10
like this?


Protocol ID: 0
Platform ID: IX86
Product ID: WAR3
Version Byte: 0x15
Product language: (bnet docs) This field is under investigation. It can safely be set to 0.
MPQ Locale ID: 1033 (?)
Local IP: (inet_addr("MyIPHere"))
Timezone bias: -240
Language ID: 9503753
Country Abbreviation: USA
Country: United States
#11
Battle.net Bot Development / MPQ Locale ID?
May 15, 2008, 04:28 PM
At bnet docs the packet info for SID_AUTH_INFO's format:

(DWORD) Platform ID
(DWORD) Product ID
(DWORD) Version Byte
(DWORD) Product language
(DWORD) Local IP for NAT compatibility*
(DWORD) Time zone bias*
(DWORD) Locale ID*
(DWORD) Language ID*
(STRING) Country abreviation
(STRING) Country

then in under remarks it has MPQ Locale ID after Product language, do I really need to send this, and how would I find the proper value?