Initial commit 2

This commit is contained in:
Cynthia Foxwell 2017-12-09 10:46:46 -07:00
parent 6871067079
commit 0bf93b60e9
8 changed files with 3845 additions and 0 deletions

12
channels/@me/assets/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

269
channels/@me/cynergy.js Normal file
View File

@ -0,0 +1,269 @@
/*
* ==== CYNERGY ====
* Copyright (c) 2017 Cynthia Foxwell
*
* This software is provided as is without waranty.
* I, Cynthia Foxwell, am not responsible for ANY
* damage done caused by this software, you are at
* fault for running any unsolicited code via this
* software. Use at your own risk.
*
* ==== CREDITS ====
* justquant - EndPwn, the basis of this framework
* leovoel - BeautifulDiscord CSS injection
* Memework(tm) - Discord datamining
*/
let cyn_ver = 1;
let electron = require("electron").remote;
let remote = electron;
let _fs = require("fs");
let fs = require("original-fs");
let win = electron.getCurrentWindow();
var cacheclear = function () {
win.webContents.session.clearCache(function(){});
}
var cleanup = function () {
win.loadURL('https://canary.discordapp.com/channels/@me');
}
var setup = function () {
cacheclear();
logging = document.getElementById('logger');
var a = navigator.appVersion;
var v = a.substring(a.indexOf('discord/')).split('/')[1].split(' ')[0];
logging.innerText += "\n";
setTimeout(function () {
if (typeof(_cynergy_ver) == "undefined")
{
logging.innerText += "Cynergy is not installed\n";
logging.innerText += "Injecting dom-ready listener into app.asar\n";
try
{
asarpwn();
}
catch(e)
{
logging.style.color = 'red';
logging.innerText += 'ASARPwn failed. If you are on Linux, try running';
logging.innerText += ` chmod -R 777 ${approot().split('app.asar')[0]}`;
logging.innerText += ". If that doesn't help, or you are not on Linux, type cleanup() in the console and PM me: quant#0010\n";
return;
}
}
else {
if (_cynergy_ver == cyn_ver) {
logging.innerText += "Cynergy is up to date, continuing to Discord\n";
cleanup();
return;
}
}
logging.innerText += "Attempting asar extraction...\n";
try{
asarpwn();
}catch(e){
logging.style.color = 'red';
logging.innerText += 'ASARPwn failed. If you are on Linux, try running';
logging.innerText += ` chmod -R 777 ${approot().split('app.asar')[0]}`;
logging.innerText += ". If that doesn't help, or you are not on Linux, type cleanup() in the console and PM me: Cynthia#0501\n";
return;
}
logging.innerText += "Injecting WEBAPP_ENDPOINT override into settings.json\n";
try
{
endpoint_setup();
}
catch(e)
{
logging.innerText += "Endpoint injection failed, continuing...\n";
}
logging.innerText += "Dropping files...\n";
dropfiles();
logging.innerText += "Restarting Discord in 10 seconds...\n";
setTimeout(crash, 10000);
}, 1000);
}
var endpoint_setup = function () {
var settings = JSON.parse(fs.readFileSync(settingsjson(), "UTF8"));
settings.WEBAPP_ENDPOINT="https://cynfoxwell.cf/cynergy";
fs.writeFileSync(settingsjson(), JSON.stringify(settings));
};
var endpoint_restore = function () {
var settings = JSON.parse(fs.readFileSync(settingsjson(), "UTF8"));
settings.WEBAPP_ENDPOINT=null;
fs.writeFileSync(settingsjson(), JSON.stringify(settings));
};
var asarpwn = function () {
if (!fs.existsSync(approot().split('app.asar')[0] + '/../cynergy')){
fs.mkdirSync(approot().split('app.asar')[0] + '/../cynergy');
}
if (!fs.existsSync(approot().split('app.asar')[0] + '/../cynergy/lib')){
fs.mkdirSync(approot().split('app.asar')[0] + '/../cynergy/lib');
}
if (!fs.existsSync(approot().split('app.asar')[0] + '/../cynergy/lib/asar')){
fs.mkdirSync(approot().split('app.asar')[0] + '/../cynergy/lib/asar');
}
var asar1 = new XMLHttpRequest();
asar1.open('GET', 'https://rawgit.com/electron/asar/master/lib/asar.js');
asar1.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/libs/asar/asar.js', asar1.responseText);
}
asar1.send();
var asar2 = new XMLHttpRequest();
asar2.open('GET', 'https://rawgit.com/electron/asar/master/lib/crawlfs.js');
asar2.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/libs/asar/crawlfs.js', asar2.responseText);
}
asar2.send();
var asar3 = new XMLHttpRequest();
asar3.open('GET', 'https://rawgit.com/electron/asar/master/lib/disk.js');
asar3.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/libs/asar/disk.js', asar3.responseText);
}
asar3.send();
var asar4 = new XMLHttpRequest();
asar4.open('GET', 'https://rawgit.com/electron/asar/master/lib/filesystem.js');
asar4.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/libs/asar/filesystem.js', asar4.responseText);
}
asar4.send();
var asar5 = new XMLHttpRequest();
asar5.open('GET', 'https://rawgit.com/electron/asar/master/lib/snapshot.js');
asar5.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/libs/asar/snapshot.js', asar5.responseText);
}
asar5.send();
let asar = require(approot().split('app.asar')[0] + '/../cynergy/libs/asar/asar.js');
try{
asar.extractAll(approot().split('app.asar')[0]+"/app.asar",approot().split('app.asar')[0] + '/app');
_fs.renameSync(approot().split('app.asar')[0]+"/app.asar",approot().split('app.asar')[0]+"/original_app.asar");
}catch(e){
console.error("asar extraction failed: "+e);
}
};
var asarunpwn = function () {
_fs.rmdirSync(approot().split('original_app.asar')[0],approot().split('original_app.asar')[0] + '/../app');
_fs.renameSync(approot().split('original_app.asar')[0]+"/original_app.asar",approot().split('app.asar')[0]+"/app.asar");
}
var data = function () {
return remote.app.getPath('userData') + "/";
}
var approot = function () {
return asar() + "/../";
}
var settingsjson = function () {
return data() + 'settings.json';
}
var asar = function () {
return remote.app.getAppPath();
}
var dropfiles = function () {
if (!fs.existsSync(approot().split('app.asar')[0] + '/../cynergy')){
fs.mkdirSync(approot().split('app.asar')[0] + '/../cynergy');
}
if (!fs.existsSync(approot().split('app.asar')[0] + '/../cynergy/styles')){
fs.mkdirSync(approot().split('app.asar')[0] + '/../cynergy/styles');
}
if (!fs.existsSync(approot().split('app.asar')[0] + '/../cynergy/plugins')){
fs.mkdirSync(approot().split('app.asar')[0] + '/../cynergy/plugins');
}
if (!fs.existsSync(approot().split('app.asar')[0] + '/../cynergy/lib')){
fs.mkdirSync(approot().split('app.asar')[0] + '/../cynergy/lib');
}
var license = 'BeautifulDiscord\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 leovoel\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the "Software"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.';
// blob of bullshit for i.js start
// imports/helper definitions
var ec = 'var fs=require("original-fs");var el=require("electron").remote;var win=el.getCurrentWindow();var app=el.app;var _cyn_data=approot().split("app.asar")[0] + "\\";';
// restart function
var rs = 'var _cyn_restart=function(){app.relaunch();app.quit()}';
// cache clear function
var cc = 'var _cyn_clean=function(){el.getCurrentWindow().webContents.session.clearCache(function(){})}';
// continue to discord function
var ct = 'var _cyn_continue=function(){win.loadURL("https://canary.discordapp.com/channels/@me")}';
// bootstrap
var pl = `var fs=require('fs');exports.x=function(win){win.webContents.executeJavaScript('${ec}var _cynergy_ver=${cyn_ver};${rs};${cc};${ct};if(window.location.hostname.includes("discordapp.com")){require(_cyn_data + "/main")}');}`;
// end i.js cyst
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/i.js', pl);
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/p.js', '// todo');
try
{
fs.readFileSync(approot().split('app.asar')[0] + '/../cynergy/autoexec.js');
}
catch(e)
{
fs.writeFileSync(approot().split('app.asar')[0] + '/../cynergy/autoexec.js', 'setupCSS(_cyn_data + "/cynergy/styles/style.css");\nconsole.log("Hello, world!");');
}
/*try
{
fs.readFileSync(data() + 'style.css');
}
catch(e)
{
var client = new XMLHttpRequest();
client.open('GET', 'http://apo.wds.us/default.css');
client.onreadystatechange = function() {
fs.writeFileSync(data() + 'style.css', client.responseText);
}
client.send();
}
var eclient = new XMLHttpRequest();
eclient.open('GET', 'https://cynfoxwell.cf/cynergy/libs/epapi.js');
eclient.onreadystatechange = function() {
if (eclient.readyState === 4) {
fs.writeFileSync(approot().split('app.asar')[0] + 'cynergy/epapi.js', eclient.responseText);
}
}
eclient.send();
var mclient = new XMLHttpRequest();
mclient.open('GET', 'https://cynfoxwell.cf/cynergy/libs/main.js');
mclient.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + 'cynergy/main.js', mclient.responseText);
}
mclient.send();
var gclient = new XMLHttpRequest();
gclient.open('GET', 'http://apo.wds.us/plugins/guild_scrollbar.js');
gclient.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + 'cynergy/plugins/guild_scrollbar.js', gclient.responseText);
}
gclient.send();
var lclient = new XMLHttpRequest();
lclient.open('GET', 'https://cynfoxwell.cf/cynergy/libs/linq.js');
lclient.onreadystatechange = function() {
fs.writeFileSync(approot().split('app.asar')[0] + 'cynergy/lib/linq.js', lclient.responseText);
}
lclient.send();*/
fs.writeFileSync(approot().split('app.asar')[0] + 'cynergy/legal.txt', license);
fs.writeFileSync(approot().split('app.asar')[0] + 'cynergy/styles/style.css', "/* custom css here */");
}
var crash = function () {
remote.app.relaunch();
remote.app.quit();
};

