From f3b3d70b2bf69c582b9d26b1b11aa01144afff96 Mon Sep 17 00:00:00 2001 From: rfi Date: Sun, 14 Apr 2024 19:27:34 +0700 Subject: [PATCH] pcap update --- AscNet.PcapParser/AscNet.PcapParser.csproj | 1 + AscNet.PcapParser/PcapParser.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/AscNet.PcapParser/AscNet.PcapParser.csproj b/AscNet.PcapParser/AscNet.PcapParser.csproj index f61c7225..4a10212d 100644 --- a/AscNet.PcapParser/AscNet.PcapParser.csproj +++ b/AscNet.PcapParser/AscNet.PcapParser.csproj @@ -22,6 +22,7 @@ DEBUG;TRACE prompt 4 + false x64 diff --git a/AscNet.PcapParser/PcapParser.cs b/AscNet.PcapParser/PcapParser.cs index 8c81f85d..fb60921b 100644 --- a/AscNet.PcapParser/PcapParser.cs +++ b/AscNet.PcapParser/PcapParser.cs @@ -69,6 +69,12 @@ namespace AscNet.PcapParser while (true) { + if (4 > bytes.Length - readLen) + { + buffer[packet.Ethernet.IpV4.Source] = bytes.AsSpan(readLen).ToArray(); + break; + } + int len = (int)BinaryPrimitives.ReadUInt32LittleEndian(bytes.AsSpan(readLen)); readLen += Marshal.SizeOf();