I would to capture all messages sent to debugger via OutputDebugString and/or via DbgPrint. Is there a way to intercept all messages without using hooks? I wish to avoid the writing of a driver, because many of these messages are sent via OutputDebugString from my library injected in other user-processes.
The function prototype for DbgSetDebugPrintCallback is available in the WDK,
though there’s no documentation available for it. Why do you need to do
this? There might be a better/easier way.
wrote in message news:xxxxx@windbg… > Hi, > > I would to capture all messages sent to debugger via OutputDebugString > and/or via DbgPrint. Is there a way to intercept all messages without > using hooks? I wish to avoid the writing of a driver, because many of > these messages are sent via OutputDebugString from my library injected in > other user-processes. > > thank you > cod >
If you have control over the code issuing the debug prints, why not modify it to log to a common mechanism that can collect all of the data as desired?
I would to capture all messages sent to debugger via OutputDebugString and/or via DbgPrint. Is there a way to intercept all messages without using hooks? I wish to avoid the writing of a driver, because many of these messages are sent via OutputDebugString from my library injected in other user-processes.
This is how we do it. It is also how we did it at other companies. Logging…
----- Original Message -----
From: “Skywing” To: “Kernel Debugging Interest List” Sent: Tuesday, May 25, 2010 11:43:06 AM GMT -05:00 US/Canada Eastern Subject: RE: [windbg] how capture OutputDebugString/DbgPrint
If you have control over the code issuing the debug prints, why not modify it to log to a common mechanism that can collect all of the data as desired?
I would to capture all messages sent to debugger via OutputDebugString and/or via DbgPrint. Is there a way to intercept all messages without using hooks? I wish to avoid the writing of a driver, because many of these messages are sent via OutputDebugString from my library injected in other user-processes.
I have access to source code of my injected dll, and I can modify my dll to send log to my app using a pipe… but some processes use OutputDebugString in user mode to send messages to debug and I can’t exclude also messages sent from driver to debugger. They are software that interact with device controller from user mode using DeviceIoControl and/or via kernel mode with custom drivers.
wrote in message news:xxxxx@windbg… > Hi, > > I would to capture all messages sent to debugger via OutputDebugString > and/or via DbgPrint. Is there a way to intercept all messages without > using hooks? I wish to avoid the writing of a driver, because many of > these messages are sent via OutputDebugString from my library injected in > other user-processes.
You can’t do this without hooks on anything before Vista. DbgSetDebugPrintCallback probably was created only after Mr. Russinovich joined MS, to legalize DebugView on x64
Not everybody is ready for ETW yet.
IMHO hooking DbgPrint and its friends is attractive idea, because they are stack hogs. They allocate the 512 bytes buffer on stack, and then always call sprintf, even if the string does not need formatting. And there is the nuisance with unicode formats at >= DISPATCH.