Can I use the Network Monitor API to do this? I have written a program in C that uses the API to read through a capture file and find the encrypted data. I can use NmAddFrame for those frames that don't contain encrypted data, but for encrypted packets, I'd like to replace the encrypted data with decrypted data (the encryption preserves length, so this should be possible) and then write the frame to the output file. But I can't find a way to modify the data within the frame before writing it out.
Dealing with compressed data might be more tricky, since obviously the length of the packet will be affected.