unknownv2 / CoreHook

A library that simplifies intercepting application function calls using managed code and the .NET Core runtime
MIT License
259 stars 40 forks source link

[FEATURE]: Example of hooking winsock incoming connections #133

Closed jjxtra closed 5 years ago

jjxtra commented 5 years ago

Greetings,

I am hoping to get an example created that hooks all winsock incoming connection attempts. I think this would include the bind, connect and WSAConnect functions from ws2_32.dll. Ideally it would hook all current and future processes created, so hooking create process function would likely be necessary too. This hook would allow the connection to be accepted by calling the base function or closed with an error if the ip address and port match a certain filter, not calling the base function in that case. The example could just hard code an ip address and port as an example.

I'm happy to donate for such an example. Please let me know how I can contact you.

jjxtra commented 5 years ago

Using WinDivert