Mai 042014
 

A few months ago I wrote an article about Olof’s Arsenal driver.

Now is time for a command line version of ImgMount GUI named ImgMountCMD.
Exe is about 50 kb and can do as much as the GUI version.
Moreover, both the GUI and the command line version have been tested in WinPE and work fine including installing the driver.

Discuss/download it here.

The syntax for the command line is the following :


ImgMountCMD file add path
ImgMountCMD file new path size(MB)
ImgMountCMD file shm name
ImgMountCMD file remove id
ImgMountCMD vm add path
ImgMountCMD vm new size(MB)
ImgMountCMD vm remove id
ImgMountCMD pm add path
ImgMountCMD pm new size(MB)
ImgMountCMD pm remove id
ImgMountCMD list
ImgMountCMD removall
ImgMountCMD driver check
ImgMountCMD driver install driver.inf
ImgMountCMD driver remove

 Posted by at 17 h 12 min
Mai 042014
 

MistyPE is an excellent WinPE generator based on Winbuilder.

It is minimalist (in a way it is easy and fast to build WinPE) but still very flexible so that one can add many extra softwares in there.

Download/Discuss it here.

How to use it? Easy :
-Launch winbuilder,
-Go to source tab,
-Select your source directory to point to your windows media installation dvd drive (E:\ for me),
-Click play,
-Retrieve your winpe iso in x:\MistyPE\MistyPE.Project.Output\.

 Posted by at 17 h 05 min
Mai 042014
 

If, like me, you often get confused with WinPE versionning, here below a quick summary :

  • WinPE 2.0 – 6.0.6000 – Vista
  • WinPE 2.1 – 6.0.6001 – Vista SP1 and possibly Server 2008
  • WinPE 3.0 – 6.1.7600 – Windows 7 and possibly Server 2008 R2
  • WinPE 3.1 – 6.1.7601 – Windows 7 SP1 and possibly Server 2008 R2 SP1
  • WinPE 4.0 – 6.2.9200 – Windows 8 and possibly Server 2012
  • WinPE 5.0 – 6.3.9600 – Windows 8.1
  • WinPE 5.1 – 6.3.9600 – Windows 8.1 Update 1

Thanks goes to Misty on reboot.pro for making this clear !

 Posted by at 16 h 58 min
Mai 042014
 

Lately I had been testing a lot Windows 8.1 and WinPE generated from Windows 8.x (i.e WinPE 4.0, 5.0, 5.1).

The Windows QEMU I had (lots of versions out there) was giving me a windows error 0x0000005d which means UNSUPPORTED_PROCESSOR .
Indeed, starting with Windows 8, you need a processor that supports NX/PAE/SSE2.
NX is not supported with older windows QEMU versions.
More details from MS here.

Googling around it appeared the solution was to use the -cpu command line parameter with QEMU.
Unfortunately, none of the QEMU versions I had was supported that parameter.

I then found the right (and latest) windows QEMU version (2.0.0) here.
I downloaded this version qemu-w32-setup-20140418.exe.
The command line : start qemu-system-i386.exe -L .-m 512-cdrom D:\WinPE5.1.iso-cpu Nehalem allowed me to boot my latest Windows 8.1 with success ! 🙂

Also, note the use of coreinfo (from sysinternals) to check your processor flags.

qemu_nx2

 Posted by at 16 h 56 min
Avr 282014
 

A cool video on youtube I have seen today around a 3D camera in XNA, well explained.
C# code source given here.

I have decided to translate to Vb.Net and to distribute the full project here.

It goes as is :
declare a camera object, a floor object and basiceffect in your mail class
initialise these variables (and add the cam to the game components)
draw the floor while passing the cam and the basiceffet as parameters

A quick video to demonstrate it (or watch the original video).

 Posted by at 20 h 10 min
Avr 262014
 

It has been a while that I wanted to do this : a X64 version of CloneDisk.

My main drive was to use it from X64 bits WinPE’s.

Well thanks to Delphi XE, I was able (after much corrections) to compile it under a X64 environement.

CloneDisk page here.
Download X64 here.
Download X32 here.

 Posted by at 19 h 01 min
Avr 262014
 

More than once did I spend (lose…) long minutes on google to find the proper syntax with windows bcdedit command line.

I came with the quick batch below that will set different entries : win7, winpe, grub4dos, etc …

You need to edit the batch to set the path to your BCD store.

Beware that the BCD is overwritten each time.

Note that this is greatly (mostly) inspired from this page.


@echo off
setlocal
set BCDEDIT=%SYSTEMROOT%\system32\bcdedit.exe
set BCDSTORE=C:\temp\BCD

