Log in

View Full Version : Packet editing


MVR
Mar 9, 2008, 06:16 AM
Hi there! :-)

I have tried to create a VB or C++ application for Jazz2 which will modify packets which are send and recieved - just like WPE.

But i can't make it work - I have tried to create a "Layered Service Provider" and some other stuff.

Could anyone please post an example of how to do this :confused:

I would really apreciate it :-)

Cpp
Mar 9, 2008, 09:07 AM
What exactly would you use this packet modifier for?

MVR
Mar 9, 2008, 09:10 AM
I'm not sure what to modify yet - the thing i'm really interested in is to send packets on the same socket as (opened by) Jazz2. So i could make something like a chat program for the game.

Jimbob
Mar 9, 2008, 09:14 AM
<a href="http://www.jazz2online.com/J2Ov2/downloads/info.php?levelID=4333">There's already lots of good chat programs out there, just one click away...</a>

MVR
Mar 9, 2008, 09:18 AM
I know, but i would really like to know how to create them, because i also need to use this in other applications...
Thank you anyway :P

Cpp
Mar 9, 2008, 09:22 AM
Why not use the native assembly functions inside jj2 to send chat?
It's very possible and has been done before.

MVR
Mar 9, 2008, 09:26 AM
Okay could you show me how to do this? ;)

MVR
Mar 9, 2008, 09:38 AM
Hvordan? :P

Neobeo
Mar 9, 2008, 10:48 AM
Packet editing is not a very simple concept at all. The way WPE works is to inject a DLL into the host application, which hooks onto the winsock functions: recv() recvfrom() send() sendto() etc. What it does is reroute these functions into some function within the DLL that modifies the packet. This is probably also your best shot at creating anything close to a packet editor.

Although like Cpp said, for JJ2 packet editing is very unnecessary since every function is provided very nicely to you already. Even if you really need to edit the packets for whatever reason, there are already nicely laid out functions in JJ2 assembly which you can hook directly, rather than the winsock functions.

MVR
Mar 9, 2008, 12:28 PM
Thanks for your post neobeo :)
I have discovered that it is really hard to make it :P
But could please explain how to hook into those JJ2 functions?

Cpp
Mar 9, 2008, 12:53 PM
First of all you'll need to know the location (memory address) of each function you wish to use. And to add some complexity, each jj2 version has different addresses. The second thing is knowing what parameters to pass to the function. And finally, you need to write some code to call the function. In most cases this would be a DLL that is attached to the game by some other process. The second option is to use assembly code injection and then have this code call the requested function. Both concepts are an advanced topic and requite a certain amount of knowledge about assembly and other low-level CPU functionality.

MVR
Mar 9, 2008, 12:58 PM
a DLL that is attached to the game by some other process

I guess its here i'm a little confused, why do i need to attach a DLL to the game? can't it be done only by an application...

Cpp
Mar 9, 2008, 01:00 PM
Because that makes it possible to call the assembly functions directly from C++ by using function pointers.

MVR
Mar 9, 2008, 01:03 PM
okay thanks ;)

I guess i'm gonna do some research about it.
Can this be done in VB as well?

Cpp
Mar 9, 2008, 01:11 PM
Yes. I've always used the second method and I've written a simple proxy function in Visual Basic 6. The function takes an address of the assembly function you wish to execute and four extra parameters. Then it injects a number of bytes into the target process and executes them by creating a new thread. The injected assembly code then takes care of the rest.

Unfortunately I can't show you any of the code right now as I don't have it handy. I'll likely upload an example onto my server when I have time.

MVR
Mar 10, 2008, 07:09 AM
That would just be perfect :)
Thank you very much for the information, it really helped a lot!

Bboy Type7
Mar 10, 2008, 02:27 PM
i program in C++ also, dunno about this one. looks interesting.