Sending a Packet

Posts 1–15 of 16 · Page 1 of 2
Sending a Packet
Ok, so I've looked around for a while but couldn't find anything that solved my problem.

I've made a dll that hooks the send function of a game.

I have also made a program that, when started, injects the dll into the game.

What I would like to do is send packets from within the program that injected the dll after it has been injected. How would I go about doing this?

Thanks
You want ur external executable to talk to you injected dll?
yep.
Is that not possible?

If it isn't then how would I be able to send a custom packet?
Quote Originally Posted by JonnyD View Post
yep.
Is that not possible?

If it isn't then how would I be able to send a custom packet?
No that's not the problem.
You should just stop using the word packet is all, its a little confusing. Packets are talked about when sending a message from a server to a client or the other way around, but usually that's is via the internet, not on your own machine.

So lets say you want to control ur .dll via ur executable.... hmmm there's several ways to do it (as always). How about just gaining the ModuleHandle and reading and writing to that process, I've also heard of things such as a mutex, hmmm... there's a better way to do this without just hacking it I think... Hopefully BA will stop in soon, I'd like to see an approach to this as well.
I do want to send it from my computer to a server.
Why not explain what you want done. Because capturing and sending your own packets to a game is not that easy most of the time. It also has legal issues greater then normal hacks for you are stealing data from them and altering there game at server level. You will need a program to capture packets to get a better understanding of what is possible to change then you will need to understand how they handle there packets once you send them. That means you will need a good part of the games source code.

Good luck
I basically want to make a simple bot for the game. An example of a function of the bot would be like auto healing. When your hp gets below a certain level, the bot would send the packet for a healing spell.
Quote Originally Posted by JonnyD View Post
I basically want to make a simple bot for the game. An example of a function of the bot would be like auto healing. When your hp gets below a certain level, the bot would send the packet for a healing spell.
Lol. Its not a packet man. You just need to in ur .dll find the value that corresponds to your life points. And when it is low, send a command, to use a healing spell, or call the healing spell function directly. by reversing it. I think what you want to do is send the game certain key and mouse presses correct? and ofcourse you want to be able to control this from an outside window that you can use even when the game is minimized. right?
Quote Originally Posted by why06 View Post
Lol. Its not a packet man. You just need to in ur .dll find the value that corresponds to your life points. And when it is low, send a command, to use a healing spell, or call the healing spell function directly. by reversing it. I think what you want to do is send the game certain key and mouse presses correct? and ofcourse you want to be able to control this from an outside window that you can use even when the game is minimized. right?
How is it not a packet?

And i can't do this from within the dll because all of the logic and options are in the other program. I do not want to simulate mouse presses or keyboard presses.

Here basically what I want to do within my program:

Code:
//packet to send, this is the actual heal spell packet
char healSpellBuffer[]="\x03\x00\x23\x91\x05";
if (hp < somevalue)
{
//mSend function is within the dll
mSend(Socket, healSpellBuffer, 5, 0);
}
or I likely will want to have a wrapper function that I only need to send in the buffer and no other information
Why don't you just call the undetoured address of the send method? DetourFunction returns the address of the method which has been detoured, calling via this address will detour the detour(lol, sounds weird..). But if that isn't possible with DetourFunction(And it is), you can write your own DetourMethod. Research of the calling convention and x86 instruction set.

As far as local communication goes. You should NOT be writing to another processes memory. It's better to use a memory-mapped file, and a mutex objects. Where read\write access to the file is only allowed when the mutex object is locked by the thread performing the io operations on the file. This way, you can avoid collision of read during writes. You'll also need to create your own messaging protocol, or use an existing one. I wrote a C++ class a while ago that performed token parseing, which makes processing a file, or string fairly easy. I can post it here if you'd like.
Well, I've thought about it and I'm probably going about this the wrong way. So what would you guys say is the easiest way to send a packet to a server?

I've read that creating a proxy is a good solution, but I haven't been able to find a tutorial on how to create a proxy.
Quote Originally Posted by JonnyD View Post
Well, I've thought about it and I'm probably going about this the wrong way. So what would you guys say is the easiest way to send a packet to a server?

I've read that creating a proxy is a good solution, but I haven't been able to find a tutorial on how to create a proxy.
A packet editor, but ... wth is with you. I keep saying you don't need to edit packets. For crying out loud look up what a packet is!
Quote Originally Posted by why06 View Post
A packet editor, but ... wth is with you. I keep saying you don't need to edit packets. For crying out loud look up what a packet is!
I don't think you understand what I am trying to do.
Quote Originally Posted by JonnyD View Post
I don't think you understand what I am trying to do.
No. I do not. =/
So, apparently. He wants to send a packet to the game when the HP reaches below a certain amount. That packet is supposed to use some sort of healing skill, and get HP back to full, or whatever. So I don't get it, LOL. Do you want your program that injects the DLL to send the packets or what dafuk.
Posts 1–15 of 16 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?