diff --git a/amt/amt-ider.js b/amt/amt-ider.js
index 3af6bec0..dcd8871f 100644
--- a/amt/amt-ider.js
+++ b/amt/amt-ider.js
@@ -15,6 +15,7 @@
// Construct a MeshAgent object, called upon connection
module.exports.CreateAmtIderSession = function (parent, db, ws, req, args, domain, user) {
+ const fs = require('fs');
const path = require('path');
const common = parent.common;
const amtMeshRedirModule = require('./amt-redir-mesh.js');
@@ -47,8 +48,7 @@ module.exports.CreateAmtIderSession = function (parent, db, ws, req, args, domai
// If the web socket is closed
ws.on('close', function (req) {
// Close the IDER session
- obj.ider.Stop();
- delete obj.ider;
+ if (obj.ider) { obj.ider.Stop(); delete obj.ider; }
});
// We are all set, start receiving data
@@ -64,42 +64,85 @@ module.exports.CreateAmtIderSession = function (parent, db, ws, req, args, domai
switch (command.action) {
case 'ping': { try { ws.send(JSON.stringify({ action: 'pong' })); } catch (ex) { } break; }
- case 'selector': {
- var r = { action: 'selector', args: { html: 'Click ok to start IDER session.' }, buttons: 3 };
- // TODO: Return a list of disk images for the user to select.
- try { ws.send(JSON.stringify(r)); } catch (ex) { }
- break;
- }
- case 'selectorResponse': {
- //console.log('selectorResponse', command.args, req.query);
- // Start IDER Session
+ case 'start': {
+ // Get the list of disk images
+ var domainx = 'domain' + ((domain.id == '') ? '' : ('-' + domain.id));
+ var useridx = user._id.split('/')[2];
+ var userPath = parent.parent.path.join(parent.parent.filespath, domainx, 'user-' + useridx);
- command.args = {
- floppyPath: 'C:\\Users\\Default.DESKTOP-M9I88C9\\Desktop\\AmtWebApp\\meshcentral-files\\domain\\user-admin\\msdos.img',
- cdromPath: 'C:\\Users\\Default.DESKTOP-M9I88C9\\Desktop\\AmtWebApp\\meshcentral-files\\domain\\user-admin\\recovery.iso',
- iderStart: 1,
- tlsv1only: true
- };
+ // Look for a list of disk images for the user to select.
+ if (fs.existsSync(userPath)) {
+ // Do something
+ readFsRec(userPath, function (err, results) {
+ var floppyImages = [], cdromImages = [];
+ for (var i in results) {
+ if (results[i].toLowerCase().endsWith('.img')) { floppyImages.push(results[i].substring(userPath.length + 1)); }
+ else if (results[i].toLowerCase().endsWith('.iso')) { cdromImages.push(results[i].substring(userPath.length + 1)); }
+ }
+ //console.log(floppyImages, cdromImages);
- // Setup the IDER session
- obj.ider = amtMeshRedirModule.CreateAmtRedirect(amtMeshIderModule.CreateAmtRemoteIder(parent, parent.parent), domain, user, parent, parent.parent);
- obj.ider.onStateChanged = onIderStateChange;
- obj.ider.m.iderStart = command.args.iderStart;
- obj.ider.m.sectorStats = iderSectorStats;
- obj.ider.tlsv1only = req.query.tlsv1only;
+ var xx, sel = true, html = "
Select disk images & start type.
";
- // Setup disk images
- if (obj.ider.m.diskSetup(command.args.floppyPath, command.args.cdromPath) != 0) {
- // Error with the disk images, unable to start IDER
- obj.ider.onStateChanged = null;
- obj.ider.m.sectorStats = null;
- delete obj.ider;
- obj.close();
- break;
+ // Floppy image selection
+ xx = "";
+ html += "" + addHtmlValue("Floppy Image", xx) + "
";
+
+ // CDROM image selection
+ sel = true;
+ xx = "";
+ html += "" + addHtmlValue("CDROM Image", xx) + "
";
+
+ // Start type
+ xx = "";
+ html += "" + addHtmlValue("Session Start", xx) + "
";
+
+ var js = "function iderServerCall() { return { ider: 1, floppyPath: Q('xxFloppyImagesSelect').value, cdromPath: Q('xxCdromImagesSelect').value, iderStart: Q('xxIderStartType').value }; }";
+
+ try { ws.send(JSON.stringify({ action: 'dialog', args: { html: html, js: js }, buttons: 3 })); } catch (ex) { }
+ });
+ } else {
+ // No user folder
+ try { ws.send(JSON.stringify({ action: 'dialog', args: { html: 'No disk images found on remote server. Upload .img and .iso files to server "My Files" folder to enable this feature.' }, buttons: 2 })); } catch (ex) { }
}
- // Start the IDER session
- obj.ider.Start(req.query.host, req.query.port, req.query.tls);
+ break;
+ }
+ case 'dialogResponse': {
+ if (command.args.ider == 1) { // Start IDER Session
+ // Decode and validate file paths
+ if ((command.args.floppyPath != null) && (typeof command.args.floppyPath != 'string')) { command.args.floppyPath = null; } else { command.args.floppyPath = decodeURIComponent(command.args.floppyPath); }
+ if ((command.args.cdromPath != null) && (typeof command.args.cdromPath != 'string')) { command.args.cdromPath = null; } else { command.args.cdromPath = decodeURIComponent(command.args.cdromPath); }
+ // TODO: Double check that "." or ".." are not used.
+ if ((command.args.floppyPath != null) && (command.args.floppyPath.indexOf("..") >= 0)) { delete command.args.floppyPath; }
+ if ((command.args.cdromPath != null) && (command.args.cdromPath.indexOf("..") >= 0)) { delete command.args.cdromPath; }
+
+ // Get the disk image paths
+ var domainx = 'domain' + ((domain.id == '') ? '' : ('-' + domain.id));
+ var useridx = user._id.split('/')[2];
+ var floppyPath = null, cdromPath = null;
+ if (command.args.floppyPath) { floppyPath = parent.parent.path.join(parent.parent.filespath, domainx, 'user-' + useridx, command.args.floppyPath); }
+ if (command.args.cdromPath) { cdromPath = parent.parent.path.join(parent.parent.filespath, domainx, 'user-' + useridx, command.args.cdromPath); }
+
+ // Setup the IDER session
+ obj.ider = amtMeshRedirModule.CreateAmtRedirect(amtMeshIderModule.CreateAmtRemoteIder(parent, parent.parent), domain, user, parent, parent.parent);
+ obj.ider.onStateChanged = onIderStateChange;
+ obj.ider.m.iderStart = command.args.iderStart;
+ obj.ider.m.sectorStats = iderSectorStats;
+ obj.ider.tlsv1only = req.query.tlsv1only;
+
+ // Setup disk images
+ var iderError = obj.ider.m.diskSetup(floppyPath, cdromPath);
+
+ // Error with the disk images, unable to start IDER
+ if (iderError != 0) { try { ws.send(JSON.stringify({ action: "error", code: iderError })); } catch (ex) { } break; }
+
+ // Start the IDER session
+ obj.ider.Start(req.query.host, req.query.port, req.query.tls);
+ }
break;
}
@@ -128,5 +171,27 @@ module.exports.CreateAmtIderSession = function (parent, db, ws, req, args, domai
try { ws.send(JSON.stringify({ action: 'stats', mode: mode, dev: dev, total: total, start: start, len: len, toAmt: obj.ider.m.bytesToAmt, fromAmt: obj.ider.m.bytesFromAmt })); } catch (ex) { }
}
+ // Recursivly read all of the files in a fonder
+ function readFsRec(dir, func) {
+ var results = [];
+ fs.readdir(dir, function (err, list) {
+ if (err) return func(err);
+ var pending = list.length;
+ if (!pending) return func(null, results);
+ list.forEach(function (file) {
+ file = path.resolve(dir, file);
+ fs.stat(file, function (err, stat) {
+ if (stat && stat.isDirectory()) {
+ readFsRec(file, function (err, res) { results = results.concat(res); if (!--pending) func(null, results); });
+ } else {
+ results.push(file); if (!--pending) func(null, results);
+ }
+ });
+ });
+ });
+ };
+
+ function addHtmlValue(t, v) { return ''; }
+
return obj;
};
\ No newline at end of file
diff --git a/public/commander.htm b/public/commander.htm
index f25af00d..cdc013f2 100644
--- a/public/commander.htm
+++ b/public/commander.htm
@@ -34,39 +34,40 @@ e.iderinfo.minor=e.acc.charCodeAt(9);e.iderinfo.fwmajor=e.acc.charCodeAt(10);e.i
e.Stop());0==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(9)):1==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(17)):2==e.iderStart&&e.SendDisableEnableFeatures(3,IntToStrX(25));return 30+a;case 67:return b("CLOSE"),e.Stop(),8;case 68:return e.SendCommand(69),8;case 69:return b("PONG"),8;case 70:if(9>e.acc.length)break;a=e.acc.charCodeAt(8);null===D?(e.SendCommand(71),b("RESETOCCURED1",a)):(z=!0,b("RESETOCCURED2",a));return 9;case 73:if(13>e.acc.length)break;var a=e.acc.charCodeAt(8),
m=ReadIntX(e.acc,9);b("STATUS_DATA",a,m);switch(a){case 1:m&1&&(0==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(9)):1==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(17)):2==e.iderStart&&e.SendDisableEnableFeatures(3,IntToStrX(25)));break;case 2:e.enabled=m&2?!0:!1;b("IDER Status: "+e.enabled);break;case 3:1!=m&&b("Register toggle failure")}return 13;case 74:if(11>e.acc.length)break;b("IDER: ABORT",e.acc.charCodeAt(8));return 11;case 75:return 8;case 80:if(28>e.acc.length)break;var a=
e.acc.charCodeAt(14)&16?176:160,m=e.acc.charCodeAt(14),g=e.acc.substring(16,28),y=e.acc.charCodeAt(9);b("SCSI_CMD",a,rstr2hex(g),y,m);c(a,g,y,m);return 28;case 83:if(14>e.acc.length)break;a=ReadShortX(e.acc,9);if(e.acc.length<14+a)break;b("SCSI_WRITE, len = "+(14+a));e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0),!0);return 14+a;default:b("Unknown IDER command",e.acc[0]),e.Stop()}return 0};var z=!1,D=null,A,G,L;return e},CreateAmtRemoteServerIder=function(){function b(){urlvars&&
-urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}var c={protocol:4,iderStart:0,floppy:null,cdrom:null,state:0,onStateChanged:null,m:{sectorStats:null,onDialogPrompt:null,dialogPrompt:function(a){console.log("dialogPromptResponse",a);c.socket.send(JSON.stringify({action:"selectorResponse",args:a}))},bytesToAmt:0,bytesFromAmt:0,server:!0,Stop:function(){c.Stop()}},xxStateChange:function(a){if(c.state!=a&&(b("SIDER-StateChange",a),c.state=a,null!=c.onStateChanged))c.onStateChanged(c,
-c.state)},Start:function(a,d,e,n,p){b("SIDER-Start",a,d,e,n,p);c.host=a;c.port=d;c.user=e;c.pass=n;c.connectstate=0;c.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webider.ashx?host="+a+"&port="+d+"&tls="+p+("*"==e?"&serverauth=1":"")+("undefined"===typeof n?"&serverauth=1&user="+e:"")+"&tls1only="+c.tlsv1only);c.socket.onopen=c.xxOnSocketConnected;c.socket.onmessage=c.xxOnMessage;
-c.socket.onclose=c.xxOnSocketClosed;c.xxStateChange(1)},Stop:function(){b("SIDER-Stop");null!=c.socket&&(c.socket.close(),c.socket=null);c.xxStateChange(0)},xxOnSocketConnected:function(){c.xxStateChange(2);c.socket.send(JSON.stringify({action:"selector"}))},xxOnMessage:function(a){var b=null;try{b=JSON.parse(a.data)}catch(e){}if(null!=b&&"string"==typeof b.action)switch(b.action){case "selector":if(null!=c.m.onDialogPrompt)c.m.onDialogPrompt(c,b.args,b.buttons);break;case "state":2==b.state&&c.xxStateChange(3);
-break;case "stats":c.m.bytesToAmt=b.toAmt;c.m.bytesFromAmt=b.fromAmt;c.m.sectorStats&&c.m.sectorStats(b.mode,b.dev,b.total,b.start,b.len);break;default:console.log("Unknown Server IDER action: "+b.action),breal}},xxOnSocketClosed:function(){c.Stop()}};return c},CreateWsmanComm=function(b,c,a,d,e){function n(){g.socketState=2;g.socketParseState=0;g.socketAccumulator="";g.socketHeader=null;g.socketData="";for(i in g.pendingAjaxCall)g.sendRequest(g.pendingAjaxCall[i][0],g.pendingAjaxCall[i][3],g.pendingAjaxCall[i][4])}
-function p(a){if("object"==typeof a.data)if(1==l)v.push(a.data);else if(w.readAsBinaryString)l=!0,w.readAsBinaryString(new Blob([a.data]));else if(w.readAsArrayBuffer)l=!0,w.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,m=0;ma)break;g.socketHeader=g.socketAccumulator.substring(0,a).split("\r\n");if(null==g.amtVersion)for(m in g.socketHeader)0==g.socketHeader[m].indexOf("Server: Intel(R) Active Management Technology ")&&(g.amtVersion=g.socketHeader[m].substring(46));g.socketAccumulator=g.socketAccumulator.substring(a+4);g.socketParseState=1;g.socketData="";g.socketXHeader={Directive:g.socketHeader[0].split(" ")};for(m in g.socketHeader)0!=m&&
-(a=g.socketHeader[m].indexOf(":"),g.socketXHeader[g.socketHeader[m].substring(0,a).toLowerCase()]=g.socketHeader[m].substring(a+2))}if(1==g.socketParseState){b=-1;if(void 0==g.socketXHeader.connection||"close"!=g.socketXHeader.connection.toLowerCase()||void 0!=g.socketXHeader["transfer-encoding"]&&"chunked"==g.socketXHeader["transfer-encoding"].toLowerCase())if(void 0!=g.socketXHeader["content-length"]){b=parseInt(g.socketXHeader["content-length"]);if(g.socketAccumulator.lengthc)break;b=parseInt(g.socketAccumulator.substring(0,c),16);if(isNaN(b)){g.websocket&&g.websocket.close();break}if(g.socketAccumulator.length++g.authcounter?
-g.challengeParams=g.parseDigest(c["www-authenticate"]):(c=g.pendingAjaxCall.shift(),g.authcounter=0,g.ActiveAjaxCount--,g.gotNextMessages(a,"success",{status:b},c),g.PerformNextAjax()),g.socketParseState=0,g.socketHeader=null)}}}function m(a){0==g.inDataCount&&(g.tlsv1only=1-g.tlsv1only);g.socketState=0;null!=g.socket&&(g.socket.close(),g.socket=null);if(0=
-g.MaxActiveAjaxCount||0==g.PendingAjax.length)){var a=g.PendingAjax.shift();g.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);g.PerformNextAjax()}};g.PerformAjaxEx=function(a,b,c,m,d){if(0!=g.FailAllError)g.gotNextMessagesError({status:g.FailAllError},"error",null,[a,b,c,m,d]);else return a||(a=""),g.ActiveAjaxCount++,g.PerformAjaxExNodeJS(a,b,c,m,d)};g.pendingAjaxCall=[];g.PerformAjaxExNodeJS=function(a,b,c,m,d){g.PerformAjaxExNodeJS2(a,b,c,m,d,3)};g.PerformAjaxExNodeJS2=function(a,b,c,m,d,e){0>=e||0!=g.FailAllError?
-(g.ActiveAjaxCount--,999!=g.FailAllError&&g.gotNextMessages(null,"error",{status:0==g.FailAllError?408:g.FailAllError},[a,b,c,m,d]),g.PerformNextAjax()):(g.pendingAjaxCall.push([a,b,c,m,d,e]),0==g.socketState?g.xxConnectHttpSocket():2==g.socketState&&g.sendRequest(a,m,d))};g.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var m=c+" "+b+" HTTP/1.1\r\n";null!=g.challengeParams&&(c=hex_md5(hex_md5(g.user+":"+g.challengeParams.realm+":"+g.pass)+":"+g.challengeParams.nonce+":"+g.noncecounter+":"+
-g.cnonce+":"+g.challengeParams.qop+":"+hex_md5(c+":"+b)),m+="Authorization: "+g.renderDigest({username:g.user,realm:g.challengeParams.realm,nonce:g.challengeParams.nonce,uri:b,qop:g.challengeParams.qop,response:c,nc:g.noncecounter++,cnonce:g.cnonce})+"\r\n");a=m+="Host: "+g.host+":"+g.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==g.socketState&&null!=g.socket&&g.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(m=0;mc.amtaccumulator.length)return;switch(c.amtaccumulator.charCodeAt(1)){case 0:if(13>c.amtaccumulator.length)return;b=c.amtaccumulator.charCodeAt(12);if(c.amtaccumulator.length<13+b)return;c.xxSend(String.fromCharCode(19,
-0,0,0,0,0,0,0,0));a=13+b;break;default:c.Stop()}break;case 20:if(9>c.amtaccumulator.length)return;var g=ReadIntX(c.amtaccumulator,5);if(c.amtaccumulator.length<9+g)return;var m=c.amtaccumulator.charCodeAt(1),b=c.amtaccumulator.charCodeAt(4),e=[];for(a=0;ac.amtaccumulator.length)break;a=23;c.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(c.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==c.protocol&&(c.amtkeepalivetimer=setInterval(c.xxSendAmtKeepAlive,2E3));c.connectstate=1;c.xxStateChange(3);break;case 41:if(10>c.amtaccumulator.length)break;a=10;break;case 42:if(10>c.amtaccumulator.length)break;b=10+((c.amtaccumulator.charCodeAt(9)&
-255)<<8)+(c.amtaccumulator.charCodeAt(8)&255);if(c.amtaccumulator.lengthc.amtaccumulator.length)break;a=8;break;case 65:if(8>c.amtaccumulator.length)break;c.connectstate=1;c.m.Start();8'+a.InstanceID+"";var b="",c;for(c in a)if(a.hasOwnProperty(c)){b+='';if(a[c].ReferenceParameters){var b=b+"",b=b+(""+a[c].Address+""+a[c].ReferenceParameters.ResourceURI+
-""),m=a[c].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(m))for(var g=0;g"+m[g].Value+"";else b+=""+m.Value+"";b+=""}else b+=a[c];b+=""}return b+""}var g={NextMessageId:1,Address:"/wsman"};g.comm=CreateWsmanComm(b,c,a,d,e,n);g.PerformAjax=function(a,b,c,m,d){null==d&&(d="");g.comm.PerformAjax('a)break;g.socketHeader=g.socketAccumulator.substring(0,a).split("\r\n");if(null==g.amtVersion)for(m in g.socketHeader)0==
+g.socketHeader[m].indexOf("Server: Intel(R) Active Management Technology ")&&(g.amtVersion=g.socketHeader[m].substring(46));g.socketAccumulator=g.socketAccumulator.substring(a+4);g.socketParseState=1;g.socketData="";g.socketXHeader={Directive:g.socketHeader[0].split(" ")};for(m in g.socketHeader)0!=m&&(a=g.socketHeader[m].indexOf(":"),g.socketXHeader[g.socketHeader[m].substring(0,a).toLowerCase()]=g.socketHeader[m].substring(a+2))}if(1==g.socketParseState){b=-1;if(void 0==g.socketXHeader.connection||
+"close"!=g.socketXHeader.connection.toLowerCase()||void 0!=g.socketXHeader["transfer-encoding"]&&"chunked"==g.socketXHeader["transfer-encoding"].toLowerCase())if(void 0!=g.socketXHeader["content-length"]){b=parseInt(g.socketXHeader["content-length"]);if(g.socketAccumulator.lengthc)break;b=parseInt(g.socketAccumulator.substring(0,c),16);
+if(isNaN(b)){g.websocket&&g.websocket.close();break}if(g.socketAccumulator.length++g.authcounter?g.challengeParams=g.parseDigest(c["www-authenticate"]):(c=g.pendingAjaxCall.shift(),g.authcounter=0,g.ActiveAjaxCount--,g.gotNextMessages(a,"success",{status:b},c),g.PerformNextAjax()),
+g.socketParseState=0,g.socketHeader=null)}}}function m(a){0==g.inDataCount&&(g.tlsv1only=1-g.tlsv1only);g.socketState=0;null!=g.socket&&(g.socket.close(),g.socket=null);if(0=g.MaxActiveAjaxCount||0==g.PendingAjax.length)){var a=g.PendingAjax.shift();g.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);g.PerformNextAjax()}};g.PerformAjaxEx=function(a,
+b,c,m,d){if(0!=g.FailAllError)g.gotNextMessagesError({status:g.FailAllError},"error",null,[a,b,c,m,d]);else return a||(a=""),g.ActiveAjaxCount++,g.PerformAjaxExNodeJS(a,b,c,m,d)};g.pendingAjaxCall=[];g.PerformAjaxExNodeJS=function(a,b,c,m,d){g.PerformAjaxExNodeJS2(a,b,c,m,d,3)};g.PerformAjaxExNodeJS2=function(a,b,c,m,d,e){0>=e||0!=g.FailAllError?(g.ActiveAjaxCount--,999!=g.FailAllError&&g.gotNextMessages(null,"error",{status:0==g.FailAllError?408:g.FailAllError},[a,b,c,m,d]),g.PerformNextAjax()):
+(g.pendingAjaxCall.push([a,b,c,m,d,e]),0==g.socketState?g.xxConnectHttpSocket():2==g.socketState&&g.sendRequest(a,m,d))};g.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var m=c+" "+b+" HTTP/1.1\r\n";null!=g.challengeParams&&(c=hex_md5(hex_md5(g.user+":"+g.challengeParams.realm+":"+g.pass)+":"+g.challengeParams.nonce+":"+g.noncecounter+":"+g.cnonce+":"+g.challengeParams.qop+":"+hex_md5(c+":"+b)),m+="Authorization: "+g.renderDigest({username:g.user,realm:g.challengeParams.realm,nonce:g.challengeParams.nonce,
+uri:b,qop:g.challengeParams.qop,response:c,nc:g.noncecounter++,cnonce:g.cnonce})+"\r\n");a=m+="Host: "+g.host+":"+g.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==g.socketState&&null!=g.socket&&g.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(m=0;mc.amtaccumulator.length)return;switch(c.amtaccumulator.charCodeAt(1)){case 0:if(13>c.amtaccumulator.length)return;b=c.amtaccumulator.charCodeAt(12);if(c.amtaccumulator.length<13+b)return;c.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+b;break;default:c.Stop()}break;case 20:if(9>c.amtaccumulator.length)return;var g=ReadIntX(c.amtaccumulator,5);if(c.amtaccumulator.length<
+9+g)return;var m=c.amtaccumulator.charCodeAt(1),b=c.amtaccumulator.charCodeAt(4),e=[];for(a=0;ac.amtaccumulator.length)break;
+a=23;c.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(c.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==c.protocol&&(c.amtkeepalivetimer=setInterval(c.xxSendAmtKeepAlive,2E3));c.connectstate=1;c.xxStateChange(3);break;case 41:if(10>c.amtaccumulator.length)break;a=10;break;case 42:if(10>c.amtaccumulator.length)break;b=10+((c.amtaccumulator.charCodeAt(9)&255)<<8)+(c.amtaccumulator.charCodeAt(8)&255);if(c.amtaccumulator.lengthc.amtaccumulator.length)break;a=8;break;case 65:if(8>c.amtaccumulator.length)break;c.connectstate=1;c.m.Start();8'+a.InstanceID+"";var b="",c;for(c in a)if(a.hasOwnProperty(c)){b+='';if(a[c].ReferenceParameters){var b=b+"",b=b+(""+a[c].Address+""+a[c].ReferenceParameters.ResourceURI+""),m=a[c].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(m))for(var g=
+0;g"+m[g].Value+"";else b+=""+m.Value+"";b+=""}else b+=a[c];b+=""}return b+""}var g={NextMessageId:1,Address:"/wsman"};g.comm=CreateWsmanComm(b,c,a,d,e,n);g.PerformAjax=function(a,b,c,m,d){null==d&&(d="");g.comm.PerformAjax('"+a,function(a,c,m){200!=c?b(g,null,{Header:{HttpError:c}},c,m):(a=g.ParseWsman(a))&&null!=a?b(g,a.Header.ResourceURI,a,200,m):b(g,null,{Header:{HttpError:c}},601,m)},c,m)};g.CancelAllQueries=function(a){g.comm.CancelAllQueries(a)};g.GetNameFromUrl=function(a){var b=a.lastIndexOf("/");return-1==b?a:a.substring(b+1)};g.ExecSubscribe=function(a,b,c,d,k,h,e,q,C,B){var y="",I="";q="";null!=C&&null!=B&&(y='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+
C+''+B+"",I='');null!=q&&(q=""+q+"");"PushWithAck"==b?b="dmtf.org/wbem/wsman/1/wsman/PushWithAck":"Push"==b&&(b="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push");
a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+g.Address+""+a+""+g.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+m(e)+y+''+c+""+q+""+I+"";g.PerformAjax(a+"",d,k,