Saturday, September 27, 2008

Modifying DLL Resources

While it wouldn't be supported by Microsoft, there are a few methods you can use to modify the resources contained in DLLs - usually useful if you would like to change how a window or dialog box is displayed. The easiest way I've seen is with a program called reshacker.exe.

A practical example is when you might be trying to display a large legal notice text using the standard MS gina on XP - and you can't actually scroll down to view the whole message due to the lack of scroll bars in the legal notice text dialog box.

To add a dialog box to this display in msgina.dll in a XP SP2 machine, you could:
  1. Use reshacker to open msgina.dll, and modify the dialog number 2500 - with 1033 language in my case (en-au)
  2. Edit the control, allowing the WS_VSCROLL option
  3. Recompile the script and save the new DLL.
  4. You'll then either have to modify WFP behaviour, disable it, or to test this I overwrote the cached copy to fool Windows File Protection in system32\dllcache

Any new logon through the interactive console or TS to a workstation with a legal notice text should display it in a dialog box with a scroll bar.

Resource Hacker homepage:
http://angusj.com/resourcehacker/


Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.

No comments:

Post a Comment