forked from grimdoomer/Xbox360BadUpdate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_exploit.bat
88 lines (70 loc) · 3.17 KB
/
build_exploit.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@echo off
:: Check if the tools directory has been setup.
if not exist "%~dp0Tools\XePatcher\XePatcher.exe" (
echo Please download Tools.zip from GitHub and extract into this directory
exit /b
)
:: Check for game argument.
if "%1" == "THAW" (
set TARGET_GAME=TONY_HAWK_AW
set GAME_NAME=TonyHawksAmericanWasteland
) else if "%1" == "RBB" (
set TARGET_GAME=RB_BLITZ
set GAME_NAME=RockBandBlitz
) else (
echo Target game unsupported or invalid
exit /b
)
set GAME_INC_DIR="%~dp0Stage1\%GAME_NAME%"
:: Check for retail/debug build config.
if "%2" == "" (
:: Default to retail build.
set BUILD_CONFIG=RETAIL_BUILD
) else (
set BUILD_CONFIG=%2
)
:: Create the output directory if it doesn't already exist.
set BIN_DIR=%~dp0bin\%BUILD_CONFIG%\%GAME_NAME%
if not exist "%BIN_DIR%" (
mkdir "%BIN_DIR%"
)
:: ----------------------------------------------------------------------------
:: Stage 2
:: ----------------------------------------------------------------------------
echo:
echo ============================================================================
echo Compiling stage 2
echo ============================================================================
"%~dp0Tools\XePatcher\XePatcher.exe" -p "%~dp0Stage2\BadUpdateExploit-2ndStage.asm" -proc ppc --defsym %BUILD_CONFIG%=1 --defsym %TARGET_GAME%=1 --include "%~dp0Common" --include %GAME_INC_DIR%
:: ----------------------------------------------------------------------------
:: Stage 3
:: ----------------------------------------------------------------------------
echo:
echo ============================================================================
echo Compiling stage 3
echo ============================================================================
:: Symbol table:
"%~dp0Tools\XePatcher\XePatcher.exe" -p "%~dp0Stage3\symbol_table.asm" -proc ppc --defsym %BUILD_CONFIG%=1 --defsym %TARGET_GAME%=1 --include "%~dp0Common" --include %GAME_INC_DIR%
echo:
:: Exploit code:
"%~dp0Tools\XePatcher\XePatcher.exe" -p "%~dp0Stage3\BadUpdateExploit-3rdStage.asm" -proc ppc --defsym %BUILD_CONFIG%=1 --defsym %TARGET_GAME%=1 --include "%~dp0Common" --include %GAME_INC_DIR%
:: ----------------------------------------------------------------------------
:: Stage 4
:: ----------------------------------------------------------------------------
echo:
echo ============================================================================
echo Compiling stage 4
echo ============================================================================
"%~dp0Tools\XePatcher\XePatcher.exe" -p "%~dp0Stage4\BadUpdateExploit-4thStage.asm" -proc ppc --defsym %BUILD_CONFIG%=1 --defsym %TARGET_GAME%=1 --include "%~dp0Common" --include %GAME_INC_DIR%
echo:
:: Copy files to output directory.
echo Copying files to "%BIN_DIR%"
xcopy "%~dp0Stage2\BadUpdateExploit-2ndStage.bin" "%BIN_DIR%" /Y /Q
xcopy "%~dp0Stage3\BadUpdateExploit-3rdStage.bin" "%BIN_DIR%" /Y /Q
xcopy "%~dp0Stage4\BadUpdateExploit-4thStage.bin" "%BIN_DIR%" /Y /Q
xcopy "%~dp0update_data.bin" "%BIN_DIR%" /Y /Q
xcopy "%~dp0xke_update.bin" "%BIN_DIR%" /Y /Q
:: Print a message telling the user to rebuild the game saves.
echo:
echo:
echo Build completed, game saves must be rebuilt if stage 1 or 2 was modified!!