Tcpsed - a tool for replacing arbitrary fields in an IPV4 packet.

While it'll do its best to create a reasonable output packet, strange requests (such as changing the IP version to 11) will not guarantee perfect output.