Valhalla Legends Forums Archive | Battle.net Bot Development | [c++] 0x0a

AuthorMessageTime
mentalCo.
why do i get disconnected when sending 0x0a?
[code]
packetbuf.clear();
packetbuf.insert(username);
packetbuf.insert((int)0);
packetbuf.sendpacket(bnetfd, 0x0a);
[/code]
should this be different?
July 16, 2004, 6:23 PM
Eli_1
Have you tried packet logging what your bot sends and comparing it to the 0x0a the real client sends?
July 16, 2004, 6:39 PM
mentalCo.
yup. sent the exact packet. still get disconnected.
July 16, 2004, 6:58 PM
ChR0NiC
[quote author=mentalCo. link=board=17;threadid=7730;start=0#msg70799 date=1090002201]
why do i get disconnected when sending 0x0a?
[code]
packetbuf.clear();
packetbuf.insert(username);
packetbuf.insert((int)0);
packetbuf.sendpacket(bnetfd, 0x0a);
[/code]
should this be different?
[/quote]

Well, I am unsure how you have decided to do your packetbuffer class, but it looks like you did "Insert" on both the Username and the Statstring. And it's fine, you are allowed to just insert 0x0 for the statstring, but since I doubt you would "Null Terminate" a single integer, it looks like you are not Null Terminating your Username. So make sure you are sending a null terminated username.

Edit: And if you are, make sure you are not null terminated the 0x0 byte you are inserting for the statstring.
July 16, 2004, 7:42 PM
UserLoser.
Just a thought, doing (int)0 might convert it to two bytes to be a WORD when it should just be one BYTE? Try (unsigned char)0

Edit: or a DWORD? Doesn't matter, because the whole point is it should just be one byte (unsigned char)0
July 16, 2004, 7:54 PM
mentalCo.
i wasnt null terminating my username lol. ill try it now i just got unbanned.

edit: if i were to use a statstring whats the format? thx
July 16, 2004, 8:10 PM
ChR0NiC
Make sure it works first, before you start trying to get all fancy.

Edit: The statstring only works for old clients that don't require cd keys, for cdkey'd products you just send null
July 16, 2004, 8:21 PM
mentalCo.
still isnt working. i sent the exact packet from a real client. do i send 0x0c first? im out of ideas.
July 16, 2004, 8:45 PM
hismajesty
0x0C should be sent last of the three packets that are sent at that time.
July 16, 2004, 8:52 PM
ChR0NiC
Well you need to SID_ENTERCHAT before you SID_JOINCHANNEL. So you send 0x0A first then 0x0C. But it is not necessary to send 0x0C, until you wish to join a channel.

Can you post a packet log please?? I am curious of the problem now ;D


Edit: Damn Trust beat me to it >:(
July 16, 2004, 8:53 PM
Maddox
Should be...
[quote]
packetbuf.insert(username);
packetbuf.insert("");
packetbuf.sendpacket(bnetfd, 0x0a);
[/quote]

You were sending the statstring as an integer (most likely 4 bytes on your platform) instead of an empty string, 1 byte.
July 16, 2004, 10:22 PM

Search