A fix for Windows 5.x loader to correctly work with TLS data in dynamically loaded DLL-s
Denis Shelomovskij
verylonglogin.reg at gmail.com
Sun Feb 10 05:27:13 PST 2013
It was supposed to be a New Year gift (which nobody needs of course) for
all Windows XP users (not only D ones) but I finally have understood I
have no time for good public announce with project page etc.
So I just want to tell there is a full fix for Windows 5.x loader.
It works on my Windows XP, probably will work on other similar systems
and probably will not work on Windows Server 2003/Windows XP x64 as I
have no time for test and finish off it now.
Done:
* Written in D.
* Compiles in DLL which fixes for owning process Windows 5.x loader to
correctly work with TLS data in dynamically loaded DLL-s.
* So you have the ability to fix every program just with injecting a DLL
in it (there is no administrator rights required for such operation on
Windows 5.x).
* Doesn't use D runtime.
* DLL size is 52 KiB (thanks to previous point).
Undone:
* One mustn't unload fixing DLL as it will result in undefined
behaviour. Auto-preventing unloading is trivial but isn't done yet. ((
* It also doesn't need C runtime, but I haven't managed to link it
without snn.dll yet so buggy runtime from DigitalMars is included and
executes its evil code. (
* There is also a utility for injecting a DLL into a process in same
hooking project but I failed find enough time to fight all the
regressions and link failures of dmd and optlink so the utility can't be
built now (it worked fine some time ago...). (((((
P.S.
If somebody really needs this feel free to email me/post here to force
me to find time to continue development and finish off the utility.
Links:
* Binary (7-zipped DLL):
http://deoma-cmd.ru/files/other/TLSFixerDLL.7z
* Source code:
https://github.com/denis-sh/hooking/tree/master/tlsfixer
* Information about implicit TLS and Windows loader:
http://www.nynaeve.net/?p=180
* Microsoft's KB article about the problem:
http://support.microsoft.com/kb/118816/en-us
--
Денис В. Шеломовский
Denis V. Shelomovskij
More information about the Digitalmars-d-announce
mailing list