Valhalla Legends Forums Archive | Battle.net Bot Development References | [VB6] G2GS 0x68

AuthorMessageTime
Fr0z3N
I can't figure out the last part

[code]
(NTSTR) Character Name
(VOID) Random Data - See below

Now the tricky part:
After you send the null terminated character name, you must fill the rest up with these bytes instead of 0x00, depending on the length of your character:
0x9E, 0xAE, 0xD4, 0x77, 0x9A, 0x81, 0xB3, 0x6F, 0x4B, 0x00, 0x00, 0x00, 0x00

Example:
If my character name is "Op" which is 2 characters long, I'd send:
4F 70 00 9E AE D4 77 9A 81 B3 6F 4B 00 00 00 00

If my character name is "Shadow" which is 6 characters long, I'd send:
53 68 61 64 6F 77 00 9A 81 B3 6F 4B 00 00 00 00

Sorry for bad explanation, can't seem to do it any other way.

NOTE: these bytes have been changed since the last time I packet logged, however these will work
[/code]

According to Shadow on BnetDocs http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=447

Just wondering if someone would share their 0x68, here's mine:

[code]
Public Sub SEND_D2GS_0x68()
With Buf 'logon D2GS
  .InsertDWORD gsData32 'Server Hash
  .InsertWORD gsData16 'Server Token
  .InsertBYTE &H4 ' Character type
  .InsertDWORD &HB 'Verbyte 0x0B
  .InsertDWORD &HED5DCC50 'Unknown
  .InsertDWORD &H91A519B6 'Unknown
  .InsertBYTE &H0 'Unknown
  .InsertNonNTString hCharName
  '.insertvoid 0x9E, 0xAE, 0xD4, 0x77, 0x9A, 0x81, 0xB3, 0x6F, 0x4B, 0x00, 0x00, 0x00, 0x00
  .SendGPacket &H68
End With
Schat vbGreen, "Sent D2GS 0x68 Game Logon Packet!"
End Sub

I also don't know how to send it as a 'void' (InsertVOID does not exist) any help is appreciated, also for all who care I'm trying to update Ringo's Open Source bot so it will be open source and I am not in any way 'ripping' it.[/code]
December 30, 2005, 10:30 PM
Ringo
Try this:
[code]
    On Error Resume Next
    Const pdBuf As String = "000000008FD4773A18AE6F4B00000000"
    Dim tmpStr As String, i As Long
    'convert the amount of hex characters needed to pad the charname + null char
    For i = Len(BNRS.MYCHAR.CharName) * 2 + 3 To 32 Step 2
        tmpStr = tmpStr & Chr("&H" & Mid(pdBuf, i, 2))
    Next i
    'add the char + null to the start
    tmpStr = BNRS.MYCHAR.CharName & Chr(0) & tmpStr
    With Buf
        .InsertDWORD BNRS.GAME.LastHash
        .InsertWORD BNRS.GAME.LastToken
        .InsertBYTE BNRS.MYCHAR.CharType
        .InsertDWORD 11   'vbyte
        .InsertDWORD &HED5DCC50
        .InsertDWORD &H91A519B6
        .InsertBYTE 0
        .InsertSTRING tmpStr '16 byte buffer with char name
        .SendPacket &H68
    End With
[/code]

Hope it helps
December 31, 2005, 12:46 AM
kamakazie
You need to send 16 bytes for the character name since packet lengths are fixed. Given that, I very much doubt the game server checks the rest of the bytes after the first null. If this is true, then you could fill them with anything and it shouldn't matter.
December 31, 2005, 1:59 AM
l2k-Shadow
[code]
Public Function Get0x68Bytes(Name As String) As String
Dim bBytes As String
    If Len(Name) = 15 Then Exit Function
    bBytes = Chr(&H9E) & Chr(&HAE) & Chr(&HD4) & Chr(&H77) & Chr(&H9A) & Chr(&H81) & Chr(&HB3) & Chr(&H6F) & Chr(&H4B) & Chr(&H0) & Chr(&H0) & Chr(&H0) & Chr(&H0)
    Get0x68Bytes = Mid$(bBytes, Len(Name) - 1)
