-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
123 lines (106 loc) · 5.11 KB
/
index.html
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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"></script>
<link href="lib/jsoneditor/jsoneditor.min.css" rel="stylesheet" type="text/css">
<script src="lib/jsoneditor/jsoneditor.min.js"></script>
<script src="lib/crypto.js" type="text/javascript" charset="utf-8"></script>
<style>
html { font-size: 14px; }
.accordion-button.collapsed { background-color: var(--bs-accordion-active-bg); }
#xeditorContainer { display: none; }
</style>
</head>
<body>
<div class="container p-4">
<main>
<h1>CrossCode Save Decryptor/Editor</h1>
<div class="mb-3">
<div class="accordion mb-3" id="infoAccordion">
<div class="accordion-item">
<h2 class="accordion-header" id="infoHeading">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#info1" aria-expanded="false" aria-controls="info1"><i class="bi bi-info-circle"></i> Info</button>
</h2>
<div id="info1" class="accordion-collapse collapse" aria-labelledby="infoHeading" data-bs-parent="#infoAccordion">
<div class="accordion-body">
<p>Basic details of the CrossCode save game location and format can be found here:
<a href="https://crosscode.fandom.com/wiki/Savegame">https://crosscode.fandom.com/wiki/Savegame</a></p>
<p>CrossCode save games are located in the cc.save file in these locations:</p>
<table class="table table-bordered table-sm">
<thead>
<tr>
<th>OS</th>
<th>Path</th>
</tr>
</thead>
<tbody>
<tr>
<td>MacOS</td>
<td>~/Library/Application Support/CrossCode/Default/cc.save</td>
</tr>
<tr>
<td>Linux</td>
<td>~/.config/CrossCode/Default/cc.save</td>
</tr>
<tr>
<td>Windows</td>
<td>%LOCALAPPDATA%\CrossCode\cc.save</td>
</tr>
<tr>
<td>Windows (Microsoft Store/Xbox Game Pass)</td>
<td>%LOCALAPPDATA%\Packages\DECK13.CrossCodePC_rn1dn9jh54zft\LocalCache\Local\CrossCode\cc.save</td>
</tr>
</tbody>
</table>
<p>The <span class="text-primary-emphasis font-monospace">cc.save</span> file is a JSON file, but the values are prefixed with an indicator string (<span class="text-primary-emphasis font-monospace">[-!_0_!-]</span>), base64 encoded and AES encrypted. However, the game already supports reading either these encrypted strings <em>or</em> plain JSON. This editor takes advantage of this and will leave the file unencrypted to make editing it much easier.</p>
<h2>How To Use</h2>
<p>
<ol>
<li><i class="bi bi-exclamation-triangle-fill"></i> Backup your original cc.save file.</li>
<li>Click <span class="text-primary-emphasis">Choose File</span> and load your save file. Any encrypted values will be decrypted, converted into plain JSON and displayed in the editor below.</li>
<li>Make any changes you want.</li>
<li>Click <span class="text-primary-emphasis">Export</span> to download the decrypted (and edited) file</li>
<li>Overwrite your original cc.save file.</li>
</ol>
</p>
</div>
</div>
</div>
</div>
<label for="formFile" class="form-label">Open your save game file to decrypt and edit.</label>
<input class="form-control" type="file" id="inputFile" accept=".save">
</div>
<div id="editorContainer" class="mb-3" style="width: 100%; height: 600px;"></div>
<div class="mb-3">
<button id="exportButton" class="btn btn-primary" disabled onclick="exportSavedGames();">Export</button>
</div>
<hr />
<div>
<p>If you just want to decrypt one of the encrypted values, paste the value below (with or without the prefix) and click 'Decrypt' to see the JSON.</p>
<div class="container text-center">
<div class="row">
<div class="col-5">
<label for="sourceTextArea" class="form-label">Encrypted value</label>
<textarea id="sourceTextArea" class="form-control" rows="10"></textarea>
</div>
<div class="col-2 mt-5">
<button id="decryptButton" class="btn btn-secondary" onclick="decryptSource()">Decrypt <i class="bi bi-caret-right-fill"></i></button>
</div>
<div class="col-5">
<label for="targetTextArea" class="form-label">Decrypted value</label>
<textarea id="targetTextArea" class="form-control" rows="10"></textarea>
</div>
</div>
</div>
</div>
</main>
</div>
</body>
<script src="src/main.js"></script>
</html>