• Welcome to Valhalla Legends Archive.
 

[VB][Solved]Profile Request (C->S 0x26) getting disconnected

Started by Don Cullen, September 23, 2005, 02:31 PM

Previous topic - Next topic

Don Cullen

'Request profile information
Public Sub P0x26(Name As String)
    With PacketBuf
        .InsertDWORD &H1
                .InsertDWORD &H1 'num of keys requested
                .InsertDWORD &H2 'Request ID
                .InsertNTString Name
                .InsertNTString "profile\description"
        End Select
        .InsertBYTE &H0
        .SendPacket DMBot.BNET, &H26
    End With
End Sub


I did a profile request, and apparently it got me disconnected, and perhaps IPBanned. Let me check-- yep, IPBanned.

BNETDocs was down, and I needed the packet information, so I merely did a search for the 0x26 packet description in here on the forums-- fortunately someone had posted that information. Based on that information, I coded the above sub. Can anyone see what's wrong with it? I'm only requesting one key: the description.

Also, do any of you know of any characters that can be put in profile description that will NOT be visible in game clients?

Also, do you know whether BNET has a rating limit on how many profile requests can be done in a certain time period? Because I'd like to have my bot do profile requests on everyone the second it joins the channel. I haven't coded that part yet, I'm focused on getting a single simple profile request to work, before I move on to mass loading everyone's profile.

Basically, the reason for this is because I'd like to have the bog tag the bot user's profile with one (preferably two) nonvisible special character(s). When someone else using same bot goes in channel, the bot would mass load everyone's profiles, and check for those two special chars- in short they'd act as bot identifiers, and my bot would then change the username's font color in the listview, so the person would know that person was also using the same bot.

Information would be appreciated! Thanks in advance!
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Blaze


Public Sub P0x26(Name As String)
         With PacketBuf
                    .InsertDWORD &H1 'I don't Remember
                    .InsertDWORD &H1 'Amount
                    .InsertDWORD &H1 'Cookie
                    .InsertNTString Name 'Username
                    .InsertNTString "profile\description" 'Key
                    .SendPacket DMBot.BNET, &H26 'Send, duh
         End With
End Sub
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Soul Taker

The empty string (being sent as just a null byte by the OP) should be kept because the official clients send an empty string at the end.  That string is counted as a key being requested, and thusly your number of keys requested should be increased to 2.

Don Cullen

Ahhh duhh i forgot to remove the End Select line when i removed code for checking client...

In any case, it returns nothing.

Here's the updated code, also updated with Soul Taker's suggestion:

'Request profile information
Public Sub P0x26(Name As String)
    With PacketBuf
        .InsertDWORD &H1 'I don't Remember
        .InsertDWORD &H2 'Amount
        .InsertDWORD &H1 'Cookie
        .InsertNTString Name 'Username
        .InsertNTString "profile\description" 'Key
        .InsertNTString Chr(0)
        .SendPacket DMBot.BNET, &H26 'Send, duh
    End With
End Sub


And here's the 0x26 case handler code:

        Case &H26
           
            'Packet ID: 0x26
            'Direction: Server -> Client (Received)
            'Format:
            'Help (DWORD)       Number of accounts
            '(DWORD)       Number of keys
            '(DWORD)       Request ID
            '(STRING[])    Requested Key Values
            'Remarks: Contains profile information as
            'requested in C->S 0x26.
           
            Dim Trash As Long
            Dim Profile As String
            Trash = PktDeBuf.rDWORD '# of accounts
            Trash = PktDeBuf.rDWORD '# of keys
            Trash = PktDeBuf.rDWORD 'RequestID, set up later
            Profile = PktDeBuf.rNTString    'Get profile string
            AddC vbCyan, Profile


Thanks for the help so far, I appreciate it!

[Edited to avoid double-posting]

By the way, the server still disconnects and ipbans after the above packet is transmitted.
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

iago

Can you grab a packetlog of it? That's the easiest way to see what's going wrong :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Don Cullen


  FF 26 31 00 01 00 00 00 02 00 00 | ÿ&1........
  00 01 00 00 00 2F 70 72 6F 66 69 | ...../profi
  6C 65 20 61 00 70 72 6F 66 69 6C | le a.profil
  65 5C 64 65 73 63 72 69 70 74 69 | e\descripti
  6F 6E 00 00 00                   | on...


That's the hex dump of the packet I'm sending.
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