127
channels/@me/index.html Normal file
View File

@ -0,0 +1,127 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Cynergy Injector</title>
<!-- [B]ootstrap -->
<link rel="stylesheet" href="./assets/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<!-- [B]ootstrap "required" metadata -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<style>
#bg {
width:100%;
position:absolute;
top:0;
left:0;
height:100%;
z-index: -9999;
}
#greets {
position: absolute;
font-family: monospace;
font-size:16px;
bottom:32px;
overflow:hidden;
font-style: bold;
}
</style>
<script src="https://rawgit.com/a1k0n/jsxm/master/xmeffects.js"></script>
<script src="https://rawgit.com/a1k0n/jsxm/master/xm.js"></script>
<script src="./cynergy.js"></script>
<script type="text/javascript">
var injectme = function(){
if(confirm("This is your last chance to back out. It's all over from here if you continue.","Final Chance To Leave")){
setup();
}else{
require("electron").remote.getCurrentWindow().loadURL("https://discordapp.com/channels/@me");
}
}
if(typeof(_cynergy_ver) !== "undefined"){
setup();
}
function loadXMAndInit(xmdata) {
if (!XMPlayer.load(xmdata)) {
return;
}
XMPlayer.play();
return XMPlayer.xm;
}
function downloadXM(uri) {
var xmReq = new XMLHttpRequest();
xmReq.open("GET", uri, true);
xmReq.responseType = "arraybuffer";
xmReq.onload = function (xmEvent) {
var arrayBuffer = xmReq.response;
if (arrayBuffer) {
loadXMAndInit(arrayBuffer);
} else {
console.log("unable to load", uri);
}
};
xmReq.send(null);
}
window.onload = function() {
XMPlayer.init();
setTimeout(()=>downloadXM("./assets/infected_-_mapedit_3_6kg.xm"),2500);
}
</script>
</head>
<body style="margin:0; font-family:monospace;">
<main role="main">
<div class="jumbotron" style="text-align:center; background-color:rgba(28,30,34,0.5);">
<h1 class="display-3 rainbowme">Cynergy</h1>
<p class="lead">Welcome to the Cynergy Injector.</p>
<p><button class="btn btn-lg btn-primary" role="button" onclick="injectme()">Inject me &#x1F489;&#x1F629;</button></p>
</div>
<div id="logger" class="rainbowme" style="background-color:rgba(0,0,0,0.5); font-size:16px; width:100%; padding:4px;">Log starts here</div>
</main>
<!-- canvases -->
<canvas id="bg"></canvas>
<footer id="greets" class="rainbowme"><marquee>Cynergy, Copyright &copy; 2017 Cynthia Foxwell - Greets to: justquant, Utopia, Memework&trade;, Foxwells Garden - Song: infected_-_mapedit_3_6kg.xm, Composed and tracked by LHS/DHS.&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Sticking around too long after injection? If you're using a regular browser, leave now. Else run _cyn_clean() and _cyn_restart() then reinject. If errors, contact Cynthia&#x1F49A;#0501 on Discord.</marquee></footer>
<script>
let c = document.getElementById("bg");
let ctx = c.getContext("2d");
c.height = window.innerHeight;
c.width = window.innerWidth;
var font_size = 8;
var columns = c.width/font_size;
var drops = [];
for(var x = 0; x < columns; x++) drops[x] = 1;
function draw()
{
ctx.fillStyle = "rgba(0, 0, 0, 0.05)";
ctx.fillRect(0, 0, c.width, c.height);
ctx.fillStyle = `hsl(${(new Date().getTime()%360)},75%,75%)`;
for(var i = 0; i < drops.length; i++)
{
ctx.fillRect((i*font_size)-font_size, (drops[i]*font_size)-font_size, font_size, font_size);
if(drops[i]*font_size > c.height && Math.random() > 0.975) drops[i] = 0;
drops[i]++;
}
let r = document.getElementsByClassName("rainbowme");
for(let i=0;i<r.length;i++){
r[i].style.color = `hsl(${(new Date().getTime()/10%360)},100%,50%)`;
}
}
setInterval(draw, 33);
</script>
</body>
</html>

