diff --git a/AscNet.PcapParser/AscNet.PcapParser.csproj b/AscNet.PcapParser/AscNet.PcapParser.csproj index f61c722..4a10212 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 8c81f85..fb60921 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();