del %BCDSTORE% /F

rem create - rem if not needed
%BCDEDIT% /createstore %BCDSTORE%

rem create bootmgr entry
%BCDEDIT% /store %BCDSTORE% /create {bootmgr}
%BCDEDIT% /store %BCDSTORE% /set {bootmgr} description "Boot Manager"
%BCDEDIT% /store %BCDSTORE% /set {bootmgr} device boot
%BCDEDIT% /store %BCDSTORE% /set {bootmgr} timeout 20

ECHO _________________________________________
ECHO BCDEDIT Main Menu
ECHO.
ECHO Menu Choices
ECHO.
ECHO 1 Add Win7
ECHO 2 Add VHDBOOT
ECHO 3 Add Grub4Dos
ECHO 4 Add Winpe
ECHO 5 Add RamDisk
ECHO 6 Add NTLDR
echo -
ECHO 9 Exit
ECHO _________________________________________
ECHO.
SET /P userChoice=ENTER OPTION:

if %userChoice% == 1 GOTO win7
if %userChoice% == 2 GOTO vhdboot
if %userChoice% == 3 GOTO g4d
if %userChoice% == 4 GOTO winpe
if %userChoice% == 5 GOTO ramdisk
if %userChoice% == 6 GOTO ntdlr
if %userChoice% == 9 GOTO QUITMENU

:win7
rem add new windows7 entry
for /f "tokens=2 delims={}" %%g in ('%BCDEDIT% /store %BCDSTORE% /create /application osloader') do set guid={%%g}
%BCDEDIT% /store %BCDSTORE% /set %guid% device partition=C:
%BCDEDIT% /store %BCDSTORE% /set %guid% path \Windows\system32\winload.exe
%BCDEDIT% /store %BCDSTORE% /set %guid% osdevice partition=C:
%BCDEDIT% /store %BCDSTORE% /set %guid% systemroot \Windows
%BCDEDIT% /store %BCDSTORE% /set %guid% description "Windows 7"
%BCDEDIT% /store %BCDSTORE% /displayorder %guid% /addlast
goto :eof

:ntdlr
%BCDEDIT% /store %BCDSTORE% /create {ntldr}
%BCDEDIT% /store %BCDSTORE% /set {ntldr} device partition=C:
%BCDEDIT% /store %BCDSTORE% /set {ntldr} path \ntldr
%BCDEDIT% /store %BCDSTORE% /set {ntldr} description "Windows XP"
%BCDEDIT% /store %BCDSTORE% /displayorder {ntldr} /addlast
goto :eof

:vhdboot
rem add new vhd boot entry
for /f "tokens=2 delims={}" %%g in ('%BCDEDIT% /store %BCDSTORE% /create /application osloader') do set guid={%%g}
%BCDEDIT% /store %BCDSTORE% /set %guid% device vhd=[C:]\disk.vhd
%BCDEDIT% /store %BCDSTORE% /set %guid% path \Windows\system32\winload.exe
%BCDEDIT% /store %BCDSTORE% /set %guid% osdevice vhd=[C:]\disk.vhd
%BCDEDIT% /store %BCDSTORE% /set %guid% systemroot \Windows
%BCDEDIT% /store %BCDSTORE% /set %guid% description "Windows 7 VHDBOOT"
%BCDEDIT% /store %BCDSTORE% /displayorder %guid% /addlast
goto :eof

:g4d
rem add grub4dos
for /f "tokens=2 delims={}" %%g in ('%BCDEDIT% /store %BCDSTORE% /create /application osloader') do set guid={%%g}
%BCDEDIT% /store %BCDSTORE% /set %guid% device boot
%BCDEDIT% /store %BCDSTORE% /set %guid% path \grldr.mbr
%BCDEDIT% /store %BCDSTORE% /set %guid% description "Grub4dos"
%BCDEDIT% /store %BCDSTORE% /displayorder %guid% /addlast
goto :eof

:winpe
rem add winpe
for /f "tokens=2 delims={}" %%g in ('%BCDEDIT% /store %BCDSTORE% /create /application osloader') do set guid={%%g}
%BCDEDIT% /store %BCDSTORE% /set %guid% systemroot \Windows
%BCDEDIT% /store %BCDSTORE% /set %guid% detecthal Yes
%BCDEDIT% /store %BCDSTORE% /set %guid% winpe Yes
%BCDEDIT% /store %BCDSTORE% /set %guid% osdevice ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
%BCDEDIT% /store %BCDSTORE% /set %guid% device ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
%BCDEDIT% /store %BCDSTORE% /set %guid% description "Windows PE"
%BCDEDIT% /store %BCDSTORE% /displayorder %guid% /addlast
goto :eof

