-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathmcppatch.S
More file actions
152 lines (128 loc) · 1.93 KB
/
Copy pathmcppatch.S
File metadata and controls
152 lines (128 loc) · 1.93 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# WUPInstaller - Install Wii U NUS content - [https://github.com/crediar/wupinstaller]
#
# Copyright (c) 2015 crediar
#
# WUPInstaller is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#include <asm.h>
mflr 0
stwu 1, -0x18(1)
stw 0, 0x1C(1)
stw 31, 0x14(1)
stw 30, 0x10(1)
stw 29, 0x0C(1)
stw 28, 0x08(1)
nop
cmpwi 3, 2
bne end
# check install done value
nop
nop
lwz 4, 0(3)
cmpwi 4, 2
beq end
# set install done value
li 4, 2
stw 4, 0(3)
#IOS_Open(/dev/mcp)
nop
nop
li 4, 0
nop
mr 30, 3
#alloc( 0x24, 32 )
li 3, 0x24
li 4, 32
nop
mr 31, 3
#MCP get info
mr 3, 30
mr 5, 31
nop
nop
nop
cmpwi 3, 0
bne error
# check title IDs
#game update
lwz 3, 0(31)
subis 3, 3, 0x0005
cmpwi 3, 0x000E
beq install
#version title
lwz 3, 4(31)
subis 3, 3, 0x1004
#JAP
cmpwi 3, 0x1000
beq install
#USA
cmpwi 3, 0x1100
beq install
#EUR
cmpwi 3, 0x1200
beq install
li 3, -1
b error_title
install:
#MCP Install
mr 3, 30
mr 5, 31
nop
nop
nop
cmpwi 3, 0
bne error
loop:
li 3, 1
stw 3, 0(31)
#MCP Progress
mr 3, 30
mr 4, 31
nop
cmpwi 3, 0
bne error
lwz 3, 0(31)
cmpwi 3, 0
bne loop
#MCPGetLastError
nop
cmpwi 3, 0
bne error_title
# "Install OK"
nop
nop
b print
error:
#MCPGetLastError
nop
error_title:
mr 6, 3
addi 3, 1, 0x40
li 4, 0x20
nop
nop
#
nop
addi 3, 1, 0x40
print:
nop
end:
lwz 28, 8(1)
lwz 29, 0xC(1)
lwz 0, 0x1C(1)
lwz 30, 0x10(1)
mtlr 0
lwz 31, 0x14(1)
addi 1, 1, 0x18
blr