endpwn3/stage2.js

93 lines
3.5 KiB
JavaScript
Raw Normal View History

/*
EndPwn3 Stage 2 Payload
Based on the EndPwn Reference Bootstrap
2018-04-19 11:20:17 +00:00
Copyright 2018 EndPwn Project
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2018-04-19 04:07:13 +00:00
https://github.com/endpwn/
*/
(() => {
// use the discord native api to require electron and get electron.remote
var electron = DiscordNative.nativeModules.requireModule('discord_/../electron').remote;
var fs = electron.require('original-fs');
// get the data path (where epapi.js should be)
var data = electron.app.getPath('userData').replace(/\\\\/g, "/") + '/';
// shakily reimplemented of require() intended for loading plugins and EPAPI itself
2018-04-18 03:14:54 +00:00
function __krequire(path) {
return eval('(()=>{var exports={};' + fs.readFileSync(data + path, 'utf8').toString() + ';return exports})()');
}
2018-04-19 07:58:39 +00:00
// define this with a default value as a fallback
var __goodies = {
guilds: [],
bots: [],
users: {}
};
// fetch goodies.json
2018-04-22 01:24:36 +00:00
fetch('https://endpwn.cathoderay.tube/goodies.json?_=' + Date.now())
2018-04-19 08:01:31 +00:00
.then(x => x.json())
2018-04-19 07:58:39 +00:00
.then(r => __goodies = r);
// EndPwn3 specific features
document.addEventListener('ep-ready', () => {
2018-04-19 07:58:39 +00:00
2018-04-19 04:35:23 +00:00
window.reload = () => { app.relaunch(); app.exit(); };
// enable experiments
$api.util.findFuncExports('isDeveloper').__defineGetter__('isDeveloper', () => true);
// disable that obnoxious warning about not pasting shit in the console
$api.util.findFuncExports('consoleWarning').consoleWarning = e => { };
2018-04-19 04:35:23 +00:00
// goodies for people directly associated with the endpwn project, and also kat bc shes my girlfriend
2018-04-19 07:58:39 +00:00
// may be expanded to anyone through a web ui later on
2018-04-18 07:51:23 +00:00
$api.util.wrapAfter(
"wc.findCache('getUser')[0].exports.getUser",
x => {
2018-04-19 02:55:11 +00:00
if (x === undefined || x === null) return;
2018-04-19 07:58:39 +00:00
if (__goodies.bots.contains(x.id)) x.bot = true;
if (__goodies.users[x.id] !== undefined) x.discriminator = __goodies.users[x.id];
2018-04-18 07:51:23 +00:00
return x;
}
);
2018-04-19 07:58:39 +00:00
// verify servers directly associated with the endpwn project
$api.util.wrapAfter(
"wc.findCache('getGuild')[0].exports.getGuild",
x => {
2018-04-19 02:55:11 +00:00
if (x === undefined || x === null) return;
2018-04-19 07:58:39 +00:00
if (__goodies.guilds.contains(x.id)) x.features.add('VERIFIED');
return x;
}
);
});
// load EPAPI
2018-04-18 03:14:54 +00:00
var epapi = __krequire('epapi.js');
// call the entrypoint
epapi.go('bootsyhax-dr1ft', 0, 1);
})();