:ramdisk
rem add ramdisk
%BCDEDIT% /store %BCDSTORE% /create {ramdiskoptions}
%BCDEDIT% /store %BCDSTORE% /set {ramdiskoptions} ramdisksdidevice boot
%BCDEDIT% /store %BCDSTORE% /set {ramdiskoptions} ramdisksdipath \Boot\boot.sdi
goto :eof

:eof
echo "this is the end..."

 Posted by at 15 h 54 min
Avr 242014
 

In the previous article, we have seen how to benefit from the new wimboot feature of MS Windows 8.1 using the DISM command.

Thanks to the free/opensource WimLib, let’s now see how we can proceed with the capture/apply phase. This WimLib method will be similar to the DISM one.

Since Wimlib 6.3, you no longer need a Windows 8.1 Update 1 source which means you can use any Winpe 3/4/5 version !

 

Here below the procedure (we assume Win8.1U1 is already installed on C drive):

1-Lets make a WINPE out of  windows (7 or 8) iso/dvd (I use QuickPE) .

2-Boot onto this Winpe (I use rufus to « burn » the winpe iso onto USB).

3-Capture the installation : wimcapture.cmd c:\ e:\install.wim --wimboot
Note : e:\ is a second partition on my hard drive.
Note : wimlib binaries are in x:\extra\wimlib if you used QuickPE.

4-Format C drive (so that we start from a fresh drive)

5-Apply our wim file (from step 3) to my C drive : wimapply.cmd e:\install.wim c:\ --wimboot

Note : before step 5, you may want to perform the following command wimlib-imagex update install.wim 1 --command="add CustomWimBootCompress.ini \Windows\System32\WimBootCompress.ini" in order to fully apply bootmgr files (and not use pointers to the wim file).
Here is the customewimbootcompress.ini.
This applies only if you have one unique boot & system partition which is nowadays rarely the case as Windows always created a hidden/reserved partition for the boot files.

And voila, you should end up with a C drive occupied by only 250 MB (before 1st boot where pagefile.sys and hyberfil.sys will be created).

 Posted by at 21 h 30 min
Avr 222014
 

Discuss it here

Download it here

Latest change log since previous version :

added : can patch the volume serial number (in boot sector)
added : can patch the hidden sectors (in boot sector)
added : can patch heads and secpertrack (in boot sector)
fixed : writing MBR or BS would not work (ressources not saved to current directory)
added : will refresh drives when on DBT_DEVICEARRIVAL/DBT_DEVICEREMOVECOMPLETE
added : generate random serial number (to patch boot sector)
added : create disk will now offer mbr, gpt or raw
fixed : create partition was adding one sector too much
fixed : create unique partition was not wiping partitions above 1st partition.
added : partition editor (using IOCTL_DISK_GET_DRIVE_LAYOUT)
added : delete partition in partition editor
added : create partition in partition editor
added : gpt support in partition editor (using IOCTL_DISK_GET_DRIVE_LAYOUT_ex)
added : gpt support in create partition (using IOCTL_DISK_GET_DRIVE_LAYOUT_ex)
added : gpt support delete partition (using IOCTL_DISK_SET_DRIVE_LAYOUT_ex)
modified : create a GPT partition when there is no partition yet
modified : IOCTL_DISK_GET_DRIVE_LAYOUT_ex before IOCTL_DISK_SET_DRIVE_LAYOUT_ex when deleting/creating a part
added : check disk, next to format using fmifs.dll
added : change partition type
added : change partition boot indicator
added : support for wimboot (windows 8.1 update 1 option)

clonedisk_216

 Posted by at 8 h 44 min
Avr 212014
 

In the previous article, we have seen how to benefit from the new wimboot feature of MS Windows 8.1 : install, capture with wimboot (from winpe), restore with wimboot (from winpe).

CloneDisk now also support wimboot (thru wimgapi.dll) for those who prefer a GUI rather than the DISM command line.

Capturing with the wimboot flag will make it so that the wim file will use a XPRESS chunk size of 4096 (vs 32768) and the image will have the extra flag wimboot.

Some facts :

-My clean install is around 13 GB.

-My wim file is around 7 GB.

-My « wimboot » install occupies « only » 3.5 GB  on drive C. (of which near 3 gigs are taken by hyberfil.sys, pagefile.sys, swapfile.sys)

Discuss it here.

wimboot_1

 Posted by at 21 h 53 min