Discussion:
Can NTSD dump and display unicode chars?
(too old to reply)
8***@gmail.com
2007-07-24 09:14:15 UTC
Permalink
I tried to use NTSD to hook the windows api GDI32!ExtTextoutW and
print out the unicode string at poi(esp+0x18), but it seems NTSD
could not display non-ascii chars.

_NT_DEBUG_LOG_FILE_APPEND=c:\test.log
ntsd -c "bp GDI32!ExtTextoutW \"J (poi(esp+0x18)!=0) 'du poi(esp
+0x18);g';'g'\";g" notepad
Skywing [MVP]
2007-07-24 15:47:53 UTC
Permalink
Try using WinDbg, perhaps? Remember that NTSD is outputting to a console
window, and console windows don't exactly have the best support for
displaying a wide range of Unicode characters. (As far as logging goes,
it's certainly possible that the logging facilities aren't all that
Unicode-friendly either, but I haven't checked.) WinDbg appears to use a
RichEdit 2 control for its command output, which is much more
Unicode-friendly. If there are no internal ANSI/Unicode round-trips done
inside of WinDbg before output gets to the output window, then I would
expect that you'll see useful text from `du' in WinDbg, at least in the GUI.
--
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
Post by 8***@gmail.com
I tried to use NTSD to hook the windows api GDI32!ExtTextoutW and
print out the unicode string at poi(esp+0x18), but it seems NTSD
could not display non-ascii chars.
_NT_DEBUG_LOG_FILE_APPEND=c:\test.log
ntsd -c "bp GDI32!ExtTextoutW \"J (poi(esp+0x18)!=0) 'du poi(esp
+0x18);g';'g'\";g" notepad
8***@gmail.com
2007-07-25 04:14:44 UTC
Permalink
Thanks, Ken
You are right, logging facilities of NTSD give dots '.' instead of
correct non-ascii unicode characters. And I found neither 'wprintf'
nor 'WideCharToMultiByte' in dependencies of NTSD.exe. :(
So I think I have to move ahead to WinDBG.

--
Joseph

Loading...