Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


packet sending with C++ ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Mon May 28, 2007 5:46 am    Post subject: packet sending with C++ ? Reply with quote

I wan't to learn how to send packets with C++.
I already tryed to sent some packets to a game with WPE PRO and it works gr8.How to send the same packets with C++?
I searched all yesterday night but I didn't find something that REALLY helps.
Only some links to Winsocks, explaining me how to connect to a server but not how to send packets to it.
I hope some1 around here can help me.
(btw: I want to do a Diablo II Channel Bot, dont know if this information can help?)
Back to top
View user's profile Send private message
Robotex
Master Cheater
Reputation: 0

Joined: 05 Sep 2006
Posts: 378
Location: The pizza country!

PostPosted: Mon May 28, 2007 6:52 am    Post subject: Reply with quote

send(<connected socket>, <buffer>, <buffer size>, <type>);

OR if you want to packet edit

hook send / recv

_________________

ASM/C++ Coder
Project Speranza lead developer
Back to top
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Mon May 28, 2007 8:23 am    Post subject: Reply with quote

Thx but I think i've got another problem.
I connect to the server his ip: 213.248.106.67 and with port 6112.
When I try to send a packet to it, I send it with the socket connected to the port 6112.I can send but nothing in Diablo happens.
In WPE PRO I use the open Socked ID 1888 .I cant connect to the ip 13.248.106.67 with the port 1888 , so I dont know how to send the packet to 1888 Crying or Very sad .
How to use open Socked ID with C++?
(I hope u can understand me)
Back to top
View user's profile Send private message
Robotex
Master Cheater
Reputation: 0

Joined: 05 Sep 2006
Posts: 378
Location: The pizza country!

PostPosted: Mon May 28, 2007 9:01 am    Post subject: Reply with quote

if you have already a connected socket, then use it to send packets to server
You have to hook send/recv to get the socket, so after you have got it you can call send normally using the connected socket

Quote:
I connect to the server his ip: 213.248.106.67 and with port 6112.
When I try to send a packet to it, I send it with the socket connected to the port 6112.I can send but nothing in Diablo happens.

It's because you're making a new connection to the server (therefore it thinks there's a new game client connecting, not the one already connected)

_________________

ASM/C++ Coder
Project Speranza lead developer
Back to top
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Mon May 28, 2007 11:06 am    Post subject: Reply with quote

Robotex wrote:
You have to hook send/recv to get the socket

Can you explay it pls with an example or something?
Back to top
View user's profile Send private message
Robotex
Master Cheater
Reputation: 0

Joined: 05 Sep 2006
Posts: 378
Location: The pizza country!

PostPosted: Mon May 28, 2007 11:19 am    Post subject: Reply with quote

haven't got the hook code but you have to redirect the original recv/send/connect to your code (by using an injected dll or something)

here's how could look like your code

bool GotSocket = false;
SOCKET ConnectedSocket = INVALID_SOCKET;
int myrecv(SOCKET s, char* buf, int len, int flags);
{
if(!GotSocket)
{
ConnectedSocket = s;
GotSocket = true;
}
return orecv(s, buf, len, flags); //Turn back to the original recv
}

then you can call send(ConnectedSocket, YourPacket, YourPacketLen, 0)

_________________

ASM/C++ Coder
Project Speranza lead developer
Back to top
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Wed May 30, 2007 9:06 am    Post subject: Reply with quote

Robotex wrote:
haven't got the hook code but you have to redirect the original recv/send/connect to your code (by using an injected dll or something)

here's how could look like your code

bool GotSocket = false;
SOCKET ConnectedSocket = INVALID_SOCKET;
int myrecv(SOCKET s, char* buf, int len, int flags);
{
if(!GotSocket)
{
ConnectedSocket = s;
GotSocket = true;
}
return orecv(s, buf, len, flags); //Turn back to the original recv
}

then you can call send(ConnectedSocket, YourPacket, YourPacketLen, 0)


Can't understand, sry Crying or Very sad
Back to top
View user's profile Send private message
xentar
Grandmaster Cheater
Reputation: 0

Joined: 08 Jul 2006
Posts: 708
Location: USA, Mass

PostPosted: Mon Jun 04, 2007 8:10 am    Post subject: Reply with quote

redhead wrote:
Robotex wrote:
haven't got the hook code but you have to redirect the original recv/send/connect to your code (by using an injected dll or something)

here's how could look like your code

bool GotSocket = false;
SOCKET ConnectedSocket = INVALID_SOCKET;
int myrecv(SOCKET s, char* buf, int len, int flags);
{
if(!GotSocket)
{
ConnectedSocket = s;
GotSocket = true;
}
return orecv(s, buf, len, flags); //Turn back to the original recv
}

then you can call send(ConnectedSocket, YourPacket, YourPacketLen, 0)


Can't understand, sry Crying or Very sad


You have to understand how API hooking work if you want to understand what he said. google for API hooking.

_________________
People encountered at CEF.

* I don't care if he wrote the code, I say it is open source then it is open source.
* I don't care if it is his trainer, if I say he can't have that hack in there, then he can't.
* Appalsap, your trainer is L337
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites