Valhalla Legends Forums Archive | Battle.net Bot Development | [VB6] sid_EnterChat 0x0A C->S

AuthorMessageTime
fataly
More info here: https://davnit.net/bnet/vL/index.php?topic=17783.0
I started new topic with better name.

S > C [0x0A] SID_ENTERCHAT
C > S [0x0A] SID_ENTERCHAT

I got problem like this:
[code]
[14:21:53] Connecting..
[14:21:53] Connected!
[14:21:54] CheckRevision..
[14:21:54] Getting Realmlist..
[14:21:54] Logging Onto Account..
[14:21:54] Connecting MCP ( 213.248.106.208:6112 )..
[14:21:54] Connected!
[14:21:54] Character logon success.
[14:21:55] Connection Closed    -> This come after i send 0X0A
[/code]

I did own send 0x0a button in form , when im logged in and i need to send 0x0a, i press button and connection closed. This method i used after i regonize that im doing something wrong on oxoa. Normaly i dont use a button to send packets.

And here is my send0x0A:
[code]
Public Sub Send0x0A()
    Call iClear
Call iNTSTRING(hplayer)
  Call iNTSTRING(hrealm)
    Call iHEADER(&HA)
    Call iPacket(Form1.Winsock1.SocketHandle)
    Call Send0x0C(lngFlag, strChannel)
End Sub
[/code]

And here packet logs:

C->S 0B 00 07 66 61 74 61 6C 79 64 00 ...fatalyd. -> Select character named Fatalyd.
S->C 07 00 07 00 00 00 00                    .......  -> SUXXES!
C->S FF 0A 13 00 66 61 74 61 6C 79 64 00 55 73 77 65 73 74 00  ....fatalyd.Uswest.  -> Enter chat!
C->S FF 0C 09 00 00 00 00 00 00            .........  -> Enter blank channel ( normaly i use randoms channel names )

S->C FF 0A 4D 00 46 61 74 61 6C 79 36 36 36 00 50 58      ..M.Fataly666.PX
        32 44 55 53 57 65 73 74 2C 66 61 74 61 6C 79 64      2DUSWest,fatalyd
        2C 84 80 FF FF FF FF FF FF FF FF FF FF FF 04 FF            ,...............
        FF FF FF FF FF FF FF FF FF FF 01 E1 80 80 80 05            ................
        FF FF 00 46 61 74 61 6C 79 36 36 36 00                      ...Fataly666.

