Tuesday, September 29, 2009

GRUB: Booting and Activating Windows Vista/7

This post describes a way to activate Windows Vista/7 with Grub and SLIC loader. In order to successfully activate Windows Vista/7, you essentially need the following 3 things.



  • OEM SLIC code

    Every SLIC code is 374 bytes. It can be extracted from the BIOS by using the SLIC Dump ToolKit on a PC running legitimate Windows.
  • OEM Certificate (*.xrm-ms) that matches with the corresponding SLIC code
  • Valid 25-digit Windows key


Once these 3 things are obtained, you need a program to insert the SLIC code into memory to emulate OEM BIOS. I found an executable file called wow.exe whose job is to insert a SLIC code into BIOS. Also, GRUB.EXE is needed to find Windows partition and to boot Windows.



Because wow.exe and grub.exe are DOS executables, DOS should be booted first and run wow.exe and grub.exe in turn. grub.exe will chain-load Windows bootmgr, and then Windows will start. FreeDOS is preferred to MS-DOS because it works better with GRUB. Download a floppy image containing FreeDOS kernel and FreeCOM command processor below.




Inserting SLIC data into wow.exe with XVI32


wow.exe has a SLIC table embedded in itself beginning at $A58. Start XVI32 and open wow.exe. Start another XVI32 and open a SLIC table which should be 374 bytes.

With the XVI32 window showing a SLIC.table, open the Edit menu, click the beginning of file, select Block mark from the Edit menu, go to the end of file and select Block mark again. Open the Edit menu, open the Clipboard submenu and select Copy.

With the XVI32 window showing wow.exe, go to $A58, open the Edit window, select Block <n> chars..., enter 374 and click OK. Select Block delete from the Edit menu. Then, open the Edit menu, open the Clipboard submenu, and choose Paste. Go to $A38 and select Overwrite string... and enter the new 14-character OEM identifier which should match the string starting at $A62. Save the file wow.exe.


Open the FreeDOS floppy image with WinImage. Insert wow.exe into the floppy image. Create a batch file called AUTOEXEC.BAT with a text editor and put the following contents in it.


@ECHO OFF
WOW
GRUB

Save the file AUTOEXEC.BAT and insert in into FreeDOS floppy image.


Assuming that Windows 7 is installed, open a Command Prompt as administrator. Create an arbitrary file in C:\Boot, for example, with the filename win7. This file will be used to find the Windows partition (useful in mutiple-Windows environment).


copy nul C:\Boot\win7

Then, create a new text file MENU.LST with the following contents:


timeout 0
default 0
fallback 0
hiddenmenu

title Windows 7
find --set-root /boot/win7
chainloader /bootmgr

Save the file as MENU.LST and insert it into the floppy image with WinImage. Save the floppy image and quit WinImage.


With GRUB installed into MBR, type the following GRUB commands at boot time to boot Windows with BIOS-inserted SLIC code. Assume memdisk and freedos.flp is in the (hd0,3) partition.


kernel (hd0,3)/boot/grub/memdisk
initrd (hd0,3)/boot/grub/freedos.flp


Activating Windows


Once Windows has started, find the OEM certificate (*.xrm-ms) and 25-character Windows key that match the SLIC table just loaded into BIOS. Open a command prompt as administrator and type the following commands to activate Windows:


slmgr -ilc oemcert.xrm-ms
slmgr -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Hopefully, Windows will be activated.

1 comment:

  1. Hola,

    Hay alguna revista de Linux que esté bien y que me pueda subscribirme en España?

    Comentarios y opiniones

    Saludos

    ReplyDelete

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger