Comments (4)
What basil said in his repo. Check that your packet is even valid in the first place. Use the helper function parse packet or manually check your work. Make sure length is correct and headers are correct.
from windivertsharp.
Mmmh, will packet parser correct the headers and how can I check if the lenght is correct, I mean is the length only the payload’s length or do i have to add every other header length to it?
from windivertsharp.
I've tried using packet parser but that didn't work... I've also tried to bruteforce the length to check which one would work but none worked...
Here's the updated code:
if (SendSpecial)
{
SendSpecial = false;
Console.WriteLine("Building the special packet...");
var buffer = StringToByteArray("HEX STUFF");
WinDivertBuffer buff = new WinDivertBuffer(buffer);
var checksum = WinDivert.WinDivertHelperCalcChecksums(buff, (uint) buff.Length, ref addr, WinDivertChecksumHelperParam.All);
var payload = new Span<byte>();
WinDivert.WinDivertHelperParsePacket(buff, (uint) buffer.Length, ref ipv4Header, ref ipv6Header,
ref icmpV4Header, ref icmpV6Header, ref tcpHeader, ref udpHeader, ref payload);
Console.WriteLine("Payload len:" + payload.ToArray().Length);
if (!WinDivert.WinDivertSend(handle, buff, (uint)payload.Length, ref addr))
{
Console.WriteLine("Write Special Packet Err: {0}", Marshal.GetLastWin32Error());
}
else
{
Console.WriteLine("Special Packet doneeeee");
}
}
from windivertsharp.
Closing as this is a non-issue.
from windivertsharp.
Related Issues (16)
- WinDivertAddress problems
- WinDivert 2.0 support HOT 4
- Handle is always null. HOT 5
- Send fake ACK HOT 1
- Lowering Latency HOT 3
- Question - How can I use this package to drop packets according to a filter? HOT 3
- How would I use this tool to filter/drop packets in a C# Ui HOT 1
- Missing Send only mode
- WinDivertRecv read length incorrect in windivert 2.2.2 HOT 1
- Other issues with checksums too apparently
- Crash within WinDivertParseResult initializer HOT 17
- Update readme HOT 1
- How do I use this? HOT 12
- Update sample code HOT 16
- Port/SeqNum have bytes reversed HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windivertsharp.