Cleaner code!!

This commit is contained in:
Ethan O'Brien 2021-11-25 19:36:43 -06:00
parent 83e148c82c
commit c5a5cdc432
4 changed files with 7368 additions and 7357 deletions

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@ fetch('https://raw.githack.com/ethanaobrien/emulatorjs/main/data/version.json').
if (response.ok) {
response.text().then(body => {
var version = JSON.parse(body);
var usingVersion = '0.4.23-07';
var usingVersion = '0.4.24';
if (usingVersion != version.current_version) {
console.log('Using emulatorjs version ' + usingVersion + ' but the newest version is ' + version.current_version + '\n\nopen https://github.com/ethanaobrien/emulatorjs to update');
};
@ -51,20 +51,6 @@ if (!EJS_pathtodata.endsWith('/')) {
}
console.log('Path to data is set to ' + EJS_pathtodata)
window.getHeadGameInfo = function(normalFunc, url) {
if (! url.startsWith('blob:')) {
return normalFunc(url, {})
} else {
return async function() {
//console.log('blob url')
var a = await fetch(url)
var a = await a.blob()
return {headers:{'content-length': a.size, 'content-type': 'text/plain'}}
}();
}
}
window.readAsBufferrr = function(fileBlob) {
return new Promise(function(resolve, reject) {
var reader = new FileReader()
@ -88,59 +74,59 @@ var loader = function(_0x3f3e4d) {
var _0x33f0f1 = {};
function _0x268bfd(_0x6631ec) {
if (_0x33f0f1[_0x6631ec]) return _0x33f0f1[_0x6631ec]['exports'];
if (_0x33f0f1[_0x6631ec]) return _0x33f0f1[_0x6631ec].exports;
var _0x50c7e4 = _0x33f0f1[_0x6631ec] = {
'i': _0x6631ec,
'l': !0x1,
'exports': {}
};
return _0x3f3e4d[_0x6631ec]['call'](_0x50c7e4['exports'], _0x50c7e4, _0x50c7e4['exports'], _0x268bfd), _0x50c7e4['l'] = !0x0, _0x50c7e4['exports'];
return _0x3f3e4d[_0x6631ec].call(_0x50c7e4.exports, _0x50c7e4, _0x50c7e4.exports, _0x268bfd), _0x50c7e4.l = !0x0, _0x50c7e4.exports;
}
return _0x268bfd['m'] = _0x3f3e4d, _0x268bfd['c'] = _0x33f0f1, _0x268bfd['d'] = function(_0xf1024d, _0x55284e, _0x262414) {
_0x268bfd['o'](_0xf1024d, _0x55284e) || Object['defineProperty'](_0xf1024d, _0x55284e, {
return _0x268bfd.m = _0x3f3e4d, _0x268bfd.c = _0x33f0f1, _0x268bfd.d = function(_0xf1024d, _0x55284e, _0x262414) {
_0x268bfd.o(_0xf1024d, _0x55284e) || Object.defineProperty(_0xf1024d, _0x55284e, {
'enumerable': !0x0,
'get': _0x262414
});
}, _0x268bfd['r'] = function(_0xa8a7e) {
'undefined' != typeof Symbol && Symbol['toStringTag'] && Object['defineProperty'](_0xa8a7e, Symbol['toStringTag'], {
}, _0x268bfd.r = function(_0xa8a7e) {
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(_0xa8a7e, Symbol.toStringTag, {
'value': 'Module'
}), Object['defineProperty'](_0xa8a7e, '__esModule', {
}), Object.defineProperty(_0xa8a7e, '__esModule', {
'value': !0x0
});
}, _0x268bfd['t'] = function(_0x5518c9, _0x2d1bbc) {
}, _0x268bfd.t = function(_0x5518c9, _0x2d1bbc) {
if (0x1 & _0x2d1bbc && (_0x5518c9 = _0x268bfd(_0x5518c9)), 0x8 & _0x2d1bbc) return _0x5518c9;
if (0x4 & _0x2d1bbc && 'object' == typeof _0x5518c9 && _0x5518c9 && _0x5518c9['__esModule']) return _0x5518c9;
var _0x37347f = Object['create'](null);
if (_0x268bfd['r'](_0x37347f), Object['defineProperty'](_0x37347f, 'default', {
if (0x4 & _0x2d1bbc && 'object' == typeof _0x5518c9 && _0x5518c9 && _0x5518c9.__esModule) return _0x5518c9;
var _0x37347f = Object.create(null);
if (_0x268bfd.r(_0x37347f), Object.defineProperty(_0x37347f, 'default', {
'enumerable': !0x0,
'value': _0x5518c9
}), 0x2 & _0x2d1bbc && 'string' != typeof _0x5518c9)
for (var _0x2b2a4e in _0x5518c9) _0x268bfd['d'](_0x37347f, _0x2b2a4e, function(_0x466464) {
for (var _0x2b2a4e in _0x5518c9) _0x268bfd.d(_0x37347f, _0x2b2a4e, function(_0x466464) {
return _0x5518c9[_0x466464];
}['bind'](null, _0x2b2a4e));
}.bind(null, _0x2b2a4e));
return _0x37347f;
}, _0x268bfd['n'] = function(_0x25eece) {
var _0x3f42e9 = _0x25eece && _0x25eece['__esModule'] ? function() {
return _0x25eece['default'];
}, _0x268bfd.n = function(_0x25eece) {
var _0x3f42e9 = _0x25eece && _0x25eece.__esModule ? function() {
return _0x25eece.default;
} : function() {
return _0x25eece;
};
return _0x268bfd['d'](_0x3f42e9, 'a', _0x3f42e9), _0x3f42e9;
}, _0x268bfd['o'] = function(_0x5570d6, _0x5eaf39) {
return Object['prototype']['hasOwnProperty']['call'](_0x5570d6, _0x5eaf39);
}, _0x268bfd['p'] = '', _0x268bfd(_0x268bfd['s'] = 0x18b);
return _0x268bfd.d(_0x3f42e9, 'a', _0x3f42e9), _0x3f42e9;
}, _0x268bfd.o = function(_0x5570d6, _0x5eaf39) {
return Object.prototype.hasOwnProperty.call(_0x5570d6, _0x5eaf39);
}, _0x268bfd.p = '', _0x268bfd(_0x268bfd.s = 0x18b);
}({
395: function(_0x316d65, _0x16e76b, _0x1f8b30) {
'use strict';
_0x1f8b30['r'](_0x16e76b);
_0x1f8b30.r(_0x16e76b);
var _0x2fbf67, _0x59b8a1, _0x3c68b9, _0x44b634, _0x2766bb, _0x46b578 = _0x1f8b30(0x38);
window, _0x2fbf67 = document, _0x59b8a1 = 'script', _0x3c68b9 = [EJS_pathtodata + 'emulator.js?v=', _0x46b578['a']]['join'](''), _0x44b634 = _0x2fbf67['createElement'](_0x59b8a1), _0x2766bb = _0x2fbf67['getElementsByTagName'](_0x59b8a1)[0x0], _0x44b634['async'] = 0x1, _0x44b634['src'] = _0x3c68b9, _0x2766bb['parentNode']['insertBefore'](_0x44b634, _0x2766bb), _0x44b634['onload'] = function() {
window, _0x2fbf67 = document, _0x59b8a1 = 'script', _0x3c68b9 = [EJS_pathtodata + 'emulator.js?v=', _0x46b578.a].join(''), _0x44b634 = _0x2fbf67.createElement(_0x59b8a1), _0x2766bb = _0x2fbf67.getElementsByTagName(_0x59b8a1)[0x0], _0x44b634.async = 0x1, _0x44b634.src = _0x3c68b9, _0x2766bb.parentNode.insertBefore(_0x44b634, _0x2766bb), _0x44b634.onload = function() {
var _0x316d65 = {};
_0x316d65['gameUrl'] = EJS_gameUrl, 'undefined' != typeof EJS_biosUrl && (_0x316d65['biosUrl'] = EJS_biosUrl), 'undefined' != typeof EJS_gameID && (_0x316d65['gameId'] = EJS_gameID), 'undefined' != typeof EJS_gameParentUrl && (_0x316d65['gameParentUrl'] = EJS_gameParentUrl), 'undefined' != typeof EJS_gamePatchUrl && (_0x316d65['gamePatchUrl'] = EJS_gamePatchUrl), _0x316d65['system'] = EJS_core, _0x316d65['onsavestate'] = null, _0x316d65['onloadstate'] = null, 'undefined' != typeof EJS_onSaveState && (_0x316d65['onsavestate'] = EJS_onSaveState), 'undefined' != typeof EJS_onLoadState && (_0x316d65['onloadstate'] = EJS_onLoadState), 'undefined' != typeof EJS_lightgun && (_0x316d65['lightgun'] = EJS_lightgun), 'undefined' != typeof EJS_mouse && (_0x316d65['mouse'] = EJS_mouse), 'undefined' != typeof EJS_multitap && (_0x316d65['multitap'] = EJS_multitap), 'undefined' != typeof EJS_playerName && (_0x316d65['playerName'] = EJS_playerName), 'undefined' != typeof EJS_cheats && (_0x316d65['cheats'] = EJS_cheats), 'undefined' != typeof EJS_color && (_0x316d65['color'] = EJS_color), window['EJS_emulator'] = new EJS(EJS_player, _0x316d65), 'undefined' != typeof EJS_onGameStart && EJS_emulator['on']('start-game', EJS_onGameStart);
_0x316d65.gameUrl = EJS_gameUrl, 'undefined' != typeof EJS_biosUrl && (_0x316d65.biosUrl = EJS_biosUrl), 'undefined' != typeof EJS_gameID && (_0x316d65.gameId = EJS_gameID), 'undefined' != typeof EJS_gameParentUrl && (_0x316d65.gameParentUrl = EJS_gameParentUrl), 'undefined' != typeof EJS_gamePatchUrl && (_0x316d65.gamePatchUrl = EJS_gamePatchUrl), _0x316d65.system = EJS_core, _0x316d65.onsavestate = null, _0x316d65.onloadstate = null, 'undefined' != typeof EJS_onSaveState && (_0x316d65.onsavestate = EJS_onSaveState), 'undefined' != typeof EJS_onLoadState && (_0x316d65.onloadstate = EJS_onLoadState), 'undefined' != typeof EJS_lightgun && (_0x316d65.lightgun = EJS_lightgun), 'undefined' != typeof EJS_mouse && (_0x316d65.mouse = EJS_mouse), 'undefined' != typeof EJS_multitap && (_0x316d65.multitap = EJS_multitap), 'undefined' != typeof EJS_playerName && (_0x316d65.playerName = EJS_playerName), 'undefined' != typeof EJS_cheats && (_0x316d65.cheats = EJS_cheats), 'undefined' != typeof EJS_color && (_0x316d65.color = EJS_color), window.EJS_emulator = new EJS(EJS_player, _0x316d65), 'undefined' != typeof EJS_onGameStart && EJS_emulator.on('start-game', EJS_onGameStart);
};
},
56: function(_0x258889, _0x2c8954, _0x2cdd3a) {
'use strict';
_0x2c8954['a'] = '0.4.23';
_0x2c8954.a = '0.4.24';
}
})['default'];
}).default;

View file

@ -1 +1 @@
{ "current_version": "0.4.23-07"}
{ "current_version": "0.4.24"}

View file

@ -9,7 +9,17 @@
<script src='decrypt.js'></script>
<script>
if (! String.prototype.includez) {
String.prototype.includez = function() {
var args = Array.prototype.slice.call(arguments)
for (var i=0; i<args.length; i++) {
if (this.indexOf(args[i]) != -1) {
return true
}
}
return false
}
}
function decryptButton() {
var finished = function() {
window.stopped = true
@ -24,18 +34,21 @@ function decryptButton() {
var reader = new FileReader()
reader.onload = async function(e) {
window.body = e.target.result
var a = body.split('\\x')
var q = []
var a = body.split('[\'')
console.log(a.length)
for (var i=1; i<a.length; i++) {
var error = false
a[i] = a[i].substr(0, 2)
console.log(a[i])
try {var code = eval('"\\x'+a[i]+'"')} catch(e) {console.log(e, '"\\x'+a[i]+'"'); var error = true}
if (! error) {
if (code != '\n' && code != '\r') {
window.body = body.replaceAll('\\x'+a[i], code.replaceAll("'", "\\'").replaceAll('"', '\\"').replaceAll('\\', '\\\\'))
}
}
var value = a[i].split('\']')[0]
if(! q.includes(value)) {
if (!value.includez("'", '-', ' ', '@', ':')) {
q.push(value)
console.log(value)
window.body = body.replaceAll("['"+value+"']", "."+value)
}
}
}
console.log(q)
finished()
}
reader.readAsText(file)