| 1 |
@echo off |
| 2 |
|
| 3 |
set MD5_VANILLA="7d96ffd6da21cc3f419e42f7227642fd" |
| 4 |
set MD5_FIRST63="50374bed7f84c51bdcdcefd6300ddb84" |
| 5 |
set MD5_LAST32="c5e46781d21cd4414e92d91502512500" |
| 6 |
|
| 7 |
echo Welcome to the Oni 2 (Angel Studios) Layout Patch Tool. |
| 8 |
|
| 9 |
if "%~1" == "" ( |
| 10 |
echo You need to pass me the path to your ISO of Oni 2. Exiting. |
| 11 |
exit /b |
| 12 |
) |
| 13 |
|
| 14 |
if not exist "%~1" ( |
| 15 |
echo Hmm, there doesn't seem to be any file at the path you passed me. Exiting. |
| 16 |
exit /b |
| 17 |
) |
| 18 |
|
| 19 |
echo Verifying checksum... |
| 20 |
|
| 21 |
setlocal enableDelayedExpansion |
| 22 |
set count=1 |
| 23 |
for /f "tokens=* USEBACKQ" %%L in (`CertUtil -hashfile %~1 MD5`) do ( |
| 24 |
if !count! == 2 set MD5_INPUT=%%L |
| 25 |
set /a count=!count!+1 |
| 26 |
) |
| 27 |
|
| 28 |
if not "!MD5_INPUT!" == !MD5_VANILLA! ( |
| 29 |
if "!MD5_INPUT!" == !MD5_FIRST! ( |
| 30 |
echo This version is already patched to enabled the first 63 layouts! You should see them in the Load Game menu. |
| 31 |
) else if "!MD5_INPUT!" == !MD5_LAST32! ( |
| 32 |
echo This version is already patched to enabled the last 32 layouts! You should see them in the Load Game menu. |
| 33 |
) else ( |
| 34 |
echo Unknown checksum! Sorry, this ISO isn't what I expected. |
| 35 |
) |
| 36 |
|
| 37 |
echo Exiting |
| 38 |
exit /b |
| 39 |
) |
| 40 |
|
| 41 |
echo You have supplied an unmodified ISO of Oni 2. Do you wish to create a patched |
| 42 |
echo copy that enables the first 63 layouts or the last 32? Enter a number from |
| 43 |
echo this menu: |
| 44 |
echo ^(1^) First 63. |
| 45 |
echo ^(2^) Last 32. |
| 46 |
echo ^(anything else^) I changed my mind, please exit. |
| 47 |
set /p the_answer= |
| 48 |
if !the_answer! == 1 ( |
| 49 |
echo Creating patched version... |
| 50 |
xdelta3win.exe -ds "%~1" patchFromVanTo63.xd3 oni2dev_ps2_first63layouts.iso |
| 51 |
echo Verifying checksum.... |
| 52 |
set count=1 |
| 53 |
for /f "tokens=* USEBACKQ" %%L in (`CertUtil -hashfile oni2dev_ps2_first63layouts.iso MD5`) do ( |
| 54 |
if !count! == 2 set MD5_OUTPUT=%%L |
| 55 |
set /a count=!count!+1 |
| 56 |
) |
| 57 |
if not "!MD5_OUTPUT!" == !MD5_FIRST63! ( |
| 58 |
echo Uh-oh, something went wrong^! Patch failed. Exiting. |
| 59 |
exit /b |
| 60 |
) |
| 61 |
) else if !the_answer! == 2 ( |
| 62 |
echo Creating patched version... |
| 63 |
xdelta3win.exe -ds "%~1" patchFromVanTo32.xd3 oni2dev_ps2_last32layouts.iso |
| 64 |
echo Verifying checksum.... |
| 65 |
set count=1 |
| 66 |
for /f "tokens=* USEBACKQ" %%L in (`CertUtil -hashfile oni2dev_ps2_last32layouts.iso MD5`) do ( |
| 67 |
if !count! == 2 set MD5_OUTPUT=%%L |
| 68 |
set /a count=!count!+1 |
| 69 |
) |
| 70 |
if not "!MD5_OUTPUT!" == !MD5_LAST32! ( |
| 71 |
echo Uh-oh, something went wrong^~ Patch failed. Exiting. |
| 72 |
exit /b |
| 73 |
) |
| 74 |
) |
| 75 |
|
| 76 |
echo Goodbye. |
| 77 |
endlocal |