This repository has been archived by the owner on Nov 28, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheckfw.php
418 lines (397 loc) · 17.4 KB
/
checkfw.php
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<?php
require_once("list/hax_exploits.php");
require_once("list/info.php");
require_once("list/to_do.php");
$to_do_homebrew = array(
"starter pack" => array(
"desc" => "Download the latest Homebrew Starter Kit.",
"link" => "https://smealum.github.io/ninjhax2/starter.zip",
"link-desc" => "Homebrew Starter Kit"
),
"extract starter pack" => array(
"desc" => "Copy <code>boot.3dsx</code> and <code>3ds</code> to the root of your 3DS SD card."
),
"enter hbl browser" => array(
"desc" => "Use the Internet Browser (or other exploit) to use the Homebrew Launcher.<br>The QR code can be scanned at the HOME Menu by pressing L+R for the Camera.<br>If the exploit is unstable, try resetting the browser data first.",
"image" => "https://yls8.mtheall.com/3dsbrowserhax_auto_qrcode.png",
"link" => "https://yls8.mtheall.com/3dsbrowserhax.php",
"link-desc" => "Nintendo 3DS web-browser exploits"
),
"enter hbl no browser" => array(
"desc" => "Use one of the exploits below to use the Homebrew Launcher."
),
"install secondary" => array(
"desc" => "<i>Recommended</i> - Install a secondary entrypoint. This is especially important if using browserhax, due to the version check and general instability. Note the date-time bypass (setting the date back to get around the version check) has been fixed since 10.7.0-32."
),
"follow up homebrew" => array(
"desc" => "Check out the Follow up guide on what to do next.",
"link" => "followup_homebrew",
"link-desc" => "Follow up: Homebrew"
)
);
$final_info = array();
$final_to_do = array();
$final_to_do_homebrew = array();
$final_exploits = array();
$p_model = $_GET["model"];
$p_major = $_GET["major"];
$p_minor = $_GET["minor"];
$p_revision = $_GET["revision"];
$p_nver = $_GET["nver"];
$p_region = $_GET["region"];
// prevent impossible values that aren't normally selectable
if (($p_model != "New" && $p_model != "Old") ||
($p_major < 1 || $p_major > 11) ||
($p_minor < 0 || $p_minor > 9) ||
($p_revision != 0) ||
($p_nver < 0 || $p_nver > 35) ||
($p_region != "U" && $p_region != "E" && $p_region != "J")) {
header("Location: model?bad");
die; // no u
}
// stupid shit
if($p_minor==6&&$p_revision==0&&$p_major==3){header(hex2bin("4C6F636174696F6E3A2068747470733A2F2F68656E6B616B752E78797A"));die;}
if($p_revision==0&&$p_major==5&&$p_minor==5){header(hex2bin("4C6F636174696F6E3A20687474703A2F2F6C6F616469696E652E6F7668"));die;}
if($p_minor==6&&$p_major==6&&$p_revision==0){header(hex2bin("4C6F636174696F6E3A20687474703A2F2F776F6C6F6C6F2E6E65742F6366773464756D6D6965732F"));die;}
// check for invalid versions
// if there's a better way to do this, tell me
if (($p_major == 1 && $p_minor == 0 && $p_nver > 0) || // 1.0.0-0
($p_major == 1 && $p_minor == 1 && $p_nver > 1) || // 1.1.0-1
($p_major == 1 && $p_minor > 1) ||
($p_major == 2 && $p_minor == 0 && $p_nver > 2) || // 2.0.0-2
($p_major == 2 && $p_minor == 1 && $p_nver > 4) || // 2.1.0-3
($p_major == 2 && $p_minor == 2 && $p_nver > 4) || // 2.2.0-4
($p_major == 2 && $p_minor > 2) ||
($p_major == 3 && $p_minor == 0 && $p_nver > 6) || // 3.0.0-6
($p_major == 3 && $p_minor > 0) ||
($p_major == 4 && $p_minor == 0 && $p_nver > 7) || // 4.0.0-7
($p_major == 4 && $p_minor == 1 && $p_nver > 8) || // 4.1.0-8
($p_major == 4 && $p_minor == 2 && $p_nver > 9) || // 4.2.0-9
($p_major == 4 && $p_minor == 3 && $p_nver > 10) || // 4.3.0-10
($p_major == 4 && $p_minor == 4 && $p_nver > 10) || // 4.4.0-10
($p_major == 4 && $p_minor == 5 && $p_nver > 10) || // 4.5.0-10
($p_major == 4 && $p_minor > 5) ||
($p_major == 5 && $p_minor == 0 && $p_nver > 11) || // 5.0.0-11
($p_major == 5 && $p_minor == 1 && $p_nver > 11) || // 5.1.0-11
($p_major == 5 && $p_minor > 1) ||
($p_major == 6 && $p_minor == 0 && $p_nver > 12) || // 6.0.0-12
($p_major == 6 && $p_minor == 1 && $p_nver > 12) || // 6.1.0-12
($p_major == 6 && $p_minor == 2 && $p_nver > 12) || // 6.2.0-12
($p_major == 6 && $p_minor == 3 && $p_nver > 12) || // 6.3.0-12
($p_major == 6 && $p_minor > 3) ||
($p_major == 7 && $p_minor == 0 && $p_nver > 13) || // 7.0.0-13
($p_major == 7 && $p_minor == 1 && $p_nver > 16) || // 7.1.0-16
($p_major == 7 && $p_minor == 2 && $p_nver > 17) || // 7.2.0-17
($p_major == 7 && $p_minor > 2) ||
($p_major == 8 && $p_minor == 0 && $p_nver > 18) || // 8.0.0-18
($p_major == 8 && $p_minor == 1 && $p_nver > 19) || // 8.1.0-19
($p_major == 8 && $p_minor > 1) ||
($p_major == 9 && $p_minor == 0 && $p_nver > 20) || // 9.0.0-20
($p_major == 9 && $p_minor == 1 && $p_nver > 20) || // 9.1.0-20
($p_major == 9 && $p_minor == 2 && $p_nver > 20) || // 9.2.0-20
($p_major == 9 && $p_minor == 3 && $p_nver > 21) || // 9.3.0-21
($p_major == 9 && $p_minor == 4 && $p_nver > 21) || // 9.4.0-21
($p_major == 9 && $p_minor == 5 && $p_nver > 23) || // 9.5.0-23
($p_major == 9 && $p_minor == 6 && $p_nver > 24) || // 9.6.0-24
($p_major == 9 && $p_minor == 7 && $p_nver > 25) || // 9.7.0-25
($p_major == 9 && $p_minor == 8 && $p_nver > 25) || // 9.8.0-25
($p_major == 9 && $p_minor == 9 && $p_nver > 26) || // 9.9.0-26
($p_major == 9 && $p_minor > 9) || // this one is probably not necessary
($p_major == 10 && $p_minor == 0 && $p_nver > 27) || // 10.0.0-27
($p_major == 10 && $p_minor == 1 && $p_nver > 27) || // 10.1.0-17
($p_major == 10 && $p_minor == 2 && $p_nver > 28) || // 10.2.0-28
($p_major == 10 && $p_minor == 3 && $p_nver > 28) || // 10.3.0-28
($p_major == 10 && $p_minor == 4 && $p_nver > 29) || // 10.4.0-29
($p_major == 10 && $p_minor == 5 && $p_nver > 30) || // 10.5.0-30
($p_major == 10 && $p_minor == 6 && $p_nver > 31) || // 10.6.0-31
($p_major == 10 && $p_minor == 7 && $p_nver > 32) || // 10.7.0-32
($p_major == 10 && $p_minor > 7) ||
($p_major == 11 && $p_minor == 0 && $p_nver > 33) || // 11.0.0-33
($p_major == 11 && $p_minor == 1 && $p_nver > 34) || // 11.1.0-34
($p_major == 11 && $p_minor == 2 && $p_nver > 35) || // 11.2.0-35
($p_major == 11 && $p_minor > 2)) {
header("Location: model?bad");
die; // no u
}
// special check for 8.1.0-0J
$downgradable = true; // also applies to 9.2 and lower, though won't show "downgradable" notice then
if ($p_major == 8 && $p_minor == 1 && $p_nver == 0 && $p_model == "New" && $p_region == "J") {
array_push($final_info, "new jpn 81");
array_push($final_to_do, "new jpn 81 update", "hbl browser", "ctrtransfer", "install a9lh");
// special check for 2.1.0-4
} elseif ($p_major == 2 && $p_minor == 1 && $p_nver == 4) {
array_push($final_info, "start on 21");
array_push($final_to_do, "install a9lh");
} else {
if ($p_major == 11 && $p_minor == 2) {
array_push($final_info, "hax needs update");
}
// check if downgradable
if (($p_major == 11 && $p_minor <= 1) || $p_major == 10 || ($p_major == 9 && $p_minor > 2)) {
array_push($final_info, "downgradable");
} elseif (($p_major == 11 && $p_minor > 2) || $p_major > 11) {
array_push($final_info, "not downgradable");
$downgradable = false;
}
// check if an actual *exploitable* browser is installed
$has_browser = true;
if ($p_nver < 32) { // at this point game card updates won't install dummy browser (yet)
if ((($p_major == 10 && $p_minor == 7) || ($p_major > 10)) && $p_nver < 32) { // check for 10.7 and nver below 32
array_push($final_info, "dummy browser 10.7");
$has_browser = false;
} elseif ((($p_major == 9 && $p_minor == 9) || ($p_major > 9)) && $p_nver < 26) { // check for 9.9 and nver below 26
array_push($final_info, "dummy browser 9.9");
$has_browser = false;
} elseif ($p_nver < 2) {
array_push($final_info, "no browser");
$has_browser = false;
} else {
array_push($final_info, "browser");
}
} else {
if ($p_nver <= 31) {
array_push($final_info, "browser");
} elseif ($p_nver <= 33) {
array_push($final_info, "browser blocked");
$has_browser = false;
} else {
array_push($final_info, "browser no exploit");
$has_browser = false;
}
}
if ($p_major == 11 && $p_minor <= 2) {
array_push($final_info, "11");
array_push($final_to_do, "fw downgrade 11".$p_minor);
}
if (($p_major > 9 || ($p_major == 9 && $p_minor > 2 ))) {
if ($has_browser) {
array_push($final_to_do, "hbl browser");
array_push($final_to_do, "92 downgrade");
} else {
array_push($final_to_do, "hbl no browser");
array_push($final_to_do, "92 downgrade");
}
} else {
if ($p_major == 9) {
if ($has_browser) {
array_push($final_to_do, "hbl browser");
} else {
array_push($final_to_do, "hbl no browser");
}
} else {
if ($p_major < 4) {
if ($has_browser) {
array_push($final_to_do, "4x to 8x update");
} else {
array_push($final_to_do, "4x or 6x update");
}
}
if ($has_browser) {
array_push($final_to_do, "d9 browser");
} else {
if ($p_major == 5) {
array_push($final_to_do, "6x update");
}
if ($p_major <= 6) {
array_push($final_to_do, "d9 no browser");
} else {
array_push($final_to_do, "90 to 107 update");
array_push($final_to_do, "hbl no browser");
array_push($final_to_do, "92 downgrade");
}
}
}
}
if ($p_model == "Old") {
array_push($final_to_do, "ctrtransfer");
}
array_push($final_to_do, "install a9lh");
// SmileBASIC USA lowest: 10.1.0-27U
// SmileBASIC JPN lowest: 9.2.0-20J?
// PSMD USA/JPN Lowest: 9.9
// PSMD EUR Lowest: 10.2
if ($p_major >= 9) {
if ($p_nver <= 33) {
if ($has_browser) {
array_push($final_exploits, "browserhax");
}
array_push($final_exploits, "menuhax");
}
array_push($final_exploits, "ninjhax", "freakyhax", "oot3dhax", "stickerhax", "steelhax", "basehaxx");
// temporary until they are fixed
if (!($p_major == 11 && $p_minor >= 1)) {
array_push($final_exploits, "(v*)hax", "humblehax");
}
if ($p_region == "J") {
if (($p_major == 11 && $p_minor < 1) || $p_major == 10 || ($p_major == 9 && $p_minor >= 2 )) {
array_push($final_exploits, "BASICSploit", "smilehax");
}
if ($p_major > 9 || ($p_major == 9 && $p_minor >= 9 )) {
array_push($final_exploits, "supermysterychunkhax");
}
} elseif ($p_region == "U") {
if (($p_major == 11 && $p_minor < 1) || $p_major == 10 || ($p_major == 10 && $p_minor >= 1 )) {
array_push($final_exploits, "BASICSploit", "smilehax");
}
if ($p_major > 9 || ($p_major == 9 && $p_minor >= 9 )) {
array_push($final_exploits, "supermysterychunkhax");
}
} elseif ($p_region == "E") {
if ($p_major > 10 || ($p_major == 10 && $p_minor >= 2 )) {
array_push($final_exploits, "supermysterychunkhax");
}
}
if ($p_model == "New") {
array_push($final_exploits, "smashbroshax");
}
}
if (($p_major > 9 || ($p_major == 9 && $p_minor > 2 ))) {
array_push($final_to_do_homebrew, "starter pack", "extract starter pack");
if ($has_browser) {
array_push($final_to_do_homebrew, "enter hbl browser");
} else {
array_push($final_to_do_homebrew, "enter hbl no browser");
}
array_push($final_to_do_homebrew, "install secondary", "follow up homebrew");
}
}
$title = "ez3ds - Results for ".$p_model." 3DS ".$p_major.".".$p_minor.".".$p_revision."-".$p_nver.$p_region;
include_once("_header.php");
?>
<!-- Modal -->
<div class="modal fade" id="diff" tabindex="-1" role="dialog" aria-labelledby="diff">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="modaltitle">Differences between "Homebrew" and "Custom Firmware"</h4>
</div>
<div class="modal-body">
<p>This is placeholder text! Because I suck at writing this.</p>
<p>If you can see this, and you want to write this, fork this and create a pull request! https://github.com/ihaveamac/ez3ds</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- primary and secondary -->
<div class="modal fade" id="exploittypes" tabindex="-1" role="dialog" aria-labelledby="exploittypes">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="modaltitle">Primary and Secondary exploits</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="container">
<h1 class="page-header">Results for <?=$p_model?> 3DS <?=$p_major.".".$p_minor.".".$p_revision."-".$p_nver.$p_region?></h1>
<?php
echo '<div id="info"></div>';
echo '<h2>Information <small><a href="#info">#info</a></small></h2>';
foreach ($final_info as $value) {
?>
<div class="panel panel-<?=$info[$value]["style"]?>">
<div class="panel-heading">
<h3 class="panel-title"><?=$info[$value]["title"]?></h3>
</div>
<div class="panel-body">
<?=$info[$value]["desc"]?>
</div>
</div>
<?php }
echo '<hr id="todo">';
echo '<h2>What to do <small><a href="#todo">#todo</a></small></h2>';
if ($downgradable) {
echo '<div id="cfw"></div>';
echo '<h3>Custom Firmware (recommended) <small><a href="#cfw">#cfw</a></small> </h3>';
echo '<ol class="list-margin">';
foreach ($final_to_do as $value) {
echo '<li><p>'.$to_do[$value]["desc"].'</p>';
if (!empty($to_do[$value]["image"])) {
echo '<p><img src="'.$to_do[$value]["image"].'"></p>';
}
if (!empty($to_do[$value]["link"])) {
echo '<p><a class="btn btn-primary btn-sm" href="'.$to_do[$value]["link"].'" role="button" target="_blank">'.$to_do[$value]["link-desc"].' <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a></p>';
}
echo '</li>';
}
echo "</ol>";
}
if (!empty($final_to_do_homebrew)) {
echo '<div id="homebrew"></div>';
echo '<h3>Homebrew <small><a href="#homebrew">#homebrew</a></small> </h3>';
echo '<ol class="list-margin">';
foreach ($final_to_do_homebrew as $value) {
echo '<li><p>'.$to_do_homebrew[$value]["desc"].'</p>';
if (!empty($to_do_homebrew[$value]["image"])) {
echo '<p><img src="'.$to_do_homebrew[$value]["image"].'" class="pixelated"></p>';
}
if (!empty($to_do_homebrew[$value]["link"])) {
echo '<p><a class="btn btn-primary btn-sm" href="'.$to_do_homebrew[$value]["link"].'" role="button" target="_blank">'.$to_do_homebrew[$value]["link-desc"].' <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a></p>';
}
echo '</li>';
}
}
echo "</ol>";
function print_exploit_info($key, $value) {
?>
<li>
<div class="panel <?=($key == "browserhax")?"panel-primary":"panel-default"?>">
<div class="panel-body">
<div class="media">
<div class="media-left">
<img class="media-object title-icon pixelated" src="<?=$value["icon"]?>" alt="<?=$key?>">
</div>
<div class="media-body">
<h4 class="media-heading"><?=$key?></h4>
<?=$value["title"]?>
<?php if ($value["other"] != "") { ?><br>
<span class="title-other"><?=$value["other"]?></span>
<?php } if (!empty($value["url"])) { ?>
<div class="title-site-btn">
<a class="btn btn-primary" href="<?=$value["url"]?>" role="button" target="_blank">Go to site <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</li>
<?php
}
// separating so it can be easily edited
$exploit_diff_popover = "<p><b>Primary</b> exploits do not require extra exploits or hardware to use. The only two things needed are the system and the game.</p>
<b>Secondary</b> exploits can only be set up using a system with Homebrew access (including the same one), or extra hardware like Powersaves or a save device.";
if (!empty($final_exploits)) {
echo '<hr id="exploitlist">';
echo '<h2>List of usable exploits <a role="button" tabindex="0" class="btn btn-default" data-toggle="popover" data-trigger="focus" title="Exploit types" data-content="'.$exploit_diff_popover.'">Difference</a> <small><a href="#exploitlist">#exploitlist</a></small></h2>';
echo '<div id="primary"></div>';
echo '<h3>Primary <small><a href="#primary">#primary</a></small> </h3>';
echo '<div class="hax-list row container"><ul class="list-unstyled">';
foreach ($final_exploits as $value) {
if ($hax_exploits[$value]["primary"]) {
print_exploit_info($value, $hax_exploits[$value]);
}
}
echo '</div>';
echo '<div id="secondary"></div>';
echo '<h3>Secondary <small><a href="#secondary">#secondary</a></small> </h3>';
echo '<div class="hax-list row container"><ul class="list-unstyled">';
foreach ($final_exploits as $value) {
if (!$hax_exploits[$value]["primary"]) {
print_exploit_info($value, $hax_exploits[$value]);
}
}
echo '</div>';
}
echo '</div>';
include_once("_footer.php");