Skip to content

Commit

Permalink
使用Writer写入数据
Browse files Browse the repository at this point in the history
  • Loading branch information
xljiulang committed Oct 20, 2022
1 parent 1d177f6 commit 7c20397
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ unsafe private void ModifyDnsPacket(WinDivertPacket packet, WinDivertAddress add
var responsePayload = response.ToArray();

// 修改payload和包长
responsePayload.CopyTo(new Span<byte>(result.Data, responsePayload.Length));
packet.Length = packet.Length + responsePayload.Length - requestPayload.Length;
packet.GetWriter(packet.Length - result.DataLength).Write(responsePayload);

// 修改ip包
IPAddress destAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="DNS" Version="7.0.0" />
<PackageReference Include="WindivertDotnet" Version="1.0.5" />
<PackageReference Include="WindivertDotnet" Version="1.0.7" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 7c20397

Please sign in to comment.