Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 12:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



recv() function

Discussion on recv() function within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
recv() function

hi friends ..
I receive a packet with the function recv ();

I receive with:

recvbuf char [255];
recv (Connect, recvbuf, 255.0);

ok, no problem ..

I Know That the receive function returns -1 (unsuccessful) or n (successful) ..
n is the number of bytes received.

how i read n?

i have the packet wrong because i receive packet + ~ ~ ~ ~
~ That character replace characters in more ..

always change the packet size

attention: i receive a packet encrypted and packet decrypted size don't is packet encrypted size..
Kingrap is offline  
Old 09/01/2012, 20:39   #2
 
elite*gold: 9
Join Date: Dec 2009
Posts: 1,071
Received Thanks: 819
Quote:
Code:
recvbuf char [255];
huh?

Code:
char recvbuf[255];
int n = 1;
while(n > 0)
{
	n = recv(Socket, recvbuf, sizeof(recvbuf), 0);
	// handle the received bytes
}
Are you looking for something like this?
.Infinite is offline  
Old 09/01/2012, 22:10   #3
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
yes but i don't receive complete encrypted packet..
my source code:

Code:
--edit--
what is wrong?
my friend say:

you dont need the size of decryptet packet
your problem is that you dont recieve complete encrypted packet
Kingrap is offline  
Old 09/02/2012, 12:26   #4
 
elite*gold: 9
Join Date: Dec 2009
Posts: 1,071
Received Thanks: 819
You have to put your recv() function into a loop. Else you will not be able to receive packets longer than 255 bytes.

Code:
char recvbuf[255];
int n = 1;
while(n > 0)
{
	n = recv(Socket, recvbuf, sizeof(recvbuf), 0);
	packet.append(recvbuf);
}
packet = decrypt(packet)
.Infinite is offline  
Old 09/02/2012, 12:49   #5
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
thx i have solved
Kingrap is offline  
Reply


Similar Threads Similar Threads
[C++]Hook all Recv function Problem
08/21/2010 - C/C++ - 5 Replies
Hi Leute wenn ich send hooke egal welches läuft das alles super nur wenn ich irgendein recv hooke habe ich immer eine Packet size von 1000 bis 10000. sry das ich schon wieder nerve #include "WinSock2.h" #include <cstdio> #include <ctime> #include <fstream> #include <iomanip>
Send Recv
08/18/2009 - Kal Online - 0 Replies
Hey;) I start checking this code http://www.elitepvpers.com/forum/kal-hacks-bots-che ats-exploits/189618-release-kalhackzz-v0-3-v0-4-so urces.html but i cant still send a packet of move just to see my player moving.Maybe this code is obsolete i dont know if there are better send and rev codes just tell me When dll process attach happens i call my function _beginthread(f,0,NULL); void f(void* start_parameter){ Console(); //Get the console printf("DLL loaded");
[help] recv
08/02/2009 - Kal Online - 3 Replies
Soo, man man behinderter tag. naja wayne. bin grad dabei mich etwas mehr mit den recv packets außeinander zu setzen. unter anderem mit den zahlen dahinter. Borsti sagte das ist die größe (size) naja also ich hab mir das mal als hex ausgeben lassen (das packet für empfangene nachrichten im chat ) ich hab mir das folgendermaßen "notiziert" 0c 00 3c //size 44 65 6e 4a 61 73//name
[Question] Hooking send() & recv() works, but recv hiding data for co???
05/06/2009 - CO2 Programming - 2 Replies
Hey guys, I've been making a DLL to allow another program to intercept the packets of conquer using windows pipes. (Then its the job of the main program to decrypt the packets, the DLL only gives a communication channel for the main program) (winsock functions btw) - hooking send() works fine for my internet browser - hooking recv() works fine for my internet browser - hooking send() works fine for conquer online



All times are GMT +1. The time now is 12:57.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.