37
index.html Normal file
View File

@ -0,0 +1,37 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<script>
function ready() {
setTimeout(go, 1000);
}
function go() {
if(typeof(require)=="undefined") {
window.location.replace("https://discordapp.com/channels/@me");
}
else if(typeof(betterDiscordIPC)!="undefined") {
alert(">using betterdiscord in $CURRENT_YEAR");
alert("Exit now if prone to seizures.");
require("electron").remote.getCurrentWindow().loadURL("https://www.youtube.com/embed/SmsRN78qMxM?autoplay=1");
}
else if(typeof(_epver)!="undefined") {
alert("EndPwn and Cynergy are not compatable together, as Cynergy is a \"fork\" of EndPwn");
require("electron").remote.getCurrentWindow().loadURL("https://discordapp.com/channels/@me");
}
else if(typeof(_cynergy_ver)!="undefined") {
require("electron").remote.getCurrentWindow().loadURL("https://discordapp.com/channels/@me");
}
else {
if(confirm("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.\n\nIf you were told to install this, DO NOT DO IT. You have a 220% chance of your account getting stolen.\n\nClick OK to accept and continue, otherwise, click Cancel to get out of here Freeman.\n\n\nIf you need support contact Cynthia\uD83D\uDC9A#0501","Cynergy Disclaimer")){
require("electron").remote.getCurrentWindow().loadURL("https://discord.cynfoxwell.cf/channels/@me");
}
else {
require("electron").remote.getCurrentWindow().loadURL("https://discordapp.com/channels/@me");
}
}
}
</script>
</head>
<body onload=ready()>
</body>
</html>

