mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-24 06:05:53 -05:00
Improved MeshCmd and added SMBIOS support.
This commit is contained in:
parent
386b535a7a
commit
426a0199ef
@ -30,10 +30,12 @@
|
||||
<Compile Include="agents\modules_meshcmd\amt-wsman.js" />
|
||||
<Compile Include="agents\modules_meshcmd\amt-xml.js" />
|
||||
<Compile Include="agents\modules_meshcmd\amt.js" />
|
||||
<Compile Include="agents\modules_meshcmd\smbios.js" />
|
||||
<Compile Include="agents\modules_meshcore\amt-lme.js" />
|
||||
<Compile Include="agents\modules_meshcore\amt-mei.js" />
|
||||
<Compile Include="agents\modules_meshcore\amt-scanner.js" />
|
||||
<Compile Include="agents\modules_meshcore\amt-xml.js" />
|
||||
<Compile Include="agents\modules_meshcore\smbios.js" />
|
||||
<Compile Include="agents\modules_meshcore\wifi-scanner.js" />
|
||||
<Compile Include="agents\testsuite.js" />
|
||||
<Compile Include="agents\tinycore.js" />
|
||||
@ -82,10 +84,14 @@
|
||||
<Content Include="agents\meshagent_x86-64" />
|
||||
<Content Include="agents\meshagent_x86-64_nokvm" />
|
||||
<Content Include="agents\meshagent_x86_nokvm" />
|
||||
<Content Include="agents\MeshCmd-signed.exe" />
|
||||
<Content Include="agents\MeshCmd64-signed.exe" />
|
||||
<Content Include="agents\MeshCommander-Small.gz" />
|
||||
<Content Include="agents\meshinstall-initd.sh" />
|
||||
<Content Include="agents\meshinstall-linux.sh" />
|
||||
<Content Include="agents\MeshService-signed.exe" />
|
||||
<Content Include="agents\MeshService.exe" />
|
||||
<Content Include="agents\MeshService64-signed.exe" />
|
||||
<Content Include="agents\MeshService64.exe" />
|
||||
<Content Include="LICENSE" />
|
||||
<Content Include="package.json" />
|
||||
|
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.
@ -40,6 +40,7 @@ var amtLms = null, amtMei = null, amtMeiState = null;
|
||||
var wsstack = null, amtstack = null;
|
||||
var oswsstack = null, osamtstack = null;
|
||||
var amtMeiTmpState = null;
|
||||
var SMBiosTables = null;
|
||||
|
||||
|
||||
// MeshCommander for Firmware (GZIP'ed, Base64)
|
||||
@ -62,15 +63,35 @@ function md5hex(str) { return require('MD5Stream').create().syncHash(str).toStri
|
||||
function guidToStr(g) { return g.substring(6, 8) + g.substring(4, 6) + g.substring(2, 4) + g.substring(0, 2) + "-" + g.substring(10, 12) + g.substring(8, 10) + "-" + g.substring(14, 16) + g.substring(12, 14) + "-" + g.substring(16, 20) + "-" + g.substring(20); }
|
||||
function parceArguments(argv) { var r = {}; for (var i in argv) { i = parseInt(i); if (argv[i].startsWith('--') == true) { var key = argv[i].substring(2).toLowerCase(), val = true; if (((i + 1) < argv.length) && (argv[i + 1].startsWith('--') == false)) { val = argv[i + 1]; } r[key] = val; } } return r; }
|
||||
|
||||
// Convert an object to string with all functions
|
||||
function objToString(x, p, ret) {
|
||||
if (ret == undefined) ret = '';
|
||||
if (p == undefined) p = 0;
|
||||
if (x == null) { return '[null]'; }
|
||||
if (p > 8) { return '[...]'; }
|
||||
if (x == undefined) { return '[undefined]'; }
|
||||
if (typeof x == 'string') { if (p == 0) return x; return '"' + (x.split('\0')[0]) + '"'; }
|
||||
if (typeof x == 'buffer') { return '[buffer]'; }
|
||||
if (typeof x != 'object') { return x; }
|
||||
var r = '{' + (ret ? '\r\n' : ' ');
|
||||
for (var i in x) {
|
||||
if (i != '_ObjectID') { r += (addPad(p + 2, ret) + i + ': ' + objToString(x[i], p + 2, ret) + (ret ? '\r\n' : ' ')); }
|
||||
}
|
||||
return r + addPad(p, ret) + '}';
|
||||
}
|
||||
|
||||
// Return p number of spaces
|
||||
function addPad(p, ret) { var r = ''; for (var i = 0; i < p; i++) { r += ' '; } return r; }
|
||||
|
||||
// Parse the incoming arguments
|
||||
function run(argv) {
|
||||
if (meshCmdVersion[0] == '*') { meshCmdVersion = ''; } else { meshCmdVersion = ' v' + meshCmdVersion; }
|
||||
var args = parceArguments(argv);
|
||||
//console.log('MeshCentral Command' + meshCmdVersion);
|
||||
//console.log(JSON.stringify(argv));
|
||||
//console.log('addedModules = ' + JSON.stringify(addedModules));
|
||||
var actionpath = 'meshaction.txt';
|
||||
if (args.actionfile != null) { actionpath = args.actionfile; }
|
||||
var actions = ['ROUTE', 'AMTLMS', 'AMTLOADWEBAPP', 'AMTLOADSMALLWEBAPP', 'AMTLOADLARGEWEBAPP', 'AMTCLEARWEBAPP', 'AMTSTORAGESTATE', 'MEINFO', 'MEVERSIONS', 'MEHASHES', 'AMTSAVESTATE', 'MESCRIPT', 'AMTUUID', 'AMTCCM', 'AMTDEACTIVATE'];
|
||||
var actions = ['HELP', 'ROUTE', 'AMTLMS', 'AMTLOADWEBAPP', 'AMTLOADSMALLWEBAPP', 'AMTLOADLARGEWEBAPP', 'AMTCLEARWEBAPP', 'AMTSTORAGESTATE', 'AMTINFO', 'AMTVERSIONS', 'AMTHASHES', 'AMTSAVESTATE', 'AMTSCRIPT', 'AMTUUID', 'AMTCCM', 'AMTDEACTIVATE', 'SMBIOS', 'RAWSMBIOS'];
|
||||
|
||||
// Load the action file
|
||||
var actionfile = null;
|
||||
@ -103,10 +124,132 @@ function run(argv) {
|
||||
if ((argv.length > 1) && (actions.indexOf(argv[1].toUpperCase()) >= 0)) { settings.action = argv[1]; }
|
||||
|
||||
// Validate meshaction.txt
|
||||
if (settings.action == null) { console.log('No action specified, valid actions are: ' + actions.join(', ') + '.'); exit(1); return; }
|
||||
if (settings.action == null) {
|
||||
console.log('MeshCentral Command (MeshCmd) ' + meshCmdVersion);
|
||||
console.log('No action specified, use MeshCmd like this:\r\n');
|
||||
console.log(' meshcmd [action] [arguments...]\r\n');
|
||||
console.log('Valid MeshCentral actions:');
|
||||
console.log(' Route - Map a local TCP port to a remote computer.');
|
||||
console.log('\r\nValid local actions:');
|
||||
console.log(' SMBios - Display System Management BIOS tables for this computer.');
|
||||
console.log(' RawSMBios - Display RAW System Management BIOS tables for this computer.');
|
||||
console.log(' AmtInfo - Show Intel AMT version and activation state.');
|
||||
console.log(' AmtVersions - Show all Intel ME version information.');
|
||||
console.log(' AmtHashes - Show all Intel AMT trusted activation hashes.');
|
||||
console.log(' AmtLMS - Run MicroLMS, allowing local access to Intel AMT.');
|
||||
console.log(' AmtCCM - Activate Intel AMT into Client Control Mode.');
|
||||
console.log(' AmtDeactivate - Deactivate Intel AMT if activated in Client Control mode.');
|
||||
console.log('\r\nValid local or remote actions:');
|
||||
console.log(' AmtUUID - Show Intel AMT unique identifier.');
|
||||
console.log(' AmtLoadWebApp - Load MeshCommander in Intel AMT 11.6+ firmware.');
|
||||
console.log(' AmtClearWebApp - Clear everything from Intel AMT web storage.');
|
||||
console.log(' AmtStorageState - Show contents of the Intel AMT web storage.');
|
||||
console.log(' AmtSaveState - Save all Intel AMT WSMAN object to file.');
|
||||
console.log(' AmtScript - Run .mescript on Intel AMT.');
|
||||
console.log('\r\nHelp on a specific action using:\r\n');
|
||||
console.log(' meshcmd help [action]');
|
||||
exit(1); return;
|
||||
}
|
||||
if (settings.action == 'help') {
|
||||
if (argv.length <= 2) {
|
||||
actions.shift();
|
||||
console.log('Help usage:\r\n\r\n MeshCmd help [action]\r\n\r\nValid actions are: ' + actions.join(', ') + '.');
|
||||
exit(1); return;
|
||||
}
|
||||
var action = argv[2].toLowerCase();
|
||||
if (action == 'route') {
|
||||
console.log("The route action is used along with a MeshCentral account to map a local TCP port to a remote port on any computer on your MeshCentral account. This action requires many arguments, to avoid specifying them all it's best to download the meshaction.txt file from the web site and place it in the current folder. Example usage:\r\n\r\n (Place meshaction.txt file in current folder)\r\n meshcmd route --pass myAccountPassword");
|
||||
} else if (action == 'smbios') {
|
||||
console.log("SMBios action will display this computer's system management BIOS information. Example usage:\r\n\r\n meshcmd smbios --out smbios.txt\r\n");
|
||||
console.log('\r\Optional arguments:\r\n');
|
||||
console.log(' --output [filename] Optional filename to write the results to.');
|
||||
} else if (action == 'rawsmbios') {
|
||||
console.log("RawSMBios action will display this computer's system management BIOS information in raw hexdecimal form. Example usage:\r\n\r\n meshcmd rawsmbios --out smbios.txt\r\n");
|
||||
console.log('\r\Optional arguments:\r\n');
|
||||
console.log(' --output [filename] Optional filename to write the results to.');
|
||||
} else if (action == 'amtinfo') {
|
||||
console.log('AmtInfo action will get the version and activation state of Intel AMT on this computer. The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Example usage:\r\n\r\n meshcmd amtinfo');
|
||||
} else if ((action == 'amtversion') || (action == 'amtversions')) {
|
||||
console.log('AmtVersions will display all version information about Intel AMT on this computer. The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Example usage:\r\n\r\n meshcmd amtversions');
|
||||
} else if (action == 'amthashes') {
|
||||
console.log('Amthashes will display all trusted activations hashes for Intel AMT on this computer. The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. These certificates hashes are used by Intel AMT when performing activation into ACM mode. Example usage:\r\n\r\n meshcmd amthashes');
|
||||
} else if (action == 'amtlms') {
|
||||
console.log('AmtLMS will state MicroLMS on this computer, allowing local access to Intel AMT on TCP ports 16992 and 16993 when applicable. The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. These certificates hashes are used by Intel AMT when performing activation into ACM mode. Example usage:\r\n\r\n meshcmd amtlms');
|
||||
} else if (action == 'amtccm') {
|
||||
console.log('AmtCCM will attempt to activate Intel AMT on this computer into client control mode (CCM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be in "pre-provisioning" state for this command to work and a administrator password must be provided. Example usage:\r\n\r\n meshcmd amtccm --pass mypassword');
|
||||
} else if (action == 'amtdeactivate') {
|
||||
console.log('AmtDeactivate will attempt to deactivate Intel AMT on this computer when in client control mode (CCM). The command must be run on a computer with Intel AMT, must run as administrator and the Intel management driver must be installed. Intel AMT must be activated in client control mode for this command to work. Example usage:\r\n\r\n meshcmd amtdeactivate');
|
||||
} else if (action == 'amtuuid') {
|
||||
console.log('AmtUUID action will get the unique identifier of the local or remote Intel AMT computer. By default, the local UUID is obtained unless a host is specified. Intel AMT must be activated for this command to work. Example usage:\r\n\r\n meshcmd amtuuid --host 1.2.3.4 --user admin --pass mypassword --tls');
|
||||
console.log('\r\nRequired arguments:\r\n');
|
||||
console.log(' --host [hostname] The IP address or DNS name of Intel AMT, 127.0.0.1 is default.');
|
||||
console.log(' --user [username] The Intel AMT login username, admin is default.');
|
||||
console.log(' --pass [password] The Intel AMT login password.');
|
||||
console.log(' --tls Specifies that TLS must be used.');
|
||||
} else if ((action == 'amtloadwebapp') || (action == 'amtloadsmallwebapp') || (action == 'amtloadlargewebapp') || (action == 'amtclearwebapp') || (action == 'amtstoragestate')) {
|
||||
console.log('AmtLoadWebApp action will load MeshCommander into Intel AMT 11.6 or higher. If the computer is in ACM mode, MeshCommander will replace the default index.htm on HTTP/16992 or HTTPS/16993. If Intel AMT is in CCM mode, MeshCommander will be installed alongside the default web page and will be accessible in the "Web Applications" section. This action works on Intel AMT 11.6 and higher only. Example usage:\r\n\r\n meshcmd amtloadwebapp --host 1.2.3.4 --user admin --pass mypassword --tls');
|
||||
console.log('\r\nRequired arguments:\r\n');
|
||||
console.log(' --host [hostname] The IP address or DNS name of Intel AMT, 127.0.0.1 is default.');
|
||||
console.log(' --user [username] The Intel AMT login username, admin is default.');
|
||||
console.log(' --pass [password] The Intel AMT login password.');
|
||||
console.log(' --tls Specifies that TLS must be used.');
|
||||
} else if (action == 'amtclearwebstorage') {
|
||||
console.log('AmtClearWebStorage will clear the web storage of Intel AMT, removing any loaded firmware version of MeshCommander. This command can clear the local or a remote Intel AMT computer. By default, the local computer storage is cleared unless a host is specified. Intel AMT must be activated for this command to work. This action works on Intel AMT 11.6 and higher only. Example usage:\r\n\r\n meshcmd amtclearwebstorage --host 1.2.3.4 --user admin --pass mypassword --tls');
|
||||
console.log('\r\nRequired arguments:\r\n');
|
||||
console.log(' --host [hostname] The IP address or DNS name of Intel AMT, 127.0.0.1 is default.');
|
||||
console.log(' --user [username] The Intel AMT login username, admin is default.');
|
||||
console.log(' --pass [password] The Intel AMT login password.');
|
||||
console.log(' --tls Specifies that TLS must be used.');
|
||||
} else if (action == 'amtstoragestate') {
|
||||
console.log('AmtStorageState will display the content of the web storage of Intel AMT including any loaded firmware version of MeshCommander. This command can read the storage state of a local or remote Intel AMT computer. By default, the local computer storage state is displayed unless a host is specified. Intel AMT must be activated for this command to work. This action works on Intel AMT 11.6 and higher only. Example usage:\r\n\r\n meshcmd amtstoragestate --host 1.2.3.4 --user admin --pass mypassword --tls');
|
||||
console.log('\r\nRequired arguments:\r\n');
|
||||
console.log(' --host [hostname] The IP address or DNS name of Intel AMT, 127.0.0.1 is default.');
|
||||
console.log(' --user [username] The Intel AMT login username, admin is default.');
|
||||
console.log(' --pass [password] The Intel AMT login password.');
|
||||
console.log(' --tls Specifies that TLS must be used.');
|
||||
} else if (action == 'amtsavestate') {
|
||||
console.log('AmtSaveState action will fetch all the entire state of Intel AMT and save it as a JSON file. This action will take multiple minutes to perform. The command will fetch the local computer state unless host is specified. Intel AMT must be ativated for this command to work. Example usage:\r\n\r\n meshcmd amtsavestate --host 1.2.3.4 --user admin --pass mypassword --tls --output state.json');
|
||||
console.log('\r\nRequired arguments:\r\n');
|
||||
console.log(' --output [filename] The output file for the Intel AMT state in JSON format.');
|
||||
console.log(' --host [hostname] The IP address or DNS name of Intel AMT, 127.0.0.1 is default.');
|
||||
console.log(' --user [username] The Intel AMT login username, admin is default.');
|
||||
console.log(' --pass [password] The Intel AMT login password.');
|
||||
console.log(' --tls Specifies that TLS must be used.');
|
||||
} else if (action == 'amtscript') {
|
||||
console.log('AmtScript will run a .mescript file on the local or remote Intel AMT. Script files can be built using the MeshCommander script editor and be used to setup or perform actions on Intel AMT. Example usage:\r\n\r\n meshcmd amtscript --script myscript.mescript --host 1.2.3.4 --user admin --pass mypassword --tls');
|
||||
console.log('\r\nRequired arguments:\r\n');
|
||||
console.log(' --script [filename] The script file to run on Intel AMT.');
|
||||
console.log(' --host [hostname] The IP address or DNS name of Intel AMT, 127.0.0.1 is default.');
|
||||
console.log(' --user [username] The Intel AMT login username, admin is default.');
|
||||
console.log(' --pass [password] The Intel AMT login password.');
|
||||
console.log(' --tls Specifies that TLS must be used.');
|
||||
} else {
|
||||
actions.shift();
|
||||
console.log('Invalid action, usage:\r\n\r\n meshcmd help [action]\r\n\r\nValid actions are: ' + actions.join(', ') + '.');
|
||||
}
|
||||
exit(1); return;
|
||||
}
|
||||
settings.action = settings.action.toLowerCase();
|
||||
debug(1, "Settings: " + JSON.stringify(settings));
|
||||
if (settings.action == 'route') {
|
||||
if (settings.action == 'smbios') {
|
||||
// Display SM BIOS tables in raw form
|
||||
SMBiosTables = require('smbios');
|
||||
SMBiosTables.get(function (data) {
|
||||
var r = SMBiosTables.parse(data);
|
||||
var out = objToString(r, 0, '\r\n');
|
||||
if (settings.output == null) { console.log(out); } else { var file = fs.openSync(settings.output, 'w'); fs.writeSync(file, new Buffer(out, 'utf8')); fs.closeSync(file); }
|
||||
exit(1);
|
||||
});
|
||||
} else if (settings.action == 'rawsmbios') {
|
||||
// Display SM BIOS tables in raw form
|
||||
SMBiosTables = require('smbios');
|
||||
SMBiosTables.get(function (data) {
|
||||
var out = '';
|
||||
for (var i in data) { var header = false; for (var j in data[i]) { if (data[i][j].length > 0) { if (header == false) { out += ('Table type #' + i + ((SMBiosTables.smTableTypes[i] == null) ? '' : (', ' + SMBiosTables.smTableTypes[i]))) + '\r\n'; header = true; } out += (' ' + data[i][j].toString('hex')) + '\r\n'; } } }
|
||||
if (settings.output == null) { console.log(out); } else { var file = fs.openSync(settings.output, 'w'); fs.writeSync(file, new Buffer(out, 'utf8')); fs.closeSync(file); }
|
||||
exit(1);
|
||||
});
|
||||
} else if (settings.action == 'route') {
|
||||
// MeshCentral Router, port map local TCP port to a remote computer
|
||||
if ((settings.localPort == null) || (typeof settings.localPort != 'number') || (settings.localPort < 0) || (settings.localPort > 65535)) { console.log('No or invalid \"localPort\" specified, use --localport [localport].'); exit(1); return; }
|
||||
if ((settings.remoteNodeId == null) || (typeof settings.remoteNodeId != 'string')) { console.log('No or invalid \"remoteNodeId\" specified.'); exit(1); return; }
|
||||
@ -116,8 +259,7 @@ function run(argv) {
|
||||
if ((settings.serverHttpsHash == null) || (typeof settings.serverHttpsHash != 'string') || (settings.serverHttpsHash.length != 96)) { console.log('No or invalid \"serverHttpsHash\" specified.'); exit(1); return; }
|
||||
if ((settings.remotePort == null) || (typeof settings.remotePort != 'number') || (settings.remotePort < 0) || (settings.remotePort > 65535)) { console.log('No or invalid \"remotePort\" specified, use --remoteport [remoteport].'); exit(1); return; }
|
||||
if (settings.serverUrl != null) { startRouter(); } else { discoverMeshServer(); } // Start MeshCentral Router
|
||||
}
|
||||
else if ((settings.action == 'amtloadwebapp') || (settings.action == 'amtloadsmallwebapp') || (settings.action == 'amtloadlargewebapp') || (settings.action == 'amtclearwebapp') || (settings.action == 'amtstoragestate')) { // Intel AMT Web Application Actions
|
||||
} else if ((settings.action == 'amtloadwebapp') || (settings.action == 'amtloadsmallwebapp') || (settings.action == 'amtloadlargewebapp') || (settings.action == 'amtclearwebapp') || (settings.action == 'amtstoragestate')) { // Intel AMT Web Application Actions
|
||||
// Intel AMT 11.6+ Load MeshCommander into firmware
|
||||
if ((settings.password == null) || (typeof settings.password != 'string') || (settings.password == '')) { console.log('No or invalid \"password\" specified, use --password [password].'); exit(1); return; }
|
||||
if ((settings.hostname == null) || (typeof settings.hostname != 'string') || (settings.hostname == '')) { settings.hostname = '127.0.0.1'; }
|
||||
@ -136,7 +278,7 @@ function run(argv) {
|
||||
else if (settings.action == 'amtclearwebapp') { settings.webapp = null; }
|
||||
nextStepStorageUpload();
|
||||
}
|
||||
} else if ((settings.action == 'meversion') || (settings.action == 'meversions') || (settings.action == 'mever')) {
|
||||
} else if ((settings.action == 'amtversion') || (settings.action == 'amtversions') || (settings.action == 'amtver')) {
|
||||
// Display Intel AMT versions
|
||||
var amtMeiModule = require('amt-mei');
|
||||
var amtMei = new amtMeiModule();
|
||||
@ -148,7 +290,7 @@ function run(argv) {
|
||||
exit(1); return;
|
||||
});
|
||||
});
|
||||
} else if (settings.action == 'mehashes') {
|
||||
} else if (settings.action == 'amthashes') {
|
||||
// Display Intel AMT list of trusted hashes
|
||||
var amtMeiModule = require('amt-mei');
|
||||
var amtMei = new amtMeiModule();
|
||||
@ -164,7 +306,7 @@ function run(argv) {
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (settings.action == 'meinfo') {
|
||||
} else if (settings.action == 'amtinfo') {
|
||||
// Display Intel AMT version and activation state
|
||||
var amtMeiModule = require('amt-mei');
|
||||
var amtMei = new amtMeiModule();
|
||||
@ -201,7 +343,7 @@ function run(argv) {
|
||||
} else if (settings.action == 'amtlms') {
|
||||
// Start Intel AMT MicroLMS
|
||||
startLms(function (state) { console.log(['MicroLMS did not start. MicroLMS must run as administrator or LMS any already be active.', 'MicroLMS started.', 'MicroLMS started, MeshCommander on HTTP/16994.', 'MEI error'][state]); if (state == 0) { exit(0); } });
|
||||
} else if (settings.action == 'mescript') {
|
||||
} else if (settings.action == 'amtscript') {
|
||||
// Start running a MEScript
|
||||
if ((settings.password == null) || (typeof settings.password != 'string') || (settings.password == '')) { console.log('No or invalid \"password\" specified, use --password [password].'); exit(1); return; }
|
||||
if ((settings.hostname == null) || (typeof settings.hostname != 'string') || (settings.hostname == '')) { settings.hostname = '127.0.0.1'; }
|
||||
@ -233,6 +375,7 @@ function run(argv) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Deactivate Intel AMT CCM
|
||||
//
|
||||
@ -250,7 +393,6 @@ function deactivateCCM() {
|
||||
// Activate Intel AMT to CCM
|
||||
//
|
||||
|
||||
|
||||
function activeToCCM() {
|
||||
// See if MicroLMS needs to be started and setup the $$OsAdmin wsman stack
|
||||
settings.noconsole = true;
|
||||
|
@ -30,6 +30,7 @@ function createMeshCore(agent) {
|
||||
var net = require('net');
|
||||
var fs = require('fs');
|
||||
var rtc = require('ILibWebRTC');
|
||||
var SMBiosTables = require('smbios');
|
||||
var amtMei = null, amtLms = null, amtLmsState = 0;
|
||||
var amtMeiConnected = 0, amtMeiTmpState = null;
|
||||
var wifiScannerLib = null;
|
||||
@ -236,7 +237,7 @@ function createMeshCore(agent) {
|
||||
}
|
||||
|
||||
// Convert an object to string with all functions
|
||||
function objToString(x, p, ret) {
|
||||
function objToString(x, p, pad, ret) {
|
||||
if (ret == undefined) ret = '';
|
||||
if (p == undefined) p = 0;
|
||||
if (x == null) { return '[null]'; }
|
||||
@ -246,8 +247,8 @@ function createMeshCore(agent) {
|
||||
if (typeof x == 'buffer') { return '[buffer]'; }
|
||||
if (typeof x != 'object') { return x; }
|
||||
var r = '{' + (ret ? '\r\n' : ' ');
|
||||
for (var i in x) { r += (addPad(p + 2, ret) + i + ': ' + objToString(x[i], p + 2, ret) + (ret ? '\r\n' : ' ')); }
|
||||
return r + addPad(p, ret) + '}';
|
||||
for (var i in x) { if (i != '_ObjectID') { r += (addPad(p + 2, pad) + i + ': ' + objToString(x[i], p + 2, pad, ret) + (ret ? '\r\n' : ' ')); } }
|
||||
return r + addPad(p, pad) + '}';
|
||||
}
|
||||
|
||||
// Return p number of spaces
|
||||
@ -795,14 +796,14 @@ function createMeshCore(agent) {
|
||||
response.data = function (data) { sendConsoleText(rstr2hex(buf2rstr(data)), this.sessionid); consoleHttpRequest = null; }
|
||||
response.close = function () { sendConsoleText('httprequest.response.close', this.sessionid); consoleHttpRequest = null; }
|
||||
};
|
||||
|
||||
|
||||
// Process a mesh agent console command
|
||||
function processConsoleCommand(cmd, args, rights, sessionid) {
|
||||
try {
|
||||
var response = null;
|
||||
switch (cmd) {
|
||||
case 'help': { // Displays available commands
|
||||
response = 'Available commands: help, info, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, amt, netinfo, location, power, wakeonlan, scanwifi, scanamt, setdebug.';
|
||||
response = 'Available commands: help, info, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios.';
|
||||
break;
|
||||
}
|
||||
case 'setdebug': {
|
||||
@ -810,6 +811,34 @@ function createMeshCore(agent) {
|
||||
else { if (args['_'][0] == '*') { console.setDestination(1); } else { console.setDestination(parseInt(args['_'][0]), sessionid); } }
|
||||
break;
|
||||
}
|
||||
case 'smbios': {
|
||||
if (SMBiosTables != null) {
|
||||
SMBiosTables.get(function (data) {
|
||||
if (data == null) { sendConsoleText('Unable to get SM BIOS data.', sessionid); return; }
|
||||
sendConsoleText(objToString(SMBiosTables.parse(data), 0, ' ', true), sessionid);
|
||||
});
|
||||
} else { response = 'SM BIOS module not available.'; }
|
||||
break;
|
||||
}
|
||||
case 'rawsmbios': {
|
||||
if (SMBiosTables != null) {
|
||||
SMBiosTables.get(function (data) {
|
||||
if (data == null) { sendConsoleText('Unable to get SM BIOS data.', sessionid); return; }
|
||||
var out = '';
|
||||
for (var i in data) {
|
||||
var header = false;
|
||||
for (var j in data[i]) {
|
||||
if (data[i][j].length > 0) {
|
||||
if (header == false) { out += ('Table type #' + i + ((SMBiosTables.smTableTypes[i] == null) ? '' : (', ' + SMBiosTables.smTableTypes[i]))) + '\r\n'; header = true; }
|
||||
out += (' ' + data[i][j].toString('hex')) + '\r\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
sendConsoleText(out, sessionid);
|
||||
});
|
||||
} else { response = 'SM BIOS module not available.'; }
|
||||
break;
|
||||
}
|
||||
case 'eval': { // Eval JavaScript
|
||||
if (args['_'].length < 1) {
|
||||
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
Copyright 2018 Intel Corporation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Parse XML and return JSON
|
||||
module.exports.ParseWsman = function (xml) {
|
||||
|
284
agents/modules_meshcmd/smbios.js
Normal file
284
agents/modules_meshcmd/smbios.js
Normal file
@ -0,0 +1,284 @@
|
||||
/*
|
||||
Copyright 2018 Intel Corporation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
try { Object.defineProperty(Array.prototype, "peek", { value: function () { return (this.length > 0 ? this[this.length - 1] : undefined); } }); } catch (e) { }
|
||||
try { Object.defineProperty(String.prototype, "replaceAll", { value: function replaceAll(oldVal, newVal) { return (this.split(oldVal).join(newVal)); } }); } catch (e) { }
|
||||
|
||||
var RSMB = 1381190978;
|
||||
var memoryLocation = { 0x1: 'Other', 0x2: 'Unknown', 0x3: 'System Board', 0x4: 'ISA', 0x5: 'EISA', 0x6: 'PCI', 0x7: 'MCA', 0x8: 'PCMCIA', 0x9: 'Proprietary', 0xA: 'NuBus', 0xA0: 'PC-98/C20', 0xA1: 'PC-98/C24', 0xA2: 'PC-98/E', 0xA3: 'PC-98/LB' };
|
||||
var wakeReason = ['Reserved', 'Other', 'Unknown', 'APM Timer', 'Modem Ring', 'LAN', 'Power Switch', 'PCI', 'AC Power'];
|
||||
|
||||
function SMBiosTables() {
|
||||
this._ObjectID = 'SMBiosTable';
|
||||
if (process.platform == 'win32') {
|
||||
this._marshal = require('_GenericMarshal');
|
||||
this._native = this._marshal.CreateNativeProxy("Kernel32.dll");
|
||||
|
||||
this._native.CreateMethod('EnumSystemFirmwareTables');
|
||||
this._native.CreateMethod('GetSystemFirmwareTable');
|
||||
}
|
||||
if (process.platform == 'linux') {
|
||||
this._canonicalizeData = function _canonicalizeData(data) {
|
||||
var lines = data.toString().split('Header and Data:\x0A');
|
||||
var MemoryStream = require('MemoryStream');
|
||||
var ms = new MemoryStream();
|
||||
|
||||
for (var i = 1; i < lines.length; ++i) {
|
||||
var tokens = lines[i].split('Strings:\x0A');
|
||||
var header = tokens[0].split('\x0A\x0A')[0].replaceAll('\x0A', '').trim().replaceAll(' ', '').replaceAll('\x09', '');
|
||||
ms.write(Buffer.from(header, 'hex'));
|
||||
if (tokens.length > 1) {
|
||||
var strings = tokens[1].split('\x0A\x0A')[0].split('\x0A');
|
||||
var stringsFinal = [];
|
||||
for (var strx in strings) {
|
||||
var tmp = strings[strx].trim().replaceAll(' ', '').replaceAll('\x09', '');
|
||||
if (!(tmp[0] == '"')) { stringsFinal.push(tmp); }
|
||||
}
|
||||
ms.write(Buffer.from(stringsFinal.join(''), 'hex'));
|
||||
ms.write(Buffer.from('00', 'hex'));
|
||||
}
|
||||
else {
|
||||
ms.write(Buffer.from('0000', 'hex'));
|
||||
}
|
||||
}
|
||||
var retVal = ms.buffer;
|
||||
retVal.ms = ms;
|
||||
return (retVal);
|
||||
};
|
||||
}
|
||||
this._parse = function _parse(SMData) {
|
||||
var ret = {};
|
||||
var pbyte;
|
||||
var i = 0
|
||||
var SMData;
|
||||
var structcount = 0;
|
||||
|
||||
while (SMData && i < SMData.length) {
|
||||
var SMtype = SMData[i];
|
||||
var SMlength = SMData[i + 1];
|
||||
|
||||
if (!ret[SMtype]) { ret[SMtype] = []; }
|
||||
ret[SMtype].push(SMData.slice(i + 4, i + SMlength));
|
||||
if (process.platform == 'win32') { ret[SMtype].peek()._ext = pbyte; }
|
||||
i += SMlength;
|
||||
|
||||
ret[SMtype].peek()._strings = [];
|
||||
|
||||
while (SMData[i] != 0) {
|
||||
var strstart = i;
|
||||
|
||||
// Start of String, find end of string
|
||||
while (SMData[i++] != 0);
|
||||
ret[SMtype].peek()._strings.push(SMData.slice(strstart, i).toString().trim());
|
||||
}
|
||||
i += (ret[SMtype].peek()._strings.length == 0) ? 2 : 1;
|
||||
++structcount;
|
||||
//console.log('End of Table[' + SMtype + ']: ' + i);
|
||||
}
|
||||
//console.log('Struct Count = ' + structcount);
|
||||
return (ret);
|
||||
};
|
||||
this.get = function get(callback) {
|
||||
if (process.platform == 'win32') {
|
||||
var size = this._native.GetSystemFirmwareTable(RSMB, 0, 0, 0).Val;
|
||||
//console.log('Table Size: ' + size);
|
||||
|
||||
var PtrSize = this._marshal.CreatePointer()._size;
|
||||
var buffer = this._marshal.CreateVariable(size);
|
||||
var written = this._native.GetSystemFirmwareTable(RSMB, 0, buffer, size).Val;
|
||||
//console.log('Written Size: ' + written);
|
||||
|
||||
var rawBuffer = buffer.toBuffer();
|
||||
var length = buffer.Deref(4, 4).toBuffer().readUInt32LE(0);
|
||||
|
||||
pbyte = buffer.Deref(8, length);
|
||||
SMData = pbyte.toBuffer();
|
||||
|
||||
if (callback) { callback.apply(this, [this._parse(SMData)]); return; } else { return (this._parse(SMData)); }
|
||||
}
|
||||
if (process.platform == 'linux') {
|
||||
var MemoryStream = require('MemoryStream');
|
||||
this.child = require('child_process').execFile('/usr/sbin/dmidecode', ['dmidecode', '-u']);
|
||||
this.child.SMBiosTable = this;
|
||||
this.child.ms = new MemoryStream();
|
||||
this.child.ms.callback = callback;
|
||||
this.child.ms.child = this.child;
|
||||
this.child.stdout.on('data', function (buffer) { this.parent.ms.write(buffer); });
|
||||
this.child.on('exit', function () { this.ms.end(); });
|
||||
this.child.ms.on('end', function () {
|
||||
//console.log('read ' + this.buffer.length + ' bytes');
|
||||
if (this.buffer.length < 300) {
|
||||
//console.log('Not enough permission to read SMBiosTable');
|
||||
if (this.callback) { this.callback.apply(this.child.SMBiosTable, []); }
|
||||
}
|
||||
else {
|
||||
var SMData = this.child.SMBiosTable._canonicalizeData(this.buffer);
|
||||
var j = this.child.SMBiosTable._parse(SMData);
|
||||
if (this.callback) { this.callback.apply(this.child.SMBiosTable, [j]); }
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
throw (process.platform + ' not supported');
|
||||
};
|
||||
this.parse = function parse(data) {
|
||||
var r = {};
|
||||
r.processorInfo = this.processorInfo(data);
|
||||
r.memoryInfo = this.memoryInfo(data);
|
||||
r.systemInfo = this.systemInfo(data);
|
||||
r.systemSlots = this.systemInfo(data);
|
||||
r.amtInfo = this.amtInfo(data);
|
||||
return r;
|
||||
}
|
||||
this.processorInfo = function processorInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var ret = [];
|
||||
var ptype = ['ERROR', 'Other', 'Unknown', 'CPU', 'ALU', 'DSP', 'GPU'];
|
||||
var statusString = ['Unknown', 'Enabled', 'Disabled by user', 'Disabled by BIOS', 'Idle', 'Reserved', 'Reserved', 'Other'];
|
||||
var cpuid = 0;
|
||||
while (data[4] && data[4].length > 0) {
|
||||
var p = data[4].pop();
|
||||
var populated = p[20] & 0x40;
|
||||
var status = p[20] & 0x07
|
||||
if (populated) {
|
||||
var j = { _ObjectID: 'SMBiosTables.processorInfo' };
|
||||
j.Processor = ptype[p[1]];
|
||||
j.MaxSpeed = p.readUInt16LE(16) + ' Mhz';
|
||||
if (p[31]) { j.Cores = p[31]; }
|
||||
if (p[33]) { j.Threads = p[33]; }
|
||||
j.Populated = 1;
|
||||
j.Status = statusString[status];
|
||||
j.Socket = p._strings[p[0] - 1];
|
||||
j.Manufacturer = p._strings[p[3] - 1];
|
||||
j.Version = p._strings[p[12] - 1];
|
||||
ret.push(j);
|
||||
}
|
||||
}
|
||||
return (ret);
|
||||
};
|
||||
this.memoryInfo = function memoryInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = { _ObjectID: 'SMBiosTables.memoryInfo' };
|
||||
if (data[16]) {
|
||||
var m = data[16].peek();
|
||||
retVal.location = memoryLocation[m[0]];
|
||||
if ((retVal.maxCapacityKb = m.readUInt32LE(3)) == 0x80000000) {
|
||||
retVal.maxCapacityKb = 'A really big number';
|
||||
}
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.systemInfo = function systemInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = { _ObjectID: 'SMBiosTables.systemInfo' };
|
||||
if (data[1]) {
|
||||
var si = data[1].peek();
|
||||
retVal.uuid = si.slice(4, 20).toString('hex');
|
||||
retVal.wakeReason = wakeReason[si[20]];
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.systemSlots = function systemSlots(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = [];
|
||||
if (data[9]) {
|
||||
while (data[9].length > 0) {
|
||||
var ss = data[9].pop();
|
||||
retVal.push({ name: ss._strings[ss[0] - 1] });
|
||||
}
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.amtInfo = function amtInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = { AMT: false };
|
||||
if (data[130] && data[130].peek().slice(0, 4).toString() == '$AMT') {
|
||||
var amt = data[130].peek();
|
||||
retVal.AMT = amt[4] ? true : false;
|
||||
if (retVal.AMT) {
|
||||
retVal.enabled = amt[5] ? true : false;
|
||||
retVal.storageRedirection = amt[6] ? true : false;
|
||||
retVal.serialOverLan = amt[7] ? true : false;
|
||||
retVal.kvm = amt[14] ? true : false;
|
||||
if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') {
|
||||
var settings = data[131].peek();
|
||||
if (settings[0] & 0x04) { retVal.TXT = (settings[0] & 0x08) ? true : false; }
|
||||
if (settings[0] & 0x10) { retVal.VMX = (settings[0] & 0x20) ? true : false; }
|
||||
retVal.MEBX = settings.readUInt16LE(10).toString() + '.' + settings.readUInt16LE(8).toString() + '.' + settings.readUInt16LE(6).toString() + '.' + settings.readUInt16LE(4).toString();
|
||||
|
||||
var mecap = settings.slice(20, 32);
|
||||
retVal.ManagementEngine = mecap.readUInt16LE(6).toString() + '.' + mecap.readUInt16LE(4).toString() + '.' + mecap.readUInt16LE(2).toString() + '.' + mecap.readUInt16LE(0).toString();
|
||||
|
||||
//var lan = settings.slice(36, 48);
|
||||
//console.log(lan.toString('hex'));
|
||||
//retVal.LAN = (lan.readUInt16LE(10) & 0x03).toString() + '/' + ((lan.readUInt16LE(10) & 0xF8) >> 3).toString();
|
||||
|
||||
//console.log(lan.readUInt16LE(3));
|
||||
//retVal.WLAN = (lan.readUInt16LE(3) & 0x07).toString() + '/' + ((lan.readUInt16LE(3) & 0xF8) >> 3).toString() + '/' + (lan.readUInt16LE(3) >> 8).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.smTableTypes = {
|
||||
0: 'BIOS information',
|
||||
1: 'System information',
|
||||
2: 'Baseboard (or Module) information',
|
||||
4: 'Processor information',
|
||||
5: 'memory controller information',
|
||||
6: 'Memory module information',
|
||||
7: 'Cache information',
|
||||
8: 'Port connector information',
|
||||
9: 'System slots',
|
||||
10: 'On board devices information',
|
||||
11: 'OEM strings',
|
||||
12: 'System configuration options',
|
||||
13: 'BIOS language information',
|
||||
14: 'Group associations',
|
||||
15: 'System event log',
|
||||
16: 'Physical memory array',
|
||||
17: 'Memory device',
|
||||
18: '32bit memory error information',
|
||||
19: 'Memory array mapped address',
|
||||
20: 'Memory device mapped address',
|
||||
21: 'Built-in pointing device',
|
||||
22: 'Portable battery',
|
||||
23: 'System reset',
|
||||
24: 'Hardware security',
|
||||
25: 'System power controls',
|
||||
26: 'Voltage probe',
|
||||
27: 'Cooling device',
|
||||
28: 'Temperature probe',
|
||||
29: 'Electrical current probe',
|
||||
30: 'Out-of-band remote access',
|
||||
31: 'Boot integrity services (BIS) entry point',
|
||||
32: 'System boot information',
|
||||
33: '64bit memory error information',
|
||||
34: 'Management device',
|
||||
35: 'Management device component',
|
||||
36: 'Management device threshold data',
|
||||
37: 'Memory channel',
|
||||
38: 'IPMI device information',
|
||||
39: 'System power supply',
|
||||
40: 'Additional information',
|
||||
41: 'Onboard devices extended information',
|
||||
42: 'Management controller host interface',
|
||||
126: 'Inactive',
|
||||
127: 'End-of-table'
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new SMBiosTables();
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
Copyright 2018 Intel Corporation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Parse XML and return JSON
|
||||
module.exports.ParseWsman = function (xml) {
|
||||
|
284
agents/modules_meshcore/smbios.js
Normal file
284
agents/modules_meshcore/smbios.js
Normal file
@ -0,0 +1,284 @@
|
||||
/*
|
||||
Copyright 2018 Intel Corporation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
try { Object.defineProperty(Array.prototype, "peek", { value: function () { return (this.length > 0 ? this[this.length - 1] : undefined); } }); } catch (e) { }
|
||||
try { Object.defineProperty(String.prototype, "replaceAll", { value: function replaceAll(oldVal, newVal) { return (this.split(oldVal).join(newVal)); } }); } catch (e) { }
|
||||
|
||||
var RSMB = 1381190978;
|
||||
var memoryLocation = { 0x1: 'Other', 0x2: 'Unknown', 0x3: 'System Board', 0x4: 'ISA', 0x5: 'EISA', 0x6: 'PCI', 0x7: 'MCA', 0x8: 'PCMCIA', 0x9: 'Proprietary', 0xA: 'NuBus', 0xA0: 'PC-98/C20', 0xA1: 'PC-98/C24', 0xA2: 'PC-98/E', 0xA3: 'PC-98/LB' };
|
||||
var wakeReason = ['Reserved', 'Other', 'Unknown', 'APM Timer', 'Modem Ring', 'LAN', 'Power Switch', 'PCI', 'AC Power'];
|
||||
|
||||
function SMBiosTables() {
|
||||
this._ObjectID = 'SMBiosTable';
|
||||
if (process.platform == 'win32') {
|
||||
this._marshal = require('_GenericMarshal');
|
||||
this._native = this._marshal.CreateNativeProxy("Kernel32.dll");
|
||||
|
||||
this._native.CreateMethod('EnumSystemFirmwareTables');
|
||||
this._native.CreateMethod('GetSystemFirmwareTable');
|
||||
}
|
||||
if (process.platform == 'linux') {
|
||||
this._canonicalizeData = function _canonicalizeData(data) {
|
||||
var lines = data.toString().split('Header and Data:\x0A');
|
||||
var MemoryStream = require('MemoryStream');
|
||||
var ms = new MemoryStream();
|
||||
|
||||
for (var i = 1; i < lines.length; ++i) {
|
||||
var tokens = lines[i].split('Strings:\x0A');
|
||||
var header = tokens[0].split('\x0A\x0A')[0].replaceAll('\x0A', '').trim().replaceAll(' ', '').replaceAll('\x09', '');
|
||||
ms.write(Buffer.from(header, 'hex'));
|
||||
if (tokens.length > 1) {
|
||||
var strings = tokens[1].split('\x0A\x0A')[0].split('\x0A');
|
||||
var stringsFinal = [];
|
||||
for (var strx in strings) {
|
||||
var tmp = strings[strx].trim().replaceAll(' ', '').replaceAll('\x09', '');
|
||||
if (!(tmp[0] == '"')) { stringsFinal.push(tmp); }
|
||||
}
|
||||
ms.write(Buffer.from(stringsFinal.join(''), 'hex'));
|
||||
ms.write(Buffer.from('00', 'hex'));
|
||||
}
|
||||
else {
|
||||
ms.write(Buffer.from('0000', 'hex'));
|
||||
}
|
||||
}
|
||||
var retVal = ms.buffer;
|
||||
retVal.ms = ms;
|
||||
return (retVal);
|
||||
};
|
||||
}
|
||||
this._parse = function _parse(SMData) {
|
||||
var ret = {};
|
||||
var pbyte;
|
||||
var i = 0
|
||||
var SMData;
|
||||
var structcount = 0;
|
||||
|
||||
while (SMData && i < SMData.length) {
|
||||
var SMtype = SMData[i];
|
||||
var SMlength = SMData[i + 1];
|
||||
|
||||
if (!ret[SMtype]) { ret[SMtype] = []; }
|
||||
ret[SMtype].push(SMData.slice(i + 4, i + SMlength));
|
||||
if (process.platform == 'win32') { ret[SMtype].peek()._ext = pbyte; }
|
||||
i += SMlength;
|
||||
|
||||
ret[SMtype].peek()._strings = [];
|
||||
|
||||
while (SMData[i] != 0) {
|
||||
var strstart = i;
|
||||
|
||||
// Start of String, find end of string
|
||||
while (SMData[i++] != 0);
|
||||
ret[SMtype].peek()._strings.push(SMData.slice(strstart, i).toString().trim());
|
||||
}
|
||||
i += (ret[SMtype].peek()._strings.length == 0) ? 2 : 1;
|
||||
++structcount;
|
||||
//console.log('End of Table[' + SMtype + ']: ' + i);
|
||||
}
|
||||
//console.log('Struct Count = ' + structcount);
|
||||
return (ret);
|
||||
};
|
||||
this.get = function get(callback) {
|
||||
if (process.platform == 'win32') {
|
||||
var size = this._native.GetSystemFirmwareTable(RSMB, 0, 0, 0).Val;
|
||||
//console.log('Table Size: ' + size);
|
||||
|
||||
var PtrSize = this._marshal.CreatePointer()._size;
|
||||
var buffer = this._marshal.CreateVariable(size);
|
||||
var written = this._native.GetSystemFirmwareTable(RSMB, 0, buffer, size).Val;
|
||||
//console.log('Written Size: ' + written);
|
||||
|
||||
var rawBuffer = buffer.toBuffer();
|
||||
var length = buffer.Deref(4, 4).toBuffer().readUInt32LE(0);
|
||||
|
||||
pbyte = buffer.Deref(8, length);
|
||||
SMData = pbyte.toBuffer();
|
||||
|
||||
if (callback) { callback.apply(this, [this._parse(SMData)]); return; } else { return (this._parse(SMData)); }
|
||||
}
|
||||
if (process.platform == 'linux') {
|
||||
var MemoryStream = require('MemoryStream');
|
||||
this.child = require('child_process').execFile('/usr/sbin/dmidecode', ['dmidecode', '-u']);
|
||||
this.child.SMBiosTable = this;
|
||||
this.child.ms = new MemoryStream();
|
||||
this.child.ms.callback = callback
|
||||
this.child.ms.child = this.child;
|
||||
this.child.stdout.on('data', function (buffer) { this.parent.ms.write(buffer); });
|
||||
this.child.on('exit', function () { this.ms.end(); });
|
||||
this.child.ms.on('end', function () {
|
||||
//console.log('read ' + this.buffer.length + ' bytes');
|
||||
if (this.buffer.length < 300) { // TODO: Trap error message better that this.
|
||||
console.log('Not enough permission to read SMBiosTable');
|
||||
if (this.callback) { this.callback.apply(this.child.SMBiosTable, []); }
|
||||
}
|
||||
else {
|
||||
var SMData = this.child.SMBiosTable._canonicalizeData(this.buffer);
|
||||
var j = this.child.SMBiosTable._parse(SMData);
|
||||
if (this.callback) { this.callback.apply(this.child.SMBiosTable, [j]); }
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
throw (process.platform + ' not supported');
|
||||
};
|
||||
this.parse = function parse(data) {
|
||||
var r = {};
|
||||
r.processorInfo = this.processorInfo(data);
|
||||
r.memoryInfo = this.memoryInfo(data);
|
||||
r.systemInfo = this.systemInfo(data);
|
||||
r.systemSlots = this.systemInfo(data);
|
||||
r.amtInfo = this.amtInfo(data);
|
||||
return r;
|
||||
}
|
||||
this.processorInfo = function processorInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var ret = [];
|
||||
var ptype = ['ERROR', 'Other', 'Unknown', 'CPU', 'ALU', 'DSP', 'GPU'];
|
||||
var statusString = ['Unknown', 'Enabled', 'Disabled by user', 'Disabled by BIOS', 'Idle', 'Reserved', 'Reserved', 'Other'];
|
||||
var cpuid = 0;
|
||||
while (data[4] && data[4].length > 0) {
|
||||
var p = data[4].pop();
|
||||
var populated = p[20] & 0x40;
|
||||
var status = p[20] & 0x07
|
||||
if (populated) {
|
||||
var j = { _ObjectID: 'SMBiosTables.processorInfo' };
|
||||
j.Processor = ptype[p[1]];
|
||||
j.MaxSpeed = p.readUInt16LE(16) + ' Mhz';
|
||||
if (p[31]) { j.Cores = p[31]; }
|
||||
if (p[33]) { j.Threads = p[33]; }
|
||||
j.Populated = 1;
|
||||
j.Status = statusString[status];
|
||||
j.Socket = p._strings[p[0] - 1];
|
||||
j.Manufacturer = p._strings[p[3] - 1];
|
||||
j.Version = p._strings[p[12] - 1];
|
||||
ret.push(j);
|
||||
}
|
||||
}
|
||||
return (ret);
|
||||
};
|
||||
this.memoryInfo = function memoryInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = { _ObjectID: 'SMBiosTables.memoryInfo' };
|
||||
if (data[16]) {
|
||||
var m = data[16].peek();
|
||||
retVal.location = memoryLocation[m[0]];
|
||||
if ((retVal.maxCapacityKb = m.readUInt32LE(3)) == 0x80000000) {
|
||||
retVal.maxCapacityKb = 'A really big number';
|
||||
}
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.systemInfo = function systemInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = { _ObjectID: 'SMBiosTables.systemInfo' };
|
||||
if (data[1]) {
|
||||
var si = data[1].peek();
|
||||
retVal.uuid = si.slice(4, 20).toString('hex');
|
||||
retVal.wakeReason = wakeReason[si[20]];
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.systemSlots = function systemSlots(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = [];
|
||||
if (data[9]) {
|
||||
while (data[9].length > 0) {
|
||||
var ss = data[9].pop();
|
||||
retVal.push({ name: ss._strings[ss[0] - 1] });
|
||||
}
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.amtInfo = function amtInfo(data) {
|
||||
if (!data) { throw ('no data'); }
|
||||
var retVal = { AMT: false };
|
||||
if (data[130] && data[130].peek().slice(0, 4).toString() == '$AMT') {
|
||||
var amt = data[130].peek();
|
||||
retVal.AMT = amt[4] ? true : false;
|
||||
if (retVal.AMT) {
|
||||
retVal.enabled = amt[5] ? true : false;
|
||||
retVal.storageRedirection = amt[6] ? true : false;
|
||||
retVal.serialOverLan = amt[7] ? true : false;
|
||||
retVal.kvm = amt[14] ? true : false;
|
||||
if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') {
|
||||
var settings = data[131].peek();
|
||||
if (settings[0] & 0x04) { retVal.TXT = (settings[0] & 0x08) ? true : false; }
|
||||
if (settings[0] & 0x10) { retVal.VMX = (settings[0] & 0x20) ? true : false; }
|
||||
retVal.MEBX = settings.readUInt16LE(10).toString() + '.' + settings.readUInt16LE(8).toString() + '.' + settings.readUInt16LE(6).toString() + '.' + settings.readUInt16LE(4).toString();
|
||||
|
||||
var mecap = settings.slice(20, 32);
|
||||
retVal.ManagementEngine = mecap.readUInt16LE(6).toString() + '.' + mecap.readUInt16LE(4).toString() + '.' + mecap.readUInt16LE(2).toString() + '.' + mecap.readUInt16LE(0).toString();
|
||||
|
||||
//var lan = settings.slice(36, 48);
|
||||
//console.log(lan.toString('hex'));
|
||||
//retVal.LAN = (lan.readUInt16LE(10) & 0x03).toString() + '/' + ((lan.readUInt16LE(10) & 0xF8) >> 3).toString();
|
||||
|
||||
//console.log(lan.readUInt16LE(3));
|
||||
//retVal.WLAN = (lan.readUInt16LE(3) & 0x07).toString() + '/' + ((lan.readUInt16LE(3) & 0xF8) >> 3).toString() + '/' + (lan.readUInt16LE(3) >> 8).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return (retVal);
|
||||
};
|
||||
this.smTableTypes = {
|
||||
0: 'BIOS information',
|
||||
1: 'System information',
|
||||
2: 'Baseboard (or Module) information',
|
||||
4: 'Processor information',
|
||||
5: 'memory controller information',
|
||||
6: 'Memory module information',
|
||||
7: 'Cache information',
|
||||
8: 'Port connector information',
|
||||
9: 'System slots',
|
||||
10: 'On board devices information',
|
||||
11: 'OEM strings',
|
||||
12: 'System configuration options',
|
||||
13: 'BIOS language information',
|
||||
14: 'Group associations',
|
||||
15: 'System event log',
|
||||
16: 'Physical memory array',
|
||||
17: 'Memory device',
|
||||
18: '32bit memory error information',
|
||||
19: 'Memory array mapped address',
|
||||
20: 'Memory device mapped address',
|
||||
21: 'Built-in pointing device',
|
||||
22: 'Portable battery',
|
||||
23: 'System reset',
|
||||
24: 'Hardware security',
|
||||
25: 'System power controls',
|
||||
26: 'Voltage probe',
|
||||
27: 'Cooling device',
|
||||
28: 'Temperature probe',
|
||||
29: 'Electrical current probe',
|
||||
30: 'Out-of-band remote access',
|
||||
31: 'Boot integrity services (BIS) entry point',
|
||||
32: 'System boot information',
|
||||
33: '64bit memory error information',
|
||||
34: 'Management device',
|
||||
35: 'Management device component',
|
||||
36: 'Management device threshold data',
|
||||
37: 'Memory channel',
|
||||
38: 'IPMI device information',
|
||||
39: 'System power supply',
|
||||
40: 'Additional information',
|
||||
41: 'Onboard devices extended information',
|
||||
42: 'Management controller host interface',
|
||||
126: 'Inactive',
|
||||
127: 'End-of-table'
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new SMBiosTables();
|
155
agents/modules_meshcore/wifi-scanner-windows.js
Normal file
155
agents/modules_meshcore/wifi-scanner-windows.js
Normal file
@ -0,0 +1,155 @@
|
||||
|
||||
function _Scan()
|
||||
{
|
||||
var wlanInterfaces = this.Marshal.CreatePointer();
|
||||
this.Native.WlanEnumInterfaces(this.Handle, 0, wlanInterfaces);
|
||||
|
||||
var count = wlanInterfaces.Deref().Deref(0, 4).toBuffer().readUInt32LE(0);
|
||||
|
||||
var info = wlanInterfaces.Deref().Deref(8, 532);
|
||||
var iname = info.Deref(16, 512).AnsiString;
|
||||
|
||||
var istate;
|
||||
switch (info.Deref(528, 4).toBuffer().readUInt32LE(0))
|
||||
{
|
||||
case 0:
|
||||
istate = "NOT READY";
|
||||
break;
|
||||
case 1:
|
||||
istate = "CONNECTED";
|
||||
break;
|
||||
case 2:
|
||||
istate = "AD-HOC";
|
||||
break;
|
||||
case 3:
|
||||
istate = "DISCONNECTING";
|
||||
break;
|
||||
case 4:
|
||||
istate = "DISCONNECTED";
|
||||
break;
|
||||
case 5:
|
||||
istate = "ASSOCIATING";
|
||||
break;
|
||||
case 6:
|
||||
istate = "DISCOVERING";
|
||||
break;
|
||||
case 7:
|
||||
istate = "AUTHENTICATING";
|
||||
break;
|
||||
default:
|
||||
istate = "UNKNOWN";
|
||||
break;
|
||||
}
|
||||
|
||||
var iguid = info.Deref(0, 16);
|
||||
if (this.Native.WlanScan(this.Handle, iguid, 0, 0, 0).Val == 0)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
function AccessPoint(_ssid, _bssid, _rssi, _lq)
|
||||
{
|
||||
this.ssid = _ssid;
|
||||
this.bssid = _bssid;
|
||||
this.rssi = _rssi;
|
||||
this.lq = _lq;
|
||||
}
|
||||
AccessPoint.prototype.toString = function()
|
||||
{
|
||||
return (this.ssid + " [" + this.bssid + "]: " + this.lq);
|
||||
}
|
||||
|
||||
function OnNotify(NotificationData)
|
||||
{
|
||||
var NotificationSource = NotificationData.Deref(0, 4).toBuffer().readUInt32LE(0);
|
||||
var NotificationCode = NotificationData.Deref(4, 4).toBuffer().readUInt32LE(0);
|
||||
var dataGuid = NotificationData.Deref(8, 16);
|
||||
|
||||
if ((NotificationSource & 0X00000008) && (NotificationCode == 7))
|
||||
{
|
||||
var bss = this.Parent.Marshal.CreatePointer();
|
||||
var result = this.Parent.Native.GetBSSList(this.Parent.Handle, dataGuid, 0, 3, 0, 0, bss).Val;
|
||||
if (result == 0)
|
||||
{
|
||||
var totalSize = bss.Deref().Deref(0, 4).toBuffer().readUInt32LE(0);
|
||||
var numItems = bss.Deref().Deref(4, 4).toBuffer().readUInt32LE(0);
|
||||
for (i = 0; i < numItems; ++i)
|
||||
{
|
||||
var item = bss.Deref().Deref(8 + (360 * i), 360);
|
||||
var ssid = item.Deref(4, 32).String.trim();
|
||||
var bssid = item.Deref(40, 6).HexString2;
|
||||
var rssi = item.Deref(56, 4).toBuffer().readUInt32LE(0);
|
||||
var lq = item.Deref(60, 4).toBuffer().readUInt32LE(0);
|
||||
|
||||
this.Parent.emit('Scan', new AccessPoint(ssid, bssid, rssi, lq));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function Wireless()
|
||||
{
|
||||
var emitterUtils = require('events').inherits(this);
|
||||
|
||||
this.Marshal = require('_GenericMarshal');
|
||||
this.Native = this.Marshal.CreateNativeProxy("wlanapi.dll");
|
||||
this.Native.CreateMethod("WlanOpenHandle");
|
||||
this.Native.CreateMethod("WlanGetNetworkBssList", "GetBSSList");
|
||||
this.Native.CreateMethod("WlanRegisterNotification");
|
||||
this.Native.CreateMethod("WlanEnumInterfaces");
|
||||
this.Native.CreateMethod("WlanScan");
|
||||
this.Native.CreateMethod("WlanQueryInterface");
|
||||
|
||||
var negotiated = this.Marshal.CreatePointer();
|
||||
var h = this.Marshal.CreatePointer();
|
||||
|
||||
this.Native.WlanOpenHandle(2, 0, negotiated, h);
|
||||
this.Handle = h.Deref();
|
||||
|
||||
this._NOTIFY_PROXY_OBJECT = this.Marshal.CreateCallbackProxy(OnNotify, 2);
|
||||
this._NOTIFY_PROXY_OBJECT.Parent = this;
|
||||
var PrevSource = this.Marshal.CreatePointer();
|
||||
var result = this.Native.WlanRegisterNotification(this.Handle, 0X0000FFFF, 0, this._NOTIFY_PROXY_OBJECT.Callback, this._NOTIFY_PROXY_OBJECT.State, 0, PrevSource);
|
||||
|
||||
emitterUtils.createEvent('Scan');
|
||||
emitterUtils.addMethod('Scan', _Scan);
|
||||
|
||||
this.GetConnectedNetwork = function ()
|
||||
{
|
||||
var interfaces = this.Marshal.CreatePointer();
|
||||
|
||||
console.log('Success = ' + this.Native.WlanEnumInterfaces(this.Handle, 0, interfaces).Val);
|
||||
var count = interfaces.Deref().Deref(0, 4).toBuffer().readUInt32LE(0);
|
||||
var info = interfaces.Deref().Deref(8, 532);
|
||||
var iname = info.Deref(16, 512).AnsiString;
|
||||
var istate = info.Deref(528, 4).toBuffer().readUInt32LE(0);
|
||||
if(info.Deref(528, 4).toBuffer().readUInt32LE(0) == 1) // CONNECTED
|
||||
{
|
||||
var dataSize = this.Marshal.CreatePointer();
|
||||
var pData = this.Marshal.CreatePointer();
|
||||
var valueType = this.Marshal.CreatePointer();
|
||||
var iguid = info.Deref(0, 16);
|
||||
var retVal = this.Native.WlanQueryInterface(this.Handle, iguid, 7, 0, dataSize, pData, valueType).Val;
|
||||
if (retVal == 0)
|
||||
{
|
||||
var associatedSSID = pData.Deref().Deref(524, 32).String;
|
||||
var bssid = pData.Deref().Deref(560, 6).HexString;
|
||||
var lq = pData.Deref().Deref(576, 4).toBuffer().readUInt32LE(0);
|
||||
|
||||
return (new AccessPoint(associatedSSID, bssid, 0, lq));
|
||||
}
|
||||
}
|
||||
throw ("GetConnectedNetworks: FAILED (not associated to a network)");
|
||||
};
|
||||
|
||||
|
||||
return (this);
|
||||
}
|
||||
|
||||
module.exports = new Wireless();
|
@ -1,166 +1,5 @@
|
||||
var MemoryStream = require('MemoryStream');
|
||||
var WindowsWireless = new Buffer([
|
||||
0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x5F, 0x53, 0x63, 0x61, 0x6E, 0x28, 0x29, 0x0A, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x77, 0x6C, 0x61, 0x6E,
|
||||
0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
|
||||
0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x57, 0x6C, 0x61, 0x6E, 0x45,
|
||||
0x6E, 0x75, 0x6D, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x77, 0x6C,
|
||||
0x61, 0x6E, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x29, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x20, 0x3D, 0x20,
|
||||
0x77, 0x6C, 0x61, 0x6E, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x30, 0x2C, 0x20,
|
||||
0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6E, 0x66, 0x6F, 0x20, 0x3D, 0x20, 0x77, 0x6C, 0x61, 0x6E, 0x49, 0x6E, 0x74, 0x65,
|
||||
0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x38, 0x2C, 0x20, 0x35, 0x33, 0x32, 0x29, 0x3B, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6E, 0x61, 0x6D, 0x65, 0x20, 0x3D, 0x20, 0x69, 0x6E, 0x66, 0x6F, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x31, 0x36, 0x2C, 0x20, 0x35, 0x31, 0x32,
|
||||
0x29, 0x2E, 0x41, 0x6E, 0x73, 0x69, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3B, 0x0A, 0x20,
|
||||
0x20, 0x20, 0x20, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x20, 0x28, 0x69, 0x6E, 0x66, 0x6F, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x35, 0x32, 0x38, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61,
|
||||
0x6C, 0x29, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x30, 0x3A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x22, 0x4E, 0x4F, 0x54, 0x20, 0x52, 0x45, 0x41, 0x44, 0x59, 0x22, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x31, 0x3A, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x22, 0x43, 0x4F, 0x4E, 0x4E, 0x45, 0x43, 0x54, 0x45, 0x44, 0x22, 0x3B, 0x0A,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20,
|
||||
0x32, 0x3A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x22, 0x41, 0x44, 0x2D, 0x48, 0x4F, 0x43, 0x22,
|
||||
0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73,
|
||||
0x65, 0x20, 0x33, 0x3A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x22, 0x44, 0x49, 0x53, 0x43, 0x4F,
|
||||
0x4E, 0x4E, 0x45, 0x43, 0x54, 0x49, 0x4E, 0x47, 0x22, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x34, 0x3A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||
0x20, 0x3D, 0x20, 0x22, 0x44, 0x49, 0x53, 0x43, 0x4F, 0x4E, 0x4E, 0x45, 0x43, 0x54, 0x45, 0x44, 0x22, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62,
|
||||
0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x35, 0x3A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x22, 0x41, 0x53, 0x53, 0x4F, 0x43, 0x49, 0x41, 0x54, 0x49, 0x4E, 0x47, 0x22, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x36, 0x3A, 0x0A, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x22, 0x44, 0x49, 0x53, 0x43, 0x4F, 0x56, 0x45, 0x52, 0x49, 0x4E, 0x47, 0x22, 0x3B,
|
||||
0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65,
|
||||
0x20, 0x37, 0x3A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x22, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4E,
|
||||
0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4E, 0x47, 0x22, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B, 0x3B, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6C, 0x74, 0x3A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74,
|
||||
0x65, 0x20, 0x3D, 0x20, 0x22, 0x55, 0x4E, 0x4B, 0x4E, 0x4F, 0x57, 0x4E, 0x22, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6B,
|
||||
0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x67, 0x75, 0x69, 0x64, 0x20, 0x3D, 0x20, 0x69, 0x6E, 0x66, 0x6F, 0x2E, 0x44, 0x65,
|
||||
0x72, 0x65, 0x66, 0x28, 0x30, 0x2C, 0x20, 0x31, 0x36, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E,
|
||||
0x57, 0x6C, 0x61, 0x6E, 0x53, 0x63, 0x61, 0x6E, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x2C, 0x20, 0x69, 0x67, 0x75, 0x69, 0x64, 0x2C, 0x20, 0x30, 0x2C, 0x20,
|
||||
0x30, 0x2C, 0x20, 0x30, 0x29, 0x20, 0x3D, 0x3D, 0x20, 0x30, 0x29, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E,
|
||||
0x20, 0x28, 0x74, 0x72, 0x75, 0x65, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6C, 0x73, 0x65, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x20, 0x28, 0x66, 0x61, 0x6C, 0x73, 0x65, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x7D, 0x0A, 0x0A, 0x66,
|
||||
0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x28, 0x5F, 0x73, 0x73, 0x69, 0x64, 0x2C, 0x20, 0x5F, 0x62, 0x73, 0x73, 0x69,
|
||||
0x64, 0x2C, 0x20, 0x5F, 0x72, 0x73, 0x73, 0x69, 0x2C, 0x20, 0x5F, 0x6C, 0x71, 0x29, 0x0A, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x73, 0x73, 0x69, 0x64, 0x20, 0x3D,
|
||||
0x20, 0x5F, 0x73, 0x73, 0x69, 0x64, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x62, 0x73, 0x73, 0x69, 0x64, 0x20, 0x3D, 0x20, 0x5F, 0x62, 0x73, 0x73, 0x69, 0x64, 0x3B,
|
||||
0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x72, 0x73, 0x73, 0x69, 0x20, 0x3D, 0x20, 0x5F, 0x72, 0x73, 0x73, 0x69, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73,
|
||||
0x2E, 0x6C, 0x71, 0x20, 0x3D, 0x20, 0x5F, 0x6C, 0x71, 0x3B, 0x0A, 0x7D, 0x0A, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x2E, 0x70, 0x72, 0x6F, 0x74, 0x6F, 0x74, 0x79,
|
||||
0x70, 0x65, 0x2E, 0x74, 0x6F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x20, 0x3D, 0x20, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x28, 0x29, 0x0A, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x72,
|
||||
0x65, 0x74, 0x75, 0x72, 0x6E, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x73, 0x73, 0x69, 0x64, 0x20, 0x2B, 0x20, 0x22, 0x20, 0x5B, 0x22, 0x20, 0x2B, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x62,
|
||||
0x73, 0x73, 0x69, 0x64, 0x20, 0x2B, 0x20, 0x22, 0x5D, 0x3A, 0x20, 0x22, 0x20, 0x2B, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x6C, 0x71, 0x29, 0x3B, 0x0A, 0x7D, 0x0A, 0x0A, 0x66, 0x75, 0x6E, 0x63,
|
||||
0x74, 0x69, 0x6F, 0x6E, 0x20, 0x4F, 0x6E, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x79, 0x28, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x44, 0x61, 0x74, 0x61, 0x29, 0x0A,
|
||||
0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x53, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x20, 0x3D, 0x20, 0x4E,
|
||||
0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x44, 0x61, 0x74, 0x61, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x30, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B,
|
||||
0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x43, 0x6F, 0x64, 0x65, 0x20, 0x3D, 0x20, 0x4E, 0x6F, 0x74, 0x69,
|
||||
0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x44, 0x61, 0x74, 0x61, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x34, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x47, 0x75, 0x69, 0x64, 0x20, 0x3D, 0x20, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x44, 0x61, 0x74,
|
||||
0x61, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x38, 0x2C, 0x20, 0x31, 0x36, 0x29, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69,
|
||||
0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x53, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x20, 0x26, 0x20, 0x30, 0x58, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x38, 0x29, 0x20, 0x26, 0x26, 0x20, 0x28, 0x4E,
|
||||
0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x43, 0x6F, 0x64, 0x65, 0x20, 0x3D, 0x3D, 0x20, 0x37, 0x29, 0x29, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x73, 0x73, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x50, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68,
|
||||
0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20,
|
||||
0x72, 0x65, 0x73, 0x75, 0x6C, 0x74, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x50, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x47, 0x65, 0x74, 0x42,
|
||||
0x53, 0x53, 0x4C, 0x69, 0x73, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x50, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x2E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x2C, 0x20, 0x64, 0x61, 0x74, 0x61, 0x47,
|
||||
0x75, 0x69, 0x64, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x33, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x62, 0x73, 0x73, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69,
|
||||
0x66, 0x20, 0x28, 0x72, 0x65, 0x73, 0x75, 0x6C, 0x74, 0x20, 0x3D, 0x3D, 0x20, 0x30, 0x29, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6F, 0x74, 0x61, 0x6C, 0x53, 0x69, 0x7A, 0x65, 0x20, 0x3D, 0x20, 0x62, 0x73, 0x73, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28,
|
||||
0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x30, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76,
|
||||
0x61, 0x72, 0x20, 0x6E, 0x75, 0x6D, 0x49, 0x74, 0x65, 0x6D, 0x73, 0x20, 0x3D, 0x20, 0x62, 0x73, 0x73, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28,
|
||||
0x34, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x28, 0x69, 0x20, 0x3D, 0x20,
|
||||
0x30, 0x3B, 0x20, 0x69, 0x20, 0x3C, 0x20, 0x6E, 0x75, 0x6D, 0x49, 0x74, 0x65, 0x6D, 0x73, 0x3B, 0x20, 0x2B, 0x2B, 0x69, 0x29, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x74, 0x65, 0x6D, 0x20, 0x3D, 0x20, 0x62,
|
||||
0x73, 0x73, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x38, 0x20, 0x2B, 0x20, 0x28, 0x33, 0x36, 0x30, 0x20, 0x2A, 0x20, 0x69, 0x29, 0x2C, 0x20,
|
||||
0x33, 0x36, 0x30, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x73, 0x73, 0x69, 0x64, 0x20, 0x3D,
|
||||
0x20, 0x69, 0x74, 0x65, 0x6D, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x34, 0x2C, 0x20, 0x33, 0x32, 0x29, 0x2E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x2E, 0x74, 0x72, 0x69, 0x6D, 0x28, 0x29,
|
||||
0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x73, 0x73, 0x69, 0x64, 0x20, 0x3D, 0x20, 0x69, 0x74,
|
||||
0x65, 0x6D, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x34, 0x30, 0x2C, 0x20, 0x36, 0x29, 0x2E, 0x48, 0x65, 0x78, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x32, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x72, 0x73, 0x73, 0x69, 0x20, 0x3D, 0x20, 0x69, 0x74, 0x65, 0x6D, 0x2E, 0x44, 0x65, 0x72, 0x65,
|
||||
0x66, 0x28, 0x35, 0x36, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61,
|
||||
0x72, 0x20, 0x6C, 0x71, 0x20, 0x3D, 0x20, 0x69, 0x74, 0x65, 0x6D, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x36, 0x30, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x0A, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x50, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x2E, 0x65, 0x6D, 0x69, 0x74, 0x28,
|
||||
0x27, 0x53, 0x63, 0x61, 0x6E, 0x27, 0x2C, 0x20, 0x6E, 0x65, 0x77, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x28, 0x73, 0x73, 0x69, 0x64, 0x2C, 0x20, 0x62, 0x73,
|
||||
0x73, 0x69, 0x64, 0x2C, 0x20, 0x72, 0x73, 0x73, 0x69, 0x2C, 0x20, 0x6C, 0x71, 0x29, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x7D, 0x0A, 0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x57, 0x69, 0x72, 0x65,
|
||||
0x6C, 0x65, 0x73, 0x73, 0x28, 0x29, 0x0A, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6D, 0x69, 0x74, 0x74, 0x65, 0x72, 0x55, 0x74, 0x69, 0x6C, 0x73, 0x20, 0x3D, 0x20,
|
||||
0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x27, 0x65, 0x76, 0x65, 0x6E, 0x74, 0x73, 0x27, 0x29, 0x2E, 0x69, 0x6E, 0x68, 0x65, 0x72, 0x69, 0x74, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29,
|
||||
0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x20, 0x3D, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x27, 0x5F,
|
||||
0x47, 0x65, 0x6E, 0x65, 0x72, 0x69, 0x63, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x27, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76,
|
||||
0x65, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x6F,
|
||||
0x78, 0x79, 0x28, 0x22, 0x77, 0x6C, 0x61, 0x6E, 0x61, 0x70, 0x69, 0x2E, 0x64, 0x6C, 0x6C, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69,
|
||||
0x76, 0x65, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x28, 0x22, 0x57, 0x6C, 0x61, 0x6E, 0x4F, 0x70, 0x65, 0x6E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x22,
|
||||
0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x28,
|
||||
0x22, 0x57, 0x6C, 0x61, 0x6E, 0x47, 0x65, 0x74, 0x4E, 0x65, 0x74, 0x77, 0x6F, 0x72, 0x6B, 0x42, 0x73, 0x73, 0x4C, 0x69, 0x73, 0x74, 0x22, 0x2C, 0x20, 0x22, 0x47, 0x65, 0x74, 0x42, 0x53, 0x53,
|
||||
0x4C, 0x69, 0x73, 0x74, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4D, 0x65,
|
||||
0x74, 0x68, 0x6F, 0x64, 0x28, 0x22, 0x57, 0x6C, 0x61, 0x6E, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x22, 0x29,
|
||||
0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x28, 0x22,
|
||||
0x57, 0x6C, 0x61, 0x6E, 0x45, 0x6E, 0x75, 0x6D, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E,
|
||||
0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x28, 0x22, 0x57, 0x6C, 0x61, 0x6E, 0x53, 0x63, 0x61, 0x6E, 0x22, 0x29, 0x3B, 0x0A,
|
||||
0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x28, 0x22, 0x57, 0x6C,
|
||||
0x61, 0x6E, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x22, 0x29, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6E, 0x65, 0x67,
|
||||
0x6F, 0x74, 0x69, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6F, 0x69,
|
||||
0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x68, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C,
|
||||
0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69,
|
||||
0x76, 0x65, 0x2E, 0x57, 0x6C, 0x61, 0x6E, 0x4F, 0x70, 0x65, 0x6E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x28, 0x32, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x6E, 0x65, 0x67, 0x6F, 0x74, 0x69, 0x61, 0x74,
|
||||
0x65, 0x64, 0x2C, 0x20, 0x68, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x20, 0x3D, 0x20, 0x68, 0x2E, 0x56, 0x61, 0x6C, 0x3B,
|
||||
0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x5F, 0x4E, 0x4F, 0x54, 0x49, 0x46, 0x59, 0x5F, 0x50, 0x52, 0x4F, 0x58, 0x59, 0x5F, 0x4F, 0x42, 0x4A, 0x45, 0x43, 0x54, 0x20,
|
||||
0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6C, 0x6C, 0x62, 0x61, 0x63, 0x6B, 0x50, 0x72, 0x6F,
|
||||
0x78, 0x79, 0x28, 0x4F, 0x6E, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x79, 0x2C, 0x20, 0x32, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x5F, 0x4E, 0x4F, 0x54, 0x49, 0x46,
|
||||
0x59, 0x5F, 0x50, 0x52, 0x4F, 0x58, 0x59, 0x5F, 0x4F, 0x42, 0x4A, 0x45, 0x43, 0x54, 0x2E, 0x50, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x3B, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x50, 0x72, 0x65, 0x76, 0x53, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E,
|
||||
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6C, 0x74, 0x20,
|
||||
0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x57, 0x6C, 0x61, 0x6E, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4E, 0x6F, 0x74, 0x69, 0x66, 0x69,
|
||||
0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x2C, 0x20, 0x30, 0x58, 0x30, 0x30, 0x30, 0x30, 0x46, 0x46, 0x46, 0x46, 0x2C, 0x20,
|
||||
0x30, 0x2C, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x5F, 0x4E, 0x4F, 0x54, 0x49, 0x46, 0x59, 0x5F, 0x50, 0x52, 0x4F, 0x58, 0x59, 0x5F, 0x4F, 0x42, 0x4A, 0x45, 0x43, 0x54, 0x2E, 0x43, 0x61, 0x6C,
|
||||
0x6C, 0x62, 0x61, 0x63, 0x6B, 0x2C, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x5F, 0x4E, 0x4F, 0x54, 0x49, 0x46, 0x59, 0x5F, 0x50, 0x52, 0x4F, 0x58, 0x59, 0x5F, 0x4F, 0x42, 0x4A, 0x45, 0x43, 0x54,
|
||||
0x2E, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x50, 0x72, 0x65, 0x76, 0x53, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x29, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6D, 0x69,
|
||||
0x74, 0x74, 0x65, 0x72, 0x55, 0x74, 0x69, 0x6C, 0x73, 0x2E, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6E, 0x74, 0x28, 0x27, 0x53, 0x63, 0x61, 0x6E, 0x27, 0x29, 0x3B, 0x0A, 0x20,
|
||||
0x20, 0x20, 0x20, 0x65, 0x6D, 0x69, 0x74, 0x74, 0x65, 0x72, 0x55, 0x74, 0x69, 0x6C, 0x73, 0x2E, 0x61, 0x64, 0x64, 0x4D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x28, 0x27, 0x53, 0x63, 0x61, 0x6E, 0x27,
|
||||
0x2C, 0x20, 0x5F, 0x53, 0x63, 0x61, 0x6E, 0x29, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x47, 0x65, 0x74, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64,
|
||||
0x4E, 0x65, 0x74, 0x77, 0x6F, 0x72, 0x6B, 0x20, 0x3D, 0x20, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x28, 0x29, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61,
|
||||
0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73,
|
||||
0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x57, 0x6C, 0x61, 0x6E, 0x45, 0x6E, 0x75, 0x6D, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2E,
|
||||
0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x20, 0x3D, 0x20, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2E,
|
||||
0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x30, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6E, 0x66, 0x6F, 0x20, 0x3D, 0x20, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44,
|
||||
0x65, 0x72, 0x65, 0x66, 0x28, 0x38, 0x2C, 0x20, 0x35, 0x33, 0x32, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6E, 0x61, 0x6D, 0x65, 0x20,
|
||||
0x3D, 0x20, 0x69, 0x6E, 0x66, 0x6F, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x31, 0x36, 0x2C, 0x20, 0x35, 0x31, 0x32, 0x29, 0x2E, 0x41, 0x6E, 0x73, 0x69, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67,
|
||||
0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x69, 0x6E, 0x66, 0x6F, 0x2E, 0x44, 0x65, 0x72, 0x65,
|
||||
0x66, 0x28, 0x35, 0x32, 0x38, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x49, 0x6E, 0x74, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x69, 0x6E,
|
||||
0x66, 0x6F, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x35, 0x32, 0x38, 0x2C, 0x20, 0x34, 0x29, 0x2E, 0x49, 0x6E, 0x74, 0x56, 0x61, 0x6C, 0x20, 0x3D, 0x3D, 0x20, 0x31, 0x29, 0x20, 0x2F, 0x2F,
|
||||
0x20, 0x43, 0x4F, 0x4E, 0x4E, 0x45, 0x43, 0x54, 0x45, 0x44, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7A, 0x65, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x70, 0x44,
|
||||
0x61, 0x74, 0x61, 0x20, 0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72,
|
||||
0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x20, 0x3D, 0x20,
|
||||
0x74, 0x68, 0x69, 0x73, 0x2E, 0x4D, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6C, 0x2E, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x28, 0x29, 0x3B, 0x0A, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x69, 0x67, 0x75, 0x69, 0x64, 0x20, 0x3D, 0x20, 0x69, 0x6E, 0x66, 0x6F, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66,
|
||||
0x28, 0x30, 0x2C, 0x20, 0x31, 0x36, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6C, 0x20,
|
||||
0x3D, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2E, 0x57, 0x6C, 0x61, 0x6E, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6E, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
|
||||
0x28, 0x74, 0x68, 0x69, 0x73, 0x2E, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x2C, 0x20, 0x69, 0x67, 0x75, 0x69, 0x64, 0x2C, 0x20, 0x37, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x64, 0x61, 0x74, 0x61, 0x53,
|
||||
0x69, 0x7A, 0x65, 0x2C, 0x20, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2C, 0x20, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x72, 0x65, 0x74, 0x56, 0x61, 0x6C, 0x20, 0x3D, 0x3D, 0x20, 0x30, 0x29, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x7B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x61, 0x73, 0x73, 0x6F, 0x63, 0x69, 0x61, 0x74, 0x65,
|
||||
0x64, 0x53, 0x53, 0x49, 0x44, 0x20, 0x3D, 0x20, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x35, 0x32, 0x34, 0x2C,
|
||||
0x20, 0x33, 0x32, 0x29, 0x2E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72,
|
||||
0x20, 0x62, 0x73, 0x73, 0x69, 0x64, 0x20, 0x3D, 0x20, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x35, 0x36, 0x30,
|
||||
0x2C, 0x20, 0x36, 0x29, 0x2E, 0x48, 0x65, 0x78, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x76, 0x61, 0x72, 0x20, 0x6C, 0x71, 0x20, 0x3D, 0x20, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x29, 0x2E, 0x44, 0x65, 0x72, 0x65, 0x66, 0x28, 0x35, 0x37, 0x36,
|
||||
0x2C, 0x20, 0x34, 0x29, 0x2E, 0x49, 0x6E, 0x74, 0x56, 0x61, 0x6C, 0x3B, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65,
|
||||
0x74, 0x75, 0x72, 0x6E, 0x20, 0x28, 0x6E, 0x65, 0x77, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x28, 0x61, 0x73, 0x73, 0x6F, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64,
|
||||
0x53, 0x53, 0x49, 0x44, 0x2C, 0x20, 0x62, 0x73, 0x73, 0x69, 0x64, 0x2C, 0x20, 0x30, 0x2C, 0x20, 0x6C, 0x71, 0x29, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x72, 0x6F, 0x77, 0x20, 0x28, 0x22, 0x47, 0x65,
|
||||
0x74, 0x43, 0x6F, 0x6E, 0x6E, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4E, 0x65, 0x74, 0x77, 0x6F, 0x72, 0x6B, 0x73, 0x3A, 0x20, 0x46, 0x41, 0x49, 0x4C, 0x45, 0x44, 0x20, 0x28, 0x6E, 0x6F, 0x74, 0x20,
|
||||
0x61, 0x73, 0x73, 0x6F, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x61, 0x20, 0x6E, 0x65, 0x74, 0x77, 0x6F, 0x72, 0x6B, 0x29, 0x22, 0x29, 0x3B, 0x0A, 0x20, 0x20, 0x20, 0x20,
|
||||
0x7D, 0x3B, 0x0A, 0x0A, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3B, 0x0A, 0x7D, 0x0A, 0x0A, 0x6D, 0x6F, 0x64, 0x75, 0x6C,
|
||||
0x65, 0x2E, 0x65, 0x78, 0x70, 0x6F, 0x72, 0x74, 0x73, 0x20, 0x3D, 0x20, 0x6E, 0x65, 0x77, 0x20, 0x57, 0x69, 0x72, 0x65, 0x6C, 0x65, 0x73, 0x73, 0x28, 0x29, 0x3B, 0x0A]);
|
||||
|
||||
|
||||
|
||||
var WindowsChildScript = new Buffer([
|
||||
0x76, 0x61, 0x72, 0x20, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x20, 0x3D, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x27, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x6F, 0x6E, 0x74,
|
||||
0x61, 0x69, 0x6E, 0x65, 0x72, 0x27, 0x29, 0x3B, 0x0D, 0x0A, 0x76, 0x61, 0x72, 0x20, 0x57, 0x69, 0x72, 0x65, 0x6C, 0x65, 0x73, 0x73, 0x20, 0x3D, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
|
||||
0x28, 0x27, 0x57, 0x69, 0x72, 0x65, 0x6C, 0x65, 0x73, 0x73, 0x27, 0x29, 0x3B, 0x0D, 0x0A, 0x0D, 0x0A, 0x57, 0x69, 0x72, 0x65, 0x6C, 0x65, 0x73, 0x73, 0x2E, 0x6F, 0x6E, 0x28, 0x27, 0x53, 0x63,
|
||||
0x61, 0x6E, 0x27, 0x2C, 0x20, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x28, 0x61, 0x70, 0x29, 0x20, 0x7B, 0x20, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x2E, 0x73, 0x65, 0x6E, 0x64,
|
||||
0x28, 0x61, 0x70, 0x29, 0x3B, 0x20, 0x7D, 0x29, 0x3B, 0x0D, 0x0A, 0x57, 0x69, 0x72, 0x65, 0x6C, 0x65, 0x73, 0x73, 0x2E, 0x53, 0x63, 0x61, 0x6E, 0x28, 0x29, 0x3B, 0x0D, 0x0A]);
|
||||
var WindowsChildScript = 'var parent = require("ScriptContainer");var Wireless = require("wifi-scanner-windows");Wireless.on("Scan", function (ap) { parent.send(ap); });Wireless.Scan();';
|
||||
|
||||
|
||||
function AccessPoint(_ssid, _bssid, _lq)
|
||||
@ -199,8 +38,8 @@ function WiFiScanner()
|
||||
this.master.parent = this;
|
||||
this.master.on('data', function (j) { this.parent.emit('accessPoint', new AccessPoint(j.ssid, j.bssid, j.lq)); });
|
||||
|
||||
this.master.addModule('Wireless', WindowsWireless.toString());
|
||||
this.master.ExecuteString(WindowsChildScript.toString());
|
||||
this.master.addModule('wifi-scanner-windows', getJSModule('wifi-scanner-windows'));
|
||||
this.master.ExecuteString(WindowsChildScript);
|
||||
}
|
||||
else if (process.platform == 'linux')
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "meshcentral",
|
||||
"version": "0.1.4-x",
|
||||
"version": "0.1.4-y",
|
||||
"keywords": [
|
||||
"Remote Management",
|
||||
"Intel AMT",
|
||||
|
Loading…
Reference in New Issue
Block a user