  jjoshua Premium join:2001-06-01 Scotch Plains, NJ | reply to aurgathor Re: how can I rewrite TCP/IP packets
Which part of the packet are you trying to modify? |
|
 aurgathor
join:2002-12-01 Bothell, WA | The data. |
|
  More Fiber Premium join:2005-09-26 West Chester, PA
·Bay Area Internet ..
| If all you want to do the modify the "application" data, and not mess with TCP headers, then a simple socket program is all you need.
(oversimplified): open a socket, listen for connections, when you get a connection, open the destination socket, read the data, modify it, write it to the destination socket. When the originator closes the connection, close your destination socket. Shouldn't be more than about 100 lines of C code and will work just fine on WinXP.
If you need more information, find a good tutorial on socket programming. »beej.us/guide/bgnet/output/html/···net.html |
|
  vpoko Premium join:2003-07-03 Jamaica Plain, MA
·Comcast
| More Fiber, What about the 16 bit checksum in the TCP header? It's computed based on the IP header, TCP header, and TCP payload. If the payload changes and the checksum in the header isn't updated appropriately, won't the receiving computer think the packet is corrupted and drop it? |
|
  More Fiber Premium join:2005-09-26 West Chester, PA
·Bay Area Internet ..
| said by vpoko :More Fiber, What about the 16 bit checksum in the TCP header? A socket application will never see the TCP header. It will be stripped from the inbound data and a new header created for the outbound data by the TCP stack. This is only suitable if the OP wants to manipulate the "application payload" and not the TCP frames themselves. |
|