319
libs/epapi.js Normal file
View File

@ -0,0 +1,319 @@
/*
ENDPWN API
if you are reading this, salutations! i dont know why you'd want to use any code from this garbage,
but this shit is licensed under the WTFPL:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
*/
// Extension methods and shit ig
window.$ = function (s) {
return document.querySelector(s)
}
window.$$ = function (s) {
return document.querySelectorAll(s)
}
window.$_ = function (e,c,t,i) {
var elm = document.createElement(e);
if (typeof(c) != 'undefined')
{
elm.className = c;
if (typeof(t) != 'undefined')
{
elm.innerText = t;
if (typeof(i) != 'undefined')
{
elm.id = i;
}
}
}
return elm;
}
window.$purge = function (e) {
e.innerHTML = '';
}
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.split(search).join(replacement);
}
Array.prototype.contains = function (s) {
return this.indexOf(s) != -1;
}
Date.fromSnowflake = (id) => new Date((id / 4194304) + 1420070400000);
// Some internal APIs we use
var internal = {}
var ui = {}
var event = {}
// Base
exports.ver = 4;
exports.xyzzy = 'Nothing happened.';
exports.go = function () {
try {
if ($(".guilds-wrapper .guilds").children.length > 0) {
internal = {
dispatcher: wc.findFunc('dirtyDispatch')[0].exports,
evnt: wc.findFunc('MESSAGE_CREATE')[1].exports,
rmsg: wc.findFunc('receiveMessage')[0].exports,
cmsg: wc.findFunc('createMessage')[1].exports,
notf: wc.findFunc('NOTIFICATION_CREATE')[1].exports,
hguild: wc.findFunc('leaveGuild')[0].exports,
lguild: wc.findFunc('markGuildAsRead')[0].exports
};
// UI
ui = {
getCurrentChannel: function () {
var p = window.location.pathname.split('/');
return p[p.length - 1];
},
getCurrentGuild: function () {
var p = window.location.pathname.split('/');
return p[p.length - 2];
},
fakeMsg: function (t, f) {
var msg = internal.cmsg.createMessage(this.getCurrentChannel(), t);
msg.author.avatar = '/08671efa6ceec0fd40b5856bd2ea1f3b'
msg.author.bot = true;
msg.author.discriminator = '1337';
msg.author.id = '152172984373608449';
msg.author.username = 'Cynergy';
msg.state = 'SENT';
msg.webhook_id = '152172984373608449';
if (typeof (f) != 'undefined') {
f(msg);
}
internal.rmsg.receiveMessage(this.getCurrentChannel(), msg);
},
hideChannels: function () {
$('.channels-wrap').style.display = 'none';
},
showChannels: function () {
$('.channels-wrap').style.display = '';
},
hideServers: function () {
$('.guilds-wrapper').style.display = 'none';
},
showServers: function () {
$('.guilds-wrapper').style.display = '';
},
hideToolbar: function () {
$('.topic').style.display = 'none';
$('.header-toolbar').style.display = 'none';
},
showToolbar: function () {
$('.topic').style.display = '';
$('.header-toolbar').style.display = '';
},
toggleUsers: function () {
wc.findFunc('toggleSection')[0].exports.toggleSection(wc.get(0).ChannelSections.MEMBERS);
}
}
// Events
event = {
discordNativeEvent: function (e) {
return new CustomEvent('ep-native', { detail: e });
},
onReady: function () {
return new Event('ep-ready');
},
onChannelChange: function (e) {
return new CustomEvent('ep-onchannelchange', { detail: e.detail });
},
onMessage: function (e) {
return new CustomEvent('ep-onmessage', { detail: e.detail });
},
onChannelMessage: function (e) {
return new CustomEvent('ep-onchannelmessage', { detail: e.detail });
}
}
$listen('ep-native', (e) => {
switch (e.detail.type) {
case 'MESSAGE_CREATE':
$dispatch(event.onMessage(e));
break;
case 'CHANNEL_SELECT':
$dispatch(event.onChannelChange(e));
break;
}
});
$listen('ep-onmessage', function (e) {
if (e.detail.channel_id == $chan()) {
$dispatch(event.onChannelMessage(e));
}
});
internal.dispatcher.default.register(function (e) {
$dispatch(event.discordNativeEvent(e));
})
// Shorthand shit
window.$chan = ui.getCurrentChannel;
window.$guild = ui.getCurrentGuild;
// Exports
exports.internal = internal;
exports.settings = settings;
exports.ui = ui;
exports.event = event;
/===/
if (fs.existsSync(_epdata + '/lib')) {
fs.readdirSync(_epdata + '/lib').forEach(function (x) {
try {
var lib = require(_epdata + '/lib/' + x);
global['_lib' + lib.name] = lib;
}
catch (e) {
console.warn(x + ' contains errors.\n\n' + e);
}
});
}
fs.readdirSync(_epdata + '/plugins').forEach(function (x) {
try {
require(_epdata + '/plugins/' + x).start();
}
catch (e) {
console.warn(x + ' contains errors.\n\n' + e);
}
});
setTimeout(function () {
$dispatch(event.onReady());
}, 500);
// This method should never be run again
exports.go = undefined;
}
else {
setTimeout(exports.go, 100);
}
}
catch (e) {
setTimeout(exports.go, 100);
}
}
var settings = {
get: function (k) {
return JSON.parse(fs.readFileSync(_epdata + '/settings.json', 'utf8'))[k];
},
set: function (k, v) {
var o = JSON.parse(fs.readFileSync(_epdata + '/settings.json', 'utf8'));
o[k] = v;
fs.writeFileSync(_epdata + '/settings.json', JSON.stringify(o, null, 2));
return v;
}
}
// Discord is a bunch of assholes so they removed the localStorage object
// This means we have to do retarded shit like manually search for and extract the token from the SQLite database
// If we had access to some sort of SQLite lib, we could do this in a much more elegant way, but this works so who cares
function token() {
return fs.readFileSync(_epdata + "/Local Storage/https_discordapp.com_0.localstorage", 'utf8')
.match(/M\0(?:(?!\.)[--z]\0){23}\.\0(?:(?!\.)[--z]\0){6}\.\0(?:(?!\.)[--z]\0){27}|m\0f\0a\0\.\0(?:(?!\.)[--z]\0){84}/)[0]
.replaceAll('\0', '');
}
// REST
exports.discord = {
rest: function (m, e, p, c) {
if (typeof (c) == "undefined") {
c = function () { };
}
var xhr = new XMLHttpRequest();
var url = "https://discordapp.com/api/v6" + e;
xhr.open(m, url, true);
xhr.setRequestHeader("Authorization", token());
xhr.setRequestHeader("Content-type", "application/json");
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status.toString().startsWith('4')) {
throw (xhr.responseText);
}
if (xhr.status.toString().startsWith('5')) {
throw (xhr.responseText);
}
c(xhr.responseText);
}
};
var data = p;
xhr.send(data);
},
sendMessage: function (channel, text) {
this.rest('POST', `/channels/${channel}/messages`, JSON.stringify({ content: text }));
},
sendEmbed: function (channel, ebd) {
this.rest('POST', `/channels/${channel}/messages`, JSON.stringify(
{
embed: ebd
}
));
},
getGuild: function (id, c) {
this.rest('GET', `/guilds/${id}`, '', function (e) { c(JSON.parse(e)) })
},
getChannel: function (id, c) {
this.rest('GET', '/channels/' + id, '', function (e) { c(JSON.parse(e)) })
},
getUser: function (id, c) {
this.rest('GET', '/users/' + id, '', function (e) { c(JSON.parse(e)) })
},
getGuildRoles: function (id, c) {
this.rest('GET', `/guilds/${id}/roles`, '', function (e) { c(JSON.parse(e)) })
},
getGuildChannels: function (id, c) {
this.rest('GET', `/guilds/${id}/channels`, '', function (e) { c(JSON.parse(e)) })
},
getGuildUser: function (id, uid, c) {
this.rest('GET', `/guilds/${id}/members/${uid}`, '', function (e) { c(JSON.parse(e)) })
},
getGuildUsers: function (id, c) {
this.rest('GET', `/guilds/${id}/members?limit=1000`, '', function (e) { c(JSON.parse(e)) })
}
}
window.$api = exports;