UserLoser.

Quote from: Kyro on September 23, 2005, 04:43 PM

  FF 26 31 00 01 00 00 00 02 00 00 | ÿ&1........
  00 01 00 00 00 2F 70 72 6F 66 69 | ...../profi
  6C 65 20 61 00 70 72 6F 66 69 6C | le a.profil
  65 5C 64 65 73 63 72 69 70 74 69 | e\descripti
  6F 6E 00 00 00                   | on...


That's the hex dump of the packet I'm sending.

Should be obvious what's wrong there...hint: see the first string

Kp

Breaking every 11 bytes has to be the weirdest boundary choice I've ever seen.  Traditional values are 8, 16, and (occasionally) 32.  That said, why're you requesting the username of the user "/profile a"?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

shadypalm88

Quote from: Kp on September 23, 2005, 04:48 PM
Breaking every 11 bytes has to be the weirdest boundary choice I've ever seen.  Traditional values are 8, 16, and (occasionally) 32.  That said, why're you requesting the username of the user "/profile a"?
Probably because he implemented the lookup as a command called profile and is sending the full command text instead of just the username argument.

Topaz


    pBuffer.InsertDWORD 1
    pBuffer.InsertDWORD 4
    pBuffer.InsertDWORD lngKey
    pBuffer.InsertNTString strUser
    pBuffer.InsertNTString "profile\age"
    pBuffer.InsertNTString "profile\location"
    pBuffer.InsertNTString "profile\sex"
    pBuffer.InsertNTString "profile\description"
    pBuffer.sendPacket &H26



Case &H26 'Profile
            Dim ProfileEnd As String
            Dim SplitProfile As Variant
            ProfileEnd = Mid(data, 13, Len(data))
            SplitProfile = Split(ProfileEnd, Chr(&H0))
            frmViewProfile.Show
            frmViewProfile.txtLocation.text = SplitProfile(2)
            frmViewProfile.txtSex.text = SplitProfile(3)
            frmViewProfile.txtDescription.text = SplitProfile(4)

UserLoser.

We don't need anymore redundant code.  The issue was solved like 4 posts ago

Don Cullen

Actually, it wasn't solved. I was busy... :-P

Anyhow, I fixed the /profile thing-- way I have it set up, I would do this:

/profile Kyro[sK]

using the bot, and the bot would then send the profile request packet. My MID command wasn't parsing the string correctly, so I fixed that- thanks everyone for pointing that out. But the packet still gets me disconnected and IPBanned. I'm IPBanned from two servers now... lol...

Here's the latest packet dump:

  FF 26 2F 00 01 00 00 00 02 00 00 | ÿ&/........
  00 01 00 00 00 4B 79 72 6F 5B 73 | .....Kyro[s
  4B 5D 00 70 72 6F 66 69 6C 65 5C | K].profile\
  64 65 73 63 72 69 70 74 69 6F 6E | description
  00 00 00                         | ...


And here's the latest packet code:

'Request profile information
Public Sub P0x26(Name As String)
    With PacketBuf
        .InsertDWORD &H1
        .InsertDWORD &H2 'Amount of keys requested
        .InsertDWORD &H1 'Profile Identifer for return
        .InsertNTString Name 'Username of profile requested
        .InsertNTString "profile\description" 'Key requested
        .InsertNTString Chr(0)
        .SendPacket DMBot.BNET, &H26
    End With
End Sub


Sorry to have made you guys wait! :P
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Hdx


Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Don Cullen

Soul Taker says in a earlier response to my post:

QuoteThe empty string (being sent as just a null byte by the OP) should be kept because the official clients send an empty string at the end.  That string is counted as a key being requested, and thusly your number of keys requested should be increased to 2.

That's why.
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Hdx

that dosent explain why there are 2! nulls. there should be 1!
Also, if you wana keep the 2 you need to up your keys count. right now your saying you are requesting 2 when your really asking for 3. ("profile\description" and 2 empty strings.)
'Request profile information
Public Sub P0x26(Name As String)
    With PacketBuf
        .InsertDWORD &H1
        .InsertDWORD &H2 'Amount of keys requested
        .InsertDWORD &H1 'Profile Identifer for return
        .InsertNTString Name 'Username of profile requested
        .InsertNTString "profile\description" 'Key requested
        .InsertNTString vbNullString
        .SendPacket DMBot.BNET, &H26
    End With
End Sub

Should fix it.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status