Valhalla Legends Forums Archive | Battle.net Bot Development | Looking for info - 0x1c

AuthorMessageTime
fataly
Do i need send whole 0x1c when i use diablo 2 lod? In http://www.bnetdocs.org/?op=packet&pid=265 are this icon :
[img]http://www.bnetdocs.org/images/games/d2exp.jpg[/img]
January 21, 2009, 2:40 PM
Ringo
[quote author=fataly link=topic=17798.msg181353#msg181353 date=1232548834]
[code]
Public Sub D2GSsend0x68(ByVal d2gshash As String, ByVal tokengs As String)
On Error Resume Next
    Const pdBuf As String = "000000008FD4773A18AE6F4B00000000"
    Dim tmpStr As String, i As Long
    For i = Len(hplayer) * 2 + 3 To 32 Step 2
        tmpStr = tmpStr & Chr("&H" & Mid(pdBuf, i, 2))
    Next i
    tmpStr = hplayer & Chr(0) & tmpStr
Call iClear
        Call iDWORD(Form1.Text9.Text) 'hash
        Call iWORD(Form1.Text8.Text) 'token
        Call iBYTE(&H3)  'BNRS.MYCHAR.CharType
        Call iDWORD(&HB)   'vbyte
       Call iDWORD(&HED5DCC50)
        Call iDWORD(&H91A519B6)
        Call iBYTE(&H0)
       Call iNTSTRING(tmpStr)
        Call iHEADER(&H68, D2GS_HEADER)
         Call iPacket(Form1.Winsock3.SocketHandle)
         ShowChat vbGreen, "0x68 sent"
      Call D2GSsend0x6D
End Sub
[/code]
[/quote]
The account name is not a null terminated string, is a fixed lengh array of bytes/characters.
At a glance, it looks like you're buffering the character name, but then inserting it into the packet buffer as a null terminated string -- so the lengh will be 1 byte to many.
Almost all packets in D2GS have fixed lenghs, if you get them wrong, the server side packet handler will desynq -- in this case, handle 0x68, then packet 0x00.
Also why on earth are you storeing the hash and token, in a text box?!?!
They are a dword (long) and word (integer), not strings.
Use global variables..

Do somthing like this:
[code]
    Dim tmpStr As String, pdBuf as string
    pdBuf = HexToStr("00 00 00 00 8F D4 77 3A 18 AE 6F 4B 00 00 00 00")
    call copymemory(byval pdBuf, byval cstr(hplayer & vbnullchar), len(hplayer)+1)
    Call iClear
    Call iDWORD(hD2GSHash) 
    Call iWORD(hD2GSToken) 
    Call iBYTE(hD2GSCharType)  'get this from you're char list (char u wanna logon)
    Call iDWORD(&HB) 
    Call iDWORD(&HED5DCC50)
    Call iDWORD(&H91A519B6)
    Call iBYTE(&H0)
    Call iSTRING(pdBuf)
    Call iHEADER(&H68, D2GS_HEADER)
    Call iPacket(Form1.Winsock3.SocketHandle)
    ShowChat vbGreen, "0x68 sent"
    Call D2GSsend0x6D
[/code]
January 22, 2009, 12:30 AM
fataly
EDiteD!
January 22, 2009, 5:25 AM
fataly
Ok here is the funny thinks: when i push create game button on my bot, it sends:
[18:39:11] Creating game!
[18:39:11] Joining created game..
[18:39:11] 0x1c sent
[18:39:12] 0x22 sent - Version: 0  <- (is this normal version number?)
[18:39:12] Leave chat - 0x10
[18:39:12] Connecting now D2GS (63.241.83.46:4000)
[18:39:12] Connected!
[18:39:12] OxAF received
[18:39:12] 0x68 sent
[18:39:12] 0x6D sent
[18:39:12] Ws 3 Connection Error: Connection is aborted due to timeout or other failure

Ok, but after i closed Visual basic, and started play diablo 2, i tested that game name and pw,(named : testgame6////same)  i get this : "A game allready exist with that name" So i did game but its not playable and my bot client drop, :D that is something! And where i can find more info about Packet 0x1c?????? looks like there is not even information of that, in bnetdocs i can just read infos about wc3 etc.. there is not diablo infos :((
January 22, 2009, 4:42 PM

Search