• Welcome to Valhalla Legends Archive.
 

Looking for info - 0x1c

Started by fataly, January 21, 2009, 08:40 AM

Previous topic - Next topic

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 :


Ringo

#1
Quote from: fataly on January 21, 2009, 08:40 AM

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

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:

    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

fataly

#2
EDiteD!

fataly

#3
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 :((