我正在使用 JPCAP 代码在 pcap 文件中写入数据包(我使用的是 JDK 1.7)。这是代码
JpcapCaptor captor=JpcapCaptor.openDevice(device[index], 65535, false, 20);
//open a file to save captured packets
JpcapWriter writer=JpcapWriter.openDumpFile(captor,"yourfilename");
for(int i=0;i<10;i++){
//capture a single packet
Packet packet=captor.getPacket();
//save it into the opened file
writer.writePacket(packet);
}
而不是将数据包保存在 pcap 文件中。它给了我以下错误
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x01cf675d, pid=5564, tid=4876
#
# JRE version: 7.0-b141
# Java VM: Java HotSpot(TM) Client VM (21.0-b11 mixed mode, sharing windows-x86 )
# Problematic frame:
# v ~BufferBlob::jni_fast_GetLongField
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#