C# Based Universal API Unhooker - Automatically Unhook API Hives (ntdll.dll,kernel32.dll,user32.dll,advapi32.dll,and kernelbase.dll).
I prefer you to use the Main function but if you want to only unhook single API DLL,you can use the SilentUnhooker
or the Unhooker
function.You might want to use the SilentUnhooker
function instead of the Unhooker
for stealth reasons.
This tool is inspired by this article.This tool also included with AMSI and ETW patcher to break/disable them.
- It reads and copies the
.text section
of the original (in-disk) DLL using "PE parser stuff" - It patches the
.text section
of the loaded DLL usingMarshal.Copy
andNtProtectVirtualMemory
from D/Invoke (to changes the permission of the memory) - It checks the patched in-memory DLL by reading it again and compare it with the original one to see if its correctly patched.
- If you want to copy the code,Pls dont change/remove the banner,or atleast dont forget to credit me
- If you want to see a good demonstration of SharpUnhooker,go check this blog post by Reigada
- Github dont like my Sublime indentation settings so dont roast me pls
Simply load the pre-compiled DLL or add the code function and call the main function from the SharpUnhooker class.
You can load the pre-compiled DLL on Powershell with Reflection.Assembly
too!
This code uses C# 5,so it can be compiled with the built-in CSC from Windows 10.
- Add ability to unhook EAT & IAT hooks