@ECHO OFF
CLS
:LOOP
ECHO.

color 2

SET SPLIT=SPLITOFF.EXE
SET ECC_8MB=FIX_ECC_8MB.EXE
SET ECC_16MB=FIX_ECC_16MB.EXE
SET ECC_32MB=FIX_ECC_32MB.EXE
SET ECC_64MB=FIX_ECC_64MB.EXE

SET DOSSIER_EUR=EUR
SET DOSSIER_USA=USA
SET DOSSIER_EUR_USA=EUR--USA

SET FICHIER_SIGNATURE=mcid.bin

SET FICHIER_IMAGE_EUR_8MB=OsDatel-EUR-8Mb.ps2
SET FICHIER_IMAGE_USA_8MB=OsDatel-USA-8Mb.ps2
SET FICHIER_IMAGE_EUR_16MB=OsDatel-EUR-16Mb.ps2
SET FICHIER_IMAGE_USA_16MB=OsDatel-USA-16Mb.ps2
SET FICHIER_IMAGE_EUR_32MB=OsDatel-EUR-32Mb.ps2
SET FICHIER_IMAGE_USA_32MB=OsDatel-USA-32Mb.ps2
SET FICHIER_IMAGE_EUR_64MB=OsDatel-EUR-64Mb.ps2
SET FICHIER_IMAGE_USA_64MB=OsDatel-USA-64Mb.ps2

SET LANG_CHOICE=Type your choice and press Enter: 
SET LANG_PATCH_IMAGE01=Patch
SET LANG_PATCH_IMAGE02=memory card image file
SET LANG_CHOICE_ERREUR=is not valid. Please try again.
SET LANG_MCID_ERREUR=!!! The file "%FICHIER_SIGNATURE%" is not found !!!
SET LANG_QUITTER=Exit
SET LANG_MESSAGE_SUCCES=Patching of file
SET LANG_TERMINER=Done

ECHO.                     ____________________________________________
ECHO                   +-/                                            \-+
ECHO                  /    ID Patch - Free OsDatel for PlayStation 2    /
ECHO                 /                                                 /
ECHO                /              By HackChip Et jMkoNm              /
ECHO                +-\____________________________________________/-+
ECHO.
ECHO ===========================http://www.metagames-eu.com==========================
ECHO.
ECHO.
ECHO 1. %LANG_PATCH_IMAGE01% %DOSSIER_EUR% %LANG_PATCH_IMAGE02% 8Mb
ECHO 2. %LANG_PATCH_IMAGE01% %DOSSIER_USA% %LANG_PATCH_IMAGE02% 8Mb
ECHO 3. %LANG_PATCH_IMAGE01% %DOSSIER_EUR% %LANG_PATCH_IMAGE02% 16Mb
ECHO 4. %LANG_PATCH_IMAGE01% %DOSSIER_USA% %LANG_PATCH_IMAGE02% 16Mb
ECHO 5. %LANG_PATCH_IMAGE01% %DOSSIER_EUR% %LANG_PATCH_IMAGE02% 32Mb
ECHO 6. %LANG_PATCH_IMAGE01% %DOSSIER_USA% %LANG_PATCH_IMAGE02% 32Mb
ECHO 7. %LANG_PATCH_IMAGE01% %DOSSIER_EUR% %LANG_PATCH_IMAGE02% 64Mb
ECHO 8. %LANG_PATCH_IMAGE01% %DOSSIER_USA% %LANG_PATCH_IMAGE02% 64Mb
ECHO 9. %LANG_QUITTER%

SET Choice=
ECHO.
SET /P Choice=%LANG_CHOICE%

IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.

IF /I '%Choice%'=='1' GOTO PATCH_IMAGE_MC_EUR_8MB
IF /I '%Choice%'=='2' GOTO PATCH_IMAGE_MC_USA_8MB
IF /I '%Choice%'=='3' GOTO PATCH_IMAGE_MC_EUR_16MB
IF /I '%Choice%'=='4' GOTO PATCH_IMAGE_MC_USA_16MB
IF /I '%Choice%'=='5' GOTO PATCH_IMAGE_MC_EUR_32MB
IF /I '%Choice%'=='6' GOTO PATCH_IMAGE_MC_USA_32MB
IF /I '%Choice%'=='7' GOTO PATCH_IMAGE_MC_EUR_64MB
IF /I '%Choice%'=='8' GOTO PATCH_IMAGE_MC_USA_64MB
IF /I '%Choice%'=='9' GOTO Fin
ECHO "%Choice%" %LANG_CHOICE_ERREUR%
ECHO.
PAUSE
CLS
GOTO Loop
CLS

:PATCH_IMAGE_MC_EUR_8MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_EUR_8MB%" (
DEL /F "%FICHIER_IMAGE_EUR_8MB%"
)
%SPLIT% x -s 0 -e 80296 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_8MB%" "Partie01.ELF"
%SPLIT% x -s 80328 -e 8650752 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_8MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_EUR_8MB%-PAS_ECC_FIX"
%ECC_8MB% "%FICHIER_IMAGE_EUR_8MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_EUR_8MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_EUR_8MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_EUR_8MB% %LANG_TERMINER%
GOTO Again