End Function
[/code]

^ Something like that. hope that helps.

InsertVOID is equivalent to InsertNonNTString in most packet buffers. VOID is the correct name for this data type.

So you'd do like
[code]
'0x68 blah blah
.InsertByte 0
.InsertSTRING Character_Name
.InsertVOID Get0x68Bytes(Character_Name)
[/code]
December 31, 2005, 6:44 AM
Fr0z3N
yeah thanks I figured it out:

[code]
Public Sub SEND_D2GS_0x68()
With Buf 'logon D2GS
  .InsertDWORD gsData32 'Server Hash
  .InsertWORD gsData16 'Server Token
  .InsertBYTE &H4 ' Character type
  .InsertDWORD &HB 'Verbyte 0x0B
  .InsertDWORD &HED5DCC50 'Unknown
  .InsertDWORD &H91A519B6 'Unknown
  .InsertBYTE &H0 'Unknown
  .InsertPString hCharName, 16
  .SendGPacket &H68
End With
Schat vbGreen, "Sent D2GS 0x68 Game Logon Packet!"
End Sub
[/code]

Now I just gotta figure out how to retrieve a gamelist but that should be easy.
December 31, 2005, 9:06 AM
Ringo
[quote author=l2k-Shadow link=topic=13713.msg139928#msg139928 date=1136011451]
    bBytes = Chr(&H9E) & Chr(&HAE) & Chr(&HD4) & Chr(&H77) & Chr(&H9A) & Chr(&H81) & Chr(&HB3) & Chr(&H6F) & Chr(&H4B) & Chr(&H0) & Chr(&H0) & Chr(&H0) & Chr(&H0)
[/quote]
Those bytes are wrong..
I wouldnt fancy doing anything incorrect, with the way Blizzard are banning at the moment.
December 31, 2005, 2:11 PM
l2k-Shadow
[quote author=Ringo link=topic=13713.msg139937#msg139937 date=1136038311]
[quote author=l2k-Shadow link=topic=13713.msg139928#msg139928 date=1136011451]
    bBytes = Chr(&H9E) & Chr(&HAE) & Chr(&HD4) & Chr(&H77) & Chr(&H9A) & Chr(&H81) & Chr(&HB3) & Chr(&H6F) & Chr(&H4B) & Chr(&H0) & Chr(&H0) & Chr(&H0) & Chr(&H0)
[/quote]
Those bytes are wrong..
I wouldnt fancy doing anything incorrect, with the way Blizzard are banning at the moment.
[/quote]

That's why I said "something like", If you read my post on BNETDocs regarding this, you notice that I say, these bytes have been changed since the last time I packet logged but those will work.
December 31, 2005, 3:33 PM
Fr0z3N
Does anyone wanna help me parse 0x05? this is what I'm receiving after sending it.

[code]
[11:22:03 AM] got unknown REALM data
  1D 00 05 01 00 C0 00 00 00 01 04 00 30 00 31 30    ............0.10
  30 20 4D 66 20 44 61 67 67 65 72 00 00    0 Mf Dagger..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 B7 01 00 00 01 04 00 30 00 42 61    ............0.Ba
  61 6C 20 52 75 6E 7A 20 30 31 00 00    al RunZ 01..
[11:22:04 AM] got unknown REALM data
  17 00 05 01 00 85 02 00 00 03 04 00 30 00 43 6F    ............0.Co
  77 2D 30 30 31 00 00    W-001..
[11:22:04 AM] got unknown REALM data
  18 00 05 01 00 99 00 00 00 02 04 00 30 00 43 6F    ............0.Co
  77 73 30 33 30 33 00 00    Ws0303..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 A9 01 00 00 04 04 00 30 00 49 20    ............0.I
  43 6F 77 20 59 6F 75 20 30 34 00 00    CoW You 04..
[11:22:04 AM] got unknown REALM data
  18 00 05 01 00 02 01 00 00 07 04 00 30 00 43 6F    ............0.Co
  77 73 30 31 30 31 00 00    Ws0101..
[11:22:04 AM] got unknown REALM data
  1A 00 05 01 00 19 02 00 00 04 04 00 30 00 42 61    ............0.Ba
  61 6C 72 75 6E 31 30 32 00 00    alrun102..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 EA 00 00 00 01 04 00 30 00 42 61    ............0.Ba
  61 6C 72 75 6E 2D 30 30 32 34 00 00    alrun-0024..
[11:22:04 AM] got unknown REALM data
  1B 00 05 01 00 D6 02 00 00 04 04 00 30 00 54 72    ............0.Tr
  69 73 74 72 61 6D 20 30 33 00 00    istram 03..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 E2 00 00 00 03 04 00 30 00 49 20    ............0.I
  43 6F 77 20 59 6F 75 20 30 31 00 00    CoW You 01..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 1C 01 00 00 06 04 00 30 00 54 6F    ............0.To
  6D 62 73 2D 2D 2D 30 30 30 31 00 00    mbs---0001..
[11:22:04 AM] got unknown REALM data
  17 00 05 01 00 0C 03 00 00 03 04 00 30 00 54 6F    ............0.To
  6D 62 20 30 31 00 00    mb 01..
[11:22:04 AM] got unknown REALM data
  1D 00 05 01 00 70 02 00 00 04 04 00 30 00 54 72    .....p......0.Tr
  69 73 74 20 52 75 6E 7A 2D 31 30 00 00    ist RunZ-10..
[11:22:04 AM] got unknown REALM data
  1A 00 05 01 00 28 03 00 00 04 04 00 30 00 4E 6F    .....(......0.No
  72 6D 62 61 61 6C 30 37 00 00    rmbaal07..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 24 01 00 00 01 04 00 30 00 4E 69    .....$......0.Ni
  67 68 74 63 6F 77 73 2D 30 36 00 00    ghtcoWs-06..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 E1 01 00 00 03 04 00 30 00 49 74    ............0.It
  65 6C 65 62 61 61 6C 2D 30 32 00 00    elebaal-02..
[11:22:04 AM] got unknown REALM data
  1A 00 05 01 00 0D 02 00 00 01 04 00 30 00 54 72    ............0.Tr
  69 73 74 69 6E 67 30 33 00 00    isting03..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 AE 01 00 00 03 04 00 30 00 4C 65    ............0.Le
  74 73 74 72 69 73 74 30 30 31 00 00    tstrist001..
[11:22:04 AM] got unknown REALM data
  18 00 05 01 00 A4 03 00 00 03 04 00 30 00 43 6F    ............0.Co
  77 73 30 32 30 32 00 00    Ws0202..
[11:22:04 AM] got unknown REALM data
  1C 00 05 01 00 9C 01 00 00 02 04 00 30 00 42 61    ............0.Ba
  61 6C 20 52 75 6E 20 30 30 36 00 00    al Run 006..
[11:22:04 AM] got unknown REALM data
  11 00 05 01 00 00 00 00 00 00 00 00 00 00 00 00    ................
  00    .
[/code]
December 31, 2005, 4:22 PM
Ringo
I had a few problems with the listview controll crashing when adding realm games, the only way i could stop it was to buffer the packets, and parse them on the end blank one.
example:
[code]
Public rs0x05Data As String
Public Sub BNRS0x05Handler(ByVal Data As String)
    '//game list
    On Error Resume Next
    Dim tmpGame$, tmpDesc$, tmpPlayers%
    tmpGame = Buf.GetSTRING(Mid(Data, 15))
    If Not tmpGame = "" Then 'buffer packets
        rs0x05Data = rs0x05Data & Mid(Data, 4)
        Exit Sub
    End If
    'parse them
    While Len(rs0x05Data) > 0
        tmpPlayers = Asc(Mid(rs0x05Data, 7))
        tmpGame = Buf.GetSTRING(Mid(rs0x05Data, 12))
        tmpDesc = Buf.GetSTRING(Mid(rs0x05Data, 13 + Len(tmpGame)))
        '...
        rs0x05Data = Mid(rs0x05Data, 14 + Len(tmpGame) + Len(tmpDesc))
    Wend
    rs0x05Data = ""
End Sub
[/code]
December 31, 2005, 6:04 PM

Search