2015-02-08 34 views
0

我使用Pcap.net庫在C#中改變和匿名fileds.i已經閱讀離線PCAP文件包小包,我已經在這改變了一些領域。 我的問題是,有什麼辦法可以創建一個pcap格式的輸出文件,改變數據包的IP地址,MAC地址和......的後綴? 任何人都可以幫助我嗎?我如何在C#中建立輸出PCAP文件中pcap.net

謝謝您事先 Ftm.E

回答

0

是。

您應該按照Pcap.Net user guide section "Saving packets to a dump file"

從那裏的代碼段:

// Open the device 
using (PacketCommunicator communicator = 
    selectedDevice.Open(65536, // portion of the packet to capture 
           // 65536 guarantees that the whole packet will be captured on all the link layers 
    PacketDeviceOpenAttributes.Promiscuous, // promiscuous mode 
    1000)) // read timeout 
{ 
    // Open the dump file 
    using (PacketDumpFile dumpFile = communicator.OpenDump(args[0])) 
    { 
     Console.WriteLine("Listening on " + selectedDevice.Description + "... Press Ctrl+C to stop..."); 

     // start the capture 
     communicator.ReceivePackets(0, dumpFile.Dump); 
    } 
}