# This menu will disable HDD booting to your PC - you will only be able to boot to your PC by booting from your E2B drive first!
# See www.rmprepusb.com Tutorial #131  - tested using TrueCrypt 7.1a
# TrueCrypt Rescue ISO can be used to boot in case of problems - file extension must be .iso01 for repair option to work

title Trash  TC MBR boot code and boot to first Internal HDD\n Modifies TrueCrypt boot code in MBR so it won't boot without booting from USB first
#uncomment line below to prompt for password
# password secret || reboot
debug on
# trash boot code in MBR if still TC code
echo
cat --locate=\xea\x1e\x7c --replace=\xc3 --length=3 (hd1)0+1 > nul && echo TC Boot sector trashed!
# copy code in MBR to memory
dd if=(hd1)0+1 of=(md)0x300+1  > nul 
# repair MBR boor code in memory
cat --locate=\xc3\x1e --replace=\xea\x1e --length=3 (md)0x300+1 > nul 
# map hd1 (internal hdd) to hd0
map (hd1) (hd0)  > nul 
# chainload patched (good) MBR
chainloader (md)0x300+1
echo hd1 MBR code:
cat --hex --length=16 (hd1)0+1
echo Patched MBR code in memory:
cat --hex --length=16 (md)0x300+1
echo
set ask=
set /p:3 ask=Press R quickly to reboot!...
if /i "%ask%"=="R" reboot
boot

iftitle [cat --locate=\xc3\x1e\x7c --length=3 (hd1)0+1 > nul] Repair TC MBR boot code and boot to first Internal HDD\n Fix boot code in MBR so we can boot directly from hard disk again
# menu only shown if MBR is patched - uncomment line below to prompt for password
# password secret || reboot
debug on
echo
# repair byte in MBR
cat --locate=\xc3\x1e\x7c --replace=\xea --length=3 (hd1)0+1 > nul  && echo TC MBR Boot sector repaired!
# make internal HDD hd0
map (hd1) (hd0)  > nul
# load repaired TC MBR
chainloader (hd1)0+1 
echo
echo hd1 MBR code now:
cat --hex --length=16 (hd1)0+1
echo
set ask=
set /p:3 ask=Press R quickly to reboot!...
if /i "%ask%"=="R" reboot
boot
