Closed SpriteOvO closed 5 years ago
Use the proof of concept as is. It's not production ready code. It just implements a very simplistic hook.
Your suggestion should work fine and make it safer to use in real world scenarios. I don't think we will add it to this demo though.
After I repeatedly load and unload the driver, I get a bugcheck with code 0xCE.
I found through ida that
kinfinityhook+0x11ab
points toadd rsp, 78h
inDetourNtCreateFile
.So I guess it may be that after the driver is unloaded,
DetourNtCreateFile
isn't done yet. Perhaps you should add a mutex to theSyscallStub
andDetourNtCreateFile
andDriverUnload
routines. Thanks for reading.