mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 04:42:54 -05:00
Updated Windows/OSX agent.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -19,6 +19,7 @@ process.on('uncaughtException', function (ex) {
|
||||
require('MeshAgent').SendCommand({ "action": "msg", "type": "console", "value": "uncaughtException1: " + ex });
|
||||
});
|
||||
|
||||
//attachDebugger({ webport: 9999, wait: 1 }).then(function (prt) { console.log('Point Browser for Debug to port: ' + prt); });
|
||||
|
||||
function createMeshCore(agent) {
|
||||
var obj = {};
|
||||
@@ -1526,6 +1527,7 @@ function createMeshCore(agent) {
|
||||
obj.setupMeiOsAdmin = function (func, state) {
|
||||
if ((amtMei == null) || (amtMeiConnected != 2)) { return; } // If there is no MEI, don't bother with this.
|
||||
amtMei.getLocalSystemAccount(function (x) {
|
||||
if (x == null) return;
|
||||
var transport = require('amt-wsman-duk');
|
||||
var wsman = require('amt-wsman');
|
||||
var amt = require('amt');
|
||||
@@ -1537,6 +1539,7 @@ function createMeshCore(agent) {
|
||||
//*************************************
|
||||
// Setup KVM data channel if this is Intel AMT 12 or above
|
||||
amtMei.getVersion(function (x) {
|
||||
if (x == null) return;
|
||||
var amtver = null;
|
||||
try { for (var i in x.Versions) { if (x.Versions[i].Description == 'AMT') amtver = parseInt(x.Versions[i].Version.split('.')[0]); } } catch (e) { }
|
||||
if ((amtver != null) && (amtver >= 12)) {
|
||||
|
||||
@@ -215,7 +215,7 @@ function UserSessions()
|
||||
self.parent._user32.ACDC_H = self.parent._user32.RegisterPowerSettingNotification(self.parent.hwnd, GUID_ACDC_POWER_SOURCE, 0);
|
||||
self.parent._user32.BATT_H = self.parent._user32.RegisterPowerSettingNotification(self.parent.hwnd, GUID_BATTERY_PERCENTAGE_REMAINING, 0);
|
||||
self.parent._user32.DISP_H = self.parent._user32.RegisterPowerSettingNotification(self.parent.hwnd, GUID_CONSOLE_DISPLAY_STATE, 0);
|
||||
console.log(self.parent._user32.ACDC_H.Val, self.parent._user32.BATT_H.Val, self.parent._user32.DISP_H.Val);
|
||||
//console.log(self.parent._user32.ACDC_H.Val, self.parent._user32.BATT_H.Val, self.parent._user32.DISP_H.Val);
|
||||
}, this);
|
||||
});
|
||||
this._messagepump.on('message', function (msg)
|
||||
|
||||
@@ -172,11 +172,14 @@ function lme_heci(options) {
|
||||
{ // Bind a new server socket if not already present
|
||||
this[name][port] = require('net').createServer();
|
||||
this[name][port].HECI = this;
|
||||
if (lme_port_offset == 0) {
|
||||
this[name][port].listen({ port: port, host: '127.0.0.1' }); // Normal mode
|
||||
} else {
|
||||
this[name][port].listen({ port: (port + lme_port_offset) }); // Debug mode
|
||||
}
|
||||
|
||||
try {
|
||||
if (lme_port_offset == 0) {
|
||||
this[name][port].listen({ port: port, host: '127.0.0.1' }); // Normal mode
|
||||
} else {
|
||||
this[name][port].listen({ port: (port + lme_port_offset) }); // Debug mode
|
||||
}
|
||||
} catch (ex) { console.log('Binding error, LMS port ' + (port + lme_port_offset) + ': ' + ex) } // TODO: We can't bind
|
||||
this[name][port].on('connection', function (socket) {
|
||||
//console.log('New [' + socket.remoteFamily + '] TCP Connection on: ' + socket.remoteAddress + ' :' + socket.localPort);
|
||||
this.HECI.LMS.bindDuplexStream(socket, socket.remoteFamily, socket.localPort - lme_port_offset);
|
||||
|
||||
2163
agents/modules_meshcore/duktape-debugger.jsx
Normal file
2163
agents/modules_meshcore/duktape-debugger.jsx
Normal file
File diff suppressed because one or more lines are too long
@@ -55,56 +55,74 @@ function monitorinfo()
|
||||
else if(process.platform == 'linux')
|
||||
{
|
||||
// First thing we need to do, is determine where the X11 libraries are
|
||||
var fs = require('fs');
|
||||
var files = fs.readdirSync('/usr/lib');
|
||||
var files2;
|
||||
|
||||
/*
|
||||
for (j in files)
|
||||
var askOS = false;
|
||||
try
|
||||
{
|
||||
if (files[j].split('libX11.so.').length > 1 && files[j].split('.').length == 3)
|
||||
if (require('user-sessions').isRoot()) { askOS = true; }
|
||||
}
|
||||
catch (e)
|
||||
{ }
|
||||
|
||||
if (askOS)
|
||||
{
|
||||
// Sufficient access rights to use ldconfig
|
||||
var p = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
p.stdout._lines = '';
|
||||
p.stdout.on('data', function (chunk) { this._lines += chunk.toString(); });
|
||||
p.stdin.write('ldconfig -v\nexit\n');
|
||||
p.waitExit();
|
||||
|
||||
var paths = p.stdout._lines.split('\n');
|
||||
var searchPath = '';
|
||||
for (var i in paths)
|
||||
{
|
||||
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[j] });
|
||||
}
|
||||
if (files[j].split('libXtst.so.').length > 1 && files[j].split('.').length == 3)
|
||||
{
|
||||
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[j] });
|
||||
}
|
||||
if (files[j].split('libXext.so.').length > 1 && files[j].split('.').length == 3)
|
||||
{
|
||||
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[j] });
|
||||
if (paths[i].endsWith(':'))
|
||||
{
|
||||
searchPath = paths[i].substring(0, paths[i].length - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paths[i].split('libX11.').length > 1) { Object.defineProperty(this, 'Location_X11LIB', { value: searchPath + '/' + paths[i].split('->')[1].trim() }); }
|
||||
if (paths[i].split('libXtst.').length > 1) { Object.defineProperty(this, 'Location_X11TST', { value: searchPath + '/' + paths[i].split('->')[1].trim() }); }
|
||||
if (paths[i].split('libXext.').length > 1) { Object.defineProperty(this, 'Location_X11EXT', { value: searchPath + '/' + paths[i].split('->')[1].trim() }); }
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
for (var i in files)
|
||||
else
|
||||
{
|
||||
try {
|
||||
if (files[i].split('libX11.so.').length > 1 && files[i].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] });
|
||||
}
|
||||
if (files[i].split('libXtst.so.').length > 1 && files[i].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] });
|
||||
}
|
||||
if (files[i].split('libXext.so.').length > 1 && files[i].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] });
|
||||
}
|
||||
// Not enough access rights to use ldconfig, so manually search
|
||||
var fs = require('fs');
|
||||
var files = fs.readdirSync('/usr/lib');
|
||||
var files2;
|
||||
|
||||
if (files[i].split('-linux-').length > 1) {
|
||||
files2 = fs.readdirSync('/usr/lib/' + files[i]);
|
||||
for (j in files2) {
|
||||
if (files2[j].split('libX11.so.').length > 1 && files2[j].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||
}
|
||||
if (files2[j].split('libXtst.so.').length > 1 && files2[j].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||
}
|
||||
if (files2[j].split('libXext.so.').length > 1 && files2[j].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||
for (var i in files) {
|
||||
try {
|
||||
if (files[i].split('libX11.so.').length > 1 && files[i].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] });
|
||||
}
|
||||
if (files[i].split('libXtst.so.').length > 1 && files[i].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] });
|
||||
}
|
||||
if (files[i].split('libXext.so.').length > 1 && files[i].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] });
|
||||
}
|
||||
|
||||
if (files[i].split('-linux-').length > 1) {
|
||||
files2 = fs.readdirSync('/usr/lib/' + files[i]);
|
||||
for (j in files2) {
|
||||
if (files2[j].split('libX11.so.').length > 1 && files2[j].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11LIB', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||
}
|
||||
if (files2[j].split('libXtst.so.').length > 1 && files2[j].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11TST', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||
}
|
||||
if (files2[j].split('libXext.so.').length > 1 && files2[j].split('.').length == 3) {
|
||||
Object.defineProperty(this, 'Location_X11EXT', { value: '/usr/lib/' + files[i] + '/' + files2[j] });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ex) { }
|
||||
} catch (ex) { }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(this, 'kvm_x11_support', { value: (this.Location_X11LIB && this.Location_X11TST && this.Location_X11EXT)?true:false });
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ function UserSessions()
|
||||
self.parent._user32.ACDC_H = self.parent._user32.RegisterPowerSettingNotification(self.parent.hwnd, GUID_ACDC_POWER_SOURCE, 0);
|
||||
self.parent._user32.BATT_H = self.parent._user32.RegisterPowerSettingNotification(self.parent.hwnd, GUID_BATTERY_PERCENTAGE_REMAINING, 0);
|
||||
self.parent._user32.DISP_H = self.parent._user32.RegisterPowerSettingNotification(self.parent.hwnd, GUID_CONSOLE_DISPLAY_STATE, 0);
|
||||
console.log(self.parent._user32.ACDC_H.Val, self.parent._user32.BATT_H.Val, self.parent._user32.DISP_H.Val);
|
||||
//console.log(self.parent._user32.ACDC_H.Val, self.parent._user32.BATT_H.Val, self.parent._user32.DISP_H.Val);
|
||||
}, this);
|
||||
});
|
||||
this._messagepump.on('message', function (msg)
|
||||
|
||||
Reference in New Issue
Block a user