ZoRoNa's profileZoRoNaX' blogBlog Tools Help

Blog


    12/19/2006

    Windows PE 2.0 + .NET Framework 2.0

    After playing around with Windows Vista, I decided to look into Windows PE 2.0 (it's based on Windows Vista). Having worked with it for a couple of days, I can say that Windows PE 2.0 is so much better than Windows PE 1.*. As a result I was able to fully integrate the Microsoft .NET Framework v2.0.50727, with the size of the image being increased by only 24MB! (uncompressed the Microsoft .NET Framework 2.0 takes about 70 MB) That just totally rocks!
     
    On the included screenshot you can see that it is able to run an application with Windows Forms and Reflection without any problems at all.
    10/8/2006

    Windows Vista boot screen customization

    Until Windows Vista, one had to change the resources of ntoskrnl.exe to modify the boot screen. Modifying the ntoskrnl.exe executable is, of course, is very sensitive to human error which could render your Windows installation useless. With Windows Vista, the Windows loading process has been overhauled. For example, boot-time graphics were relocated, new native-mode boot-time applications added (winload.exe, winresume.exe) and all critical kernel components have received a digital signature. Because of the digital signatures, tampering with the kernel is no longer possible. Has the customization of the boot graphics come to an end? NO!
     
    Multilingual User Interface files
    With Windows Vista, Microsoft provides new functionalities in the Multilingual User Interface (MUI) area. This new functionality allows developers to separate localized resources (e.g. text strings) from language independent resources (e.g. bitmaps, icons, cursors). Typically, the separate .mui file contains the localized resources and the application executable contains the language independent resources. Just as with any .dll or .exe, a .mui file is just a normal Win32 portable executable (PE) stripped of executable code. On Windows Vista, the Win32 resource API functions have been modified to load resources from the .mui files automatically. Because the loading of resources happens independently of the application, it doesn't matter if the resource is located in the application executable or in a .mui file. The resource loading process can be seen as the following: First, the resources located in the applications executable are loaded into the memory. Afterwards, the system decides which .mui file to use (based on the language) and loads the resources from the .mui file on top of the previously loaded resources, replacing any resources that already exists! If a resource exists in a .mui file it will be loaded from the .mui file, but if a resource doesn't exist in a .mui file, the system loads it from the application executable resources if it exists there. But what does this MUI stuff has to do with boot screen customization? Everything!
     
    Boot screen customization
    Because .mui files don't have a digital signature, its resources can be modified without problems. So if one wants to replace a resource in a digitally signed executable, one can add the resource to the .mui file (or replace it in the .mui file if the resource exists there). That's exactly what we'll do to customize the Windows Vista boot screen, so grab your favorite Win32 resource editing tool and let's start! If you don't know which tool you need for this, you can download the excellent Resource Builder or the alternative Resource Hacker.
     
    Customization instructions
    First you have to create a working directory, let's say X:\bootscreen\, which is going to contain the modified winload.exe.mui file. Furthermore, I will assume that you have installed Windows Vista on your V: drive (of course you have to substitute these paths in this article with your own paths).
    1. Open V:\Windows\System32\Boot\winload.exe with your favorite Win32 resource editing tool, navigate to resource 1 in the RCData resource section and save its contents to X:\bootscreen\winload.wim (there is only one RCData resource).

      The extracted Windows Image (WIM) file contains the boot screen bitmaps. You can modify the winload.wim contents by using ImageX.

      NOTE: ImageX currently is only distributed with "Microsoft Solution Accelerator for Business Desktop Deployment (BDD) 2007 (Beta) for Microsoft Windows Vista". Because BDD 2007 is still in beta, you can only get ImageX if you are a member of the beta program.
    2. Mount the WIM image by creating a mount directory in the working directory (for example X:\bootscreen\mount\). Mount the WIM image with write access by executing:

      imagex /mountrw X:\bootscreen\winload.wim 1 X:\bootscreen\mount

      If ImageX successfully mounted the image, you will see two bitmap files in the X:\bootscreen\mount\ directory: osload800x600.bmp and osload1024x768.bmp . These two files are required and are used for the boot screen at 800x600 and 1024x786 resolutions respectively. You can replace these files with your own, as long as they are of bitmap type and have the above defined name and size.
    3. After editing the bitmaps, commit the changes to the WIM file by executing:

      imagex /unmount X:\bootscreen\mount /commit
    4. Now X:\bootscreen\winload.wim contains your custom images, copy V:\Windows\System32\Boot\en-US\winload.exe.mui to X:\bootscreen\winload.exe.mui and open it with your favorite Win32 resource editing tool.
    5. Create a new resource of the type RCDATA with name 1 and language 1033 (1033 stands for English-US) and import X:\bootscreen\winload.wim as the resource’s data. Save the file and exit your Win32 resource editing tool.

      If you have a non English-US version of Windows Vista, your language code may be different. You can find a list of language codes here.
    6. Copy X:\bootscreen\winload.exe.mui back to V:\Windows\System32\Boot\en-US\winload.exe.mui and you're done!
    Text customization instructions
    Changing the text in the boot screen is also possible. XML editing experience is required and assumed below.
    1. Open X:\bootscreen\winload.exe.mui with your favorite Win32 resource editing tool and navigate to resource OSLOADER.XSL in the 23 resource section and save its contents to X:\bootscreen\osloader.xsl.
    2. To change the Starting Windows Vista text, navigate to the osload-status template and change the text of the value attribute in the update element.
    3. To change the position of the Starting Windows Vista text, navigate to the osload-graphics template and change the value of the height and width attributes of the textarea element in front of the textarea with a name attribute of status.