Jump to content











Photo
- - - - -

chain.c32: Boot Recovery Console of Windows NT/2K/XP with automatic "cmdcons" hack


  • Please log in to reply
14 replies to this topic

#1 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 28 December 2009 - 09:59 PM

I have made a patched chain.c32 which can boot the Recovery Console of Windows NT/2K/XP, by applying the "cmdcons" hack in memory.

How to use:
LABEL recoveryconsole

COM32 chain.c32

APPEND cmldr=/cmldr
or:
LABEL recoveryconsole

COM32 chain.c32

APPEND cmldr=/SETUPLDR.BIN

This will do the same as this Grub4Dos entry:
title find and load CMLDR, the Recovery Console of Windows NT/2K/XP

chainloader /cmldr

# write string "cmdcons" to memory 0000:7C03 in 2 steps:

# step 1. Write 4 chars "cmdc" at 0000:7C03

write 0x7C03 0x63646D63

# step 2. Write 3 chars "ons" and an ending null at 0000:7C07

write 0x7C07 0x00736E6F

In the attachment you can find a compiled chain.c32 and the source code of the module. Get syslinux-3.84 for the other binaries (syslinux.exe, isolinux.bin and other modules) and source files.

With a bit of luck. This chain.c32 will be included in syslinux-3.85-pre1.

Attached Files



#2 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 03 January 2010 - 03:11 PM

Syslinux 3.85-pre1 has the patch.

#3 Bernd

Bernd
  • Members
  • 3 posts

Posted 19 April 2010 - 04:32 PM

Hi Icecube,

I am a little bit confused.

I want to boot Windows Recovery Console and Windows PE 2.1 with USB-Stick by using following statements:

LABEL WinRecovery
MENU LABEL Windows NT/2000/XP/2003/2003R2 Recovery Console
COM32 chain.c32
APPEND hd0 cmldr=/cmldr

LABEL WinPEBoot
MENU LABEL Windows PE 2.1
COM32 chain.c32
APPEND hd0 ntldr=/bootmgr


Booting with your patched chain.c32 runs very well.
I think your patch won't be included in syslinux-3.85-pre1.

I wonder if your patch is included in syslinux-3.86 and syslinux-4.00-pre38.
My tries with this versions won't run as well.

Any help is welcome because I want to use the actual official version.
Bernd

#4 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 20 April 2010 - 09:10 PM

Hi Bernd,

Syslinux-3.86 and Syslinux-4.00-pre38 have a reworked patch (due other Windows booting related changes in chain.c32).

Now you need to add the partition from which you want to boot it, too ("hd0,1" or "hd0 1" instead of "hd0"):
LABEL WinRecovery

MENU LABEL Windows NT/2000/XP/2003/2003R2 Recovery Console

COM32 chain.c32

APPEND hd0,1 cmldr=/cmldr



LABEL WinPEBoot

MENU LABEL Windows PE 2.1

COM32 chain.c32

APPEND hd0,1 ntldr=/bootmgr
I did notice this before already :ranting2: :
http://syslinux.zyto...rch/013852.html

#5 Bernd

Bernd
  • Members
  • 3 posts

Posted 21 April 2010 - 09:00 AM

Hi Icecube,

many thanks for your help.
I think I must have overlooked.

Bernd

#6 stonesonnow

stonesonnow

    Newbie

  • Members
  • 23 posts
  •  
    United States

Posted 29 May 2010 - 08:34 AM

and can i boot cmdcons from cd/dvd with isolinux?

#7 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 29 May 2010 - 05:01 PM

Yes.

#8 stonesonnow

stonesonnow

    Newbie

  • Members
  • 23 posts
  •  
    United States

Posted 29 May 2010 - 05:07 PM

ok but i have tried it and it doesn' work

i have the cmdcons folder on dvdroot and
what should i set for the dvd drive in this line? APPEND hd0,1 cmldr=/CMDCONS/setupldr.bin or APPEND hd0,1 cmldr=/cmldr

