Answer the question
In order to leave comments, you need to log in
Socket Hook or how to intercept WS2_32.dll function call on .NET?
There is a certain application (game) which sends TCP/UDP requests. My task is to intercept these requests and * change their direction to another host (computer).
* change their direction - it is necessary that the packet is not sent to the host that it was previously sent to.
I read a bunch of articles on this topic, including this one, but they are all in C ++ or ASMe, are there any ways to implement it in C # (or in any other .NET language)?
PS Implementations of the sniffer, OpenVPN, do not offer network drivers, because they don't fit.
P.S.2. I can't do without pictures. This is to the fact that the picture below carries a small semantic load.
Answer the question
In order to leave comments, you need to log in
Try the BoxedApp SDK for an example of a similar hook in C# (see samples\C#\Sample6_CreateFileHooking).
In C#, you can use the Win32API with P/Invoke (DllImport).
List of methods in ws2_32.dll - www.pinvoke.net/default.aspx/ws2_32.wsastartup
Ready wrapper class: www.elitepvpers.com/forum/co2-programming/159327-advanced-winsock-c.html
Your conditions explicitly say that you need to intercept the packet and change its direction.
Can you explain why you can't use a locally installed sniffer?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question