:PATCH_IMAGE_MC_USA_8MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_USA_8MB%" (
DEL /F "%FICHIER_IMAGE_USA_8MB%"
)
%SPLIT% x -s 0 -e 80296 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_8MB%" "Partie01.ELF"
%SPLIT% x -s 80328 -e 8650752 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_8MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_USA_8MB%-PAS_ECC_FIX"
%ECC_8MB% "%FICHIER_IMAGE_USA_8MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_USA_8MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_USA_8MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_USA_8MB% %LANG_TERMINER%
GOTO Again

:PATCH_IMAGE_MC_EUR_16MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_EUR_16MB%" (
DEL /F "%FICHIER_IMAGE_EUR_16MB%"
)
%SPLIT% x -s 0 -e 114088 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_16MB%" "Partie01.ELF"
%SPLIT% x -s 114120 -e 17301504 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_16MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_EUR_16MB%-PAS_ECC_FIX"
%ECC_16MB% "%FICHIER_IMAGE_EUR_16MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_EUR_16MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_EUR_16MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_EUR_16MB% %LANG_TERMINER%
GOTO Again

:PATCH_IMAGE_MC_USA_16MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_USA_16MB%" (
DEL /F "%FICHIER_IMAGE_USA_16MB%"
)
%SPLIT% x -s 0 -e 114088 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_16MB%" "Partie01.ELF"
%SPLIT% x -s 114120 -e 17301504 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_16MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_USA_16MB%-PAS_ECC_FIX"
%ECC_16MB% "%FICHIER_IMAGE_USA_16MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_USA_16MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_USA_16MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_USA_16MB% %LANG_TERMINER%
GOTO Again

:PATCH_IMAGE_MC_EUR_32MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_EUR_32MB%" (
DEL /F "%FICHIER_IMAGE_EUR_32MB%"
)
%SPLIT% x -s 0 -e 181672 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_32MB%" "Partie01.ELF"
%SPLIT% x -s 181704 -e 34603008 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_32MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_EUR_32MB%-PAS_ECC_FIX"
%ECC_32MB% "%FICHIER_IMAGE_EUR_32MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_EUR_32MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_EUR_32MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_EUR_32MB% %LANG_TERMINER%
GOTO Again

:PATCH_IMAGE_MC_USA_32MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_USA_32MB%" (
DEL /F "%FICHIER_IMAGE_USA_32MB%"
)
%SPLIT% x -s 0 -e 181672 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_32MB%" "Partie01.ELF"
%SPLIT% x -s 181704 -e 34603008 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_32MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_USA_32MB%-PAS_ECC_FIX"
%ECC_32MB% "%FICHIER_IMAGE_USA_32MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_USA_32MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_USA_32MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_USA_32MB% %LANG_TERMINER%
GOTO Again

:PATCH_IMAGE_MC_EUR_64MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_EUR_64MB%" (
DEL /F "%FICHIER_IMAGE_EUR_64MB%"
)
%SPLIT% x -s 0 -e 316840 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_64MB%" "Partie01.ELF"
%SPLIT% x -s 316872 -e 69206016 "%DOSSIER_EUR%\%FICHIER_IMAGE_EUR_64MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_EUR_64MB%-PAS_ECC_FIX"
%ECC_64MB% "%FICHIER_IMAGE_EUR_64MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_EUR_64MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_EUR_64MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_EUR_64MB% %LANG_TERMINER%
GOTO Again

:PATCH_IMAGE_MC_USA_64MB
IF NOT EXIST "%FICHIER_SIGNATURE%" (
ECHO %LANG_MCID_ERREUR%
GOTO Again
)
IF EXIST "%FICHIER_IMAGE_USA_64MB%" (
DEL /F "%FICHIER_IMAGE_USA_64MB%"
)
%SPLIT% x -s 0 -e 316840 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_64MB%" "Partie01.ELF"
%SPLIT% x -s 316872 -e 69206016 "%DOSSIER_USA%\%FICHIER_IMAGE_USA_64MB%" "Partie02.ELF"
COPY /B "Partie01.ELF" + "%FICHIER_SIGNATURE%" + "Partie02.ELF" "%FICHIER_IMAGE_USA_64MB%-PAS_ECC_FIX"
%ECC_64MB% "%FICHIER_IMAGE_USA_64MB%-PAS_ECC_FIX" "%FICHIER_IMAGE_USA_64MB%"
DEL "Partie*.ELF" "%FICHIER_IMAGE_USA_64MB%-PAS_ECC_FIX"
ECHO.
ECHO.
ECHO.
ECHO %LANG_MESSAGE_SUCCES% %FICHIER_IMAGE_USA_64MB% %LANG_TERMINER%
GOTO Again

:Again
PAUSE
CLS
GOTO Loop
:Fin
CLS
