views:

57

answers:

2

How would one go about taking hex data into a program and sending it back out?

char peer0_0[] = { 0x00, 0x00, 0x10, 0x01, 0xbf, 0x8b, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07 };

char peer0_1[] = { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 };

char peer0_2[] = { 0x02, 0x00, 0x00, 0x00 };

+1  A: 

If you already have the code in the format you have posted, then there's not much to do. You haven't actually specified where you want to replay it. Depending on how you want to do this, you simply pass the array to whatever function does the actual sending. For example, if you want to send this data over an existing socket, you can do something like this:

send(my_socket, peer0_0, sizeof(peer0_0), 0);
casablanca
A: 

What you want is bit-twist. It is essentially a replay device for pcap files. You don't have to save the file in any special format, it can be used with the native file format wireshark captures data in.

http://bittwist.sourceforge.net/

Chris S.