3020
libs/linq.js Normal file

File diff suppressed because it is too large Load Diff

61
libs/main.js Normal file
View File

@ -0,0 +1,61 @@
// asar injector, for applying post-install asar patches
function asarinject(sig, inj) {
if (sig.length != inj.length) {
throw 'signature and injection not same size'
}
var bdata = new Buffer(fs.readFileSync(app.getAppPath()));
var index = bdata.indexOf(sig);
if (index == -1) {
throw 'patched or already modified';
}
bdata.write(inj, index);
fs.writeFileSync(app.getAppPath(), bdata);
}
try {
asarinject(
"\x0A webPreferences: {\x0A blinkFeatures: 'EnumerateDevices,AudioOutputDevices'\x0A }\x0A };",
"webPreferences:{blinkFeatures:'EnumerateDevices,AudioOutputDevices',preload:__dirname+'/../p.js'}}; "
);
alert('A bootstrap patch has just been applied. Press OK to restart Discord.', 'EndPwn');
_cyn_restart();
}
catch (e) {
console.debug('Bootstrap patch 2 has already been applied.')
}
// webcrack, used to search for and modify objects in webpack
// credit to NO_BOOT_DEVICE
webpackJsonp([1e3],{webcrack_ver01_xyzzy:function(n,b,d){mArr=d.m,mCac=d.c,mCar=[],Object.keys(mCac).forEach(function(n){mCar[n]=mCac[n]}),findFunc=function(n){if(results=[],"string"==typeof n)mArr.forEach(function(r,t){-1!==r.toString().indexOf(n)&&results.push(mCac[t])});else{if("function"!=typeof n)throw new TypeError("findFunc can only find via string and function, "+typeof n+" was passed");modArray.forEach(function(r,e){n(r)&&results.push(t.c[e])})}return results},findCache=function(n){if(results=[],"function"==typeof n)mCar.forEach(function(r,t){n(r)&&results.push(r)});else{if("string"!=typeof n)throw new TypeError("findCache can only find via function or string, "+typeof n+" was passed");mCar.forEach(function(r,t){if("object"==typeof r.exports)for(p in r.exports)if(p==n&&results.push(r),"default"==p&&"object"==typeof r.exports["default"])for(p in r.exports["default"])p==n&&results.push(r)})}return results},window.wc={get:d,modArr:mArr,modCache:mCac,modCArr:mCar,findFunc:findFunc,findCache:findCache}}});webpackJsonp([1e3],"",["webcrack_ver01_xyzzy"]);
// some epapi shorthand methods, moved here because early accessibility
window.$listen = function (e, c) {
return document.addEventListener(e, c);
}
window.$dispatch = function (e) {
return document.dispatchEvent(e);
}
// beautifuldiscord, used to load css styles
// credit to leovoel
bdwatcher=null,bdtag=null,setupCSS=function(n){var e=fs.readFileSync(n,"utf-8");null===bdtag&&(bdtag=document.createElement("style"),document.head.appendChild(bdtag)),bdtag.innerHTML=e,null===bdwatcher&&(bdwatcher=fs.watch(n,{encoding:"utf-8"},function(e,w){if("change"===e){var i=fs.readFileSync(n,"utf-8");bdtag.innerHTML=i}}))};
// SELF_XSS warning disable (quant)
var results=wc.findFunc("SELF_XSS_HEADER");wc.get(results[results.length-1].i).consoleWarning=function(e){};
// load epapi.js
window._epapi = require(_cyn_data + "/cynergy/epapi");
// start the api
$api.go();
// blend the linq.js methods into the array prototype for implicit Enumerable.from()
if (!typeof (Enumerable) == 'undefined')
for (var k in Enumerable.prototype)
if (!Array.prototype.hasOwnProperty(k))
eval('Array.prototype.' + k + '=function(){return Enumerable.prototype.' + k + '.apply(Enumerable.from(this),arguments)}');
// load autoexec.js
try { require(_cyn_data + "/autoexec") } catch (e) { console.warn("Your autoexec.js file appears to have an error:\n\n" + e) };
// welcome message
console.log('%cCynergy', 'font-size: 72px; line-height: 72px; background: linear-gradient(to right, orange , yellow, green, cyan, blue, violet); -webkit-background-clip: text; -webkit-text-fill-color: transparent;');
console.log(`Cynergy (EndPwn v2) API v${_epapi.ver} | v${_cynergy_ver} loaded.\nAesthetics and maintence by Cynthia\nUpdater and WEBAPP_ENDPOINT override concept by quant\nwebcrack.js, ASAR injection concept, and general help from NO_BOOT_DEVICE\nExperiments menu enabler code by zatherz\nBeautifulDiscord by leovoel`);