It's difficult to edit raw packets, having a look at this would be a start, it's a raw packet sniffer, pure vb6, shows you everything about the UDP/TCP header.

http://www.pscode.com/vb/scripts/Sho...46567&lngWId=1

If you want to modify data about packets for a specific app, that is much easier, one way would be to create an app to act as a proxy server between the two real apps, and have all the data go through your proxy, this would enable you to edit it as much or little as you want.