And then connection closed, what is wrong ! :(




January 17, 2009, 12:31 PM
Ringo
At a glance, since you're getting a responce to 0x0A, then getting connection closed, it's logical to assume, you're getting connection closed for somthing you send after 0x0A.
From what I can see above, that would be the 0x0C.
Send somthing like:
Call Send0x0C(&H5, "Diablo II")
And see if that makes any differnce.

As for 0x0A, for realm logon (altho, this shouldnt really matter to much) send somthing like this: (assuming the hPlayer variable contains the you're realm character name, and hRealm contains the realm name)
[code]
    Call iClear
    Call iNTSTRING(hplayer)
    Call iNTSTRING(hrealm & "," & hplayer)
    Call iHEADER(&HA)
    Call iPacket(Form1.Winsock1.SocketHandle)
    Call Send0x0C(&H5&, "Diablo II")
[/code]
January 17, 2009, 3:07 PM
fataly
[quote author=Ringo link=topic=17793.msg181311#msg181311 date=1232204835]
At a glance, since you're getting a responce to 0x0A, then getting connection closed, it's logical to assume, you're getting connection closed for somthing you send after 0x0A.
From what I can see above, that would be the 0x0C.
Send somthing like:
Call Send0x0C(&H5, "Diablo II")
And see if that makes any differnce.

As for 0x0A, for realm logon (altho, this shouldnt really matter to much) send somthing like this: (assuming the hPlayer variable contains the you're realm character name, and hRealm contains the realm name)
[code]
    Call iClear
    Call iNTSTRING(hplayer)
    Call iNTSTRING(hrealm & "," & hplayer)
    Call iHEADER(&HA)
    Call iPacket(Form1.Winsock1.SocketHandle)
    Call Send0x0C(&H5&, "Diablo II")
[/code]
[/quote]

Thanks for replay, i got it work some hours ago but this give some idea for other think :)
January 17, 2009, 4:05 PM
fataly
[quote author=fataly link=topic=17793.msg181314#msg181314 date=1232208313]
[quote author=Ringo link=topic=17793.msg181311#msg181311 date=1232204835]
At a glance, since you're getting a responce to 0x0A, then getting connection closed, it's logical to assume, you're getting connection closed for somthing you send after 0x0A.
From what I can see above, that would be the 0x0C.
Send somthing like:
Call Send0x0C(&H5, "Diablo II")
And see if that makes any differnce.

As for 0x0A, for realm logon (altho, this shouldnt really matter to much) send somthing like this: (assuming the hPlayer variable contains the you're realm character name, and hRealm contains the realm name)
[code]
    Call iClear
    Call iNTSTRING(hplayer)
    Call iNTSTRING(hrealm & "," & hplayer)
    Call iHEADER(&HA)
    Call iPacket(Form1.Winsock1.SocketHandle)
    Call Send0x0C(&H5&, "Diablo II")
[/code]
[/quote]

Thanks for replay, i got it work some hours ago but this give some idea for other think :)
[/quote]

Looks like i got same problem again... im getting so boored with this. Does some1 ever got problems with this?

And little offtopic :)
[code]
This is from ringo, and i add it to my code.
Private Sub Winsock3_DataArrival(ByVal D2GS_DATA As Long)
On Error Resume Next
Dim offset As Long
Dim Size As Long
Dim H1 As String
Dim H2 As Integer
Dim outdata As String
Dim maxsize As Long
Dim outsize As Long
H1 = GamePacketSize(D2GS_DATA, Size, offset)
outdata = String(Size + 6, vbNullChar)
H2 = GamePacketDecode(Mid(D2GS_DATA, 1 + offset), Size + 5, outdata, Size + 5, outsize)
Call parsed2Gs(outdata)
End Sub
[/code]
i got error on GamePacketSize() or  are this code write wrong
I added these on modapi.
public Declare Sub GamePacketSize Lib "D2GS.dll" (ByVal Data$, ByRef Size&, ByRef OffSet&)
public Declare Function GamePacketDecode& Lib "D2GS.dll" (ByVal InData$, ByVal InSize&, ByVal OutData$, ByVal OutMax&, ByRef OutSize&)
public Declare Function GamePacketEncode& Lib "D2GS.dll" (ByVal InData$, ByVal InSize&, ByVal OutData$)
public Declare Function GamePacketHeader& Lib "D2GS.dll" (ByVal Size&, ByVal Out$)

In first time i used:
[code]
AGAIN now edit :


Private Sub Winsock3_DataArrival(ByVal bytesTotal As Long)
Dim strTemp As String
Call Winsock3.GetData(strTemp, vbString, bytesTotal)
Call ParseD2GS(strTemp)
End Sub


[/code]
And when i compres data ? this is new to meh:D and im little bit a lost now.. Like ringo told meh, im gonna drop very deep when i start d2gs :D hes right.

And last think:
Are here anymore any tutorials to use d2gs? im sure i learn it but this compression is not funny at all, i try get it work.. but if some1 wanna help meh, post examples like :(https://davnit.net/bnet/vL/index.php?topic=11932.30)

I got again connection closed ...
EDIT:
Here is 0x0a packet lock S->C and C->S

[code]
sent: 0x0a
FF 0A 1B 00 66 61 74 61 6C 79 64 00 45 75 72 6F....fatalyd.Euro
70 65 2C 66 61 74 61 6C 79 64 00                        pe,fatalyd.
then send 0x0c:
FF 0C 0F 00 05 00 00 00 44 69 61 62 6C 6F 00 ........Diablo.

recv:

FF 0A 1D 00 46 61 74 61 6C 79 36 36 36 00 50 58  ....Fataly666.PX
32 44 00 46 61 74 61 6C 79 36 36 36 00                  2D.Fataly666.

CONNECTION CLOSED.
[/code]
January 17, 2009, 7:32 PM
fataly
Problem solved, i messedup sumthing1 & 2 and i sent packets on wrong order. Thanks all to help meh ;P

EDIT: This post can delete or trash!
January 21, 2009, 2:30 PM

Search