Open PSR009 opened 3 years ago
Thanks for filing this, can you also add what version of windows you are running on? Example:
$ systeminfo | findstr "Version"
OS Version: 10.0.XXXX N/A Build XXXX
Windows 10 Pro Version 20H2 OS Build 19042.928
> systeminfo | findstr "Version"
OS Version: 10.0.19042 N/A Build 19042
These days i view open issues and discover this issue is similiar with #230 , because FileOps.exe is a console application, so it prints these logs on console.
Dll_FileOps64.dll: Starting.
Dll_FileOps64.dll: Detoured.
Hooked --> CreateFileW
Hooked --> WriteFile
however notepad.exe
is a desktop application, so you cound not found these prints. Try to open cmd.exe
, i get these prints too. so i think hook is success, just you can not observe from the print.
.\withdll.exe -d:.\Dll_FileOps.dll cmd.exe
withdll.exe: Starting: `cmd.exe'
withdll.exe: with `D:\Code\BCM\Detours\Detours\bin.X64\Dll_FileOps.dll'
Dll_FileOps64.dll: Starting.
Dll_FileOps64.dll: Detoured.
Hooked --> CreateFileW
Hooked --> CreateFileW
Hooked --> CreateFileW
@mooooonlight Use OutputDebugString and open DebugView to see log.
I'm using the latest Detours version and have built it for x64. When I'm using
withdll.exe
to inject the DLL into the binary (x64) built on my own usingVisual Studio 2019
it is working but when I'm injecting the same DLL intonotepad.exe
(x64), it isn't hooking them at all.My DLL code
DEF file
Simple Application used
Command-line Output
Visual Studio 2019
notepad.exe
When I directly write into the text file opened by
withdll.exe
and save, it simply exits in the abovenotepad.exe
case without any output. Even if I write my DLL code into thesamples
example, it is working with my binary but not withnotepad.exe
. Please tell me if I'm missing anything here. Thank you!