├── .gitmodules
├── LICENSE
├── Makefile
├── README.md
├── agentunderfire_crc
├── build.bat
└── main.c
└── exploit
├── 007.c
├── 007.ld
├── Makefile
├── agentunderfire_crc.exe
├── gciB1.bin
├── gw7d.hdr
├── gw7e_v100.hdr
├── gw7e_v101.hdr
├── gw7f.hdr
├── gw7p.hdr
├── head.b
└── start.S
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "loader"]
2 | path = loader
3 | url = https://github.com/FIX94/gc-exploit-common-loader.git
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Copyright 2016 FIX94
2 | # This code is licensed to you under the terms of the GNU GPL, version 2;
3 | # see file LICENSE or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
4 |
5 | all:
6 | @$(MAKE) --no-print-directory -C loader
7 | @mv -f loader/loader.h exploit/loader.h
8 | @$(MAKE) --no-print-directory -C exploit
9 | @mkdir -p gci
10 | @mv -f exploit/*.gci gci
11 |
12 | clean:
13 | @$(MAKE) --no-print-directory -C loader clean
14 | @$(MAKE) --no-print-directory -C exploit clean
15 | rm -rf gci
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 007-exploit-gc
2 | A gc exploit for 007 agent under fire, you only need a method of injecting the .gci onto your memory card.
3 | This exploit will load a boot.dol converted with dol2gci (included in Home Bros.) from your memory card.
--------------------------------------------------------------------------------
/agentunderfire_crc/build.bat:
--------------------------------------------------------------------------------
1 | gcc -Wall -O3 -s -static main.c -o agentunderfire_crc.exe
2 | pause
--------------------------------------------------------------------------------
/agentunderfire_crc/main.c:
--------------------------------------------------------------------------------
1 | // Copyright 2016 FIX94
2 | // This code is licensed to you under the terms of the GNU GPL, version 2;
3 | // see file LICENSE or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
4 |
5 | #include
6 | #include
7 |
8 | unsigned int table[256] =
9 | {
10 | 0x00000000, 0x09073096, 0x120E612C, 0x1B0951BA, 0xFF6DC419, 0xF66AF48F,
11 | 0xED63A535, 0xE46495A3, 0xFEDB8832, 0xF7DCB8A4, 0xECD5E91E, 0xE5D2D988,
12 | 0x01B64C2B, 0x08B17CBD, 0x13B82D07, 0x1ABF1D91, 0xFDB71064, 0xF4B020F2,
13 | 0xEFB97148, 0xE6BE41DE, 0x02DAD47D, 0x0BDDE4EB, 0x10D4B551, 0x19D385C7,
14 | 0x036C9856, 0x0A6BA8C0, 0x1162F97A, 0x1865C9EC, 0xFC015C4F, 0xF5066CD9,
15 | 0xEE0F3D63, 0xE7080DF5, 0xFB6E20C8, 0xF269105E, 0xE96041E4, 0xE0677172,
16 | 0x0403E4D1, 0x0D04D447, 0x160D85FD, 0x1F0AB56B, 0x05B5A8FA, 0x0CB2986C,
17 | 0x17BBC9D6, 0x1EBCF940, 0xFAD86CE3, 0xF3DF5C75, 0xE8D60DCF, 0xE1D13D59,
18 | 0x06D930AC, 0x0FDE003A, 0x14D75180, 0x1DD06116, 0xF9B4F4B5, 0xF0B3C423,
19 | 0xEBBA9599, 0xE2BDA50F, 0xF802B89E, 0xF1058808, 0xEA0CD9B2, 0xE30BE924,
20 | 0x076F7C87, 0x0E684C11, 0x15611DAB, 0x1C662D3D, 0xF6DC4190, 0xFFDB7106,
21 | 0xE4D220BC, 0xEDD5102A, 0x09B18589, 0x00B6B51F, 0x1BBFE4A5, 0x12B8D433,
22 | 0x0807C9A2, 0x0100F934, 0x1A09A88E, 0x130E9818, 0xF76A0DBB, 0xFE6D3D2D,
23 | 0xE5646C97, 0xEC635C01, 0x0B6B51F4, 0x026C6162, 0x196530D8, 0x1062004E,
24 | 0xF40695ED, 0xFD01A57B, 0xE608F4C1, 0xEF0FC457, 0xF5B0D9C6, 0xFCB7E950,
25 | 0xE7BEB8EA, 0xEEB9887C, 0x0ADD1DDF, 0x03DA2D49, 0x18D37CF3, 0x11D44C65,
26 | 0x0DB26158, 0x04B551CE, 0x1FBC0074, 0x16BB30E2, 0xF2DFA541, 0xFBD895D7,
27 | 0xE0D1C46D, 0xE9D6F4FB, 0xF369E96A, 0xFA6ED9FC, 0xE1678846, 0xE860B8D0,
28 | 0x0C042D73, 0x05031DE5, 0x1E0A4C5F, 0x170D7CC9, 0xF005713C, 0xF90241AA,
29 | 0xE20B1010, 0xEB0C2086, 0x0F68B525, 0x066F85B3, 0x1D66D409, 0x1461E49F,
30 | 0x0EDEF90E, 0x07D9C998, 0x1CD09822, 0x15D7A8B4, 0xF1B33D17, 0xF8B40D81,
31 | 0xE3BD5C3B, 0xEABA6CAD, 0xEDB88320, 0xE4BFB3B6, 0xFFB6E20C, 0xF6B1D29A,
32 | 0x12D54739, 0x1BD277AF, 0x00DB2615, 0x09DC1683, 0x13630B12, 0x1A643B84,
33 | 0x016D6A3E, 0x086A5AA8, 0xEC0ECF0B, 0xE509FF9D, 0xFE00AE27, 0xF7079EB1,
34 | 0x100F9344, 0x1908A3D2, 0x0201F268, 0x0B06C2FE, 0xEF62575D, 0xE66567CB,
35 | 0xFD6C3671, 0xF46B06E7, 0xEED41B76, 0xE7D32BE0, 0xFCDA7A5A, 0xF5DD4ACC,
36 | 0x11B9DF6F, 0x18BEEFF9, 0x03B7BE43, 0x0AB08ED5, 0x16D6A3E8, 0x1FD1937E,
37 | 0x04D8C2C4, 0x0DDFF252, 0xE9BB67F1, 0xE0BC5767, 0xFBB506DD, 0xF2B2364B,
38 | 0xE80D2BDA, 0xE10A1B4C, 0xFA034AF6, 0xF3047A60, 0x1760EFC3, 0x1E67DF55,
39 | 0x056E8EEF, 0x0C69BE79, 0xEB61B38C, 0xE266831A, 0xF96FD2A0, 0xF068E236,
40 | 0x140C7795, 0x1D0B4703, 0x060216B9, 0x0F05262F, 0x15BA3BBE, 0x1CBD0B28,
41 | 0x07B45A92, 0x0EB36A04, 0xEAD7FFA7, 0xE3D0CF31, 0xF8D99E8B, 0xF1DEAE1D,
42 | 0x1B64C2B0, 0x1263F226, 0x096AA39C, 0x006D930A, 0xE40906A9, 0xED0E363F,
43 | 0xF6076785, 0xFF005713, 0xE5BF4A82, 0xECB87A14, 0xF7B12BAE, 0xFEB61B38,
44 | 0x1AD28E9B, 0x13D5BE0D, 0x08DCEFB7, 0x01DBDF21, 0xE6D3D2D4, 0xEFD4E242,
45 | 0xF4DDB3F8, 0xFDDA836E, 0x19BE16CD, 0x10B9265B, 0x0BB077E1, 0x02B74777,
46 | 0x18085AE6, 0x110F6A70, 0x0A063BCA, 0x03010B5C, 0xE7659EFF, 0xEE62AE69,
47 | 0xF56BFFD3, 0xFC6CCF45, 0xE00AE278, 0xE90DD2EE, 0xF2048354, 0xFB03B3C2,
48 | 0x1F672661, 0x166016F7, 0x0D69474D, 0x046E77DB, 0x1ED16A4A, 0x17D65ADC,
49 | 0x0CDF0B66, 0x05D83BF0, 0xE1BCAE53, 0xE8BB9EC5, 0xF3B2CF7F, 0xFAB5FFE9,
50 | 0x1DBDF21C, 0x14BAC28A, 0x0FB39330, 0x06B4A3A6, 0xE2D03605, 0xEBD70693,
51 | 0xF0DE5729, 0xF9D967BF, 0xE3667A2E, 0xEA614AB8, 0xF1681B02, 0xF86F2B94,
52 | 0x1C0BBE37, 0x150C8EA1, 0x0E05DF1B, 0x0702EF8D,
53 | } ;
54 |
55 | static inline unsigned int ppcmask(unsigned int mb, unsigned int me)
56 | {
57 | unsigned int maskmb = ~0u >> mb;
58 | unsigned int maskme = ~0u << (31 - me);
59 | return (mb <= me) ? maskmb & maskme : maskmb | maskme;
60 | }
61 |
62 | static inline unsigned int rotl32(unsigned int x, unsigned int amount)
63 | {
64 | return (x << amount) | (x >> ((32 - amount) & 31));
65 | }
66 |
67 | static inline unsigned int __rlwinm(unsigned int rs, unsigned int sh, unsigned int mb, unsigned int me)
68 | {
69 | return rotl32(rs, sh) & ppcmask(mb, me);
70 | }
71 |
72 | static inline unsigned int __extrwi(unsigned int rs, unsigned int mb, unsigned int me)
73 | {
74 | return __rlwinm(rs, mb+me, 32-mb, 31);
75 | }
76 |
77 | int main(int argc, char *argv[])
78 | {
79 | if(argc != 2) return 0;
80 | FILE *f = fopen(argv[1],"rb");
81 | fseek(f,0,SEEK_END);
82 | size_t fsize = ftell(f);
83 | if(fsize != 0x6040)
84 | {
85 | puts("No AUF gci!");
86 | fclose(f);
87 | return 0;
88 | }
89 | rewind(f);
90 | unsigned char *buf = malloc(fsize);
91 | fread(buf,fsize,1,f);
92 | fclose(f);
93 |
94 | int sum = -1;
95 | unsigned int chkArea = 0x1690;
96 |
97 | size_t i;
98 | for(i = 0x48A4; i < 0x48A4+chkArea; i++)
99 | {
100 | unsigned short tblIdx = sum&0xFF;
101 | sum >>= 8;
102 | sum ^= table[tblIdx^buf[i]];
103 | }
104 | unsigned short wSum = __extrwi(sum, 16, 13) & 0xFFFF;
105 |
106 | wSum = __builtin_bswap16(wSum);
107 |
108 | memcpy(buf+0x46, &wSum, 2);
109 | f = fopen(argv[1],"wb");
110 | fwrite(buf,0x6040,1,f);
111 | fclose(f);
112 | free(buf);
113 | return 0;
114 | }
--------------------------------------------------------------------------------
/exploit/007.c:
--------------------------------------------------------------------------------
1 | // Copyright 2016 FIX94
2 | // This code is licensed to you under the terms of the GNU GPL, version 2;
3 | // see file LICENSE or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
4 |
5 | #include "loader.h"
6 |
7 | #define TO_ARAM 0
8 | #define TO_MRAM 1
9 |
10 | typedef unsigned int u32;
11 | typedef unsigned short u16;
12 | typedef unsigned char u8;
13 | typedef volatile unsigned int vu32;
14 | typedef volatile unsigned short vu16;
15 |
16 | typedef struct _cInfo
17 | {
18 | int chan;
19 | int fnum;
20 | int offset;
21 | int length;
22 | u16 block;
23 | } cInfo;
24 |
25 | static void sync_cache(void *p, u32 n)
26 | {
27 | u32 start, end;
28 |
29 | start = (u32)p & ~31;
30 | end = ((u32)p + n + 31) & ~31;
31 | n = (end - start) >> 5;
32 |
33 | while (n--) {
34 | asm("dcbst 0,%0 ; icbi 0,%0" : : "b"(p));
35 | p += 32;
36 | }
37 | asm("sync ; isync");
38 | }
39 |
40 | void *_memcpy(void *ptr, const void *src, int size)
41 | {
42 | char* ptr2 = ptr;
43 | const char* src2 = src;
44 | while(size--) *ptr2++ = *src2++;
45 | return ptr;
46 | }
47 |
48 | void ar_dma(u32 type, u32 mram, u32 aram, u32 len)
49 | {
50 | *(vu16*)0xCC005020 = (mram>>16);
51 | *(vu16*)0xCC005022 = (mram&0xFFFF);
52 | *(vu16*)0xCC005024 = (aram>>16);
53 | *(vu16*)0xCC005026 = (aram&0xFFFF);
54 | *(vu16*)0xCC005028 = (type<<15)|(len>>16);
55 | *(vu16*)0xCC00502A = (len&0xFFFF);
56 | while(*(vu16*)0xCC00500A & 0x200) ;
57 | }
58 |
59 | void __attribute__ ((noreturn)) _main()
60 | {
61 | char *gameid = (char *)0x80000000;
62 | void (*card_sync_cb)();
63 | int (*card_sync)(int chan);
64 | int (*card_mountasync)(int chan, void* workArea, void *cb1, void *cb2);
65 | int (*card_unmount)(int chan);
66 | int (*card_open)(int chan, const char *path, cInfo *inf);
67 | int (*card_close)(cInfo *inf);
68 | int (*card_readasync)(cInfo *inf, void* addr, int length, int offset, void *cb);
69 | void (*gx_drawdone)(void);
70 | void (*os_stopaudiosystem)(void);
71 |
72 | switch (gameid[3]) {
73 | case 'D':
74 | case 'P':
75 | card_sync_cb = (void*)0x801E5CD8;
76 | card_sync = (void*)0x801E6F3C;
77 | card_mountasync = (void*)0x801EA1A4;
78 | card_unmount = (void*)0x801EA3E0;
79 | card_open = (void*)0x801EAEF0;
80 | card_close = (void*)0x801EB068;
81 | card_readasync = (void*)0x801EB6FC;
82 | gx_drawdone = (void*)0x801F3C54;
83 | os_stopaudiosystem = (void*)0x801FE958;
84 | break;
85 | case 'E':
86 | if(gameid[7] == 0) //V1.00
87 | {
88 | card_sync_cb = (void*)0x801E5AF0;
89 | card_sync = (void*)0x801E6D54;
90 | card_mountasync = (void*)0x801E9FBC;
91 | card_unmount = (void*)0x801EA1F8;
92 | card_open = (void*)0x801EAD08;
93 | card_close = (void*)0x801EAE80;
94 | card_readasync = (void*)0x801EB514;
95 | gx_drawdone = (void*)0x801F3A6C;
96 | os_stopaudiosystem = (void*)0x801FE790;
97 | }
98 | else //V1.01
99 | {
100 | card_sync_cb = (void*)0x801E5C10;
101 | card_sync = (void*)0x801E6E74;
102 | card_mountasync = (void*)0x801EA0DC;
103 | card_unmount = (void*)0x801EA318;
104 | card_open = (void*)0x801EAE28;
105 | card_close = (void*)0x801EAFA0;
106 | card_readasync = (void*)0x801EB634;
107 | gx_drawdone = (void*)0x801F3B8C;
108 | os_stopaudiosystem = (void*)0x801FE8B0;
109 | }
110 | break;
111 | case 'F':
112 | card_sync_cb = (void*)0x801E5A08;
113 | card_sync = (void*)0x801E6C6C;
114 | card_mountasync = (void*)0x801E9ED4;
115 | card_unmount = (void*)0x801EA110;
116 | card_open = (void*)0x801EAC20;
117 | card_close = (void*)0x801EAD98;
118 | card_readasync = (void*)0x801EB42C;
119 | gx_drawdone = (void*)0x801F3984;
120 | os_stopaudiosystem = (void*)0x801FE688;
121 | break;
122 | default:
123 | for (;;)
124 | ;
125 | }
126 | //prevent BEEPing
127 | os_stopaudiosystem();
128 | gx_drawdone();
129 | //game id DOLX00 for boot.dol
130 | *(volatile u32*)0x80000000 = 0x444F4C58;
131 | *(volatile u16*)0x80000004 = 0x3030;
132 | sync_cache((void*)0x80000000, 6);
133 | //re-mount the memory card
134 | if(card_mountasync(0, (void*)0x81700000, (void*)0, card_sync_cb) >= 0) card_sync(0);
135 | //open up boot.dol from memory card
136 | cInfo mInf;
137 | card_open(0, "boot.dol", &mInf);
138 | u32 curOffset = 0;
139 | //copy until it returns error
140 | while((card_readasync(&mInf, (void*)0x80001800, 0x200, curOffset, card_sync_cb) == 0) && (card_sync(0) == 0))
141 | {
142 | sync_cache((void*)0x80001800, 0x200);
143 | ar_dma(TO_ARAM, 0x1800, curOffset, 0x200);
144 | curOffset += 0x200;
145 | }
146 | //we are done
147 | card_close(&mInf);
148 | card_unmount(0);
149 | //copy our loader into mem
150 | _memcpy((void*)0x80001800, loader, loader_size);
151 | sync_cache((void*)0x80001800, loader_size);
152 | //jump to it
153 | __asm__ volatile(
154 | "lis 3, 0x8000\n"
155 | "ori 3, 3, 0x1800\n"
156 | "mtlr 3\n"
157 | "blr\n"
158 | );
159 | __builtin_unreachable();
160 | }
161 |
--------------------------------------------------------------------------------
/exploit/007.ld:
--------------------------------------------------------------------------------
1 | /* Copyright 2016 FIX94
2 | This code is licensed to you under the terms of the GNU GPL, version 2;
3 | see file LICENSE or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt */
4 |
5 | OUTPUT_FORMAT("elf32-powerpc")
6 | OUTPUT_ARCH(powerpc:common)
7 |
8 | SECTIONS {
9 | .exploit baddr :
10 | {
11 | gw7*.o(.start)
12 | *(.text)
13 | *(.rodata .rodata.*)
14 | *(.data)
15 | *(.bss)
16 | . = 0x179C;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/exploit/Makefile:
--------------------------------------------------------------------------------
1 | # Copyright 2016 FIX94
2 | # This code is licensed to you under the terms of the GNU GPL, version 2;
3 | # see file LICENSE or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
4 |
5 |
6 | # Configuration:
7 |
8 | # What toolchain prefix should we use
9 | CROSS ?= powerpc-eabi-
10 |
11 | ifeq ($(OS),Windows_NT)
12 | FIXCRC = $(CURDIR)/agentunderfire_crc.exe
13 | else
14 | FIXCRC = $(CURDIR)/agentunderfire_crc
15 | endif
16 |
17 | # End of configuration.
18 |
19 |
20 |
21 | # Set CC, LD, OBJCOPY based on CROSS, unless they are set already
22 |
23 | ifeq ($(origin CC), default)
24 | CC := $(CROSS)gcc -m32
25 | endif
26 | ifeq ($(origin LD), default)
27 | LD := $(CROSS)ld
28 | endif
29 | OBJCOPY ?= $(CROSS)objcopy
30 |
31 |
32 | # The compiler flags we need.
33 |
34 | CFLAGS := -Wall -W -O1 -ffreestanding -mno-eabi -mno-sdata -mcpu=750
35 |
36 |
37 | # Build with "V=1" to see the commands executed; be quiet otherwise.
38 |
39 | ifeq ($(V),1)
40 | Q :=
41 | else
42 | Q := @
43 | MAKEFLAGS += --no-print-directory
44 | endif
45 |
46 |
47 | targets := gw7d.gci gw7e_v100.gci gw7e_v101.gci gw7f.gci gw7p.gci
48 | targets-short := gw7d gw7e_v100 gw7e_v101 gw7f gw7p
49 |
50 | objs := 007.o
51 |
52 | all: $(targets)
53 |
54 | $(targets): %.gci : %.dat %.hdr
55 | @echo " OUTPUT $@"
56 | $(Q)dd if=$(filter %.hdr,$^) of=$@ bs=1 count=164 2>/dev/null
57 | $(Q)dd if=gciB1.bin of=$@ bs=1 seek=164 count=18432 2>/dev/null
58 | $(Q)dd if=$(filter %.dat,$^) of=$@ bs=1 seek=18596 count=6044 2>/dev/null
59 | $(Q)$(FIXCRC) $@
60 |
61 | dats := gw7d.dat gw7e_v100.dat gw7e_v101.dat gw7f.dat gw7p.dat
62 |
63 | $(dats): %.dat: %.elf
64 | @echo " OBJCOPY $@"
65 | $(Q)$(OBJCOPY) -Obinary $< $@
66 |
67 | elfs := $(dats:.dat=.elf)
68 |
69 | gw7d.elf: baddr := 0x8035B330
70 | gw7e_v100.elf: baddr := 0x8035A8F0
71 | gw7e_v101.elf: baddr := 0x8035A9F0
72 | gw7f.elf: baddr := 0x8035B470
73 | gw7p.elf: baddr := 0x8035ABB0
74 |
75 | $(elfs): %.elf: 007.ld %.o $(objs)
76 | @echo " LINK $@"
77 | $(Q)$(LD) --defsym baddr=$(baddr) -T $^ -o $@
78 |
79 | exploit-objs := $(elfs:.elf=.o)
80 |
81 | $(exploit-objs): %.o: start.S head.b
82 | @echo " ASSEMBLE $@"
83 | $(Q)$(CC) $(CFLAGS) -c $< -o $@
84 |
85 | %.o: %.c
86 | @echo " COMPILE $@"
87 | $(Q)$(CC) $(CFLAGS) -c $< -o $@
88 |
89 | clean:
90 | -rm -f $(targets) $(saves) $(elfs) $(exploit-objs) $(objs) $(slots) $(dats) loader.h
91 |
--------------------------------------------------------------------------------
/exploit/agentunderfire_crc.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FIX94/007-exploit-gc/4cdc29a12f708338ef39493587fdecdc0e6a5b8b/exploit/agentunderfire_crc.exe
--------------------------------------------------------------------------------
/exploit/gciB1.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FIX94/007-exploit-gc/4cdc29a12f708338ef39493587fdecdc0e6a5b8b/exploit/gciB1.bin
--------------------------------------------------------------------------------
/exploit/gw7d.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FIX94/007-exploit-gc/4cdc29a12f708338ef39493587fdecdc0e6a5b8b/exploit/gw7d.hdr
--------------------------------------------------------------------------------
/exploit/gw7e_v100.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FIX94/007-exploit-gc/4cdc29a12f708338ef39493587fdecdc0e6a5b8b/exploit/gw7e_v100.hdr
--------------------------------------------------------------------------------
/exploit/gw7e_v101.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FIX94/007-exploit-gc/4cdc29a12f708338ef39493587fdecdc0e6a5b8b/exploit/gw7e_v101.hdr
--------------------------------------------------------------------------------
/exploit/gw7f.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FIX94/007-exploit-gc/4cdc29a12f708338ef39493587fdecdc0e6a5b8b/exploit/gw7f.hdr
--------------------------------------------------------------------------------
/exploit/gw7p.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FIX94/007-exploit-gc/4cdc29a12f708338ef39493587fdecdc0e6a5b8b/exploit/gw7p.hdr
--------------------------------------------------------------------------------
/exploit/head.b:
--------------------------------------------------------------------------------
1 | Version 1.07
--------------------------------------------------------------------------------
/exploit/start.S:
--------------------------------------------------------------------------------
1 | // Copyright 2016 FIX94
2 | // This code is licensed to you under the terms of the GNU GPL, version 2;
3 | // see file LICENSE or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
4 |
5 | .section .start,"ax"
6 |
7 | // Uninteresting stuff.
8 | .incbin "head.b"
9 |
10 | 0: // get to corrupted LR
11 | .fill 0x44,4,0x3CF3CF3D
12 |
13 | // Our start address
14 | .long start
15 |
16 | // Needed to not get into crashes
17 | .fill 0x17B,4,0x3CF3CF3D
18 |
19 | // Align things properly -- there's code after this.
20 | .balign 4,0
21 |
22 | start:
23 | // Disable interrupts
24 | mfmsr 3 ; rlwinm 3,3,0,17,15 ; mtmsr 3 ; isync
25 |
26 | // Set up a stack frame.
27 | lis 1,0x8170 ; li 0,0 ; stwu 0,-64(1)
28 |
29 | // Go for it!
30 | b _main
31 |
--------------------------------------------------------------------------------