| View previous topic :: View next topic |
| Author |
Message |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Mon May 28, 2007 5:46 am Post subject: packet sending with C++ ? |
|
|
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 |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Mon May 28, 2007 6:52 am Post subject: |
|
|
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 |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Mon May 28, 2007 8:23 am Post subject: |
|
|
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 .
How to use open Socked ID with C++?
(I hope u can understand me)
|
|
| Back to top |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Mon May 28, 2007 9:01 am Post subject: |
|
|
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 |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Mon May 28, 2007 11:06 am Post subject: |
|
|
| 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 |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Mon May 28, 2007 11:19 am Post subject: |
|
|
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 |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Wed May 30, 2007 9:06 am Post subject: |
|
|
| 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
|
|
| Back to top |
|
 |
xentar Grandmaster Cheater
Reputation: 0
Joined: 08 Jul 2006 Posts: 708 Location: USA, Mass
|
Posted: Mon Jun 04, 2007 8:10 am Post subject: |
|
|
| 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  |
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 |
|
 |
|