!BAT
debug off
checkrange 20101214:-1 read 0x8278 || echo Err.version && exit 1
goto %~x1
exit
:.automenu
delmod -l wenv || insmod /efi/_ISO/NoTouch/WENV
delmod -l %~nx0 || insmod %0 .makemenu
if "%DD%"=="1" echo Writing default menu entry
if "%DD%"=="1" echo -e default 0\n#timeout 10\n\n > (md)0x3000+0x50
if exist (bd)/efi/_ISO/NoTouch/linuxuser.mnu echo Using default user menu /efi/_ISO/NoTouch/LINUXUSER.MNU...
cat --length=0 (bd)/efi/_ISO/NoTouch/linuxuser.mnu && cat (bd)/efi/_ISO/NoTouch/linuxuser.mnu > (md)0x3000+0x50
set ME=%0
if "%2"=="" goto :endloop
set DIR=%2
echo Using %DIR% as main folder for .iso  files
echo set MFOLDER=%DIR% >> (md)0x3000+0x50
echo Looking for .iso files starting at %DIR%/
ls %DIR%/ | call :cpa
:endloop
echo -e -n \n >> (md)0x3000+0x50
echo -e title Возврат в главное меню\\n Возврат в главное меню >> (md)0x3000+0x50
if "%LBACKMENU%"=="" set LBACKMENU=(bd)/efi/_ISO/NoTouch/back
echo -e \nconfigfile %LBACKMENU% >> (md)0x3000+0x50
set DD=
set DIR=
set hlp=
root (bd)/
if "%ELBACKUP%"=="YES" echo BACKING UP TO /efi/_ISO/NoTouch/LINUXBACKUP.lst...
if "%ELBACKUP%"=="YES" cat (md)0x3000+0x50 > (bd)/efi/_ISO/NoTouch/LINUXBACKUP.lst
if "%ELBACKUP%"=="YES" pause
debug on
exit
:.makemenu
if "%DD%"=="1" echo @MAKEMENU
setlocal
if "%DD%"=="1" echo Checking (bd)%DIR%/%1
if "%1"=="" endlocal && goto :EOF
cat --length=0 (bd)%DIR%/%1 || goto :EOF
if "%DD%"=="1" echo MAKEMENU: checking %~x1 extension 
WENV check "#.iso#"=="#%~x1#" || goto :EOF
set hlp=\n Загрузка %1 (монтируется на USB диске - раздел 4)
echo %1 > (md)0x2800+1 && cat --locatei=ophcrack (md)0x2800+1 > nul && set hlp=\nTo find the tables type: su root, mkdir /media/oph, mount /dev/sdb4 /media/oph  and then run Launcher. && echo FOUND OPHCRACK!
echo ADDING %DIR%/%1
echo title %1 %hlp% >> (md)0x3000+0x50
echo partnew (hd0,3) 0x00 %DIR%/%1 >> (md)0x3000+0x50
echo map  %DIR%/%1 (0xff) >> (md)0x3000+0x50
echo map --hook >> (md)0x3000+0x50
echo root (0xff) >> (md)0x3000+0x50
echo chainloader (0xff) >> (md)0x3000+0x50
echo >> (md)0x3000+0x50
goto :EOF
:cpa
if "%DD%"=="1" echo @CPA: Current Root: %DIR%
if "%DD%"=="1" echo Change source root to (bd)%DIR%/
root (bd)%DIR%/
ls | call :copyfiles
goto :eof
:copyfiles
if "%DD%"=="1" echo @COPYFILES %1
if "%1"=="" goto :eof
cat --length=0 /%1 || goto :sub-dir
if "%DD%"=="1" echo @COPY FILE
call :.makemenu %1
shift
goto :copyfiles
:sub-dir
if "%DD%"=="1" echo @SUB_DIR %1
setlocal
set DIR=%DIR%/%1
call :cpa
endlocal
shift
goto :copyfiles