#9 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 29 May 2010 - 05:14 PM

When the Recovery Console is booted from an optical disc drive (ODD), it expects the layout as found on the original installation media. That is, the I386\ directory rather than a CMDCONS\ directory. Also, since there is no HDD boot-sector involved, there is nothing to patch with cmldr=. Simply use ntldr=
LABEL cmdcons

  COM32 chain.c32

  APPEND ntldr=i386/setupldr.bin

You'll likely wish to remove your I386\WINNT.SIF file, as well as convince Windows that it is on original installation media by including the cdtagfiles found near the bottom of TXTSETUP.SIF

#10 stonesonnow

stonesonnow

    Newbie

  • Members
  • 23 posts
  •  
    United States

Posted 29 May 2010 - 07:47 PM

When the Recovery Console is booted from an optical disc drive (ODD), it expects the layout as found on the original installation media. That is, the I386\ directory rather than a CMDCONS\ directory. Also, since there is no HDD boot-sector involved, there is nothing to patch with cmldr=. Simply use ntldr=

LABEL cmdcons

  COM32 chain.c32

  APPEND ntldr=i386/setupldr.bin

You'll likely wish to remove your I386\WINNT.SIF file, as well as convince Windows that it is on original installation media by including the cdtagfiles found near the bottom of TXTSETUP.SIF



if i do this he boots the normal setup not the recoveryconsole.

#11 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 29 May 2010 - 09:45 PM

Press R, as mentioned here.

#12 stonesonnow

stonesonnow

    Newbie

  • Members
  • 23 posts
  •  
    United States

Posted 01 June 2010 - 11:36 AM

Press R, as mentioned here.



Thanks! This works!

So there is no way to boot directly from odd into RC like from hdd? :)

#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15182 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 June 2010 - 12:13 PM

So there is no way to boot directly from odd into RC like from hdd? :(

Also, since there is no HDD boot-sector involved, there is nothing to patch with cmldr=. Simply use ntldr=


More details:
http://www.boot-land...?...c=2362&st=7

From a "standard" windows install CD, NO, AFAIK.

But you can make alright a Recovery Console disk image and put the image on CD, there are several methods.

Since *somehow* SETUPLDR.BIN must read the "cmdcons" string and "switch mode" consequently, it should be possible to patch it so that it "always" switches to "RC mode", but AFAIK noone took the challenge.

:)
Wonko

#14 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 01 June 2010 - 01:19 PM

...From a "standard" windows install CD, NO, AFAIK.

If anyone knows what kind of magic WinNT.SIF file might accomplish this (Recovery Console automatically from an ODD boot), please do share.

But you can make alright a Recovery Console disk image and put the image on CD, there are several methods.

Are you talking about a Recovery Console HDD image loaded as a RAM disk?

Since *somehow* SETUPLDR.BIN must read the "cmdcons" string and "switch mode" consequently, it should be possible to patch it so that it "always" switches to "RC mode", but AFAIK noone took the challenge.

That's exactly what cmldr= does; it patches the partition boot-sector (as loaded in memory, but not persisted to disk) with that string. With an ODD (CD/DVD), there's no filesystem boot-sector and I don't know if SETUPLDR would look for the string. Oh wait, you mean patch SETUPLDR, I think... Nevermind.

#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15182 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 June 2010 - 02:00 PM

Are you talking about a Recovery Console HDD image loaded as a RAM disk?

Yep. :(

Reference starting from here (with original MS RAMDISK):
http://www.boot-land...?...=5316&st=40


Oh wait, you mean patch SETUPLDR, I think... Nevermind.

Yep again, I mean, somehow the "cmdcons" in the bootsector is "read" by SETUPLDR.BIN, and if found the code inside SETUPLDR.BIN "decides" to switch to the direct loading, I guess that the whoile patch of SETUPLDR.BIN is changing a conditional jump to a "plain" jump, so it shouldn't be that difficult, but as said AFAIK noone looked at it.

:)
Wonko




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users