source: oni2aslpt/o2aslpt.bat@ 1138

Last change on this file since 1138 was 1104, checked in by iritscen, 7 years ago

Adding oni2aslpt, a tool to unlock the hidden layouts on the Oni 2 disc.

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1@echo off
2
3set MD5_VANILLA="7d 96 ff d6 da 21 cc 3f 41 9e 42 f7 22 76 42 fd"
4set MD5_FIRST63="50 37 4b ed 7f 84 c5 1b dc dc ef d6 30 0d db 84"
5set MD5_LAST32="c5 e4 67 81 d2 1c d4 41 4e 92 d9 15 02 51 25 00"
6
7echo Welcome to the Oni 2 (Angel Studios) Layout Patch Tool.
8
9if "%~1" == "" (
10 echo You need to pass me the path to your ISO of Oni 2. Exiting.
11 exit /b
12)
13
14if 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
19echo Verifying checksum...
20
21setlocal enableDelayedExpansion
22set count=1
23for /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
28if 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
41echo You have supplied an unmodified ISO of Oni 2. Do you wish to create a patched
42echo copy that enables the first 63 layouts or the last 32? Enter a number from
43echo this menu:
44echo ^(1^) First 63.
45echo ^(2^) Last 32.
46echo ^(anything else^) I changed my mind, please exit.
47set /p the_answer=
48if !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
76echo Goodbye.
77endlocal
Note: See TracBrowser for help on using the repository browser.