Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » General Jazz Jackrabbit Talk

Packet editing

MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 06:16 AM
MVR is offline
Reply With Quote
Question Packet editing

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

I would really apreciate it
Cpp

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Mar 9, 2008, 09:07 AM
Cpp is offline
Reply With Quote
What exactly would you use this packet modifier for?
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 09:10 AM
MVR is offline
Reply With Quote
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.
__________________
Signatureless...
Jimbob

JCF Member

Joined: Jun 2006

Posts: 658

Jimbob is doing well so far

Mar 9, 2008, 09:14 AM
Jimbob is offline
Reply With Quote
There's already lots of good chat programs out there, just one click away...
__________________
Pack: Legacies
-
Level 1: Fairytale Fantasy Land - 140x140
15.4% - ||||||||||
Diamondus Night FP - y_light.xm
-
Level 2: Barricade Beach - 110x110
6% - ||||||||||
Beach+ Tropical - tropical_beach.s3m
-
Level 3: Starlight City - 140x140
5.387% - ||||||||||
Big Landscape Evening - aws_anew.xm
-
Level 4: Nightly Nature Walk - 180x180
4.641% - ||||||||||
IC - SluggionP - alc_run.xm
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 09:18 AM
MVR is offline
Reply With Quote
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
__________________
Signatureless...
Cpp

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Mar 9, 2008, 09:22 AM
Cpp is offline
Reply With Quote
Why not use the native assembly functions inside jj2 to send chat?
It's very possible and has been done before.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 09:26 AM
MVR is offline
Reply With Quote
Okay could you show me how to do this?
__________________
Signatureless...
Old Mar 9, 2008, 09:36 AM
Grytolle
This message has been deleted by Stijn. Reason: foreign language/spam
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 09:38 AM
MVR is offline
Reply With Quote
Hvordan? :P
__________________
Signatureless...
Neobeo

JCF Member

Joined: Sep 2002

Posts: 409

Neobeo is an asset to this forumNeobeo is an asset to this forum

Mar 9, 2008, 10:48 AM
Neobeo is offline
Reply With Quote
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.
__________________
<TABLE border=1><TR><TD>Facts:
Jazz Sprite Dynamite (JSD)
Tileset Extractor
Neobeo's Firetruck

</TD><TD>Myths:
Jazz Creation Station Plus (JCS+) - 10%
Coming soon - a dedicated server! - 25%
Jazz Sprite Dynamite v2 (JSDv2) - 2%
Another generic single-player level - 0%
</TD></TR></TABLE>
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 12:28 PM
MVR is offline
Reply With Quote
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?
__________________
Signatureless...
Cpp

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Mar 9, 2008, 12:53 PM
Cpp is offline
Reply With Quote
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.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 12:58 PM
MVR is offline
Reply With Quote
Quote:
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...
__________________
Signatureless...
Cpp

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Mar 9, 2008, 01:00 PM
Cpp is offline
Reply With Quote
Because that makes it possible to call the assembly functions directly from C++ by using function pointers.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 9, 2008, 01:03 PM
MVR is offline
Reply With Quote
okay thanks

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

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Mar 9, 2008, 01:11 PM
Cpp is offline
Reply With Quote
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.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
MVR

JCF Member

Joined: Mar 2008

Posts: 13

MVR is doing well so far

Mar 10, 2008, 07:09 AM
MVR is offline
Reply With Quote
That would just be perfect
Thank you very much for the information, it really helped a lot!
__________________
Signatureless...
Bboy Type7

JCF Member

Joined: Dec 2007

Posts: 337

Bboy Type7 is doing well so far

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 09:50 AM.