-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C#] need help,WinDivertHelperCalcChecksums Not modify of packet check bits and length bits #124
Comments
Where are you getting C# code from? Another repo? Or did you write it? |
thx for reply... |
@boyyao Then open tickets on that repo. As you can plainly, easily see, the diver pivoke project is not created/run/maintained by the same person as WinDivert itself. You're cross posting and bugging people who can't even help you. |
I'm very sorry, because I'm in a hurry. And think there are more people here. |
Sure but they're following a C repository not a c# one and most of them have never heard of my wrappers anyway. |
Your wrappers is very good. It's very suitable for a novice like me. Thank you for your Class. I tried Divert.Net before, but x86 compiled the error. |
This issue is handled here: TechnikEmpire/DivertPInvoke#5 In general, issues posted here should only relate to the core WinDivert driver and libraries. If you are using a wrapper, then please report the issue to the wrapper's maintainer. |
code like:
IntPtr handle = WinDivertMethods.WinDivertOpen(Filter, WINDIVERT_LAYER.WINDIVERT_LAYER_NETWORK, -1, 0);
byte[] buffer = new byte[MAXBUF];
while (true)
{
Array.Clear(buffer, 0, buffer.Length);
if (WinDivertMethods.WinDivertRecv(handle, buffer, MAXBUF, ref windivert_ADDRESS, ref packetLen))
{
fixed (byte* buffer_fixed = buffer)
{
WinDivertMethods.WinDivertHelperParsePacket(buffer_fixed, packetLen, &IPHDR, null, null, null, &TCPHDR, null, &ppData, null);
..........some code...
string data = Marshal.PtrToStringAnsi((IntPtr)((void*)ppData));
if(date.contains("need Modify data"))
{
byte[] newbody = System.Text.Encoding.ASCII.GetBytes("i'm is new data");
//use new data modify raw data ,,40byte is tcp/ip head
Buffer.BlockCopy(newbody, 0, buffer, 40, newbody.Length);
//redefinition packetLen to newdata + 40byte head
packetLen = (uint)newbody.Length + 40;
}
}
}
//....invalid....... buffer not modify ?????????????????
WinDivertMethods.WinDivertHelperCalcChecksums(buffer, packetLen, 0UL);
}
wait for your help thx......
The text was updated successfully, but these errors were encountered: