1 |
@echo off |
2 |
|
3 |
set MD5_VANILLA="7d 96 ff d6 da 21 cc 3f 41 9e 42 f7 22 76 42 fd" |
4 |
set MD5_FIRST63="50 37 4b ed 7f 84 c5 1b dc dc ef d6 30 0d db 84" |
5 |
set MD5_LAST32="c5 e4 67 81 d2 1c d4 41 4e 92 d9 15 02 51 25 00" |
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 |