Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Have I been hacked? I found these 4 js files sitting in a user's home directory. %UserProfile%\.atom\compile-cache\836a81e7afc5e1080850f10b0790220f3d81503a\js\
'use babel';
// Filter out user's paths from require search list
var re = /[\\\/]\.node_/i;
var requirePaths = require('module').globalPaths;
var newPaths = [];
for (var i = 0; i < requirePaths.length; i++) {
if (requirePaths[i].match(re)) continue;
newPaths.push(requirePaths[i]);
}
require('module').globalPaths = newPaths;
var ipc = require('ipc');
var rx = require('rx-dom');
rx.config.longStackSupport = true;
var AppIntegration = require('./app');
var DockIntegration = require('./dock');
var NotificationIntegration = require('./notify');
var TeamIntegration = require('./team');
var ContextMenuIntegration = require('./context-menu');
var TooltipIntegration = require('./tooltips');
var SpellCheckingHelper = require('./spell-checking');
var WindowApi = require('./window-api');
var logger = require('../browser/logger').init(__filename);
global.globalLogger = logger;
window.rendererEvalAsync = function (blob) {
var data = JSON.parse(decodeURIComponent(blob));
try {
data.result = JSON.stringify(eval(data.code));
} catch (error) {
data.error = { stack: error.stack, message: error.message };
}
ipc.sendToHost('eval-async', data);
};
var webFrame = global.webFrame = require('web-frame');
webFrame.registerUrlSchemeAsSecure('slack-resources');
var spellCheckingHelper = null;
spellCheckingHelper = new SpellCheckingHelper();
if (process.platform === 'linux') {
logger.error('Spellchecking isn\'t supported on Linux');
} else {
// NB: Wait until we're in page context before we try to set up our input
// listener
rx.Scheduler.timeout.scheduleWithRelative(4 * 1000, function () {
try {
spellCheckingHelper.setupInputEventListener();
} catch (error) {
logger.error('Spellchecking is busted, continuing: ' + error.message + '\n' + error.stack);
}
});
}
var contextMenu = new ContextMenuIntegration(spellCheckingHelper ? spellCheckingHelper.currentKeyboardLanguage : rx.Observable.empty());
window.winssb = {
app: new AppIntegration(),
dock: new DockIntegration(),
notice: new NotificationIntegration(),
teams: new TeamIntegration(),
window: new WindowApi(),
contextMenu: contextMenu,
spellCheckingHelper: spellCheckingHelper,
// Tooltips are supported natively on Mac
tooltips: process.platform === 'darwin' ? null : new TooltipIntegration(),
ls: window.localStorage
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkM6L1VzZXJzL3BhdWwvY29kZS90aW55c3BlY2svc2xhY2std2luc3NiL3NyYy9zc2IvbWFpbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLENBQUM7OztBQUdaLElBQUksRUFBRSxHQUFHLGdCQUFnQixDQUFDO0FBQzFCLElBQUksWUFBWSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxXQUFXLENBQUM7QUFDakQsSUFBSSxRQUFRLEdBQUcsRUFBRSxDQUFDOztBQUVsQixLQUFLLElBQUksQ0FBQyxHQUFDLENBQUMsRUFBRSxDQUFDLEdBQUcsWUFBWSxDQUFDLE1BQU0sRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUMxQyxNQUFJLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLEVBQUcsU0FBUztBQUN6QyxVQUFRLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0NBQ2hDOztBQUVELE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxXQUFXLEdBQUcsUUFBUSxDQUFDOztBQUV6QyxJQUFNLEdBQUcsR0FBRyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDM0IsSUFBTSxFQUFFLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBQzdCLEVBQUUsQ0FBQyxNQUFNLENBQUMsZ0JBQWdCLEdBQUcsSUFBSSxDQUFDOztBQUVsQyxJQUFNLGNBQWMsR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7QUFDeEMsSUFBTSxlQUFlLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FB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5ldyBBcHBJbnRlZ3JhdGlvbigpLFxuXG4gIGRvY2s6IG5ldyBEb2NrSW50ZWdyYXRpb24oKSxcblxuICBub3RpY2U6IG5ldyBOb3RpZmljYXRpb25JbnRlZ3JhdGlvbigpLFxuXG4gIHRlYW1zOiBuZXcgVGVhbUludGVncmF0aW9uKCksXG5cbiAgd2luZG93OiBuZXcgV2luZG93QXBpKCksXG5cbiAgY29udGV4dE1lbnU6IGNvbnRleHRNZW51LFxuXG4gIHNwZWxsQ2hlY2tpbmdIZWxwZXI6IHNwZWxsQ2hlY2tpbmdIZWxwZXIsXG5cbiAgLy8gVG9vbHRpcHMgYXJlIHN1cHBvcnRlZCBuYXRpdmVseSBvbiBNYWNcbiAgdG9vbHRpcHM6IChwcm9jZXNzLnBsYXRmb3JtID09PSAnZGFyd2luJyA/IG51bGwgOiBuZXcgVG9vbHRpcEludGVncmF0aW9uKCkpLFxuXG4gIGxzOiB3aW5kb3cubG9jYWxTdG9yYWdlXG59O1xuIl19
'use babel';
var rx = require('rx');
var request = require('request');
var fs = require('fs');
var wrapMethodInRx = function wrapMethodInRx(method) {
return function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return rx.Observable.create(function (subj) {
// Push the callback as the last parameter
args.push(function (err, resp, body) {
if (err) {
subj.onError(err);
return;
}
if (resp.statusCode >= 400) {
subj.onError(new Error('Request failed: ' + resp.statusCode + '\n' + body));
return;
}
subj.onNext({ response: resp, body: body });
subj.onCompleted();
});
try {
method.apply(undefined, args);
} catch (e) {
subj.onError(e);
}
return rx.Disposable.empty;
});
};
};
var requestRx = wrapMethodInRx(request);
requestRx.get = wrapMethodInRx(request.get);
requestRx.post = wrapMethodInRx(request.post);
requestRx.patch = wrapMethodInRx(request.patch);
requestRx.put = wrapMethodInRx(request.put);
requestRx.del = wrapMethodInRx(request.del);
requestRx.pipe = function (url, stream) {
return rx.Observable.create(function (subj) {
try {
request.get(url).on('response', function (resp) {
if (resp.statusCode > 399) subj.onError(new Error('Failed request: ' + resp.statusCode));
}).on('error', function (err) {
return subj.onError(err);
}).on('end', function () {
subj.onNext(true);subj.onCompleted();
}).pipe(stream);
} catch (e) {
subj.onError(e);
}
});
};
var isHttpUrl = function isHttpUrl(pathOrUrl) {
return pathOrUrl.match(/^http/i);
};
// Public: Fetches a file or URL, then returns its content as an Observable
//
// pathOrUrl - Either a file path or an HTTP URL
//
// Returns: An Observable which will yield a single value and complete, the contents
// of the given path or URL.
requestRx.fetchFileOrUrl = function (pathOrUrl) {
if (!isHttpUrl(pathOrUrl)) {
try {
return rx.Observable['return'](fs.readFileSync(pathOrUrl, { encoding: 'utf8' }));
} catch (e) {
return rx.Observable['throw'](e);
}
}
return requestRx(pathOrUrl).map(function (x) {
return x.body;
});
};
// Private: Opens a file or URL, then returns a Readable Stream as an Observable
//
// pathOrUrl - Either a file path or an HTTP URL
//
// Returns: An Observable which will yield a single value and complete, which will
// be a Readable Stream that can be used with `pipe` or `read` / `readSync`
requestRx.streamFileOrUrl = function (pathOrUrl) {
if (!isHttpUrl(pathOrUrl)) {
return rx.Observable.create(function (subj) {
var s = fs.createReadStream(pathOrUrl);
s.on('open', function () {
subj.onNext(s);
subj.onCompleted();
});
s.on('error', function (err) {
return subj.onError(err);
});
return rx.Disposable.empty;
});
}
return rx.Observable.create(function (subj) {
var rq = null;
try {
rq = request(pathOrUrl);
} catch (e) {
subj.onError(e);
return rx.Disposable.empty;
}
rq.on('response', function (resp) {
subj.onNext(resp);
subj.onCompleted();
});
rq.on('error', function (err) {
return subj.onError(err);
});
return rx.Disposable.empty;
});
};
module.exports = requestRx;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkM6L1VzZXJzL3BhdWwvY29kZS90aW55c3BlY2svc2xhY2std2luc3NiL3NyYy9yZXF1ZXN0LXJ4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFdBQVcsQ0FBQz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hPclVybCkpIHtcbiAgICByZXR1cm4gcnguT2JzZXJ2YWJsZS5jcmVhdGUoKHN1YmopID0+IHtcbiAgICAgIGxldCBzID0gZnMuY3JlYXRlUmVhZFN0cmVhbShwYXRoT3JVcmwpO1xuXG4gICAgICBzLm9uKCdvcGVuJywgKCkgPT4ge1xuICAgICAgICBzdWJqLm9uTmV4dChzKTtcbiAgICAgICAgc3Viai5vbkNvbXBsZXRlZCgpO1xuICAgICAgfSk7XG5cbiAgICAgIHMub24oJ2Vycm9yJywgKGVycikgPT4gc3Viai5vbkVycm9yKGVycikpO1xuXG4gICAgICByZXR1cm4gcnguRGlzcG9zYWJsZS5lbXB0eTtcbiAgICB9KTtcbiAgfVxuXG4gIHJldHVybiByeC5PYnNlcnZhYmxlLmNyZWF0ZSgoc3ViaikgPT4ge1xuICAgIGxldCBycSA9IG51bGw7XG4gICAgdHJ5IHtcbiAgICAgIHJxID0gcmVxdWVzdChwYXRoT3JVcmwpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHN1Ymoub25FcnJvcihlKTtcbiAgICAgIHJldHVybiByeC5EaXNwb3NhYmxlLmVtcHR5O1xuICAgIH1cblxuICAgIHJxLm9uKCdyZXNwb25zZScsIChyZXNwKSA9PiB7XG4gICAgICBzdWJqLm9uTmV4dChyZXNwKTtcbiAgICAgIHN1Ymoub25Db21wbGV0ZWQoKTtcbiAgICB9KTtcblxuICAgIHJxLm9uKCdlcnJvcicsIChlcnIpID0+IHN1Ymoub25FcnJvcihlcnIpKTtcbiAgICByZXR1cm4gcnguRGlzcG9zYWJsZS5lbXB0eTtcbiAgfSk7XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVlc3RSeDtcbiJdfQ==
'use babel';
var ref = require('ref');
var refStruct = require('ref-struct');
var refArray = require('ref-array');
var ffi = require('ffi-atom-shell');
var intPtr = null;
var boolPtr = null;
var LASTINPUTINFO = null;
var OSVERSIONINFO = null;
var pOSVERSIONINFO = null;
var pLASTINPUTINFO = null;
var shell32 = null;
var user32 = null;
var kernel32 = null;
var dwmApi = null;
var setupWindowsLibs = function setupWindowsLibs() {
intPtr = intPtr || ref.refType(ref.types.int32);
boolPtr = boolPtr || ref.refType(ref.types.bool);
LASTINPUTINFO = LASTINPUTINFO || refStruct({
cbSize: ref.types.int32,
dwTime: ref.types.uint32 });
OSVERSIONINFO = OSVERSIONINFO || refStruct({
dwOSVersionInfoSize: ref.types.uint32,
dwMajorVersion: ref.types.uint32,
dwMinorVersion: ref.types.uint32,
dwBuildNumber: ref.types.uint32,
dwPlatformId: ref.types.uint32,
szCSDVersion: refArray(ref.types.byte, 128) });
pLASTINPUTINFO = pLASTINPUTINFO || ref.refType(LASTINPUTINFO);
pOSVERSIONINFO = pOSVERSIONINFO || ref.refType(OSVERSIONINFO);
shell32 = shell32 || ffi.Library('shell32', {
SHQueryUserNotificationState: ['int', [intPtr]]
});
user32 = user32 || ffi.Library('user32', {
GetLastInputInfo: ['int', [pLASTINPUTINFO]],
GetSystemMetrics: ['int', ['int']]
});
kernel32 = kernel32 || ffi.Library('kernel32', {
GetTickCount: ['uint32', []],
GetVersionExA: ['int', [pOSVERSIONINFO]],
GetLastError: ['uint32', []]
});
dwmApi = dwmApi || ffi.Library('dwmapi', {
DwmIsCompositionEnabled: ['int', [boolPtr]]
});
};
var logger = null;
exports = {
win32: {
shouldDisplayNotifications: function shouldDisplayNotifications() {
setupWindowsLibs();
logger = logger || require('./browser/logger').init(__filename);
var outVal = ref.alloc(intPtr);
var hr = shell32.SHQueryUserNotificationState(outVal);
if (hr !== 0) {
throw new Error('Failed to query notification state, hr is 0x' + hr.toString(16));
}
var result = outVal.get();
logger.debug('shouldDisplayNotifications: ' + result);
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb762533(v=vs.85).aspx
if (result === 5) {
return true;
} // QUNS_ACCEPTS_NOTIFICATIONS
if (result === 7) {
return true;
} // QUNS_APP
return false;
},
getIdleTimeInMs: function getIdleTimeInMs() {
setupWindowsLibs();
logger = logger || require('./browser/logger').init(__filename);
var result = new LASTINPUTINFO();
result.cbSize = LASTINPUTINFO.size;
var failed = user32.GetLastInputInfo(result.ref()) === 0;
if (failed) {
throw new Error('Couldn\'t get idle time');
}
var ret = kernel32.GetTickCount() - result.dwTime;
logger.debug('Idle time is: ' + ret);
return ret;
},
getOSVersion: function getOSVersion() {
setupWindowsLibs();
logger = logger || require('./browser/logger').init(__filename);
var result = new OSVERSIONINFO();
result.dwOSVersionInfoSize = OSVERSIONINFO.size;
var failed = kernel32.GetVersionExA(result.ref()) === 0;
if (failed) {
var gle = kernel32.GetLastError();
throw new Error('Failed to get version information: 0x' + gle.toString(16));
}
return {
major: result.dwMajorVersion,
minor: result.dwMinorVersion,
build: result.dwBuildNumber };
},
// Public: Determine if this machine can support transparent windows.
// First check for DWM Composition, then see if we're in a remote session.
supportsTransparentWindows: function supportsTransparentWindows() {
setupWindowsLibs();
logger = logger || require('./browser/logger').init(__filename);
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa969518%28v=vs.85%29.aspx
var outVal = ref.alloc(boolPtr);
var hr = dwmApi.DwmIsCompositionEnabled(outVal);
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724385%28v=vs.85%29.aspx
var remoteSession = 4096;
var isRemoteSession = user32.GetSystemMetrics(remoteSession);
if (hr !== 0) {
throw new Error('Failed to check DWM composition, hr is 0x' + hr.toString(16));
}
var isComposing = outVal.get();
logger.debug('DwmIsCompositionEnabled: ' + isComposing + ', Remote Session: ' + isRemoteSession);
return !!(isComposing && !isRemoteSession && !process.env.SLACK_DWM_DISABLED);
} },
darwin: {
shouldDisplayNotifications: function shouldDisplayNotifications() {
// TODO: Replace this with a call to NSApplication.currentSystemPresentationOptions
return true;
},
getIdleTimeInMs: function getIdleTimeInMs() {
// TODO: Replace with a call to CGEventSourceCounterForEventType
return 100000000;
},
getOSVersion: function getOSVersion() {
logger = logger || require('./browser/logger').init(__filename);
logger.error('Not implemented!!!!');
return { major: 1, minor: 0, build: 0 };
},
supportsTransparentWindows: function supportsTransparentWindows() {
return true;
} },
linux: {
shouldDisplayNotifications: function shouldDisplayNotifications() {
return true;
},
getIdleTimeInMs: function getIdleTimeInMs() {
return 100000000;
},
getOSVersion: function getOSVersion() {
logger = logger || require('./browser/logger').init(__filename);
logger.error('Not implemented!!!!');
return { major: 1, minor: 0, build: 0 };
},
supportsTransparentWindows: function supportsTransparentWindows() {
return true;
} }
};
module.exports = exports[process.platform];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkM6L1VzZXJzL3BhdWwvY29kZS90aW55c3BlY2svc2xhY2std2luc3NiL3NyYy9uYXRpdmUtaW50ZXJvcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLENBQUM7O0FBRVosSUFBSSxHQUFHLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3pCLElBQUksU0FBUyxHQUFHLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FBQztBQUN0QyxJQUFJLFFBQVEsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDcEMsSUFBSSxHQUFHLEdBQUcsT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBQUM7O0FBRXBDLElBQUksTUFBTSxHQUFHLElBQUksQ0FBQztBQUNsQixJQUFJLE9BQU8sR0FBRyxJQUFJLENBQUM7QUFDbkIsSUFBSSxhQUFhLEdBQUcsSUFBSSxDQUFDO0FBQ3pCLElBQUksYUFBYSxHQUFHLElBQUksQ0FBQztBQUN6QixJQUFJLGNBQWMsR0FBRyxJQUFJLENBQUM7QUFDMUIsSUFBSSxjQUFjLEdBQUcsSUFBSSxDQUFDO0FBQzFCLElBQUksT0FBTyxHQUFHLElBQUksQ0FBQztBQUNuQixJQUFJLE1BQU0sR0FBRyxJQUFJLENBQUM7QUFDbEIsSUFBSSxRQUFRLEdBQUcsSUFBSSxDQUFDO0F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ISEhXCIpO1xuXG4gICAgICByZXR1cm4geyBtYWpvcjogMSwgbWlub3I6IDAsIGJ1aWxkOiAwIH07XG4gICAgfSxcblxuICAgIHN1cHBvcnRzVHJhbnNwYXJlbnRXaW5kb3dzOiAoKSA9PiB0cnVlLFxuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGV4cG9ydHNbcHJvY2Vzcy5wbGF0Zm9ybV07XG4iXX0=
'use babel';
var rx = require('rx');
var _ = require('underscore-plus');
var ipc = require('ipc');
module.exports = _.extend({}, ipc, {
listen: function listen(channel) {
return rx.Observable.create(function (subj) {
var listener = function listener(event, args) {
return subj.onNext(args);
};
ipc.on(channel, listener);
return rx.Disposable.create(function () {
return ipc.removeListener(channel, listener);
});
});
}
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkM6L1VzZXJzL3BhdWwvY29kZS90aW55c3BlY2svc2xhY2std2luc3NiL3NyYy9icm93c2VyL2lwYy1yeC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLENBQUM7O0FBRVosSUFBSSxFQUFFLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3ZCLElBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO0FBQ25DLElBQUksR0FBRyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQzs7QUFFekIsTUFBTSxDQUFDLE9BQU8sR0FDZCxDQUFDLENBQUMsTUFBTSxDQUFDLEVBQUUsRUFBRSxHQUFHLEVBQUU7QUFDaEIsUUFBTSxFQUFFLFNBQUEsTUFBQSxDQUFDLE9BQU8sRUFBSztBQUNuQixXQUFPLEVBQUUsQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDLFVBQUMsSUFBSSxFQUFLO0FBQ3BDLFVBQUksUUFBUSxHQUNWLFNBQUEsUUFBQSxDQUFDLEt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19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment