Console Which Sends Packets With 1 Click ?
Hey guys,
I am new to C++, I would like to create a program which sends multiple "Packets" with 1 click of a button, the only problem is I do not know how to do, if anyone can show me- I would be truly grateful. The idea behind it, is that when activated, it will Purchase and Sell items to make gold. One of my friends told me I need to "Loop through every bag slot and send a packet" but I do not really know how to do this, if anyone could take my code and just do 1 part of it so I can learn from it, thankx - Cadbury
Code:
void SellItem(int nBagNum, int nBagSlot, int nAmount)
{
BYTE* tmp = new BYTE[5];
*reinterpret_cast<WORD*>(tmp) = 0x0703;
*static_cast<BYTE*>(tmp + 2) = nBagNum;
*static_cast<BYTE*>(tmp + 3) = nBagSlot;
*static_cast<BYTE*>(tmp + 4) = nAmount;
SendPacket(tmp, 5);
delete[] tmp;
}
Here are the Packets which I want sent,
Packets
These are sent to NPC the items
03 07 01 00 FF
03 07 01 01 FF
03 07 01 02 FF
03 07 01 03 FF
03 07 01 04 FF
03 07 01 05 FF
03 07 01 06 FF
03 07 01 07 FF
03 07 01 08 FF
03 07 01 09 FF
03 07 01 0A FF
03 07 01 0B FF
03 07 01 0C FF
03 07 01 0D FF
03 07 01 0E FF
03 07 01 0F FF
03 07 01 10 FF
03 07 01 11 FF
03 07 01 12 FF
03 07 01 13 FF
03 07 01 14 FF
03 07 01 15 FF
03 07 01 16 FF
03 07 01 17 FF
03 07 02 00 FF
03 07 02 01 FF
03 07 02 02 FF
03 07 02 03 FF
03 07 02 04 FF
03 07 02 05 FF
03 07 02 06 FF
03 07 02 07 FF
03 07 02 08 FF
03 07 02 09 FF
03 07 02 0A FF
03 07 02 0B FF
03 07 02 0C FF
03 07 02 0D FF
03 07 02 0E FF
03 07 02 0F FF
03 07 02 10 FF
03 07 02 11 FF
03 07 02 12 FF
03 07 02 13 FF
03 07 02 14 FF
03 07 02 15 FF
03 07 02 16 FF
03 07 02 17 FF
03 07 03 00 FF
03 07 03 01 FF
03 07 03 02 FF
03 07 03 03 FF
03 07 03 04 FF
03 07 03 05 FF
03 07 03 06 FF
03 07 03 07 FF
03 07 03 08 FF
03 07 03 09 FF
03 07 03 0A FF
03 07 03 0B FF
03 07 03 0C FF
03 07 03 0D FF
03 07 03 0E FF
03 07 03 0F FF
03 07 03 10 FF
03 07 03 11 FF
03 07 03 12 FF
03 07 03 13 FF
03 07 03 14 FF
03 07 03 15 FF
03 07 03 16 FF
03 07 03 17 FF
03 07 04 00 FF
03 07 04 01 FF
03 07 04 02 FF
03 07 04 03 FF
03 07 04 04 FF
03 07 04 05 FF
03 07 04 06 FF
03 07 04 07 FF
03 07 04 08 FF
03 07 04 09 FF
03 07 04 0A FF
03 07 04 0B FF
03 07 04 0C FF
03 07 04 0D FF
03 07 04 0E FF
03 07 04 0F FF
03 07 04 10 FF
03 07 04 11 FF
03 07 04 12 FF
03 07 04 13 FF
03 07 04 14 FF
03 07 04 15 FF
03 07 04 16 FF
03 07 04 17 FF
03 07 05 00 FF
03 07 05 01 FF
03 07 05 02 FF
03 07 05 03 FF
03 07 05 04 FF
03 07 05 05 FF
03 07 05 06 FF
03 07 05 07 FF
03 07 05 08 FF
03 07 05 09 FF
03 07 05 0A FF
03 07 05 0B FF
03 07 05 0C FF
03 07 05 0D FF
03 07 05 0E FF
03 07 05 0F FF
03 07 05 10 FF
03 07 05 11 FF
03 07 05 12 FF
03 07 05 13 FF
03 07 05 14 FF
03 07 05 15 FF
03 07 05 16 FF
03 07 05 17 FF
My example of the layout of the packet.
03 07 01 00 FF.
Self-assigned Bytes | The Inventory Bag | The Slot Number | The Number of items(In bytes)
Buying the Item
02 26 42 31 5F 42 63 61 6C 6C 30 30 30 35 00 00 00 00 3D AA AE 07 00 , this is more complicated to explain, but basically it buys an item from a merchant. If you can, how can I send THIS same packet 20 times
We need more information, Are you talking about sending a packet over a network? Or does this have something to do with pipes and IPC?
If you want to send packets over a network (on windows) You can use raw sockets. When you use raw sockets windows will only establish an IP connection with your peer, and leaves the actual packets to you. If you want *full* control (eg. also build your own Internet packets) take a look at winpcap, it allows you to receive and send raw packets.
On linux raw sockets are also an option, and I believe that raw packet sending is natively supported.
Ohh no, it is for a game, where I want to send packets before it gets encrypted and sent to the server. If it is needed, i can post the source for the packet editor if it would help ?
No that wont help. Just explain what your problem is exactly.
This is what I think you're trying to do:
There's a game you want to cheat on by editing and sending your packets through a tcp/ip connection to the server.
Because of your last comment ("I want...the server") I'm also assuming you have a program ready to encrypt your data, or you're doing it by hand.
What I'm not clear on is what exactly is your problem. Are you having trouble sending the packet? Or are you having trouble constructing it?
As .:SCHiM:. has explained, we need more information. It really depends on the network protocol used by your target (it will be either UDP or TCP most likely) If you're working with UDP you can send packets over to the server without first establishing a connection and thus you may be able to (in theory) throw your packet in when ever you like (though this really depends on the communication layer the server has created over top of the UDP protocol...) but with TCP you cannot just create a new connection(as the server will probably treat you as a new client...) you will need to get a handle of the previously opened connection. Also, you can't just throw data into the communication stream where ever you like - you should make sure that you aren't interrupting another transaction.
Its probably easier just to get a hold of the parameters by hijacking send or if you can get access to a higher-level communication routine that would be even better.
Mmm, tbh I do not have a proper understanding of how it works, didnt know it would be this hard lol, but would you know how to loop a packet through the code I pasted at the intro ?
EDIT: "The hack was written in C++. For IDE I use Visual Studio 2010.(hack referring to the persons original hack which sent packets, although I wanted to spread on one of the things they did)" and "Loop through every bag slot and send a packet." quotes from what the person answered me with before, it might help with the programming of this? Idk....