Skip to content

Commit 53421a8

Browse files
Close down service, the current method is misleading now.
1 parent 3e619c9 commit 53421a8

File tree

1 file changed

+2
-182
lines changed

1 file changed

+2
-182
lines changed

index.html

Lines changed: 2 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -89,185 +89,5 @@
8989

9090
</style>
9191
<h1>Is This Mod Legit?</h1>
92-
<h2>Find out whether or not your mods have been tampered with. Powered by Modrinth's API.</h2>
93-
94-
<script defer data-domain="isthismodlegit.anopensauce.dev" src="https://analytics.anopensauce.dev/js/script.tagged-events.js"></script>
95-
96-
97-
<p><a href="https://github.com/AnOpenSauceDev/IsThisModLegit-Web/issues">Found an issue? Report it here!</a></p>
98-
99-
100-
<br>
101-
102-
<div>
103-
104-
<p id="result"></p>
105-
106-
<p>File Upload</p>
107-
<h2>Your uploaded files never leave your computer, only the hash.</h2>
108-
<form onsubmit="handleButtonPress('file')" id="form">
109-
<br>
110-
<label>Upload file:</label> <input type="file" id="fileSelector" onchange="hashFile();"> <input class="plausible-event-name=Scan" type="submit" value="Scan Mod!"></input>
111-
<p id="filehash"></p>
112-
</form>
113-
114-
<br>
115-
116-
<p>Hash Search</p>
117-
<form onsubmit="handleButtonPress('hash')" id="form">
118-
<label for="hash">SHA1 Hash</label>
119-
<br>
120-
<input type="text" id="hash"></input> <input class="plausible-event-name=Scan" type="submit" value="Search Hash!"></input>
121-
</form>
122-
123-
124-
125-
<script>// full credit to: https://stackoverflow.com/questions/60595630/javascript-use-input-type-file-to-compute-sha256-file-hash
126-
// my solution was... much worse compared to this.
127-
128-
var filehash = document.getElementById("filehash");
129-
130-
function hashFile() {
131-
132-
readBinaryFile(fileSelector.files[0])
133-
.then(function(result) {
134-
result = new Uint8Array(result);
135-
return window.crypto.subtle.digest('SHA-512', result); // SHA-1 produces zeros that cause things to break
136-
}).then(function(result) {
137-
result = new Uint8Array(result);
138-
var resultHex = Uint8ArrayToHexString(result);
139-
filehash.innerText = resultHex;
140-
});
141-
}
142-
143-
function readBinaryFile(file) {
144-
return new Promise((resolve, reject) => {
145-
var fr = new FileReader();
146-
fr.onload = () => {
147-
resolve(fr.result)
148-
};
149-
fr.readAsArrayBuffer(file);
150-
});
151-
}
152-
153-
function Uint8ArrayToHexString(ui8array) {
154-
var hexString = '',
155-
h;
156-
for (var i = 0; i < ui8array.length; i++) {
157-
h = ui8array[i].toString(16);
158-
if (h.length == 1) {
159-
h = '0' + h;
160-
}
161-
hexString += h;
162-
}
163-
var p = Math.pow(2, Math.ceil(Math.log2(hexString.length)));
164-
hexString = hexString.padStart(p, '0');
165-
return hexString;
166-
}
167-
168-
169-
170-
</script>
171-
172-
173-
</div>
174-
175-
<script>
176-
177-
function handleButtonPress(type){
178-
179-
if(type == "hash"){
180-
var sha1 = document.getElementById("hash");
181-
var reqstring = "https://api.modrinth.com/v2/version_file/" + sha1.value + "?algorithm=sha1"
182-
}
183-
else{ // file upload
184-
var sha1 = document.getElementById("filehash");
185-
var reqstring = "https://api.modrinth.com/v2/version_file/" + sha1.innerText + "?algorithm=sha512"
186-
document.getElementById("fileSelector").value = "";
187-
}
188-
189-
var result = document.getElementById("result");
190-
191-
if(sha1.innerText == ""){
192-
result.innerText = "This... is not a file. Please upload a real file."
193-
return;
194-
}
195-
196-
if(type == "file"){
197-
sha1.innerText = "";
198-
}
199-
200-
//var reqstring = "https://api.modrinth.com/v2/version_file/" + sha1.value + "?algorithm=sha1"
201-
console.log("grabbing from " + reqstring)
202-
var requestdata = GET(reqstring);
203-
if(requestdata.status == 200){
204-
result.innerHTML = "<div class='result-found'>This mod's hash matches 1:1 on Modrinth!</div>"
205-
}else if(requestdata.status == 410){
206-
result.innerText = "ERROR: The modrinth API endpoint is deprecated."
207-
}else{
208-
result.innerHTML = "<div class='result-bad'>Warning, no matching hash found! Read the FAQ for more information.</div"
209-
}
210-
211-
}
212-
213-
function GET(URL)
214-
{
215-
var xmlHttp = new XMLHttpRequest();
216-
xmlHttp.open( "GET", URL, false );
217-
xmlHttp.send( null );
218-
return xmlHttp;
219-
}
220-
221-
222-
var form = document.getElementById("form");
223-
function handleForm(event) { event.preventDefault(); }
224-
form.addEventListener('submit', handleForm);
225-
</script>
226-
227-
<br>
228-
229-
<details>
230-
<summary>FAQ</summary>
231-
<h3 name="no-matching-hash">There wasn't a matching hash for my mod!</h3>
232-
This could mean one of a few things. Either:
233-
<ul>
234-
<li>Your mod is not available anywhere on Modrinth. This might be because the mod is only on a platform like CurseForge, or it's a developer build on GitHub.</li>
235-
<li>Your mod has been <strong>potentially tampered with.</strong> If you're not 100% about the legitimacy of this mod, you should remove it, just to be safe.</li>
236-
</ul>
237-
238-
<br>
239-
240-
<h3>Does this support plugins?</h3>
241-
<strong>Yes!</strong> This works with mods, plugins and even Modpacks!
242-
243-
<br> <br>
244-
245-
<h3>Will you support CurseForge mods?</h3>
246-
<strong>No,</strong> CurseForge doesn't really have a good way to grab a mod from a file hash. There also have been multiple cases of malware distribution on CurseForge, so it's best to steer clear anyways.
247-
248-
<br> <br>
249-
250-
<h3>Is there a way to bulk-scan mods?</h3>
251-
<strong>Yes... kinda...</strong> Is This Mod Legit does have a <a href="https://modrinth.com/mod/is-this-mod-legit"> companion mod</a>, but that requires you... running Minecraft to scan your mods, so this isn't a great idea in hindsight.
252-
253-
<br> <br>
254-
255-
<h3>Are only specific modloaders supported?</h3>
256-
<strong>No!</strong> all modloaders/server types (and even files that aren't mods) are supported.
257-
258-
<br> <br>
259-
260-
<h3>Is any data tracked?</h3>
261-
<strong>No!</strong> I use a Plausible Analytics instance that's fully GDPR compliant, and no files uploaded ever get saved. Only the file hashes leave your computer.
262-
263-
<h3>Are any other games supported?</h3>
264-
<strong>Not yet...</strong> but Modrinth has plans to support other games, and other mod distribution APIs can be added here in the future.
265-
266-
<br> <br>
267-
268-
<h3>Why is this website in vanilla CSS/JS?</h3>
269-
I <i>normally</i> use Svelte like a sane developer, but i was too lazy to make a project this time, and made this atrocity instead. 😎
270-
271-
</details>
272-
273-
<h2>A Project by <a href="https://github.com/AnOpenSauceDev">AnOpenSauceDev</a></h2>
92+
<h2>Due to recent events involving Malware being distributed on Modrinth, "Is This Mod Legit?" can no longer be used as a benchmark for determining if a mod has been tampered with.</h2>
93+
<h2>I may work on an alternative that checks for suspicous behaviour if I have the time, but the current method used is not trustworthy anymore.</h2>

0 commit comments

Comments
 (0)