• Welcome to Valhalla Legends Archive.
 

[RESOLVED] My packet recv function

Started by Sorc.Polgara, December 25, 2004, 09:33 AM

Previous topic - Next topic

Sorc.Polgara

Ok, I am positive that I am sending the correct data buffer to Bnet however I get an error, I'm not recieving any data.  I'm thinking that it is probably due to my function that I use to recieve data from a socket.  Here is the function:


char* recvPacket(SOCKET sck)
{
int nBytes;
char *tempbuf = new char[512];

nBytes = recv(sck, tempbuf, 512, 0);

if ((nBytes == SOCKET_ERROR) || (nBytes <= 0)) {

delete [] tempbuf;
printf("Recv Failed!\n");
return 0;
}
else {
printf("Message Received.\n");
DebugOutput(tempbuf, nBytes);

return tempbuf;
}
}


I am trying to send the 0x50 BNCS packet, SID_AUTH_INFO.

I've successfully sent and recieved the BNLS 0x10 packet, BNLS_REQUESTVERSIONBYTE.  I am very sure that I am sending a correct buffer b/c I've compared what I'm sending to a packet log that I did using both StealthBot and Warcraft III!

Soul Taker

Well... you have a packet logger... why don't you see if you are recieving data or not?

Sorc.Polgara

Quote from: Soul Taker on December 25, 2004, 10:44 AM
Well... you have a packet logger... why don't you see if you are recieving data or not?


I said in the post above that I'm recieving nothing.  packet size 0.

Mephisto


Sorc.Polgara

Hehe, I woke up like at 2:45 AM and then couldn't go back to sleep.  While I was laying in bed I was going over what possibly be the problem.   I thought back to when I had done my bot in VB and 5 minutes later I remember that I had to send the byte 0x01 first, before I send any other data to BNET.  I was so curious to debug and see if this was my problem that I said fuck this and went to my computar.

Guess what?  My problem was exactly what I thought!

phew, I'm so relieved.

Warrior

Ive done that before rofl I must of looked At BnetDocs / asked a million friends before I realized I wasnt sending it either . :P
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?