Valhalla Legends Forums Archive | Battle.net Bot Development | [VB][Solved]Profile Request (C->S 0x26) getting disconnected

AuthorMessageTime
LockesRabb
[code]'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[/code]

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!
September 23, 2005, 7:31 PM
KkBlazekK
[code]
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
[/code]
September 23, 2005, 7:47 PM
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.
September 23, 2005, 7:51 PM
LockesRabb
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:

[code]'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[/code]

And here's the 0x26 case handler code:

[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
[/code]

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.
September 23, 2005, 7:58 PM
iago
Can you grab a packetlog of it? That's the easiest way to see what's going wrong :)
September 23, 2005, 8:16 PM
LockesRabb
[pre]
  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...
[/pre]

That's the hex dump of the packet I'm sending.
September 23, 2005, 9:43 PM
UserLoser.
[quote author=Kyro link=topic=12888.msg129110#msg129110 date=1127511802]
[pre]
  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...
[/pre]

That's the hex dump of the packet I'm sending.
[/quote]

Should be obvious what's wrong there...hint: see the first string
September 23, 2005, 9:47 PM
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"?
September 23, 2005, 9:48 PM
shadypalm88
[quote author=Kp link=topic=12888.msg129114#msg129114 date=1127512109]
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"?
[/quote]Probably because he implemented the lookup as a command called profile and is sending the full command text instead of just the username argument.
September 23, 2005, 10:04 PM
Topaz
[code]
    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
[/code]

[code]
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)
[/code]
September 23, 2005, 10:15 PM
UserLoser.
We don't need anymore redundant code.  The issue was solved like 4 posts ago
September 23, 2005, 10:16 PM
LockesRabb
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:

[pre]  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                         | ...[/pre]

And here's the latest packet code:

[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[/code]

Sorry to have made you guys wait! :P
September 24, 2005, 6:36 PM
HdxBmx27
why do you have 2 extra nulls on there?
~-~(HDX)~-~
September 24, 2005, 6:39 PM
LockesRabb
Soul Taker says in a earlier response to my post:

[quote]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.[/quote]

That's why.
September 24, 2005, 6:44 PM
HdxBmx27
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.)
[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 vbNullString
        .SendPacket DMBot.BNET, &H26
    End With
End Sub[/code]
Should fix it.
~-~(HDX)~-~
September 24, 2005, 7:05 PM
LockesRabb
Problem solved thanks to  l2k-Shadow.

The problem was, when I requested the profile description key, I had the key all in lower caps. I had to fix caps. I also found out the two extra nulls wasn't correct- I was told I should have tried NonNTString instead of NTString when inserting a blank string. I was also informed that blank string wasn't really neccessary, so I opted to remove the blank string. Here's new, and also working code-- this time with age, sex, loc all included for anyone who needs it.

[code]'Request profile information
Public Sub P0x26(Name As String)
   With PacketBuf
       .InsertDWORD &H1
       .InsertDWORD &H4 'Amount of keys requested
       .InsertDWORD GetTickCount 'Profile Identifer for return
       .InsertNTString Name 'Username of profile requested
       .InsertNTString "Profile\Age"
       .InsertNTString "Profile\Sex"
       .InsertNTString "Profile\Location"
       .InsertNTString "Profile\Description"
       .SendPacket DMBot.BNET, &H26
   End With
End Sub[/code]

Thanks everyone for helping! And HdxBmx-- yea, that's probably why. Thanks!
September 24, 2005, 7:10 PM
UserLoser.
[quote author=Kyro link=topic=12888.msg129204#msg129204 date=1127589046]
Problem solved thanks to l2k-Shadow.
The problem was, when I requested the profile description key, I had the key all in lower caps. I had to fix caps. I also found out the two extra nulls wasn't correct
[/quote]

What?  That is not the problem.  The key names are not case sensitive and the extra byte is really there.
September 24, 2005, 10:28 PM
LockesRabb
Well, when I removed the extra null bytes as a result of my doing:

    .InsertNTString chr(0)

And also fixed case in profile string, it started working fine, and I was no longer being disconnected nor ipbanned. So I assumed that was the problem.
September 24, 2005, 10:34 PM

Search