8){return"[...]"}if(x==undefined){return"[undefined]"}if(typeof x=="string"){if(p==0){return x}return'"'+x+'"'}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,pad)+i+": "+objToString(x[i],p+2,pad,ret)+(ret?"\r\n":" "))}}return r+addPad(p,pad)+"}"}function addPad(p,ret){var r="";for(var i=0;i2&&x[0]=="-"&&x[1]=="-"){if(current!=null){results[current]=true}current=x.substring(2)}else{if(current!=null){results[current]=toNumberIfNumber(x);current=null}else{results._.push(toNumberIfNumber(x))}}}if(current!=null){results[current]=true}return results}function getServerTargetUrl(path){var x=mesh.ServerUrl;if(x==null){return null}if(path==null){path=""}x=http.parseUri(x);if(x==null){return null}return x.protocol+"//"+x.host+":"+x.port+"/"+path}function getServerTargetUrlEx(url){if(url.substring(0,2)=="*/"){return getServerTargetUrl(url.substring(2))}return url}function sendWakeOnLan(hexMac){var count=0;try{var interfaces=require("os").networkInterfaces();var magic="FFFFFFFFFFFF";for(var x=1;x<=16;++x){magic+=hexMac}var magicbin=Buffer.from(magic,"hex");for(var adapter in interfaces){if(interfaces.hasOwnProperty(adapter)){for(var i=0;i0){sendNextBlock--;var buf=new Buffer(4096);var len=fs.readSync(this.filedownload.f,buf,4,4092,null);this.filedownload.ptr+=len;if(len<4092){buf.writeInt32BE(16777217,0);fs.closeSync(this.filedownload.f);delete this.filedownload;sendNextBlock=0}else{buf.writeInt32BE(16777216,0)}this.write(buf.slice(0,len+4))}break;case"upload":if(this.httprequest.uploadFile!=undefined){fs.closeSync(this.httprequest.uploadFile);this.httprequest.uploadFile=undefined}if(cmd.path==undefined){break}var filepath=cmd.name?obj.path.join(cmd.path,cmd.name):cmd.path;try{this.httprequest.uploadFile=fs.openSync(filepath,"wbN")}catch(e){this.write(new Buffer(JSON.stringify({action:"uploaderror",reqid:cmd.reqid})));break}this.httprequest.uploadFileid=cmd.reqid;if(this.httprequest.uploadFile){this.write(new Buffer(JSON.stringify({action:"uploadstart",reqid:this.httprequest.uploadFileid})))}break;case"copy":for(var i in cmd.names){var sc=obj.path.join(cmd.scpath,cmd.names[i]),ds=obj.path.join(cmd.dspath,cmd.names[i]);if(sc!=ds){try{fs.copyFileSync(sc,ds)}catch(e){}}}break;case"move":for(var i in cmd.names){var sc=obj.path.join(cmd.scpath,cmd.names[i]),ds=obj.path.join(cmd.dspath,cmd.names[i]);if(sc!=ds){try{fs.copyFileSync(sc,ds);fs.unlinkSync(sc)}catch(e){}}}break;default:break}}}}}}}function deleteFolderRecursive(path,rec){if(fs.existsSync(path)){if(rec==true){fs.readdirSync(obj.path.join(path,"*")).forEach(function(file,index){var curPath=obj.path.join(path,file);if(fs.statSync(curPath).isDirectory()){deleteFolderRecursive(curPath,true)}else{fs.unlinkSync(curPath)}})}fs.unlinkSync(path)}}function onTunnelWebRTCControlData(data){if(typeof data!="string"){return}var obj;try{obj=JSON.parse(data)}catch(e){sendConsoleText("Invalid control JSON on WebRTC: "+data);return}if(obj.type=="close"){try{this.close()}catch(e){}try{this.xrtc.close()}catch(e){}}}function onTunnelControlData(data,ws){var obj;if(ws==null){ws=this}if(typeof data=="string"){try{obj=JSON.parse(data)}catch(e){sendConsoleText("Invalid control JSON: "+data);return}}else{if(typeof data=="object"){obj=data}else{return}}if(obj.action){switch(obj.action){case"lock":try{if(process.platform=="win32"){var child=require("child_process");child.execFile(process.env.windir+"\\system32\\cmd.exe",["/c","RunDll32.exe user32.dll,LockWorkStation"],{type:1})}}catch(e){}break;default:break}return}if(obj.type=="close"){try{ws.close()}catch(e){}}else{if(obj.type=="webrtc0"){if(ws.httprequest.protocol==1){if(process.platform=="win32"){ws.httprequest._term.unpipe(ws)}else{ws.httprequest.process.stdout.unpipe(ws);ws.httprequest.process.stderr.unpipe(ws)}}else{if(ws.httprequest.protocol==2){ws.httprequest.desktop.kvm.unpipe(ws)}else{ws.rtcchannel.httprequest=ws.httprequest;ws.rtcchannel.removeAllListeners("data");ws.rtcchannel.on("data",onTunnelData)}}ws.write('{"ctrlChannel":"102938","type":"webrtc1"}')}else{if(obj.type=="webrtc1"){if(ws.httprequest.protocol==1){if(process.platform=="win32"){ws.unpipe(ws.httprequest._term);ws.rtcchannel.pipe(ws.httprequest._term,{dataTypeSkip:1})}else{ws.unpipe(ws.httprequest.process.stdin);ws.rtcchannel.pipe(ws.httprequest.process.stdin,{dataTypeSkip:1})}ws.resume()}else{if(ws.httprequest.protocol==2){ws.unpipe(ws.httprequest.desktop.kvm);try{ws.webrtc.rtcchannel.pipe(ws.httprequest.desktop.kvm,{dataTypeSkip:1,end:false})}catch(e){sendConsoleText("EX2")}ws.resume()}}ws.write('{"ctrlChannel":"102938","type":"webrtc2"}')}else{if(obj.type=="webrtc2"){if(ws.httprequest.protocol==1){if(process.platform=="win32"){ws.httprequest._term.pipe(ws.webrtc.rtcchannel,{dataTypeSkip:1,end:false})}else{ws.httprequest.process.stdout.pipe(ws.webrtc.rtcchannel,{dataTypeSkip:1,end:false});ws.httprequest.process.stderr.pipe(ws.webrtc.rtcchannel,{dataTypeSkip:1,end:false})}}else{if(ws.httprequest.protocol==2){ws.httprequest.desktop.kvm.pipe(ws.webrtc.rtcchannel,{dataTypeSkip:1})}}}else{if(obj.type=="offer"){if(ws.httprequest.protocol==1){return}ws.webrtc=rtc.createConnection();ws.webrtc.websocket=ws;ws.webrtc.on("connected",function(){});ws.webrtc.on("disconnected",function(){});ws.webrtc.on("dataChannel",function(rtcchannel){rtcchannel.xrtc=this;rtcchannel.websocket=this.websocket;this.rtcchannel=rtcchannel;this.websocket.rtcchannel=rtcchannel;this.websocket.rtcchannel.on("data",onTunnelWebRTCControlData);this.websocket.rtcchannel.on("end",function(){if(this.websocket.desktop&&this.websocket.desktop.kvm){this.unpipe(this.websocket.desktop.kvm);this.websocket.httprequest.desktop.kvm.unpipe(this)}});this.websocket.write('{"ctrlChannel":"102938","type":"webrtc0"}')});var sdp=null;try{sdp=ws.webrtc.setOffer(obj.sdp)}catch(ex){}if(sdp!=null){ws.write({type:"answer",ctrlChannel:"102938",sdp:sdp})}}}}}}}var consoleWebSockets={};var consoleHttpRequest=null;function consoleHttpResponse(response){response.data=function(data){sendConsoleText(rstr2hex(buf2rstr(data)),this.sessionid);consoleHttpRequest=null};response.close=function(){sendConsoleText("httprequest.response.close",this.sessionid);consoleHttpRequest=null}}function openUserDesktopUrl(url){var child=null;try{switch(process.platform){case"win32":child=require("child_process").execFile(process.env.windir+"\\system32\\cmd.exe",["/c","start",url],{type:childProcess.SpawnTypes.USER});break;case"linux":child=require("child_process").execFile("/usr/bin/xdg-open",["xdg-open",url],{uid:require("user-sessions").consoleUid()});break;case"darwin":child=require("child_process").execFile("/usr/bin/open",["open",url],{uid:require("user-sessions").consoleUid()});break;default:break}}catch(ex){}return child}function processConsoleCommand(cmd,args,rights,sessionid){try{var response=null;switch(cmd){case"help":response="Available commands: help, info, osinfo,args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtdeactivate,\r\namtpolicy, getscript, getclip, setclip.";break;case"getclip":if(require("MeshAgent").isService){require("clipboard").dispatchRead().then(function(str){sendConsoleText(str,sessionid)})}else{require("clipboard").read().then(function(str){sendConsoleText(str,sessionid)})}break;case"setclip":if(args._.length!=1){response='Proper usage: setclip "sample text"'}else{if(require("MeshAgent").isService){require("clipboard").dispatchWrite(args._[0]);response='Setting clipboard to: "'+args._[0]+'"'}else{require("clipboard")(args._[0]);response='Setting clipboard to: "'+args._[0]+'"'}}break;case"amtreset":if(amt!=null){amt.reset();response="Done."}break;case"amtlmsreset":if(amt!=null){amt.lmsreset();response="Done."}break;case"amtccm":if(amt==null){response="Intel AMT not supported."}else{if(args._.length!=1){response="Proper usage: amtccm (adminPassword)"}else{amt.setPolicy({type:0});amt.activeToCCM(args._[0])}}break;case"amtdeactivate":if(amt==null){response="Intel AMT not supported."}else{amt.setPolicy({type:0});amt.deactivateCCM()}break;case"amtpolicy":if(amtPolicy==null){response="No Intel(R) AMT policy."}else{response=JSON.stringify(amtPolicy)}break;case"openurl":if(args._.length!=1){response="Proper usage: openurl (url)"}else{if(openUserDesktopUrl(args._[0])==null){response="Failed."}else{response="Success."}}break;case"users":if(meshCoreObj.users==null){response="Active users are unknown."}else{response="Active Users: "+meshCoreObj.users.join(", ")+"."}require("user-sessions").enumerateUsers().then(function(u){for(var i in u){sendConsoleText(u[i])}});break;case"toast":if(process.platform=="win32"){if(args._.length<1){response='Proper usage: toast "message"'}else{try{require("toaster").Toast("MeshCentral",args._[0]);response="ok"}catch(ex){response=ex}}}else{response="Only supported on Windows."}break;case"setdebug":if(args._.length<1){response="Proper usage: setdebug (target), 0 = Disabled, 1 = StdOut, 2 = This Console, * = All Consoles, 4 = WebLog, 8 = Logfile"}else{if(args._[0]=="*"){console.setDestination(2)}else{console.setDestination(parseInt(args._[0]),sessionid)}}break;case"ps":processManager.getProcesses(function(plist){var x="";for(var i in plist){x+=i+", "+plist[i].cmd+((plist[i].user)?(", "+plist[i].user):"")+"\r\n"}sendConsoleText(x,sessionid)});break;case"kill":if((args._.length<1)){response="Proper usage: kill [pid]"}else{process.kill(parseInt(args._[0]));response="Killed process "+args._[0]+"."}break;case"smbios":if(SMBiosTables==null){response="SMBios tables not available."}else{response=objToString(SMBiosTables,0," ",true)}break;case"rawsmbios":if(SMBiosTablesRaw==null){response="SMBios tables not available."}else{response="";for(var i in SMBiosTablesRaw){var header=false;for(var j in SMBiosTablesRaw[i]){if(SMBiosTablesRaw[i][j].length>0){if(header==false){response+=("Table type #"+i+((require("smbios").smTableTypes[i]==null)?"":(", "+require("smbios").smTableTypes[i])))+"\r\n";header=true}response+=(" "+SMBiosTablesRaw[i][j].toString("hex"))+"\r\n"}}}}break;case"eval":if(args._.length<1){response='Proper usage: eval "JavaScript code"'}else{response=JSON.stringify(mesh.eval(args._[0]))}break;case"notify":if(args._.length!=1){response='Proper usage: notify "message" [--session]'}else{var notification={action:"msg",type:"notify",value:args._[0],tag:"console"};if(args.session){notification.sessionid=sessionid}mesh.SendCommand(notification);response="ok"}break;case"info":response="Current Core: "+meshCoreObj.value+".\r\nAgent Time: "+Date()+".\r\nUser Rights: 0x"+rights.toString(16)+".\r\nPlatform: "+process.platform+".\r\nCapabilities: "+meshCoreObj.caps+".\r\nServer URL: "+mesh.ServerUrl+".";if(amt!=null){response+="\r\nBuilt-in LMS: "+["Disabled","Connecting..","Connected"][amt.lmsstate]+"."}if(meshCoreObj.osdesc){response+="\r\nOS: "+meshCoreObj.osdesc+"."}response+="\r\nModules: "+addedModules.join(", ")+".";response+="\r\nServer Connection: "+mesh.isControlChannelConnected+", State: "+meshServerConnectionState+".";response+="\rlastMeInfo: "+lastMeInfo+".";var oldNodeId=db.Get("OldNodeId");if(oldNodeId!=null){response+="\r\nOldNodeID: "+oldNodeId+"."}if(process.platform!="win32"){response+="\r\nX11 support: "+require("monitor-info").kvm_x11_support+"."}break;case"osinfo":var i=1;if(args._.length>0){i=parseInt(args._[0]);if(i>8){i=8}response="Calling "+i+" times."}for(var j=0;j0){meshCoreObj.osdesc=args._[0];mesh.SendCommand(meshCoreObj);response=JSON.stringify(meshCoreObj)}else{response="Proper usage: sendosdesc [os description]"}break;case"args":response="args "+objToString(args,0," ",true);break;case"print":var r=[];for(var i in args._){r.push(args._[i])}console.log(r.join(" "));response="Message printed on agent console.";break;case"type":if(args._.length==0){response="Proper usage: type (filepath) [maxlength]"}else{var max=4096;if((args._.length>1)&&(typeof args._[1]=="number")){max=args._[1]}if(max>4096){max=4096}var buf=Buffer.alloc(max),fd=fs.openSync(args._[0],"r"),r=fs.readSync(fd,buf,0,max);response=buf.toString();var i=response.indexOf("\n");if((i>0)&&(response[i-1]!="\r")){response=response.split("\n").join("\r\n")}if(r==max){response+="..."}fs.closeSync(fd)}break;case"dbkeys":response=JSON.stringify(db.Keys);break;case"dbget":if(db==null){response="Database not accessible.";break}if(args._.length!=1){response="Proper usage: dbget (key)"}else{response=db.Get(args._[0])}break;case"dbset":if(db==null){response="Database not accessible.";break}if(args._.length!=2){response="Proper usage: dbset (key) (value)"}else{var r=db.Put(args._[0],args._[1]);response="Key set: "+r}break;case"dbcompact":if(db==null){response="Database not accessible.";break}var r=db.Compact();response="Database compacted: "+r;break;case"httpget":if(consoleHttpRequest!=null){response="HTTP operation already in progress."}else{if(args._.length!=1){response="Proper usage: httpget (url)"}else{var options=http.parseUri(args._[0]);options.method="GET";if(options==null){response="Invalid url."}else{try{consoleHttpRequest=http.request(options,consoleHttpResponse)}catch(e){response="Invalid HTTP GET request"}consoleHttpRequest.sessionid=sessionid;if(consoleHttpRequest!=null){consoleHttpRequest.end();response="HTTPGET "+options.protocol+"//"+options.host+":"+options.port+options.path}}}}break;case"wslist":response="";for(var i in consoleWebSockets){var httprequest=consoleWebSockets[i];response+="Websocket #"+i+", "+httprequest.url+"\r\n"}if(response==""){response="no websocket sessions."}break;case"wsconnect":if(args._.length==0){response="Proper usage: wsconnect (url)\r\nFor example: wsconnect wss://localhost:443/meshrelay.ashx?id=abc"}else{var httprequest=null;try{var options=http.parseUri(args._[0]);options.rejectUnauthorized=0;httprequest=http.request(options)}catch(e){response="Invalid HTTP websocket request"}if(httprequest!=null){httprequest.upgrade=onWebSocketUpgrade;httprequest.on("error",function(e){sendConsoleText("ERROR: "+JSON.stringify(e))});var index=1;while(consoleWebSockets[index]){index++}httprequest.sessionid=sessionid;httprequest.index=index;httprequest.url=args._[0];consoleWebSockets[index]=httprequest;response="New websocket session #"+index}}break;case"wssend":if(args._.length==0){response="Proper usage: wssend (socketnumber)\r\n";for(var i in consoleWebSockets){var httprequest=consoleWebSockets[i];response+="Websocket #"+i+", "+httprequest.url+"\r\n"}}else{var i=parseInt(args._[0]);var httprequest=consoleWebSockets[i];if(httprequest!=undefined){httprequest.s.write(args._[1]);response="ok"}else{response="Invalid web socket number"}}break;case"wsclose":if(args._.length==0){response="Proper usage: wsclose (socketnumber)"}else{var i=parseInt(args._[0]);var httprequest=consoleWebSockets[i];if(httprequest!=undefined){if(httprequest.s!=null){httprequest.s.end()}else{httprequest.end()}response="ok"}else{response="Invalid web socket number"}}break;case"tunnels":response="";for(var i in tunnels){response+="Tunnel #"+i+", "+tunnels[i].url+"\r\n"}if(response==""){response="No websocket sessions."}break;case"ls":response="";var xpath="*";if(args._.length>0){xpath=obj.path.join(args._[0],"*")}response="List of "+xpath+"\r\n";var results=fs.readdirSync(xpath);for(var i=0;i0){var r="",pstates=["NotActivated","InActivation","Activated"];for(var i in data){var x=data[i];if(r!=""){r+="\r\n"}r+=x.address+" - Intel AMT v"+x.majorVersion+"."+x.minorVersion;if(x.provisioningState<3){r+=(", "+pstates[x.provisioningState])}if(x.provisioningState==2){r+=(", "+x.openPorts.join(", "))}r+="."}}else{r="No Intel AMT found."}sendConsoleText(r)})}}else{response="Intel AMT scanner module not present."}break;case"modules":response=JSON.stringify(addedModules);break;case"getscript":if(args._.length!=1){response="Proper usage: getscript [scriptNumber]."}else{mesh.SendCommand({action:"getScript",type:args._[0]})}break;default:response='Unknown command "'+cmd+'", type "help" for list of avaialble commands.';break}}catch(e){response="Command returned an exception error: "+e;console.log(e)}if(response!=null){sendConsoleText(response,sessionid)}}function sendConsoleText(text,sessionid){if(typeof text=="object"){text=JSON.stringify(text)}mesh.SendCommand({action:"msg",type:"console",value:text,sessionid:sessionid})}function handleServerConnection(state){meshServerConnectionState=state;if(meshServerConnectionState==0){if(selfInfoUpdateTimer!=null){clearInterval(selfInfoUpdateTimer);selfInfoUpdateTimer=null}lastSelfInfo=null}else{var oldNodeId=db.Get("OldNodeId");if(oldNodeId!=null){mesh.SendCommand({action:"mc1migration",oldnodeid:oldNodeId})}mesh.SendCommand(meshCoreObj);if(SMBiosTablesRaw!=null){mesh.SendCommand({action:"smbios",value:SMBiosTablesRaw})}meInfoStr=null;sendPeriodicServerUpdate()}}var sendNetworkUpdateNagleTimer=null;function sendNetworkUpdateNagle(){if(sendNetworkUpdateNagleTimer!=null){clearTimeout(sendNetworkUpdateNagleTimer);sendNetworkUpdateNagleTimer=null}sendNetworkUpdateNagleTimer=setTimeout(sendNetworkUpdate,5000)}function sendNetworkUpdate(force){sendNetworkUpdateNagleTimer=null;var netInfo=mesh.NetInfo;if(netInfo){netInfo.action="netinfo";var netInfoStr=JSON.stringify(netInfo);if((force==true)||(clearGatewayMac(netInfoStr)!=clearGatewayMac(lastNetworkInfo))){mesh.SendCommand(netInfo);lastNetworkInfo=netInfoStr}}}function sendPeriodicServerUpdate(flags){if(meshServerConnectionState==0){return}if(!flags){flags=4294967295}if((flags&1)&&(amt!=null)){amt.getAmtInfo(function(meinfo){try{if(meinfo==null){return}var intelamt={},p=false;if(meinfo.Versions&&meinfo.Versions.AMT){intelamt.ver=meinfo.Versions.AMT;p=true}if(meinfo.ProvisioningState){intelamt.state=meinfo.ProvisioningState;p=true}if(meinfo.Flags){intelamt.flags=meinfo.Flags;p=true}if(meinfo.OsHostname){intelamt.host=meinfo.OsHostname;p=true}if(meinfo.UUID){intelamt.uuid=meinfo.UUID;p=true}if(p==true){var meInfoStr=JSON.stringify(intelamt);if(meInfoStr!=lastMeInfo){meshCoreObj.intelamt=intelamt;mesh.SendCommand(meshCoreObj);lastMeInfo=meInfoStr}}}catch(ex){}})}if(flags&2){sendNetworkUpdateNagle(false)}}obj.start=function(){mesh.AddCommandHandler(handleServerCommand);mesh.AddConnectHandler(handleServerConnection);try{var userSession=require("user-sessions");userSession.on("changed",function onUserSessionChanged(){userSession.enumerateUsers().then(function(users){var u=[],a=users.Active;for(var i=0;i>9):0);B.sectorStats(0,1,B.cdrom?(B.cdrom.size>>11):0)}};B.Stop=function(){if(B.debug){console.log("IDER-Stop")}B.parent.Stop()};B.ProcessData=function(E){B.bytesFromAmt+=E.length;if(B.acc==null){B.acc=E}else{B.acc=Buffer.concat(B.acc,E)}if(B.debug){console.log("IDER-ProcessData",B.acc.length,B.acc.toString("hex"))}while(B.acc!=null){var F=B.ProcessDataEx();if(F==0){return}if(B.inSequence!=ReadIntX(B.acc,4)){if(B.debug){console.log("ERROR: Out of sequence",B.inSequence,ReadIntX(B.acc,4))}B.Stop();return}B.inSequence++;if(F==B.acc.length){B.acc=null}else{B.acc=B.acc.slice(F)}}};B.SendCommand=function(F,H,G,I){if(H==null){H=new Buffer(0)}var E=((F>50)&&(G==true))?2:0;if(I){E+=1}var J=Buffer.concat([Buffer([F,0,0,E]),IntToStrX(B.outSequence++),H]);B.parent.xxSend(J);B.bytesToAmt+=J.length};B.SendCommandEndResponse=function(H,I,G,E,F){if(H){B.SendCommand(81,new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,G,80,0,0,0]),true)}else{B.SendCommand(81,new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,135,(I<<4),3,0,0,0,G,81,I,E,F]),true)}};B.SendDataToHost=function(G,E,F,H){var I=(H)?0:F.length;if(E==true){B.SendCommand(84,Buffer.concat([new Buffer([0,(F.length&255),(F.length>>8),0,H?180:181,0,2,0,(I&255),(I>>8),G,88,133,0,3,0,0,0,G,80,0,0,0,0,0,0]),F]),E,H)}else{B.SendCommand(84,Buffer.concat([new Buffer([0,(F.length&255),(F.length>>8),0,H?180:181,0,2,0,(I&255),(I>>8),G,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),F]),E,H)}};B.SendGetDataFromHost=function(F,E){B.SendCommand(82,new Buffer([0,(E&255),(E>>8),0,181,0,0,0,(E&255),(E>>8),F,88,0,0,0,0,0,0,0,0,0,0,0]),false)};B.SendDisableEnableFeatures=function(F,E){if(E==null){E=""}B.SendCommand(72,Buffer.concat([new Buffer([F]),E]))};B.ProcessDataEx=function(){if(B.acc.length<8){return 0}switch(B.acc[0]){case 65:if(B.acc.length<30){return 0}var I=B.acc[29];if(B.acc.length<(30+I)){return 0}B.iderinfo={};B.iderinfo.major=B.acc[8];B.iderinfo.minor=B.acc[9];B.iderinfo.fwmajor=B.acc[10];B.iderinfo.fwminor=B.acc[11];B.iderinfo.readbfr=ReadShortX(B.acc,16);B.iderinfo.writebfr=ReadShortX(B.acc,18);B.iderinfo.proto=B.acc[21];B.iderinfo.iana=ReadIntX(B.acc,25);if(B.debug){console.log(B.iderinfo)}if(B.iderinfo.proto!=0){if(B.debug){console.log("Unknown proto",B.iderinfo.proto)}B.Stop()}if(B.iderinfo.readbfr>8192){if(B.debug){console.log("Illegal read buffer size",B.iderinfo.readbfr)}B.Stop()}if(B.iderinfo.writebfr>8192){if(B.debug){console.log("Illegal write buffer size",B.iderinfo.writebfr)}B.Stop()}if(B.iderStart==0){B.SendDisableEnableFeatures(3,IntToStrX(1+8))}else{if(B.iderStart==1){B.SendDisableEnableFeatures(3,IntToStrX(1+16))}else{if(B.iderStart==2){B.SendDisableEnableFeatures(3,IntToStrX(1+24))}}}return 30+I;case 67:if(B.debug){console.log("CLOSE")}B.Stop();return 8;case 68:B.SendCommand(69);return 8;case 69:if(B.debug){console.log("PONG")}return 8;case 70:if(B.acc.length<9){return 0}var J=B.acc[8];if(d===null){B.SendCommand(71);if(B.debug){console.log("RESETOCCURED1",J)}}else{f=true;if(B.debug){console.log("RESETOCCURED2",J)}}return 9;case 73:if(B.acc.length<13){return 0}var K=B.acc[8];var L=ReadIntX(B.acc,9);if(B.debug){console.log("STATUS_DATA",K,L)}switch(K){case 1:if(L&1){if(B.iderStart==0){B.SendDisableEnableFeatures(3,IntToStrX(1+8))}else{if(B.iderStart==1){B.SendDisableEnableFeatures(3,IntToStrX(1+16))}else{if(B.iderStart==2){B.SendDisableEnableFeatures(3,IntToStrX(1+24))}}}}break;case 2:B.enabled=(L&2)?true:false;if(B.debug){console.log("IDER Status: "+B.enabled)}break;case 3:if(L!=1){if(B.debug){console.log("Register toggle failure")}}break}return 13;case 74:if(B.acc.length<11){return 0}if(B.debug){console.log("IDER: ABORT",B.acc[8])}return 11;case 75:return 8;case 80:if(B.acc.length<28){return 0}var F=(B.acc[14]&16)?176:160;var G=B.acc[14];var E=B.acc.slice(16,28);var H=B.acc[9];if(B.debug){console.log("SCSI_CMD",F,E.toString("hex"),H,G)}g(F,E,H,G);return 28;case 83:if(B.acc.length<14){return 0}var I=ReadShortX(B.acc,9);if(B.acc.length<(14+I)){return 0}if(B.debug){console.log("SCSI_WRITE, len = "+(14+I))}B.SendCommand(81,new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0]),true);return 14+I;default:if(B.debug){console.log("Unknown IDER command",B.acc[0])}B.Stop();break}return 0};function g(I,H,K,J){var N;var O;switch(H[0]){case 0:if(B.debug){console.log("SCSI: TEST_UNIT_READY",I)}switch(I){case 160:if(B.floppy==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}if(B.floppyReady==false){B.floppyReady=true;B.SendCommandEndResponse(1,6,I,40,0);return -1}break;case 176:if(B.cdrom==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}if(B.cdromReady==false){B.cdromReady=true;B.SendCommandEndResponse(1,6,I,40,0);return -1}break;default:if(B.debug){console.log("SCSI Internal error 3",I)}return -1}B.SendCommandEndResponse(1,0,I,0,0);break;case 8:N=((H[1]&31)<<16)+(H[2]<<8)+H[3];O=H[4];if(O==0){O=256}if(B.debug){console.log("SCSI: READ_6",I,N,O)}C(I,N,O,K);break;case 10:N=((H[1]&31)<<16)+(H[2]<<8)+H[3];O=H[4];if(O==0){O=256}if(B.debug){console.log("SCSI: WRITE_6",I,N,O)}B.SendCommandEndResponse(1,2,I,58,0);return -1;case 26:if(B.debug){console.log("SCSI: MODE_SENSE_6",I)}if((H[2]==63)&&(H[3]==0)){var E=0,F=0;switch(I){case 160:if(B.floppy==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}E=0;F=128;break;case 176:if(B.cdrom==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}E=5;F=128;break;default:if(B.debug){console.log("SCSI Internal error 6",I)}return -1}B.SendDataToHost(I,true,new Buffer([0,E,F,0]),K&1);return}B.SendCommandEndResponse(1,5,I,36,0);break;case 27:B.SendCommandEndResponse(1,0,I);break;case 30:if(B.debug){console.log("SCSI: ALLOW_MEDIUM_REMOVAL",I)}if((I==160)&&(B.floppy==null)){B.SendCommandEndResponse(1,2,I,58,0);return -1}if((I==176)&&(B.cdrom==null)){B.SendCommandEndResponse(1,2,I,58,0);return -1}B.SendCommandEndResponse(1,0,I,0,0);break;case 35:if(B.debug){console.log("SCSI: READ_FORMAT_CAPACITIES",I)}var G=ReadShort(H,7);var Q=0,V;var P=G/8;switch(I){case 160:if((B.floppy==null)||(B.floppy.size==0)){B.SendCommandEndResponse(0,5,I,36,0);return -1}V=(B.floppy.size>>9)-1;break;case 176:if((B.cdrom==null)||(B.cdrom.size==0)){B.SendCommandEndResponse(0,5,I,36,0);return -1}V=(B.cdrom.size>>11)-1;break;default:if(B.debug){console.log("SCSI Internal error 4",I)}return -1}B.SendDataToHost(I,true,Buffer.concat([IntToStr(8),new Buffer([0,0,11,64,2,0,2,0])]),K&1);break;case 37:if(B.debug){console.log("SCSI: READ_CAPACITY",I)}var O=0;switch(I){case 160:if((B.floppy==null)||(B.floppy.size==0)){B.SendCommandEndResponse(0,2,I,58,0);return -1}if(B.floppy!=null){O=(B.floppy.size>>9)-1}if(B.debug){console.log("DEV_FLOPPY",O)}break;case 176:if((B.cdrom==null)||(B.cdrom.size==0)){B.SendCommandEndResponse(0,2,I,58,0);return -1}if(B.cdrom!=null){O=(B.cdrom.size>>11)-1}if(B.debug){console.log("DEV_CDDVD",O)}break;default:if(B.debug){console.log("SCSI Internal error 4",I)}return -1}if(B.debug){console.log("SCSI: READ_CAPACITY2",I,J)}B.SendDataToHost(J,true,Buffer.concat([IntToStr(O),new Buffer([0,0,((I==176)?8:2),0])]),K&1);break;case 40:N=ReadInt(H,2);O=ReadShort(H,7);if(B.debug){console.log("SCSI: READ_10",I,N,O)}C(I,N,O,K);break;case 42:case 46:N=ReadInt(H,2);O=ReadShort(H,7);if(B.debug){console.log("SCSI: WRITE_10",I,N,O)}B.SendGetDataFromHost(I,512*O);break;case 67:var G=ReadShort(H,7);var R=H[1]&2;var M=H[2]&7;if(M==0){M=H[9]>>6}if(B.debug){console.log("SCSI: READ_TOC, dev="+I+", buflen="+G+", msf="+R+", format="+M)}switch(I){case 160:B.SendCommandEndResponse(1,5,I,32,0);return -1;case 176:break;default:if(B.debug){console.log("SCSI Internal error 9",I)}return -1}if(M==1){B.SendDataToHost(I,true,new Buffer([0,10,1,1,0,20,1,0,0,0,0,0]),K&1)}else{if(M==0){if(R){B.SendDataToHost(I,true,new Buffer([0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19]),K&1)}else{B.SendDataToHost(I,true,new Buffer([0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0]),K&1)}}}break;case 70:var W=(H[1]!=2);var L=ReadShort(H,2);var G=ReadShort(H,7);if(B.debug){console.log("SCSI: GET_CONFIGURATION",I,W,L,G)}if(G==0){B.SendDataToHost(I,true,Buffer.concat([IntToStr(60),IntToStr(8)]),K&1);return -1}var T=null;if(L==0){T=j}if((L==1)||(W&&(L<1))){T=h}if((L==2)||(W&&(L<2))){T=m}if((L==3)||(W&&(L<3))){T=l}if((L==16)||(W&&(L<16))){T=k}if((L==30)||(W&&(L<30))){T=o}if((L==256)||(W&&(L<256))){T=n}if((L==261)||(W&&(L<261))){T=p}if(T==null){T=Buffer.concat([IntToStr(8),IntToStr(4)])}else{T=Buffer.concat([IntToStr(8),IntToStr(T.length+4),T])}if(T.length>G){T=T.slice(0,G)}B.SendDataToHost(I,true,T,K&1);return -1;case 74:if(B.debug){console.log("SCSI: GET_EVENT_STATUS_NOTIFICATION",I,H[1],H[4],H[9])}if((H[1]!=1)&&(H[4]!=16)){if(B.debug){console.log("SCSI ERROR")}B.SendCommandEndResponse(1,5,I,38,1);break}var S=0;if((I==160)&&(B.floppy!=null)){S=2}else{if((I==176)&&(B.cdrom!=null)){S=2}}B.SendDataToHost(I,true,new Buffer([0,S,128,0]),K&1);break;case 76:B.SendCommand(81,Buffer.concat([IntToStrX(0),IntToStrX(0),IntToStrX(0),new Buffer([135,80,3,0,0,0,176,81,5,32,0])]),true);break;case 81:if(B.debug){console.log("SCSI READ_DISC_INFO",I)}B.SendCommandEndResponse(0,5,I,32,0);return -1;case 85:if(B.debug){console.log("SCSI ERROR: MODE_SELECT_10",I)}B.SendCommandEndResponse(1,5,I,32,0);return -1;case 90:if(B.debug){console.log("SCSI: MODE_SENSE_10",I,H[2]&63)}var G=ReadShort(H,7);var T=null;if(G==0){B.SendDataToHost(I,true,Buffer.concat([IntToStr(60),IntToStr(8)]),K&1);return -1}var U=0;if(I==160){if(B.floppy!=null){U=(B.floppy.size>>9)}}else{if(B.cdrom!=null){U=(B.cdrom.size>>11)}}switch(H[2]&63){case 1:if(I==160){T=(U<=2880)?y:A}else{T=w}break;case 5:if(I==160){T=(U<=2880)?x:z}break;case 63:if(I==160){T=(U<=2880)?r:s}else{T=q}break;case 26:if(I==176){T=t}break;case 29:if(I==176){T=u}break;case 42:if(I==176){T=v}break}if(T==null){B.SendCommandEndResponse(0,5,I,32,0)}else{B.SendDataToHost(I,true,T,K&1)}break;default:if(B.debug){console.log("IDER: Unknown SCSI command",H[0])}B.SendCommandEndResponse(0,5,I,32,0);return -1}return 0}function C(E,G,H,F){var I=null;var J=0;if(E==160){I=B.floppy;if(B.floppy!=null){J=(B.floppy.size>>9)}}if(E==176){I=B.cdrom;if(B.cdrom!=null){J=(B.cdrom.size>>11)}}if((H<0)||(G+H>J)){B.SendCommandEndResponse(1,5,E,33,0);return 0}if(H==0){B.SendCommandEndResponse(1,0,E,0,0);return 0}if(I!=null){if(B.sectorStats){B.sectorStats(1,(E==160)?0:1,J,G,H)}if(E==160){G<<=9;H<<=9}else{G<<=11;H<<=11}if(d!==null){e.push({media:I,dev:E,lba:G,len:H,fr:F})}else{d=I;a=E;b=G;c=H;D(F)}}}var e=[];var f=false;var d=null;var a;var b;var c;function D(E){var G=c,F=b;if(c>B.iderinfo.readbfr){G=B.iderinfo.readbfr}c-=G;b+=G;var I=new Buffer(G);fs.readSync(d.file,I,0,G,F);B.SendDataToHost(a,(c==0),I,E&1);if((c>0)&&(f==false)){D(E)}else{d=null;if(f){B.SendCommand(71);e=[];f=false}else{if(e.length>0){var H=e.shift();d=H.media;a=H.dev;b=H.lba;c=H.len;D(H.fr)}}}}return B};function ShortToStr(a){return new Buffer([(a>>8)&255,a&255])}function ShortToStrX(a){return new Buffer([a&255,(a>>8)&255])}function IntToStr(a){return new Buffer([(a>>24)&255,(a>>16)&255,(a>>8)&255,a&255])}function IntToStrX(a){return new Buffer([a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255])}function ReadShort(b,a){return(b[a]<<8)+b[a+1]}function ReadShortX(b,a){return(b[a+1]<<8)+b[a]}function ReadInt(b,a){return(b[a]*16777216)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadSInt(b,a){return(b[a]<<24)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadIntX(b,a){return(b[a+3]*16777216)+(b[a+2]<<16)+(b[a+1]<<8)+b[a]};
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt-lme.min.js b/agents/modules_meshcmd_min/amt-lme.min.js
deleted file mode 100644
index 1d43678a..00000000
--- a/agents/modules_meshcmd_min/amt-lme.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var MemoryStream=require("MemoryStream");var lme_id=0;var lme_port_offset=0;var xmlParser=require("amt-xml");var APF_DISCONNECT=1;var APF_SERVICE_REQUEST=5;var APF_SERVICE_ACCEPT=6;var APF_USERAUTH_REQUEST=50;var APF_USERAUTH_FAILURE=51;var APF_USERAUTH_SUCCESS=52;var APF_GLOBAL_REQUEST=80;var APF_REQUEST_SUCCESS=81;var APF_REQUEST_FAILURE=82;var APF_CHANNEL_OPEN=90;var APF_CHANNEL_OPEN_CONFIRMATION=91;var APF_CHANNEL_OPEN_FAILURE=92;var APF_CHANNEL_WINDOW_ADJUST=93;var APF_CHANNEL_DATA=94;var APF_CHANNEL_CLOSE=97;var APF_PROTOCOLVERSION=192;function lme_object(){this.ourId=++lme_id;this.amtId=-1;this.LME_CHANNEL_STATUS="LME_CS_FREE";this.txWindow=0;this.rxWindow=0;this.localPort=0;this.errorCount=0}function stream_bufferedWrite(){var a=require("events").inherits(this);this.buffer=[];this._readCheckImmediate=undefined;this._ObjectID="bufferedWriteStream";a.createEvent("close");a.createEvent("drain");a.createEvent("error");a.createEvent("finish");a.createEvent("pipe");a.createEvent("unpipe");a.createEvent("readable");this.isEmpty=function(){return(this.buffer.length==0)};this.isWaiting=function(){return(this._readCheckImmediate==undefined)};this.write=function(c){for(var b in arguments){if(typeof(arguments[b])=="function"){this.once("drain",arguments[b]);break}}var d=Buffer.alloc(c.length);c.copy(d);this.buffer.push({offset:0,data:d});this.emit("readable");return(this.buffer.length==0?true:false)};this.read=function(){var f=arguments.length==0?undefined:arguments[0];var b=0;var d=[];while((f==undefined||b0){var c=this.buffer[0].data.length-this.buffer[0].offset;var e=this.buffer[0].offset;if(c>(f-b)){d.push(this.buffer[0].data.slice(e,e+f-b));this.buffer[0].offset+=(f-b);b+=(f-b)}else{d.push(this.buffer[0].data.slice(e));b+=c;this.buffer.shift()}}this._readCheckImmediate=setImmediate(function(g){g._readCheckImmediate=undefined;if(g.buffer.length==0){g.emit("drain")}else{g.emit("readable")}},this);return(Buffer.concat(d))}}function lme_heci(c){var a=require("events").inherits(this);a.createEvent("error");a.createEvent("connect");a.createEvent("notify");a.createEvent("bind");if((c!=null)&&(c.debug==true)){lme_port_offset=-100}var b=require("heci");this.INITIAL_RXWINDOW_SIZE=4096;this._ObjectID="lme";this._LME=b.create();this._LME._binded={};this._LME.LMS=this;this._LME.on("error",function(d){this.LMS.emit("error",d)});this._LME.on("connect",function(){this.on("data",function(k){var l=k.readUInt8(0);switch(l){default:console.log("Unhandled LME Command "+l+", "+k.length+" byte(s).");break;case APF_SERVICE_REQUEST:var z=k.readUInt32BE(1);var y=k.slice(5,z+5);if(y=="pfwd@amt.intel.com"||y=="auth@amt.intel.com"){var F=Buffer.alloc(5+z);F.writeUInt8(6,0);F.writeUInt32BE(z,1);F.write(y.toString(),5);this.write(F)}else{}break;case APF_GLOBAL_REQUEST:var z=k.readUInt32BE(1);var y=k.slice(5,z+5).toString();switch(y){case"tcpip-forward":var v=k.readUInt32BE(z+6);var G=k.readUInt32BE(z+10+v);if(this[y]==undefined){this[y]={}}if(this[y][G]!=null){for(var s in this.sockets){var h=this.sockets[s];if(h.localPort==G){this.sockets[s].end();delete this.sockets[s]}}}if(this[y][G]==null){this[y][G]=require("net").createServer();this[y][G].HECI=this;if(lme_port_offset==0){this[y][G].listen({port:G,host:"127.0.0.1"})}else{this[y][G].listen({port:(G+lme_port_offset)})}this[y][G].on("connection",function(e){this.HECI.LMS.bindDuplexStream(e,e.remoteFamily,e.localPort-lme_port_offset)});this._binded[G]=true;this.LMS.emit("bind",this._binded)}var F=Buffer.alloc(5);F.writeUInt8(81,0);F.writeUInt32BE(G,1);this.write(F);break;case"cancel-tcpip-forward":var F=Buffer.alloc(1);F.writeUInt8(APF_REQUEST_SUCCESS,0);this.write(F);break;case"udp-send-to@amt.intel.com":var F=Buffer.alloc(1);F.writeUInt8(APF_REQUEST_FAILURE,0);this.write(F);break;default:break}break;case APF_CHANNEL_OPEN_CONFIRMATION:var I=k.readUInt32BE(1);var M=k.readUInt32BE(5);var N=k.readUInt32BE(9);if(this.sockets[I]!=undefined){this.sockets[I].lme.amtId=M;this.sockets[I].lme.rxWindow=N;this.sockets[I].lme.txWindow=N;this.sockets[I].lme.LME_CHANNEL_STATUS="LME_CS_CONNECTED";this.sockets[I].bufferedStream=new stream_bufferedWrite();this.sockets[I].bufferedStream.socket=this.sockets[I];this.sockets[I].bufferedStream.on("readable",function(){if(this.socket.lme.txWindow>0){var e=this.read(this.socket.lme.txWindow);var i=Buffer.alloc(9+e.length);i.writeUInt8(APF_CHANNEL_DATA,0);i.writeUInt32BE(this.socket.lme.amtId,1);i.writeUInt32BE(e.length,5);e.copy(i,9);this.socket.lme.txWindow-=e.length;this.socket.HECI.write(i)}});this.sockets[I].bufferedStream.on("drain",function(){this.socket.resume()});this.sockets[I].on("data",function(e){if(!this.bufferedStream.write(e)){this.pause()}});this.sockets[I].on("end",function(){var e=Buffer.alloc(5);e.writeUInt8(APF_CHANNEL_CLOSE,0);e.writeUInt32BE(this.lme.amtId,1);this.HECI.write(e)});this.sockets[I].resume()}break;case APF_PROTOCOLVERSION:var w=k.readUInt32BE(1);var x=k.readUInt32BE(5);var K=k.readUInt32BE(9);var F=Buffer.alloc(93);F.writeUInt8(192,0);F.writeUInt32BE(1,1);F.writeUInt32BE(0,5);F.writeUInt32BE(K,9);this.write(F);break;case APF_CHANNEL_WINDOW_ADJUST:var J=k.readUInt32BE(1);var g=k.readUInt32BE(5);if(this.sockets[J]!=undefined){this.sockets[J].lme.txWindow+=g;if(!this.sockets[J].bufferedStream.isEmpty()&&this.sockets[J].bufferedStream.isWaiting()){this.sockets[J].bufferedStream.emit("readable")}}else{console.log("Unknown Recipient ID/"+J+" for APF_CHANNEL_WINDOW_ADJUST")}break;case APF_CHANNEL_DATA:var J=k.readUInt32BE(1);var n=k.readUInt32BE(5);var m=k.slice(9,9+n);if((this.sockets!=null)&&(this.sockets[J]!=undefined)){this.sockets[J].pendingBytes.push(m.length);this.sockets[J].write(m,function(){var i=this.pendingBytes.shift();var e=Buffer.alloc(9);e.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);e.writeUInt32BE(this.lme.amtId,1);e.writeUInt32BE(i,5);this.HECI.write(e)})}else{if((this.insockets!=null)&&(this.insockets[J]!=undefined)){var h=this.insockets[J];if(h.data==null){h.data=m.toString()}else{h.data+=m.toString()}h.rxWindow+=n;var r=parseHttp(h.data);if((r!=null)||(h.data.length>=8000)){var A=null;try{A=xmlParser.ParseWsman(r)}catch(o){}if(A!=null){this.LMS.emit("notify",A,h.options,_lmsNotifyToString(A),_lmsNotifyToCode(A))}var f=Buffer.alloc(5);f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if(h.rxWindow>6000){var f=Buffer.alloc(9);f.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);f.writeUInt32BE(h.amtId,1);f.writeUInt32BE(h.rxWindow,5);this.write(f);h.rxWindow=0}}}else{console.log("Unknown Recipient ID/"+J+" for APF_CHANNEL_DATA")}}break;case APF_CHANNEL_OPEN_FAILURE:var J=k.readUInt32BE(1);var L=k.readUInt32BE(5);if((this.sockets!=null)&&(this.sockets[J]!=undefined)){this.sockets[J].end();delete this.sockets[J]}else{if((this.insockets!=null)&&(this.insockets[J]!=undefined)){delete this.insockets[J]}else{console.log("Unknown Recipient ID/"+J+" for APF_CHANNEL_OPEN_FAILURE")}}break;case APF_CHANNEL_CLOSE:var J=k.readUInt32BE(1);if((this.sockets!=null)&&(this.sockets[J]!=undefined)){this.sockets[J].end();var d=this.sockets[J].lme.amtId;var f=Buffer.alloc(5);delete this.sockets[J];f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if((this.insockets!=null)&&(this.insockets[J]!=undefined)){delete this.insockets[J]}else{console.log("Unknown Recipient ID/"+J+" for APF_CHANNEL_CLOSE")}}break;case APF_CHANNEL_OPEN:var z=k.readUInt32BE(1);var y=k.slice(5,z+5).toString();var j=k.readUInt32BE(z+5);var t=k.readUInt32BE(z+9);var q=k.readUInt32BE(z+17);var p=k.slice(z+21,z+21+q).toString();var H=k.readUInt32BE(z+21+q);var C=k.readUInt32BE(z+25+q);var B=k.slice(z+29+q,z+29+q+C).toString();var D=k.readUInt32BE(z+29+q+C);if(this.insockets==null){this.insockets={}}var E=++lme_id;var u=new lme_object();u.ourId=E;u.amtId=j;u.txWindow=t;u.rxWindow=0;u.options={target:p,targetPort:H,source:B,sourcePort:D};this.insockets[E]=u;var f=Buffer.alloc(17);f.writeUInt8(APF_CHANNEL_OPEN_CONFIRMATION,0);f.writeUInt32BE(j,1);f.writeUInt32BE(E,5);f.writeUInt32BE(4000,9);f.writeUInt32BE(4294967295,13);this.write(f);break}});this.LMS.emit("connect");this.resume()});this.bindDuplexStream=function(e,h,g){var j=e;j.pendingBytes=[];j.HECI=this._LME;j.LMS=this;j.lme=new lme_object();j.lme.Socket=j;j.localPort=g;var d=new MemoryStream();d.writeUInt8(90);d.writeUInt32BE(15);d.write("forwarded-tcpip");d.writeUInt32BE(j.lme.ourId);d.writeUInt32BE(this.INITIAL_RXWINDOW_SIZE);d.writeUInt32BE(4294967295);for(var f=0;f<2;++f){if(h=="IPv6"){d.writeUInt32BE(3);d.write("::1")}else{d.writeUInt32BE(9);d.write("127.0.0.1")}d.writeUInt32BE(g)}this._LME.write(d.buffer);if(this._LME.sockets==undefined){this._LME.sockets={}}this._LME.sockets[j.lme.ourId]=j;j.pause()};this._LME.connect(b.GUIDS.LME,{noPipeline:0})}function parseHttp(c){var d=c.indexOf("\r\n\r\n");if((d==-1)||(c.length<(d+2))){return null}var b=require("http-headers")(c.substring(0,d),true);var a=parseInt(b["content-length"]);if(c.length>=a+d+4){return c.substring(d+4,d+4+a)}return null}function _lmsNotifyToCode(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}return b}function _lmsNotifyToString(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}if(lmsEvents[b]){return lmsEvents[b]}return null}var lmsEvents={iAMT0001:"System Defense Policy %1s triggered.",iAMT0002:"Agent Presence Agent %1s not started.",iAMT0003:"Agent Presence Agent %1s stopped.",iAMT0004:"Agent Presence Agent %1s running.",iAMT0005:"Agent Presence Agent %1s expired.",iAMT0006:"Agent Presence Agent %1s suspended.",iAMT0007:"Host software attempt to disable AMT Network link detected.",iAMT0008:"Host software attempt to disable AMT Network link detected -- Host Network link blocked.",iAMT0009:"AMT clock or FLASH wear-out protection disabled.",iAMT0010:"Intel(R) AMT Network Interface %1s heuristics defense slow threshold trespassed.",iAMT0011:"Intel(R) AMT Network Interface %1s heuristics defense fast threshold trespassed.",iAMT0012:"Intel(R) AMT Network Interface %1s heuristics defense factory defined threshold trespassed.",iAMT0013:"Intel(R) AMT Network Interface %1s heuristics defense Encounter timeout expired.",iAMT0014:"General certificate error.",iAMT0015:"Certificate expired.",iAMT0016:"No trusted root certificate.",iAMT0017:"Not configured to work with server certificate.",iAMT0018:"Certificate revoked.",iAMT0019:"RSA exponent too large.",iAMT0020:"RSA modulus too large.",iAMT0021:"Unsupported digest.",iAMT0022:"Distinguished name too long.",iAMT0023:"Key usage missing.",iAMT0024:"General SSL handshake error.",iAMT0025:"General 802.1x error.",iAMT0026:"AMT Diagnostic AlertEAC error - General NAC error.",iAMT0027:"AMT Diagnostic AlertEAC error - attempt to get a NAC posture while AMT NAC is disabled.",iAMT0028:"AMT Diagnostic AlertEAC error - attempt to get a posture of an unsupported type.",iAMT0029:"Audit log storage is 50% full.",iAMT0030:"Audit log storage is 75% full.",iAMT0031:"Audit log storage is 85% full.",iAMT0032:"Audit log storage is 95% full.",iAMT0033:"Audit log storage is full.",iAMT0034:"Firmware Update Event - Partial.",iAMT0035:"Firmware Update Event - Failure.",iAMT0036:"Remote connectivity initiated.",iAMT0037:"ME Presence event.","iAMT0038-0":"AMT is being unprovisioned using BIOS command.","iAMT0038-1":"AMT is being unprovisioned using Local MEI command.","iAMT0038-2":"AMT is being unprovisioned using Local WS-MAN/SOAP command.","iAMT0038-3":"AMT is being unprovisioned using Remote WS-MAN/SOAP command.",iAMT0039:"HW Asset Error.",iAMT0050:"User Notification Alert - General Notification.","iAMT0050-16":"User Notification Alert - Circuit Breaker notification (CB Drop TX filter hit.).","iAMT0050-17":"User Notification Alert - Circuit Breaker notification (CB Rate Limit TX filter hit.).","iAMT0050-18":"User Notification Alert - Circuit Breaker notification (CB Drop RX filter hit.).","iAMT0050-19":"User Notification Alert - Circuit Breaker notification (CB Rate Limit RX filter hit.).","iAMT0050-32":"User Notification Alert - EAC notification.","iAMT0050-48":"User Notification Alert - Remote diagnostics - (Remote Redirection session started - SOL).","iAMT0050-49":"User Notification Alert - Remote diagnostics - (Remote Redirection session stopped - SOL).","iAMT0050-50":"User Notification Alert - Remote diagnostics. (Remote Redirection session started - IDE-R).","iAMT0050-51":"User Notification Alert - Remote diagnostics. (Remote Redirection session stopped - IDE-R).","iAMT0050-66":"User Notification Alert - WLAN notification (Host profile mismatch - Management Interface ignored).","iAMT0050-67":"User Notification Alert - WLAN notification (Management device overrides host radio).","iAMT0050-68":"User Notification Alert - WLAN notification (Host profile security mismatch).","iAMT0050-69":"User Notification Alert - WLAN notification (Management device relinquishes control over host Radio).",iAMT0051:"User Notification Alert - SecIo event.","iAMT0051-0":"User Notification Alert - SecIo event semaphore at host.","iAMT0051-1":"User Notification Alert - semaphore at ME.","iAMT0051-2":"User Notification Alert - SecIo event - semaphore timeout.",iAMT0052:"User Notification Alert - KVM session event.","iAMT0052-0":"User Notification Alert - KVM session requested.","iAMT0052-1":"User Notification Alert - KVM session started.","iAMT0052-2":"User Notification Alert - KVM session stopped.","iAMT0052-3":"User Notification Alert - KVM data channel.",iAMT0053:"User Notification Alert - RCS notification.","iAMT0053-50":"User Notification Alert - RCS notification (HW button pressed. Connection initiated automatically).","iAMT0053-52":"User Notification Alert - RCS notification (HW button pressed. Connection wasn't initiated automatically).","iAMT0053-53":"User Notification Alert - RCS notification (Contracts updated).",iAMT0054:"User Notification Alert - WLAN notification. Wireless Profile sync enablement state changed.",iAMT0055:"User Notification Alert - Provisioning state change notification.","iAMT0055-0":"User Notification Alert - Provisioning state change notification - Pre-configuration.","iAMT0055-1":"User Notification Alert - Provisioning state change notification - In configuration.","iAMT0055-2":"User Notification Alert - Provisioning state change notification - Post-configuration.","iAMT0055-3":"User Notification Alert - Provisioning state change notification - Unprovision process has started.",iAMT0056:"User Notification Alert - System Defense change notification.",iAMT0057:"User Notification Alert - Network State change notification.",iAMT0058:"User Notification Alert - Remote Access change notification.","iAMT0058-1":"User Notification Alert - Remote Access change notification - tunnel is closed.",iAMT0059:"User Notification Alert - KVM enabled event.","iAMT0059-0":"User Notification Alert - KVM enabled event - KVM disabled.","iAMT0059-1":"User Notification Alert - KVM enabled event - KVM enabled (both from MEBx and PTNI).",iAMT0060:"User Notification Alert - SecIO configuration event.",iAMT0061:"ME FW reset occurred.",iAMT0062:"User Notification Alert - IpSyncEnabled event.","iAMT0062-0":"User Notification Alert - IpSyncEnabled event - IpSync disabled.","iAMT0062-1":"User Notification Alert - IpSyncEnabled event - IpSync enabled.",iAMT0063:"User Notification Alert - HTTP Proxy sync enabled event.","iAMT0063-0":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync disabled.","iAMT0063-1":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync enabled.",iAMT0064:"User Notification Alert - User Consent event.","iAMT0064-1":"User Notification Alert - User Consent event - User Consent granted.","iAMT0064-2":"User Notification Alert - User Consent event - User Consent ended.","iAMT0067-0":"Graceful Remote Control Operation - Shutdown.","iAMT0067-1":"Graceful Remote Control Operation - Reset.","iAMT0067-2":"Graceful Remote Control Operation - Hibernate.","iAMT0068-0":"Link Protection Notification - No link protection.","iAMT0068-1":"Link Protection Notification - Passive link protection.","iAMT0068-2":"Link Protection Notification - High link protection.","iAMT0069-0":"Local Time Sync Enablement Notification - Local Time Sync Disabled.","iAMT0069-1":"Local Time Sync Enablement Notification - Local Time Sync Enabled.",iAMT0070:"Host Reset Triggered by WD Expiration Notification.",PLAT0004:"The chassis %1s was opened.",PLAT0005:"The chassis %1s was closed.",PLAT0006:"The drive bay %1s was opened.",PLAT0007:"The drive bay %1s was closed.",PLAT0008:"The I/O card area %1s was opened.",PLAT0009:"The I/O card area %1s was closed.",PLAT0010:"The processor area %1s was opened.",PLAT0011:"The processor area %1s was closed.",PLAT0012:"The LAN %1s has been disconnected.",PLAT0013:"The LAN %1s has been connected.",PLAT0016:"The permission to insert package %1s has been granted.",PLAT0017:"The permission to insert package %1s has been removed.",PLAT0018:"The fan card area %1s is open.",PLAT0019:"The fan card area %1s is closed.",PLAT0022:"The computer system %1s has detected a secure mode violation.",PLAT0024:"The computer system %1s has detected a pre-boot user password violation.",PLAT0026:"The computer system %1s has detected a pre-boot setup password violation.",PLAT0028:"The computer system %1s has detected a network boot password violation.",PLAT0030:"The computer system %1s has detected a password violation.",PLAT0032:"The management controller %1s has detected an out-of-band password violation.",PLAT0034:"The processor %1s has been added.",PLAT0035:"The processor %1s has been removed.",PLAT0036:"An over-temperature condition has been detected on the processor %1s.",PLAT0037:"An over-temperature condition has been removed on the processor %1s.",PLAT0038:"The processor %1s is operating in a degraded State.",PLAT0039:"The processor %1s is no longer operating in a degraded State.",PLAT0040:"The processor %1s has failed.",PLAT0042:"The processor %1s has failed.",PLAT0044:"The processor %1s has failed.",PLAT0046:"The processor %1s has failed.",PLAT0048:"The processor %1s has failed.",PLAT0060:"The processor %1s has been enabled.",PLAT0061:"The processor %1s has been disabled.",PLAT0062:"The processor %1s has a configuration mismatch.",PLAT0064:"A terminator has been detected on the processor %1s.",PLAT0084:"The Power Supply %1s has been added.",PLAT0085:"The Power Supply %1s has been removed.",PLAT0086:"The Power Supply %1s has failed.",PLAT0088:"Failure predicted on power supply %1s.",PLAT0096:"The input to power supply %1s has been lost or fallen out of range.",PLAT0098:"The power supply %1s is operating in an input state that is out of range.",PLAT0099:"The power supply %1s has returned to a normal input state.",PLAT0100:"The power supply %1s has lost input.",PLAT0104:"The power supply %1s has a configuration mismatch.",PLAT0106:"Power supply %1s has been disabled.",PLAT0107:"Power supply %1s has been enabled.",PLAT0108:"Power supply %1s has been power cycled.",PLAT0110:"Power supply %1s has encountered an error during power down.",PLAT0112:"Power supply %1s has lost power.",PLAT0114:"Soft power control has failed for power supply %1s.",PLAT0116:"Power supply %1s has failed.",PLAT0118:"Failure predicted on power supply %1s.",PLAT0120:"Memory subsystem failure.",PLAT0122:"DIMM missing.",PLAT0124:"Memory error detected & corrected for DIMM %1s.",PLAT0128:"Memory DIMM %1s added.",PLAT0129:"Memory DIMM %1s removed.",PLAT0130:"Memory DIMM %1s enabled.",PLAT0131:"Memory DIMM %1s disabled.",PLAT0134:"Memory parity error for DIMM %1s.",PLAT0136:"Memory scrub failure for DIMM %1s.",PLAT0138:"Memory uncorrectable error detected for DIMM %1s.",PLAT0140:"Memory sparing initiated for DIMM %1s.",PLAT0141:"Memory sparing concluded for DIMM %1s.",PLAT0142:"Memory DIMM %1s Throttled.",PLAT0144:"Memory logging limit reached for DIMM %1s.",PLAT0145:"Memory logging limit removed for DIMM %1s.",PLAT0146:"An over-temperature condition has been detected on the Memory DIMM %1s.",PLAT0147:"An over-temperature condition has been removed on the Memory DIMM %1s.",PLAT0162:"The drive %1s has been added.",PLAT0163:"The drive %1s has been removed.",PLAT0164:"The drive %1s has been disabled due to a detected fault.",PLAT0167:"The drive %1s has been enabled.",PLAT0168:"Failure predicted on drive %1s.",PLAT0170:"Hot spare enabled for %1s.",PLAT0171:"Hot spare disabled for %1s.",PLAT0172:"Consistency check has begun for %1s.",PLAT0173:"Consistency check completed for %1s.",PLAT0174:"Array %1s is in critical condition.",PLAT0176:"Array %1s has failed.",PLAT0177:"Array %1s has been restored.",PLAT0178:"Rebuild in progress for array %1s.",PLAT0179:"Rebuild completed for array %1s.",PLAT0180:"Rebuild Aborted for array %1s.",PLAT0184:"The system %1s encountered a POST error.",PLAT0186:"The system %1s encountered a firmware hang.",PLAT0188:"The system %1s encountered firmware progress.",PLAT0192:"The log %1s has been disabled.",PLAT0193:"The log %1s has been enabled.",PLAT0194:"The log %1s has been disabled.",PLAT0195:"The log %1s has been enabled.",PLAT0196:"The log %1s has been disabled.",PLAT0198:"The log %1s has been enabled.",PLAT0200:"The log %1s has been cleared.",PLAT0202:"The log %1s is full.",PLAT0203:"The log %1s is no longer full.",PLAT0204:"The log %1s is almost full.",PLAT0208:"The log %1s has a configuration error.",PLAT0210:"The system %1s has been reconfigured.",PLAT0212:"The system %1s has encountered an OEM system boot event.",PLAT0214:"The system %1s has encountered an unknown system hardware fault.",PLAT0216:"The system %1s has generated an auxiliary log entry.",PLAT0218:"The system %1s has executed a PEF action.",PLAT0220:"The system %1s has synchronized the system clock.",PLAT0222:"A diagnostic interrupt has occurred on system %1s.",PLAT0224:"A bus timeout has occurred on system %1s.",PLAT0226:"An I/O channel check NMI has occurred on system %1s.",PLAT0228:"A software NMI has occurred on system %1s.",PLAT0230:"System %1s has recovered from an NMI.",PLAT0232:"A PCI PERR has occurred on system %1s.",PLAT0234:"A PCI SERR has occurred on system %1s.",PLAT0236:"An EISA fail safe timeout occurred on system %1s.",PLAT0238:"A correctable bus error has occurred on system %1s.",PLAT0240:"An uncorrectable bus error has occurred on system %1s.",PLAT0242:"A fatal NMI error has occurred on system %1s.",PLAT0244:"A fatal bus error has occurred on system %1s.",PLAT0246:"A bus on system %1s is operating in a degraded state.",PLAT0247:"A bus on system %1s is no longer operating in a degraded state.",PLAT0248:"The power button %1s has been pressed.",PLAT0249:"The power button %1s has been released.",PLAT0250:"The sleep button %1s has been pressed.",PLAT0251:"The sleep button %1s has been released.",PLAT0252:"The reset button %1s has been pressed.",PLAT0253:"The reset button %1s has been released.",PLAT0254:"The latch to %1s has been opened.",PLAT0255:"The latch to %1s has been closed.",PLAT0256:"The service request %1s has been enabled.",PLAT0257:"The service request %1s has been completed.",PLAT0258:"Power control of system %1s has failed.",PLAT0262:"The network port %1s has been connected.",PLAT0263:"The network port %1s has been disconnected.",PLAT0266:"The connector %1s has encountered a configuration error.",PLAT0267:"The connector %1s configuration error has been repaired.",PLAT0272:"Power on for system %1s.",PLAT0274:"Power cycle hard requested for system %1s.",PLAT0276:"Power cycle soft requested for system %1s.",PLAT0278:"PXE boot requested for system %1s.",PLAT0280:"Diagnostics boot requested for system %1s.",PLAT0282:"System restart requested for system %1s.",PLAT0284:"System restart begun for system %1s.",PLAT0286:"No bootable media available for system %1s.",PLAT0288:"Non-bootable media selected for system %1s.",PLAT0290:"PXE server not found for system %1s.",PLAT0292:"User timeout on boot for system %1s.",PLAT0296:"System %1s boot from floppy initiated.",PLAT0298:"System %1s boot from local drive initiated.",PLAT0300:"System %1s boot from PXE on network port initiated.",PLAT0302:"System %1s boot diagnostics initiated.",PLAT0304:"System %1s boot from CD initiated.",PLAT0306:"System %1s boot from ROM initiated.",PLAT0312:"System %1s boot initiated.",PLAT0320:"Critical stop during OS load on system %1s.",PLAT0322:"Run-time critical stop on system %1s.",PLAT0324:"OS graceful stop on system %1s.",PLAT0326:"OS graceful shutdown begun on system %1s.",PLAT0327:"OS graceful shutdown completed on system %1s.",PLAT0328:"Agent not responding on system %1s.",PLAT0329:"Agent has begun responding on system %1s.",PLAT0330:"Fault in slot on system %1s.",PLAT0331:"Fault condition removed on system %1s.",PLAT0332:"Identifying slot on system %1s.",PLAT0333:"Identify stopped on slot for system %1s.",PLAT0334:"Package installed in slot for system %1s.",PLAT0336:"Slot empty system %1s.",PLAT0338:"Slot in system %1s is ready for installation.",PLAT0340:"Slot in system %1s is ready for removal.",PLAT0342:"Power is off on slot of system %1s.",PLAT0344:"Power is on for slot of system %1s.",PLAT0346:"Removal requested for slot of system %1s.",PLAT0348:"Interlock activated on slot of system %1s.",PLAT0349:"Interlock de-asserted on slot of system %1s.",PLAT0350:"Slot disabled on system %1s.",PLAT0351:"Slot enabled on system %1s.",PLAT0352:"Slot of system %1s holds spare.",PLAT0353:"Slot of system %1s no longer holds spare.",PLAT0354:"Computer system %1s enabled.",PLAT0356:"Computer system %1s is in sleep - light mode.",PLAT0358:"Computer system %1s is in hibernate.",PLAT0360:"Computer system %1s is in standby.",PLAT0362:"Computer system %1s is in soft off mode.",PLAT0364:"Computer system %1s is in hard off mode.",PLAT0366:"Computer system %1s is sleeping.",PLAT0368:"Watchdog timer expired for %1s.",PLAT0370:"Reboot of system initiated by watchdog %1s.",PLAT0372:"Powering off system initiated by watchdog %1s.",PLAT0374:"Power cycle of system initiated by watchdog %1s.",PLAT0376:"Watchdog timer interrupt occurred for %1s.",PLAT0378:"A page alert has been generated for system %1s.",PLAT0380:"A LAN alert has been generated for system %1s.",PLAT0382:"An event trap has been generated for system %1s.",PLAT0384:"An SNMP trap has been generated for system %1s.",PLAT0390:"%1s detected as present.",PLAT0392:"%1s detected as absent.",PLAT0394:"%1s has been disabled.",PLAT0395:"%1s has been enabled.",PLAT0396:"Heartbeat lost for LAN %1s.",PLAT0397:"Heartbeat detected for LAN %1s.",PLAT0398:"Sensor %1s is unavailable or degraded on management system.",PLAT0399:"Sensor %1s has returned to normal on management system.",PLAT0400:"Controller %1s is unavailable or degraded on management system.",PLAT0401:"Controller %1s has returned to normal on management system.",PLAT0402:"Management system %1s is off-line.",PLAT0404:"Management system %1s is disabled.",PLAT0405:"Management system %1s is enabled.",PLAT0406:"Sensor %1s has failed on management system.",PLAT0408:"FRU %1s has failed on management system.",PLAT0424:"The battery %1s is critically low.",PLAT0427:"The battery %1s is no longer critically low.",PLAT0430:"The battery %1s has been removed from unit.",PLAT0431:"The battery %1s has been added.",PLAT0432:"The battery %1s has failed.",PLAT0434:"Session audit is deactivated on system %1s.",PLAT0435:"Session audit is activated on system %1s.",PLAT0436:"A hardware change occurred on system %1s.",PLAT0438:"A firmware or software change occurred on system %1s.",PLAT0440:"A hardware incompatibility was detected on system %1s.",PLAT0442:"A firmware or software incompatibility was detected on system %1s.",PLAT0444:"Invalid or unsupported hardware was detected on system %1s.",PLAT0446:"Invalid or unsupported firmware or software was detected on system %1s.",PLAT0448:"A successful hardware change was detected on system %1s.",PLAT0450:"A successful software or firmware change was detected on system %1s.",PLAT0464:"FRU %1s not installed on system.",PLAT0465:"FRU %1s installed on system.",PLAT0466:"Activation requested for FRU %1s on system.",PLAT0467:"FRU %1s on system is active.",PLAT0468:"Activation in progress for FRU %1s on system.",PLAT0470:"Deactivation request for FRU %1s on system.",PLAT0471:'FRU %1s on system is in standby or "hot spare" state.',PLAT0472:"Deactivation in progress for FRU %1s on system.",PLAT0474:"Communication lost with FRU %1s on system.",PLAT0476:"Numeric sensor %1s going low (lower non-critical).",PLAT0478:"Numeric sensor %1s going high (lower non-critical).",PLAT0480:"Numeric sensor %1s going low (lower critical).",PLAT0482:"Numeric sensor %1s going high (lower critical).",PLAT0484:"Numeric sensor %1s going low (lower non-recoverable).",PLAT0486:"Numeric sensor %1s going high (lower non-critical).",PLAT0488:"Numeric sensor %1s going low (upper non-critical).",PLAT0490:"Numeric sensor %1s going high (upper non-critical).",PLAT0492:"Numeric sensor %1s going low (upper critical).",PLAT0494:"Numeric sensor %1s going high (upper critical).",PLAT0496:"Numeric sensor %1s going low (upper non-recoverable).",PLAT0498:"Numeric sensor %1s going high (upper non-recoverable).",PLAT0500:"Sensor %1s has transitioned to idle.",PLAT0502:"Sensor %1s has transitioned to active.",PLAT0504:"Sensor %1s has transitioned to busy.",PLAT0508:"Sensor %1s has asserted.",PLAT0509:"Sensor %1s has de-asserted.",PLAT0510:"Sensor %1s is asserting predictive failure.",PLAT0511:"Sensor %1s is de-asserting predictive failure.",PLAT0512:"Sensor %1s has indicated limit exceeded.",PLAT0513:"Sensor %1s has indicated limit no longer exceeded.",PLAT0514:"Sensor %1s has indicated performance met.",PLAT0516:"Sensor %1s has indicated performance lags.",PLAT0518:"Sensor %1s has transitioned to normal state.",PLAT0520:"Sensor %1s has transitioned from normal to non-critical state.",PLAT0522:"Sensor %1s has transitioned to critical from a less severe state.",PLAT0524:"Sensor %1s has transitioned to non-recoverable from a less severe state.",PLAT0526:"Sensor %1s has transitioned to non-critical from a more severe state.",PLAT0528:"Sensor %1s has transitioned to critical from a non-recoverable state.",PLAT0530:"Sensor %1s has transitioned to non-recoverable.",PLAT0532:"Sensor %1s indicates a monitor state.",PLAT0534:"Sensor %1s has an informational state.",PLAT0536:"Device %1s has been added.",PLAT0537:"Device %1s has been removed from unit.",PLAT0538:"Device %1s has been enabled.",PLAT0539:"Device %1s has been disabled.",PLAT0540:"Sensor %1s has indicated a running state.",PLAT0544:"Sensor %1s has indicated a power off state.",PLAT0546:"Sensor %1s has indicated an on-line state.",PLAT0548:"Sensor %1s has indicated an off-line state.",PLAT0550:"Sensor %1s has indicated an off-duty state.",PLAT0552:"Sensor %1s has indicated a degraded state.",PLAT0554:"Sensor %1s has indicated a power save state.",PLAT0556:"Sensor %1s has indicated an install error.",PLAT0558:"Redundancy %1s has been lost.",PLAT0560:"Redundancy %1s has been reduced.",PLAT0561:"Redundancy %1s has been restored.",PLAT0562:"%1s has transitioned to a D0 power state.",PLAT0564:"%1s has transitioned to a D1 power state.",PLAT0566:"%1s has transitioned to a D2 power state.",PLAT0568:"%1s has transitioned to a D3 power state.",PLAT0720:"The System %1s encountered firmware progress - memory initialization entry.",PLAT0721:"The System %1s encountered firmware progress - memory initialization exit.",PLAT0722:"The System %1s encountered firmware progress - hard drive initialization entry.",PLAT0723:"The System %1s encountered firmware progress - hard drive initialization exit.",PLAT0724:"The System %1s encountered firmware progress - user authentication.",PLAT0728:"The System %1s encountered firmware progress - USR resource configuration entry.",PLAT0729:"The System %1s encountered firmware progress - USR resource configuration exit.",PLAT0730:"The System %1s encountered firmware progress - PCI recource configuration entry.",PLAT0731:"The System %1s encountered firmware progress - PCI recource configuration exit.",PLAT0732:"The System %1s encountered firmware progress - Option ROM initialization entry.",PLAT0733:"The System %1s encountered firmware progress - Option ROM initialization entry exit.",PLAT0734:"The System %1s encountered firmware progress -video initialization entry entry.",PLAT0735:"The System %1s encountered firmware progress - video initialization entry exit.",PLAT0736:"The System %1s encountered firmware progress - cache initialization entry.",PLAT0737:"The System %1s encountered firmware progress - cache initialization exit.",PLAT0738:"The System %1s encountered firmware progress - keyboard controller initialization entry.",PLAT0739:"The System %1s encountered firmware progress - keyboard controller initialization exit.",PLAT0740:"The System %1s encountered firmware progress - motherboard initialization entry.",PLAT0741:"The System %1s encountered firmware progress - motherboard initialization exit.",PLAT0742:"The System %1s encountered firmware progress - floppy disk initialization entry.",PLAT0743:"The System %1s encountered firmware progress - floppy disk initialization exit.",PLAT0744:"The System %1s encountered firmware progress - keyboard test entry.",PLAT0745:"The System %1s encountered firmware progress - keyboard test exit.",PLAT0746:"The System %1s encountered firmware progress - pointing device test entry.",PLAT0747:"The System %1s encountered firmware progress - pointing device test exit.",PLAT0750:"The System %1s encountered firmware progress - dock enable entry.",PLAT0751:"The System %1s encountered firmware progress - dock enable exit.",PLAT0752:"The System %1s encountered firmware progress - dock disable entry.",PLAT0753:"The System %1s encountered firmware progress - dock disable exit.",PLAT0760:"The System %1s encountered firmware progress - start OS boot process.",PLAT0762:"The System %1s encountered firmware progress - call OS wake vector.",PLAT0764:"The System %1s encountered firmware progress - unrecoverable keyboard failure.",PLAT0766:"The System %1s encountered firmware progress - no video device detected.",PLAT0768:"The System %1s encountered firmware progress - SMART alert detected on drive.",PLAT0770:"The System %1s encountered firmware progress - unrecoverable boot device failure.",PLAT0789:"Corrupt BIOS detected.",PLAT0790:"The System %1s encountered PCI configuration failure.",PLAT0791:"The System %1s encountered a video subsystem failure.",PLAT0792:"The System %1s encountered a storage subsystem failure.",PLAT0793:"The System %1s encountered a USB subsystem failure.",PLAT0794:"The System %1s has detected no memory in the system.",PLAT0795:"The System %1s encountered a motherboard failure.",PLAT0796:"The System %1s encountered a memory Regulator Voltage Bad.",PLAT0797:"%1s PCI reset is not deasserting.",PLAT0798:"%1s Non-Motherboard Regulator Failure.",PLAT0799:"%1s Power Supply Cable failure.",PLAT0800:"%1s Motherboard regulator failure.",PLAT0801:"%1s System component compatibility mismatch."};module.exports=lme_heci;
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt-mei.min.js b/agents/modules_meshcmd_min/amt-mei.min.js
deleted file mode 100644
index 35b4455b..00000000
--- a/agents/modules_meshcmd_min/amt-mei.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var Q=require("queue");function amt_heci(){var d=require("events").inherits(this);d.createEvent("error");var u=require("heci");this._ObjectID="pthi";this._rq=new Q();this._setupPTHI=function b(){this._amt=u.create();this._amt.BiosVersionLen=65;this._amt.UnicodeStringLen=20;this._amt.Parent=this;this._amt.on("error",function E(G){if(this.Parent._rq.isEmpty()){this.Parent.emit("error",G)}else{var I=this.Parent._rq.deQueue();var H=I.optional;var F=I.func;H.unshift({Status:-1});F.apply(this.Parent,H);if(!this.Parent._rq.isEmpty()){this.connect(u.GUIDS.AMT,{noPipeline:1})}}});this._amt.on("connect",function D(){this.on("data",function F(H){var I=this.Parent.getCommand(H);var K=this.Parent._rq.deQueue();var J=K.optional;var G=K.func;J.unshift(I);G.apply(this.Parent,J);if(this.Parent._rq.isEmpty()){this.Parent._amt.disconnect();this.Parent._amt=null}else{this.write(this.Parent._rq.peekQueue().send)}});this.write(this.Parent._rq.peekQueue().send)})};function A(D){var E=D.indexOf("\0");if(E>=0){return D.substring(0,E)}else{return D}}this.getCommand=function g(D){var E=D.length==0?(this._rq.peekQueue().cmd|8388608):D.readUInt32LE(4);var F={IsResponse:(E&8388608)==8388608?true:false,Command:(E&8388607),Status:D.length!=0?D.readUInt32LE(12):-1,Data:D.length!=0?D.slice(16):null};return(F)};this.sendCommand=function x(){if(arguments.length<3||typeof(arguments[0])!="number"||typeof(arguments[1])!="object"||typeof(arguments[2])!="function"){throw ("invalid parameters")}var D=[];for(var F=3;F0){M.BiosVersion=M.BiosVersion.substring(0,M.BiosVersion.indexOf("\0"))}K.unshift(M)}else{K.unshift(null)}H.apply(this,K)},D,F)};function C(F,E){if((E==null)&&(typeof(E)!="number")){return null}if(F==null){F=""}var G="";for(var D=0;D0){I.unshift(H.Data.slice(2,2+J).toString())}else{I.unshift(null)}}else{I.unshift(null)}G.apply(this,I)},D,F)};this.getHashHandles=function k(D){var F=[];for(var E=1;E0){this.getCertHashEntry(F.shift(),this._getHashEntrySink,E,G,D,F)}else{G.unshift(D);E.apply(this,G)}};this.getLocalSystemAccount=function m(D){var F=[];for(var E=1;E>24)&255)+"."+((J>>16)&255)+"."+((J>>8)&255)+"."+(J&255);N.unshift(M);K.apply(this,N)}else{N.unshift(null);K.apply(this,N)}},D,I)};this.unprovision=function B(G,D){var H=[];for(var F=2;F=0){b.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(b.user.length+b.authuri.length+8)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0,0))}else{if(d.indexOf(3)>=0){b.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(b.user.length+b.authuri.length+7)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0))}else{if(d.indexOf(1)>=0){b.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(b.user.length+b.pass.length+2)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(b.pass.length)+b.pass)}else{b.Stop()}}}}else{if((g==3||g==4)&&y==1){var m=0;var w=e[m];var v=e.slice(m+1,m+1+w).toString();m+=(w+1);if(b.digestRealmMatch&&(b.digestRealmMatch!=v)){b.Stop();return}var r=e[m];var q=e.slice(m+1,m+1+r).toString();m+=(r+1);var u=0;var t=null;var k=b.xxRandomValueHex(32);var x="00000002";var p="";if(g==4){u=e[m];t=e.slice(m+1,m+1+u).toString();m+=(u+1);p=x+":"+k+":"+t+":"}var o=hex_md5(hex_md5(b.user+":"+v+":"+b.pass)+":"+q+":"+p+hex_md5("POST:"+b.authuri));var A=b.user.length+v.length+q.length+b.authuri.length+k.length+x.length+o.length+7;if(g==4){A+=(t.length+1)}var h=Buffer.concat([new Buffer([19,0,0,0,g]),new Buffer([A&255,(A>>8)&255,0,0]),new Buffer([b.user.length]),new Buffer(b.user),new Buffer([v.length]),new Buffer(v),new Buffer([q.length]),new Buffer(q),new Buffer([b.authuri.length]),new Buffer(b.authuri),new Buffer([k.length]),new Buffer(k),new Buffer([x.length]),new Buffer(x),new Buffer([o.length]),new Buffer(o)]);if(g==4){h=Buffer.concat([h,new Buffer([t.length]),new Buffer(t)])}b.xxSend(h)}else{if(y==0){if(b.protocol==1){}if(b.protocol==2){b.xxSend(new Buffer([64,0,0,0,0,0,0,0]))}if(b.protocol==3){b.connectstate=1;b.xxStateChange(3)}}else{b.Stop()}}}break;case 33:if(b.amtaccumulator.length<23){break}j=23;b.xxSend(String.fromCharCode(39,0,0,0)+ToIntStr(b.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));if(b.protocol==1){b.amtkeepalivetimer=setInterval(b.xxSendAmtKeepAlive,2000)}b.connectstate=1;b.xxStateChange(3);break;case 41:if(b.amtaccumulator.length<10){break}j=10;break;case 42:if(b.amtaccumulator.length<10){break}var l=(10+((b.amtaccumulator[9]&255)<<8)+(b.amtaccumulator[8]&255));if(b.amtaccumulator.length8){b.m.ProcessData(b.amtaccumulator.substring(8))}j=b.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+b.amtaccumulator[0]+" acclen="+b.amtaccumulator.length);b.Stop();return}if(j==0){return}if(j==b.amtaccumulator.length){b.amtaccumulator=null}else{b.amtaccumulator=b.amtaccumulator.slice(j)}}};b.xxSend=function(d){if(c&&c.redirtrace){console.log("REDIR-SEND("+d.length+"): "+rstr2hex(d))}if(typeof d=="string"){b.socket.write(new Buffer(d,"binary"))}else{b.socket.write(d)}};b.Send=function(d){if(b.socket==null||b.connectstate!=1){return}if(b.protocol==1){b.xxSend(String.fromCharCode(40,0,0,0)+ToIntStr(b.amtsequence++)+ToShortStr(d.length)+d)}else{b.xxSend(d)}};b.xxSendAmtKeepAlive=function(){if(b.socket==null){return}b.xxSend(String.fromCharCode(43,0,0,0)+ToIntStr(b.amtsequence++))};b.xxRandomValueHex=function(f){var g=[],e=Math.floor(f/2);for(var d=0;d>8)&255),((a>>16)&255),((a>>24)&255))}function ToShortStr(a){return String.fromCharCode((a&255),((a>>8)&255))}function ShortToStr(a){return String.fromCharCode((a>>8)&255,a&255)}function ShortToStrX(a){return String.fromCharCode(a&255,(a>>8)&255)}function IntToStr(a){return String.fromCharCode((a>>24)&255,(a>>16)&255,(a>>8)&255,a&255)}function IntToStrX(a){return String.fromCharCode(a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255)}var md5hasher=require("MD5Stream").create();function hex_md5(b){return md5hasher.syncHash(b).toString("hex").toLowerCase()};
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt-scanner.min.js b/agents/modules_meshcmd_min/amt-scanner.min.js
deleted file mode 100644
index 9b755c70..00000000
--- a/agents/modules_meshcmd_min/amt-scanner.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function AMTScanner(){var a=require("events").inherits(this);a.createEvent("found");this.dgram=require("dgram");this.buildRmcpPing=function(c){var b=Buffer.from("06000006000011BE80000000","hex");b[9]=c;return b};this.parseRmcpPacket=function(h,b,g,d){if(b==null||b.length<20){return}var f={};if(((b[12]==0)||(b[13]!=0)||(b[14]!=1)||(b[15]!=87))&&(b[21]&32)){f.servertag=b[9];f.minorVersion=b[18]&15;f.majorVersion=(b[18]>>4)&15;f.provisioningState=b[19]&3;var e=(b[16]*256)+b[17];var c=((b[19]&4)!=0)?true:false;f.openPorts=[e];f.address=g.address;if(c==true){f.openPorts=[16992,16993]}if(d!==undefined){d(h,f)}}};this.parseIPv4Range=function(f){if(f==undefined||f==null){return null}var g=f.split("-");if(g.length==2){return{min:this.parseIpv4Addr(g[0]),max:this.parseIpv4Addr(g[1])}}g=f.split("/");if(g.length==2){var c=this.parseIpv4Addr(g[0]),e=parseInt(g[1]),d=0;if(e<=16||e>32){return null}e=32-e;for(var b=0;b>24)&255)+"."+((b>>16)&255)+"."+((b>>8)&255)+"."+(b&255)};this.scan=function(d,g){var c=this.parseIPv4Range(d);var e=this.buildRmcpPing(0);var f=this.dgram.createSocket({type:"udp4"});f.parent=this;f.scanResults=[];f.on("error",function(i){console.log("Error:"+i)});f.on("message",function(i,j){if(j.size>4){this.parent.parseRmcpPacket(this,i,j,function(l,k){l.scanResults.push(k)})}});f.on("listening",function(){for(var j=c.min;j<=c.max;j++){f.send(e,623,f.parent.IPv4NumToStr(j))}});f.bind({address:"0.0.0.0",port:0,exclusive:true});var h=setTimeout(function b(){f.close();f.parent.emit("found",f.scanResults);delete f},g)}}module.exports=AMTScanner;
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt-script.min.js b/agents/modules_meshcmd_min/amt-script.min.js
deleted file mode 100644
index 62a1a11e..00000000
--- a/agents/modules_meshcmd_min/amt-script.min.js
+++ /dev/null
@@ -1 +0,0 @@
-script_functionTable1=["nop","jump","set","print","dialog","getitem","substr","indexof","split","join","length","jsonparse","jsonstr","add","substract","parseint","wsbatchenum","wsput","wscreate","wsdelete","wsexec","scriptspeed","wssubscribe","wsunsubscribe","readchar","signwithdummyca"];script_functionTable2=["encodeuri","decodeuri","passwordcheck","atob","btoa","hex2str","str2hex","random","md5","maketoarray","readshort","readshortx","readint","readsint","readintx","shorttostr","shorttostrx","inttostr","inttostrx"];script_functionTableX2=[encodeURI,decodeURI,passwordcheck,atob,btoa,hex2rstr,rstr2hex,random,rstr_md5,MakeToArray,ReadShort,ReadShortX,ReadInt,ReadSInt,ReadIntX,ShortToStr,ShortToStrX,IntToStr,IntToStrX];function MakeToArray(a){if(!a||a==null||typeof a=="object"){return a}return[a]}function ReadShort(b,a){return(b[a]<<8)+b[a+1]}function ReadShortX(b,a){return(b[a+1]<<8)+b[a]}function ReadInt(b,a){return(b[a]*16777216)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadSInt(b,a){return(b[a]<<24)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadIntX(b,a){return(b[a+3]*16777216)+(b[a+2]<<16)+(b[a+1]<<8)+b[a]}function ShortToStr(a){return String.fromCharCode((a>>8)&255,a&255)}function ShortToStrX(a){return String.fromCharCode(a&255,(a>>8)&255)}function IntToStr(a){return String.fromCharCode((a>>24)&255,(a>>16)&255,(a>>8)&255,a&255)}function IntToStrX(a){return String.fromCharCode(a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255)}function btoa(a){return Buffer.from(a).toString("base64")}function atob(b){var c=null;try{c=Buffer.from(b,"base64").toString()}catch(a){console.log(a)}return c}function passwordcheck(g){if(g.length<8){return false}var h=0,d=0,f=0,e=0;for(var b in g){var a=g.charCodeAt(b);if((a>64)&&(a<91)){h=1}else{if((a>96)&&(a<123)){d=1}else{if((a>47)&&(a<58)){f=1}else{e=1}}}}return((h+d+f+e)==4)}function hex2rstr(a){Buffer.from(a,"hex").toString()}function rstr2hex(a){Buffer.from(a).toString("hex")}function random(){return Math.floor(Math.random()*max)}function rstr_md5(a){return hex2rstr(hex_md5(a))}function getItem(b,c,d){for(var a in b){if(b[a][c]==d){return b[a]}}return null}var httpErrorTable={200:"OK",401:"Authentication Error",408:"Timeout Error",601:"WSMAN Parsing Error",602:"Unable to parse HTTP response header",603:"Unexpected HTTP enum response",604:"Unexpected HTTP pull response",998:"Invalid TLS certificate"};module.exports.setup=function(a,c){var b={startvars:c,onCompleted:null};if(a.length<6){console.error("Invalid script length");return null}if(ReadInt(a,0)!=612182341){console.error("Invalid binary script");return null}if(ReadShort(a,4)>1){console.error("Unsupported script version");return null}b.script=a.slice(6);b.reset=function(d){b.stop();b.ip=0;b.variables=c;b.state=1};b.start=function(d){b.stop();if(d==null){b.stepspeed=10}else{b.stepspeed=d}if(b.stepspeed>0){b.timer=setInterval(function(){b.step()},b.stepspeed)}};b.stop=function(){if(b.timer!=null){clearInterval(b.timer)}b.timer=null;b.stepspeed=0};b.getVar=function(d){if(d==undefined){return undefined}return b.getVarEx(d.split("."),b.variables)};b.getVarEx=function(f,g){try{if(f==undefined){return undefined}if(f.length==0){return g}return b.getVarEx(f.slice(1),g[f[0]])}catch(d){return null}};b.setVar=function(d,e){b.setVarEx(d.split("."),b.variables,e)};b.setVarEx=function(d,f,e){if(d.length==1){f[d[0]]=e}else{b.setVarEx(d.slice(1),f[d[0]],e)}};b.step=function(){if(b.state!=1){return}if(b.ip1){var r=l.split("{").pop().split("}").shift();l=l.replace("{"+r+"}",b.getVar(r))}}if(k==1){b.variables["__"+p]=decodeURI(l);l="__"+p}h.push(l)}if(k==2||k==3){b.variables["__"+p]=ReadSInt(l,0);h.push("__"+p)}g+=(2+f)}b.ip+=n;var j=[];for(var p=0;p<10;p++){j.push(b.getVar(h[p]))}var q;try{if(m<10000){switch(m){case 0:break;case 1:if(j[2]){if((j[2]=="<"&&j[1]="&&j[1]>=j[3])||(j[2]==">"&&j[1]>j[3])){b.ip=j[0]}}else{b.ip=j[0]}break;case 2:if(h[1]==undefined){delete b.variables[h[0]]}else{b.setVar(h[0],j[1])}break;case 3:var s=b.toString(j[0]);if(s.indexOf("INFO: ")==0){s=s.substring(6)}if(s.indexOf("SUCCESS: ")==0){s=s.substring(9)}if(b.onConsole){b.onConsole(s,b)}else{console.log(s)}break;case 4:b.state=2;b.dialog=true;setDialogMode(11,j[0],j[2],b.xxStepDialogOk,j[1],b);break;case 5:for(var p in j[1]){if(j[1][p][j[2]]==j[3]){q=p}}break;case 6:q=j[1].substr(j[2],j[3]);break;case 7:q=j[1].indexOf(j[2]);break;case 8:q=j[1].split(j[2]);break;case 9:q=j[1].join(j[2]);break;case 10:if(j[1]==null){q=0}else{q=j[1].length}break;case 11:q=JSON.parse(j[1]);break;case 12:q=JSON.stringify(j[1]);break;case 13:q=(j[1]+j[2]);break;case 14:q=(j[1]-j[2]);break;case 15:q=parseInt(j[1]);break;case 16:b.state=2;b.amtstack.BatchEnum(j[0],j[1],b.xxWsmanReturn,b);break;case 17:b.state=2;b.amtstack.Put(j[0],j[1],b.xxWsmanReturn,b);break;case 18:b.state=2;b.amtstack.Create(j[0],j[1],b.xxWsmanReturn,b);break;case 19:b.state=2;b.amtstack.Delete(j[0],j[1],b.xxWsmanReturn,b);break;case 20:b.state=2;b.amtstack.Exec(j[0],j[1],j[2],b.xxWsmanReturn,b,0,j[3]);break;case 21:b.stepspeed=j[0];if(b.timer!=null){clearInterval(b.timer);b.timer=setInterval(function(){b.step()},b.stepspeed)}break;case 22:b.state=2;b.amtstack.Subscribe(j[0],j[1],j[2],b.xxWsmanReturn,b,0,j[3],j[4],j[5],j[6]);break;case 23:b.state=2;b.amtstack.UnSubscribe(j[0],b.xxWsmanReturn,b,0,j[1]);break;case 24:console.log(j[1],j[2],j[1].charCodeAt(j[2]));q=j[1].charCodeAt(j[2]);break;case 25:break;default:b.state=9;console.error("Script Error, unknown command: "+m)}}else{if(m<20000){q=script_functionTableX2[m-10000](j[1],j[2],j[3],j[4],j[5],j[6])}else{}}if(q!=undefined){b.setVar(h[0],q)}}catch(o){if(typeof o=="object"){o=o.message}b.setVar("_exception",o)}}if(b.state==1&&b.ip>=b.script.length){b.state=0;b.stop();if(b.onCompleted){b.onCompleted()}}if(b.onStep){b.onStep(b)}return b};b.xxStepDialogOk=function(d){b.variables.DialogSelect=d;b.state=1;b.dialog=false;if(b.onStep){b.onStep(b)}};b.xxWsmanReturn=function(f,d,e,g){b.setVar(d,e);b.setVar("wsman_result",g);b.setVar("wsman_result_str",((httpErrorTable[g])?(httpErrorTable[g]):("Error #"+g)));b.state=1;if(b.onStep){b.onStep(b)}};b.toString=function(d){if(typeof d=="object"){return JSON.stringify(d)}return d};b.reset();return b};module.exports.compile=function(o,l){var n="",q=o.split("\n"),h={},k=[],s=[];for(var d in q){var p=q[d];if(p.startsWith("##SWAP ")){var u=p.split(" ");if(u.length==3){s[u[1]]=u[2]}}if(p[0]=="#"||p.length==0){continue}for(var u in s){p=p.split(u).join(s[u])}var f=p.match(/"[^"]*"|[^\s"]+/g);if(f.length==0){continue}if(p[0]==":"){h[f[0].toUpperCase()]=n.length;continue}var c=script_functionTable1.indexOf(f[0].toLowerCase());if(c==-1){c=script_functionTable2.indexOf(f[0].toLowerCase());if(c>=0){c+=10000}}if(c==-1){if(l){l("Unabled to compile, unknown command: "+f[0])}return""}var b=ShortToStr(f.length-1);for(var e in f){if(e==0){continue}if(f[e][0]==":"){k.push([f[e],n.length+b.length+7]);b+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295)}else{var a=parseInt(f[e]);if(a==f[e]){b+=ShortToStr(5)+String.fromCharCode(2)+IntToStr(a)}else{if(f[e][0]=='"'&&f[e][f[e].length-1]=='"'){b+=ShortToStr(f[e].length-1)+String.fromCharCode(1)+f[e].substring(1,f[e].length-1)}else{b+=ShortToStr(f[e].length+1)+String.fromCharCode(0)+f[e]}}}}b=ShortToStr(c)+ShortToStr(b.length+4)+b;n+=b}for(d in k){var g=k[d][0].toUpperCase(),m=k[d][1],t=h[g];if(t==undefined){if(l){l("Unabled to compile, unknown label: "+g)}return""}n=n.substr(0,m)+IntToStr(t)+n.substr(m+4)}return IntToStr(612182341)+ShortToStr(1)+n};module.exports.decompile=function(g,q){var t="",s=6,m=0,n={};if(q>=0){s=q}else{if(g.length<6){return"# Invalid script length"}var p=ReadInt(g,0);var w=ReadShort(g,4);if(p!=612182341){return"# Invalid binary script: "+p}if(w!=1){return"# Invalid script version"}}while(s=0)){t+=":label"+(s-6)+"\n"}for(var k=0;k=10000)&&(h<10000)){t+=script_functionTable2[h-10000]+d+"\n"}}s+=j;if(q>=0){return t}}var u=t.split("\n");t="";for(var k in u){var o=u[k];if(o[0]!=":"){t+=o+"\n"}else{if(n[o]){t+=o+"\n"}}}return t};
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt-wsman-duk.min.js b/agents/modules_meshcmd_min/amt-wsman-duk.min.js
deleted file mode 100644
index d83115f4..00000000
--- a/agents/modules_meshcmd_min/amt-wsman-duk.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function CreateWsmanComm(){var a={};a.PendingAjax=[];a.ActiveAjaxCount=0;a.MaxActiveAjaxCount=1;a.FailAllError=0;a.digest=null;a.RequestCount=0;if(arguments.length==1&&typeof(arguments[0]=="object")){a.host=arguments[0].host;a.port=arguments[0].port;a.authToken=arguments[0].authToken;a.tls=arguments[0].tls}else{a.host=arguments[0];a.port=arguments[1];a.user=arguments[2];a.pass=arguments[3];a.tls=arguments[4]}a.PerformAjax=function(d,c,f,e,g,b){if((a.ActiveAjaxCount==0||((a.ActiveAjaxCount=a.MaxActiveAjaxCount||a.PendingAjax.length==0){return}var b=a.PendingAjax.shift();a.PerformAjaxEx(b[0],b[1],b[2],b[3],b[4]);a.PerformNextAjax()};a.PerformAjaxEx=function(d,c,g,h,b){if(a.FailAllError!=0){if(a.FailAllError!=999){a.gotNextMessagesError({status:a.FailAllError},"error",null,[d,c,g])}return}if(!d){d=""}if(globalDebugFlags&1){console.log("SEND: "+d+"\r\n\r\n")}if(a.digest==null){if(a.authToken){a.digest=require("http-digest").create({authToken:a.authToken})}else{a.digest=require("http-digest").create(a.user,a.pass)}a.digest.http=require("http")}var f={protocol:(a.tls==1?"https:":"http:"),method:"POST",host:a.host,path:"/wsman",port:a.port,rejectUnauthorized:false,checkServerIdentity:function(i){console.log("checkServerIdentity",JSON.stringify(i))}};var e=a.digest.request(f);e.on("error",function(i){a.gotNextMessagesError({status:600},"error",null,[d,c,g])});e.on("response",function(i){if(globalDebugFlags&1){console.log("Response: "+i.statusCode)}if(i.statusCode!=200){if(globalDebugFlags&1){console.log("ERR:"+JSON.stringify(i))}a.gotNextMessagesError({status:i.statusCode},"error",null,[d,c,g])}else{i.acc="";i.on("data",function(j){this.acc+=j});i.on("end",function(){a.gotNextMessages(i.acc,"success",{status:i.statusCode},[d,c,g])})}});e.end(d);a.ActiveAjaxCount++;return e};a.pendingAjaxCall=[];a.gotNextMessages=function(c,e,d,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(globalDebugFlags&1){console.log("RECV: "+c+"\r\n\r\n")}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(d.status!=200){b[1](null,d.status,b[2]);return}b[1](c,200,b[2]);a.PerformNextAjax()};a.gotNextMessagesError=function(d,e,c,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(a.FailAllError!=999){b[1]({Header:{HttpError:d.status}},d.status,b[2])}a.PerformNextAjax()};a.CancelAllQueries=function(b){while(a.PendingAjax.length>0){var c=a.PendingAjax.shift();c[1](null,b,c[2])}};return a}module.exports=CreateWsmanComm;
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt-wsman.min.js b/agents/modules_meshcmd_min/amt-wsman.min.js
deleted file mode 100644
index e8afb796..00000000
--- a/agents/modules_meshcmd_min/amt-wsman.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+''+C+""+w+""+v+"";p.PerformAjax(s+"",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if((v==null)||(v=="null")){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="";return t}return p}module.exports=WsmanStackCreateService;
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt-xml.min.js b/agents/modules_meshcmd_min/amt-xml.min.js
deleted file mode 100644
index 4b2308ed..00000000
--- a/agents/modules_meshcmd_min/amt-xml.min.js
+++ /dev/null
@@ -1 +0,0 @@
-try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(w){try{if(w==null){return null}var m=new _treeBuilder(),r=null,z=w.split("<"),u=[],h=null,g=null;for(var o in z){var A=z[o].split(">"),B=A[0].split(" "),l=B[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],s,t=l.split(" ")[0].split(":"),s=(t.length>1)?t[1]:t[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:s,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(B.length>0){var v=false;for(var p in B){if(B[p]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";r=m.pop();v=true;break}var q=B[p].indexOf("=");if(q>0){var b=B[p].substring(0,q);var d=B[p].substring(q+2,B[p].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var y={name:b,value:d};if(c!=null){y.namespace=c}m.peek().attributes.push(y)}}if(v){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(A[1]){m.peek().textContent=A[1]}}else{r=m.pop()}}}}catch(n){return null}return r};
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/amt.min.js b/agents/modules_meshcmd_min/amt.min.js
deleted file mode 100644
index 6984729b..00000000
--- a/agents/modules_meshcmd_min/amt.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function AmtStackCreateService(R){var J=new Object();J._ObjectID="AMT";J.wsman=R;J.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"];J.PendingEnums=[];J.PendingBatchOperations=0;J.ActiveEnumsCount=0;J.MaxActiveEnumsCount=1;J.onProcessChanged=null;var n=0;var m=0;J.GetPendingActions=function(){return(J.PendingEnums.length*2)+(J.ActiveEnumsCount)+J.wsman.comm.PendingAjax.length+J.wsman.comm.ActiveAjaxCount+J.PendingBatchOperations};function r(){var S=J.GetPendingActions();if(n=J.MaxActiveEnumsCount||J.PendingEnums.length==0){return}var T=J.PendingEnums.shift();J.Enum(T[0],T[1],T[2]);d(0)}J.BatchEnum=function(S,V,T,X,U,W){J.PendingBatchOperations+=(V.length*2);b(S,x(V),T,X,{},U,W);r()};function x(S){return JSON.parse(JSON.stringify(S))}function b(S,X,T,aa,Z,U,Y){J.PendingBatchOperations-=2;var W=X.shift(),V=J.Enum;if(W[0]=="*"){V=J.Get;W=W.substring(1)}V(W,function(ad,ab,ac,ae,af){af[2][ab]={response:(ac==null?null:ac.Body),responses:ac,status:ae};if(af[1].length==0||ae==401||(U!=true&&ae!=200&&ae!=400)){J.PendingBatchOperations-=(X.length*2);r();T.call(J,J,S,af[2],ae,aa)}else{r();b(S,X,T,aa,af[2],Y)}},[S,X,Z],Y);r()}J.BatchGet=function(S,U,T,W,V){h({name:S,names:U,callback:T,current:0,responses:{},tag:W,pri:V});r()};function h(S){if(S.names.length<=S.current){S.callback.call(J,J,S.name,S.responses,200,S.tag)}else{J.wsman.ExecGet(J.CompleteName(S.names[S.current]),function(V,U,T,W){g(S,T,W)},S.pri);S.current++}r()}function g(S,T,U){if(T==null||U!=200){S.callback.call(J,J,S.name,null,U,S.tag)}else{S.responses[T.Header.Method]=T;h(S)}}J.CompleteName=function(S){if(S.indexOf("AMT_")==0){return J.pfx[0]+S}if(S.indexOf("CIM_")==0){return J.pfx[1]+S}if(S.indexOf("IPS_")==0){return J.pfx[2]+S}};J.CompleteExecResponse=function(S){if(S&&S!=null&&S.Body&&(S.Body.ReturnValue!=undefined)){S.Body.ReturnValueStr=J.AmtStatusToStr(S.Body.ReturnValue)}return S};J.RequestPowerStateChange=function(T,S){J.CIM_PowerManagementService_RequestPowerStateChange(T,'http://schemas.xmlsoap.org/ws/2004/08/addressinghttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystemCIM_ComputerSystemManagedSystem',null,null,S)};J.SetBootConfigRole=function(T,S){J.CIM_BootService_SetBootConfigRole('http://schemas.xmlsoap.org/ws/2004/08/addressinghttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSettingIntel(r) AMT: Boot Configuration 0',T,S)};J.CancelAllQueries=function(S){J.wsman.CancelAllQueries(S)};J.AMT_AgentPresenceWatchdog_RegisterAgent=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},S,V,T,U)};J.AMT_AgentPresenceWatchdog_AssertPresence=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AssertShutdown=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AddAction=function(X,W,V,T,S,U,aa,Y,Z){J.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U,aa,Y,Z)};J.AMT_AgentPresenceWatchdog_DeleteAllActions=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},S,V,T,U)};J.AMT_AgentPresenceWatchdogAction_GetActionEac=function(S){J.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},S)};J.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(S){J.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},S)};J.AMT_AgentPresenceWatchdogVA_AssertPresence=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AddAction=function(X,W,V,T,S,U){J.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U)};J.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(S,T){J.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:S},T)};J.AMT_AlarmClockService_AddAlarm=function s(S,T){var V=S.InstanceID;var X=S.ElementName;var Y=S.StartTime.Datetime;var W=S.Interval?S.Interval.Datetime:undefined;var U=S.DeleteOnCompletion;var Z=''+V+""+X+''+Y+""+((W!=undefined)?(''+W+""):"")+""+U+"";J.wsman.ExecMethodXml(J.CompleteName("AMT_AlarmClockService"),"AddAlarm",Z,T)};J.AMT_AuditLog_ClearLog=function(S){J.Exec("AMT_AuditLog","ClearLog",{},S)};J.AMT_AuditLog_RequestStateChange=function(T,U,S){J.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_AuditLog_ReadRecords=function(T,S,U){J.Exec("AMT_AuditLog","ReadRecords",{StartIndex:T},S,U)};J.AMT_AuditLog_SetAuditLock=function(V,T,U,S){J.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:V,Flag:T,Handle:U},S)};J.AMT_AuditLog_ExportAuditLogSignature=function(T,S){J.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:T},S)};J.AMT_AuditLog_SetSigningKeyMaterial=function(W,V,U,T,S){J.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:W,SigningKey:V,LengthOfCertificates:U,Certificates:T},S)};J.AMT_AuditPolicyRule_SetAuditPolicy=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuthorizationService_AddUserAclEntryEx=function(V,U,W,S,X,T){J.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:V,DigestPassword:U,KerberosUserSid:W,AccessPermission:S,Realms:X},T)};J.AMT_AuthorizationService_EnumerateUserAclEntries=function(T,S){J.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:T},S)};J.AMT_AuthorizationService_GetUserAclEntryEx=function(T,S,U){J.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:T},S,U)};J.AMT_AuthorizationService_UpdateUserAclEntryEx=function(W,V,U,X,S,Y,T){J.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:W,DigestUsername:V,DigestPassword:U,KerberosUserSid:X,AccessPermission:S,Realms:Y},T)};J.AMT_AuthorizationService_RemoveUserAclEntry=function(T,S){J.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:T},S)};J.AMT_AuthorizationService_SetAdminAclEntryEx=function(U,T,S){J.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:U,DigestPassword:T},S)};J.AMT_AuthorizationService_GetAdminAclEntry=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},S)};J.AMT_AuthorizationService_GetAdminAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},S)};J.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},S)};J.AMT_AuthorizationService_SetAclEnabledState=function(U,T,S,V){J.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:U,Enabled:T},S,V)};J.AMT_AuthorizationService_GetAclEnabledState=function(T,S,U){J.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:T},S,U)};J.AMT_EndpointAccessControlService_RequestStateChange=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_EndpointAccessControlService_GetPosture=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:T},S)};J.AMT_EndpointAccessControlService_GetPostureHash=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:T},S)};J.AMT_EndpointAccessControlService_UpdatePostureState=function(T,S){J.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:T},S)};J.AMT_EndpointAccessControlService_GetEacOptions=function(S){J.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},S)};J.AMT_EndpointAccessControlService_SetEacOptions=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:T,PostureHashAlgorithm:U},S)};J.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:T},S)};J.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:T},S)};J.AMT_EthernetPortSettings_SetLinkPreference=function(T,U,S){J.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:T,Timeout:U},S)};J.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(T,S){J.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:T},S)};J.AMT_KerberosSettingData_GetCredentialCacheState=function(S){J.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},S)};J.AMT_KerberosSettingData_SetCredentialCacheState=function(T,S){J.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:T},S)};J.AMT_MessageLog_CancelIteration=function(T,S){J.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:T},S)};J.AMT_MessageLog_RequestStateChange=function(T,U,S){J.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_MessageLog_ClearLog=function(S){J.Exec("AMT_MessageLog","ClearLog",{},S)};J.AMT_MessageLog_GetRecords=function(T,U,S,V){J.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:T,MaxReadRecords:U},S,V)};J.AMT_MessageLog_GetRecord=function(T,U,S){J.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:T,PositionToNext:U},S)};J.AMT_MessageLog_PositionAtRecord=function(T,U,V,S){J.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:T,MoveAbsolute:U,RecordNumber:V},S)};J.AMT_MessageLog_PositionToFirstRecord=function(S,T){J.Exec("AMT_MessageLog","PositionToFirstRecord",{},S,T)};J.AMT_MessageLog_FreezeLog=function(T,S){J.Exec("AMT_MessageLog","FreezeLog",{Freeze:T},S)};J.AMT_PublicKeyManagementService_AddCRL=function(U,T,S){J.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:U,SerialNumbers:T},S)};J.AMT_PublicKeyManagementService_ResetCRLList=function(S,T){J.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:S},T)};J.AMT_PublicKeyManagementService_AddCertificate=function(T,S,U){J.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:T},S,U)};J.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:T},S)};J.AMT_PublicKeyManagementService_AddKey=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:T},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(U,T,V,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:U,DNName:T,Usage:V},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(T,V,U,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:T,SigningAlgorithm:V,NullSignedCertificateRequest:U},S)};J.AMT_PublicKeyManagementService_GenerateKeyPair=function(T,U,S){J.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:T,KeyLength:U},S)};J.AMT_RedirectionService_RequestStateChange=function(T,S){J.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:T},S)};J.AMT_RedirectionService_TerminateSession=function(T,S){J.Exec("AMT_RedirectionService","TerminateSession",{SessionType:T},S)};J.AMT_RemoteAccessService_AddMpServer=function(S,X,Z,T,V,aa,Y,W,U){J.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:S,InfoFormat:X,Port:Z,AuthMethod:T,Certificate:V,Username:aa,Password:Y,CN:W},U)};J.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(V,W,T,U,S){J.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:V,TunnelLifeTime:W,ExtendedData:T,MpServer:U},S)};J.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(S,T){J.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_CommitChanges=function(S,T,U){J.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:S},T,U)};J.AMT_SetupAndConfigurationService_Unprovision=function(T,S){J.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:T},S)};J.AMT_SetupAndConfigurationService_PartialUnprovision=function(S,T){J.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(S,T){J.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(T,S){J.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:T},S)};J.AMT_SetupAndConfigurationService_SetMEBxPassword=function(T,S){J.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:T},S)};J.AMT_SetupAndConfigurationService_SetTLSPSK=function(T,U,S){J.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:T,PPS:U},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},S)};J.AMT_SetupAndConfigurationService_GetUuid=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUuid",{},S)};J.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},S)};J.AMT_SystemDefensePolicy_GetTimeout=function(S){J.Exec("AMT_SystemDefensePolicy","GetTimeout",{},S)};J.AMT_SystemDefensePolicy_SetTimeout=function(T,S){J.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:T},S)};J.AMT_SystemDefensePolicy_UpdateStatistics=function(T,V,S,X,U,W){J.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:T,ResetOnRead:V},S,X,U,W)};J.AMT_SystemPowerScheme_SetPowerScheme=function(S,T,U){J.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},S,U,0,{InstanceID:T})};J.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(S,T){J.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},S,T)};J.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(T,V,W,S,U){J.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:T,Tm1:V,Tm2:W},S,U)};J.AMT_TLSCredentialContext_Create=function t(T,U,S,V){J.Create("AMT_TLSCredentialContext",{ElementInContext:T,ElementProvidingContext:U},S,V)};J.AMT_UserInitiatedConnectionService_RequestStateChange=function(T,U,S){J.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_WebUIService_RequestStateChange=function(T,V,S,U){J.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:T,TimeoutPeriod:V},S,U)};J.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:S},T)};J.CIM_Account_RequestStateChange=function(T,U,S){J.Exec("CIM_Account","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_AccountManagementService_CreateAccount=function(U,S,T){J.Exec("CIM_AccountManagementService","CreateAccount",{System:U,AccountTemplate:S},T)};J.CIM_BootConfigSetting_ChangeBootOrder=function(T,S){J.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:T},S)};J.CIM_BootService_SetBootConfigRole=function(S,U,T){J.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:S,Role:U},T,0,1)};J.CIM_Card_ConnectorPower=function(T,U,S){J.Exec("CIM_Card","ConnectorPower",{Connector:T,PoweredOn:U},S)};J.CIM_Card_IsCompatible=function(T,S){J.Exec("CIM_Card","IsCompatible",{ElementToCheck:T},S)};J.CIM_Chassis_IsCompatible=function(T,S){J.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:T},S)};J.CIM_Fan_SetSpeed=function(T,S){J.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:T},S)};J.CIM_KVMRedirectionSAP_RequestStateChange=function(T,U,S){J.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:T},S)};J.CIM_MediaAccessDevice_LockMedia=function(T,S){J.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:T},S)};J.CIM_MediaAccessDevice_SetPowerState=function(T,U,S){J.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_MediaAccessDevice_Reset=function(S){J.Exec("CIM_MediaAccessDevice","Reset",{},S)};J.CIM_MediaAccessDevice_EnableDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:T},S)};J.CIM_MediaAccessDevice_OnlineDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:T},S)};J.CIM_MediaAccessDevice_QuiesceDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:T},S)};J.CIM_MediaAccessDevice_SaveProperties=function(S){J.Exec("CIM_MediaAccessDevice","SaveProperties",{},S)};J.CIM_MediaAccessDevice_RestoreProperties=function(S){J.Exec("CIM_MediaAccessDevice","RestoreProperties",{},S)};J.CIM_MediaAccessDevice_RequestStateChange=function(T,U,S){J.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_PhysicalFrame_IsCompatible=function(T,S){J.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:T},S)};J.CIM_PhysicalPackage_IsCompatible=function(T,S){J.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:T},S)};J.CIM_PowerManagementService_RequestPowerStateChange=function(U,T,V,W,S){J.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:U,ManagedElement:T,Time:V,TimeoutPeriod:W},S,0,1)};J.CIM_PowerSupply_SetPowerState=function(T,U,S){J.Exec("CIM_PowerSupply","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_PowerSupply_Reset=function(S){J.Exec("CIM_PowerSupply","Reset",{},S)};J.CIM_PowerSupply_EnableDevice=function(T,S){J.Exec("CIM_PowerSupply","EnableDevice",{Enabled:T},S)};J.CIM_PowerSupply_OnlineDevice=function(T,S){J.Exec("CIM_PowerSupply","OnlineDevice",{Online:T},S)};J.CIM_PowerSupply_QuiesceDevice=function(T,S){J.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:T},S)};J.CIM_PowerSupply_SaveProperties=function(S){J.Exec("CIM_PowerSupply","SaveProperties",{},S)};J.CIM_PowerSupply_RestoreProperties=function(S){J.Exec("CIM_PowerSupply","RestoreProperties",{},S)};J.CIM_PowerSupply_RequestStateChange=function(T,U,S){J.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Processor_SetPowerState=function(T,U,S){J.Exec("CIM_Processor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Processor_Reset=function(S){J.Exec("CIM_Processor","Reset",{},S)};J.CIM_Processor_EnableDevice=function(T,S){J.Exec("CIM_Processor","EnableDevice",{Enabled:T},S)};J.CIM_Processor_OnlineDevice=function(T,S){J.Exec("CIM_Processor","OnlineDevice",{Online:T},S)};J.CIM_Processor_QuiesceDevice=function(T,S){J.Exec("CIM_Processor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Processor_SaveProperties=function(S){J.Exec("CIM_Processor","SaveProperties",{},S)};J.CIM_Processor_RestoreProperties=function(S){J.Exec("CIM_Processor","RestoreProperties",{},S)};J.CIM_Processor_RequestStateChange=function(T,U,S){J.Exec("CIM_Processor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RecordLog_ClearLog=function(S){J.Exec("CIM_RecordLog","ClearLog",{},S)};J.CIM_RecordLog_RequestStateChange=function(T,U,S){J.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RedirectionService_RequestStateChange=function(T,U,S){J.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Sensor_SetPowerState=function(T,U,S){J.Exec("CIM_Sensor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Sensor_Reset=function(S){J.Exec("CIM_Sensor","Reset",{},S)};J.CIM_Sensor_EnableDevice=function(T,S){J.Exec("CIM_Sensor","EnableDevice",{Enabled:T},S)};J.CIM_Sensor_OnlineDevice=function(T,S){J.Exec("CIM_Sensor","OnlineDevice",{Online:T},S)};J.CIM_Sensor_QuiesceDevice=function(T,S){J.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Sensor_SaveProperties=function(S){J.Exec("CIM_Sensor","SaveProperties",{},S)};J.CIM_Sensor_RestoreProperties=function(S){J.Exec("CIM_Sensor","RestoreProperties",{},S)};J.CIM_Sensor_RequestStateChange=function(T,U,S){J.Exec("CIM_Sensor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_StatisticalData_ResetSelectedStats=function(T,S){J.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:T},S)};J.CIM_Watchdog_KeepAlive=function(S){J.Exec("CIM_Watchdog","KeepAlive",{},S)};J.CIM_Watchdog_SetPowerState=function(T,U,S){J.Exec("CIM_Watchdog","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Watchdog_Reset=function(S){J.Exec("CIM_Watchdog","Reset",{},S)};J.CIM_Watchdog_EnableDevice=function(T,S){J.Exec("CIM_Watchdog","EnableDevice",{Enabled:T},S)};J.CIM_Watchdog_OnlineDevice=function(T,S){J.Exec("CIM_Watchdog","OnlineDevice",{Online:T},S)};J.CIM_Watchdog_QuiesceDevice=function(T,S){J.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:T},S)};J.CIM_Watchdog_SaveProperties=function(S){J.Exec("CIM_Watchdog","SaveProperties",{},S)};J.CIM_Watchdog_RestoreProperties=function(S){J.Exec("CIM_Watchdog","RestoreProperties",{},S)};J.CIM_Watchdog_RequestStateChange=function(T,U,S){J.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_WiFiPort_SetPowerState=function(T,U,S){J.Exec("CIM_WiFiPort","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_WiFiPort_Reset=function(S){J.Exec("CIM_WiFiPort","Reset",{},S)};J.CIM_WiFiPort_EnableDevice=function(T,S){J.Exec("CIM_WiFiPort","EnableDevice",{Enabled:T},S)};J.CIM_WiFiPort_OnlineDevice=function(T,S){J.Exec("CIM_WiFiPort","OnlineDevice",{Online:T},S)};J.CIM_WiFiPort_QuiesceDevice=function(T,S){J.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:T},S)};J.CIM_WiFiPort_SaveProperties=function(S){J.Exec("CIM_WiFiPort","SaveProperties",{},S)};J.CIM_WiFiPort_RestoreProperties=function(S){J.Exec("CIM_WiFiPort","RestoreProperties",{},S)};J.CIM_WiFiPort_RequestStateChange=function(T,U,S){J.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_HostBasedSetupService_Setup=function(W,X,V,T,Y,U,S){J.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:W,NetworkAdminPassword:X,McNonce:V,Certificate:T,SigningAlgorithm:Y,DigitalSignature:U},S)};J.IPS_HostBasedSetupService_AddNextCertInChain=function(V,T,U,S){J.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:V,IsLeafCertificate:T,IsRootCertificate:U},S)};J.IPS_HostBasedSetupService_AdminSetup=function(V,W,U,X,T,S){J.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:V,NetworkAdminPassword:W,McNonce:U,SigningAlgorithm:X,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(U,V,T,S){J.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:U,SigningAlgorithm:V,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_DisableClientControlMode=function(S,T){J.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:S},T)};J.IPS_KVMRedirectionSettingData_TerminateSession=function(S){J.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelRead=function(S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelWrite=function(T,S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:T},S)};J.IPS_OptInService_StartOptIn=function(S){J.Exec("IPS_OptInService","StartOptIn",{},S)};J.IPS_OptInService_CancelOptIn=function(S){J.Exec("IPS_OptInService","CancelOptIn",{},S)};J.IPS_OptInService_SendOptInCode=function(T,S){J.Exec("IPS_OptInService","SendOptInCode",{OptInCode:T},S)};J.IPS_OptInService_StartService=function(S){J.Exec("IPS_OptInService","StartService",{},S)};J.IPS_OptInService_StopService=function(S){J.Exec("IPS_OptInService","StopService",{},S)};J.IPS_OptInService_RequestStateChange=function(T,U,S){J.Exec("IPS_OptInService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_RequestStateChange=function(T,U,S){J.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_ClearLog=function(S,T){J.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:S},T)};J.IPS_SecIOService_RequestStateChange=function(T,U,S){J.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AmtStatusToStr=function(S){if(J.AmtStatusCodes[S]){return J.AmtStatusCodes[S]}else{return"UNKNOWN_ERROR"}};J.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};J.GetMessageLog=function(S,T){J.AMT_MessageLog_PositionToFirstRecord(k,[S,T,[]])};function k(U,S,T,V,W){if(V!=200||T.Body.ReturnValue!="0"){W[0](J,null,W[2],V);return}J.AMT_MessageLog_GetRecords(T.Body.IterationIdentifier,390,l,W)}function l(Z,W,Y,aa,ac){if(aa!=200||Y.Body.ReturnValue!="0"){ac[0](J,null,ac[2],aa);return}var U,V,ae,T,S=ac[2],ab=new Date(),ad,X=Y.Body.RecordArray;if(typeof X==="string"){Y.Body.RecordArray=[Y.Body.RecordArray]}for(U in X){T=Buffer.from(X[U],"base64");if(T!=null){ad=M(T,0);if((ad>0)&&(ad<4294967295)){ae={DeviceAddress:T[4],EventSensorType:T[5],EventType:T[6],EventOffset:T[7],EventSourceType:T[8],EventSeverity:T[9],SensorNumber:T[10],Entity:T[11],EntityInstance:T[12],EventData:[],Time:new Date((ad+(ab.getTimezoneOffset()*60))*1000)};for(V=13;V<21;V++){ae.EventData.push(T[V])}ae.EntityStr=o[ae.Entity];ae.Desc=j(ae.EventSensorType,ae.EventOffset,ae.EventData,ae.Entity);if(!ae.EntityStr){ae.EntityStr="Unknown"}S.push(ae)}}}if(Y.Body.NoMoreRecords!=true){J.AMT_MessageLog_GetRecords(Y.Body.IterationIdentifier,390,l,[ac[0],S,ac[2]])}else{ac[0](J,S,ac[2])}}var f="Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var p="Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split("|");var q="Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split("|");var o="Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split("|");J.RealmNames="||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split("|");J.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};function j(V,U,T,S){if(V==15){if(T[0]==235){return"Invalid Data"}if(U==0){return p[T[1]]}return q[T[1]]}if(V==18&&T[0]==170){return"Agent watchdog "+char2hex(T[4])+char2hex(T[3])+char2hex(T[2])+char2hex(T[1])+"-"+char2hex(T[6])+char2hex(T[5])+"-... changed to "+J.WatchdogCurrentStates[T[7]]}if(V==6){return"Authentication failed "+(T[1]+(T[2]<<8))+" times. The system may be under attack."}if(V==30){return"No bootable media"}if(V==32){return"Operating system lockup or power interrupt"}if(V==35){return"System boot failure"}if(V==37){return"System firmware started (at least one CPU is properly executing)."}return"Unknown Sensor Type #"+V}var a={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",20:"Security Audit Log",21:"Network Time",22:"Network Administration",23:"Storage Administration",24:"Event Manager",25:"Circuit Breaker Manager",26:"Agent Presence Manager",27:"Wireless Configuration",28:"EAC",29:"KVM",30:"User Opt-In Events",32:"Screen Blanking",33:"Watchdog Events",1600:"Provisioning Started",1601:"Provisioning Completed",1602:"ACL Entry Added",1603:"ACL Entry Modified",1604:"ACL Entry Removed",1605:"ACL Access with Invalid Credentials",1606:"ACL Entry State",1607:"TLS State Changed",1608:"TLS Server Certificate Set",1609:"TLS Server Certificate Remove",1610:"TLS Trusted Root Certificate Added",1611:"TLS Trusted Root Certificate Removed",1612:"TLS Preshared Key Set",1613:"Kerberos Settings Modified",1614:"Kerberos Master Key Modified",1615:"Flash Wear out Counters Reset",1616:"Power Package Modified",1617:"Set Realm Authentication Mode",1618:"Upgrade Client to Admin Control Mode",1619:"Unprovisioning Started",1700:"Performed Power Up",1701:"Performed Power Down",1702:"Performed Power Cycle",1703:"Performed Reset",1704:"Set Boot Options",1800:"IDER Session Opened",1801:"IDER Session Closed",1802:"IDER Enabled",1803:"IDER Disabled",1804:"SoL Session Opened",1805:"SoL Session Closed",1806:"SoL Enabled",1807:"SoL Disabled",1808:"KVM Session Started",1809:"KVM Session Ended",1810:"KVM Enabled",1811:"KVM Disabled",1812:"VNC Password Failed 3 Times",1900:"Firmware Updated",1901:"Firmware Update Failed",2000:"Security Audit Log Cleared",2001:"Security Audit Policy Modified",2002:"Security Audit Log Disabled",2003:"Security Audit Log Enabled",2004:"Security Audit Log Exported",2005:"Security Audit Log Recovered",2100:"Intel(R) ME Time Set",2200:"TCPIP Parameters Set",2201:"Host Name Set",2202:"Domain Name Set",2203:"VLAN Parameters Set",2204:"Link Policy Set",2205:"IPv6 Parameters Set",2300:"Global Storage Attributes Set",2301:"Storage EACL Modified",2302:"Storage FPACL Modified",2303:"Storage Write Operation",2400:"Alert Subscribed",2401:"Alert Unsubscribed",2402:"Event Log Cleared",2403:"Event Log Frozen",2500:"CB Filter Added",2501:"CB Filter Removed",2502:"CB Policy Added",2503:"CB Policy Removed",2504:"CB Default Policy Set",2505:"CB Heuristics Option Set",2506:"CB Heuristics State Cleared",2600:"Agent Watchdog Added",2601:"Agent Watchdog Removed",2602:"Agent Watchdog Action Set",2700:"Wireless Profile Added",2701:"Wireless Profile Removed",2702:"Wireless Profile Updated",2800:"EAC Posture Signer SET",2801:"EAC Enabled",2802:"EAC Disabled",2803:"EAC Posture State",2804:"EAC Set Options",2900:"KVM Opt-in Enabled",2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3000:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};J.GetAuditLogExtendedDataStr=function(T,S){if((T==1602||T==1604)&&S[0]==0){return w(S).splice(2,2+S[1]).toString()}if(T==1603){if(S[1]==0){return w(S).splice(3).toString()}return null}if(T==1605){return["Invalid ME access","Invalid MEBx access"][S[0]]}if(T==1606){var U=["Disabled","Enabled"][S[0]];if(S[1]==0){U+=", "+S[3]}return U}if(T==1607){return"Remote "+["NoAuth","ServerAuth","MutualAuth"][S[0]]+", Local "+["NoAuth","ServerAuth","MutualAuth"][S[1]]}if(T==1617){return J.RealmNames[L(S,0)]+", "+["NoAuth","Auth","Disabled"][S[4]]}if(T==1619){return["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][S[0]]}if(T==1900){return"From "+N(S,0)+"."+N(S,2)+"."+N(S,4)+"."+N(S,6)+" to "+N(S,8)+"."+N(S,10)+"."+N(S,12)+"."+N(S,14)}if(T==2100){var V=new Date();V.setTime(L(S,0)*1000+(new Date().getTimezoneOffset()*60000));return V.toLocaleString()}if(T==3000){return"From "+["None","KVM","All"][S[0]]+" to "+["None","KVM","All"][S[1]]}if(T==3001){return["Success","Failed 3 times"][S[0]]}return null};J.GetAuditLog=function(S){J.AMT_AuditLog_ReadRecords(1,i,[S,[]])};function I(S){if(!S||S==null||typeof S=="object"){return S}return[S]}function N(T,S){return(T[S]<<8)+T[S+1]}function L(T,S){return(T[S]*16777216)+(T[S+1]<<16)+(T[S+2]<<8)+T[S+3]}function M(T,S){return(T[S+3]*16777216)+(T[S+2]<<16)+(T[S+1]<<8)+T[S]}function v(S){return Buffer.from(S).toString("base64")}function u(T){var U=null;try{U=Buffer.from(T,"base64").toString()}catch(S){console.log(S)}return U}function w(S){var U=[];for(var T in S){U.push(S[T])}return U}function i(ab,W,aa,ac,ae){if(ac!=200){ae[0](J,[],ac);return}var Y,V,S,ah,Z=ae[1],ad=new Date(),af;if(aa.Body.RecordsReturned>0){aa.Body.EventRecords=I(aa.Body.EventRecords);for(V in aa.Body.EventRecords){S=null;try{S=Buffer.from(aa.Body.EventRecords[V],"base64")}catch(T){console.log(T+" "+aa.Body.EventRecords[V])}ah={AuditAppID:N(S,0),EventID:N(S,2),InitiatorType:S[4]};ah.AuditApp=a[ah.AuditAppID];ah.Event=a[(ah.AuditAppID*100)+ah.EventID];if(!ah.Event){ah.Event="#"+ah.EventID}if(ah.InitiatorType==0){var ag=S[5];ah.Initiator=S.slice(6,6+ag).toString();Y=6+ag}if(ah.InitiatorType==1){ah.KerberosUserInDomain=L(S,5);var ag=S[9];ah.Initiator=G(S.slice(10,10+ag));Y=10+ag}if(ah.InitiatorType==2){ah.Initiator="Local";Y=5}if(ah.InitiatorType==3){ah.Initiator="KVM Default Port";Y=5}af=L(S,Y);ah.Time=new Date((af+(ad.getTimezoneOffset()*60))*1000);Y+=4;ah.MCLocationType=S[Y++];var X=S[Y++];ah.NetAddress=S.slice(Y,Y+X).toString();Y+=X;var U=S[Y++];ah.Ex=S.slice(Y,Y+U);ah.ExStr=J.GetAuditLogExtendedDataStr((ah.AuditAppID*100)+ah.EventID,ah.Ex);Z.push(ah)}}if(aa.Body.TotalRecordCount>Z.length){J.AMT_AuditLog_ReadRecords(Z.length+1,i,[ae[0],Z])}else{ae[0](J,Z,ac)}}function C(U){if(U===undefined||U===null){return null}var V="";for(var T in U){var S=U[T];if(!S){continue}if(S.__parameterType==="reference"){V+=O(T,S)}else{V+=H(T,S)}}return V}function H(V,U){if(U===undefined||U===null){return null}var T=!!U.__namespace;var Z=T?"";for(var X in U){if(!U.hasOwnProperty(X)||X.indexOf("__")===0){continue}if(typeof U[X]==="function"||Array.isArray(U[X])){continue}if(typeof U[X]==="object"){console.error("only convert one level down...")}else{Y+=Z+X+">"+U[X].toString()+S+X+">"}}Y+="";return Y}function O(T,S){if(S===undefined||S===null){return null}var U="/wsman"+S.__resourceUri+"";for(var V in S){if(!S.hasOwnProperty(V)||V.indexOf("__")===0){continue}if(typeof S[V]==="function"||typeof S[V]==="object"||Array.isArray(S[V])){continue}U+=''+S[V].toString()+""}U+="";return U}function G(U){var T="S-"+U.charCodeAt(0)+"-"+U.charCodeAt(7);for(var S=2;S<(U.length/4);S++){T+="-"+M(U,S*4)}return T}function F(V){if(!V||V==null){return null}var U=V.split("-");if(U.length<4||(U[0]!="s"&&U[0]!="S")){return null}for(var S=1;SStandardOutPath\n"+r.stdout+""):"");var i=(r.startType=="AUTO_START"?"":"");var s=" ProgramArguments\n";s+=" \n";s+=(" /usr/local/mesh_services/"+r.name+"/"+r.name+"\n");if(r.parameters){for(var p in r.parameters){s+=(" "+r.parameters[p]+"\n")}}s+=" \n";var t='\n';t+='\n';t+='\n';t+=" \n";t+=" Label\n";t+=(" "+r.name+"\n");t+=(s+"\n");t+=" WorkingDirectory\n";t+=(" /usr/local/mesh_services/"+r.name+"\n");t+=(y+"\n");t+=" RunAtLoad\n";t+=(i+"\n");t+=" \n";t+="";if(!require("fs").existsSync("/usr/local/mesh_services")){require("fs").mkdirSync("/usr/local/mesh_services")}if(!require("fs").existsSync("/Library/LaunchDaemons/"+r.name+".plist")){if(!require("fs").existsSync("/usr/local/mesh_services/"+r.name)){require("fs").mkdirSync("/usr/local/mesh_services/"+r.name)}if(r.binary){require("fs").writeFileSync("/usr/local/mesh_services/"+r.name+"/"+r.name,r.binary)}else{require("fs").copyFileSync(r.servicePath,"/usr/local/mesh_services/"+r.name+"/"+r.name)}require("fs").writeFileSync("/Library/LaunchDaemons/"+r.name+".plist",t);var q=require("fs").statSync("/usr/local/mesh_services/"+r.name+"/"+r.name).mode;q|=(require("fs").CHMOD_MODES.S_IXUSR|require("fs").CHMOD_MODES.S_IXGRP);require("fs").chmodSync("/usr/local/mesh_services/"+r.name+"/"+r.name,q)}else{throw ("Service: "+r.name+" already exists")}}};this.uninstallService=function f(i){if(!this.isAdmin()){throw ("Uninstalling a service, requires admin")}if(typeof(i)=="object"){i=i.name}if(process.platform=="win32"){var j=this.getService(i);if(j.status.state==undefined||j.status.state=="STOPPED"){if(this.proxy.DeleteService(j._service)==0){throw ("Uninstall Service for: "+i+", failed with error: "+this.proxy2.GetLastError())}else{try{require("fs").unlinkSync(this.getServiceFolder()+"\\"+i+".exe")}catch(h){}}}else{throw ("Cannot uninstall service: "+i+", because it is: "+j.status.state)}}else{if(process.platform=="linux"){switch(this.getServiceType()){case"init":this._update=require("child_process").execFile("/bin/sh",["sh"],{type:require("child_process").SpawnTypes.TERM});this._update.stdout.on("data",function(k){});this._update.stdin.write("service "+i+" stop\n");this._update.stdin.write("update-rc.d -f "+i+" remove\n");this._update.stdin.write("exit\n");this._update.waitExit();try{require("fs").unlinkSync("/etc/init.d/"+i);console.log(i+" uninstalled")}catch(h){console.log(i+" could not be uninstalled",h)}break;case"systemd":this._update=require("child_process").execFile("/bin/sh",["sh"],{type:require("child_process").SpawnTypes.TERM});this._update.stdout.on("data",function(k){});this._update.stdin.write("systemctl stop "+i+".service\n");this._update.stdin.write("systemctl disable "+i+".service\n");this._update.stdin.write("exit\n");this._update.waitExit();try{require("fs").unlinkSync("/usr/local/mesh/"+i);require("fs").unlinkSync("/lib/systemd/system/"+i+".service");console.log(i+" uninstalled")}catch(h){console.log(i+" could not be uninstalled",h)}break;default:break}}else{if(process.platform=="darwin"){if(require("fs").existsSync("/Library/LaunchDaemons/"+i+".plist")){var g=require("child_process").execFile("/bin/sh",["sh"]);g.stdout.on("data",function(k){});g.stdin.write("launchctl stop "+i+"\n");g.stdin.write("launchctl unload /Library/LaunchDaemons/"+i+".plist\n");g.stdin.write("exit\n");g.waitExit();try{require("fs").unlinkSync("/usr/local/mesh_services/"+i+"/"+i);require("fs").unlinkSync("/Library/LaunchDaemons/"+i+".plist")}catch(h){throw ("Error uninstalling service: "+i+" => "+h)}try{require("fs").rmdirSync("/usr/local/mesh_services/"+i)}catch(h){}}else{throw ("Service: "+i+" does not exist")}}}}};if(process.platform=="linux"){this.getServiceType=function c(){return(require("process-manager").getProcessInfo(1).Name)}}}module.exports=serviceManager;
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/smbios.min.js b/agents/modules_meshcmd_min/smbios.min.js
deleted file mode 100644
index 451b12c3..00000000
--- a/agents/modules_meshcmd_min/smbios.min.js
+++ /dev/null
@@ -1 +0,0 @@
-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(b,a){return(this.split(b).join(a))}})}catch(e){}var RSMB=1381190978;var memoryLocation={1:"Other",2:"Unknown",3:"System Board",4:"ISA",5:"EISA",6:"PCI",7:"MCA",8:"PCMCIA",9:"Proprietary",10:"NuBus",160:"PC-98/C20",161:"PC-98/C24",162:"PC-98/E",163:"PC-98/LB"};var wakeReason=["Reserved","Other","Unknown","APM Timer","Modem Ring","LAN","Power Switch","PCI","AC Power"];function zeroLeftPad(c,b){if((b==null)&&(typeof(b)!="number")){return null}if(c==null){c=""}var d="";for(var a=0;a1){var r=v[1].split("\x0A\x0A")[0].split("\x0A");var s=[];for(var t in r){var u=r[t].trim().replaceAll(" ","").replaceAll("\x09","");if(!(u[0]=='"')){s.push(u)}}p.write(Buffer.from(s.join(""),"hex"));p.write(Buffer.from("00","hex"))}else{p.write(Buffer.from("0000","hex"))}}var q=p.buffer;q.ms=p;return(q)}}this._parse=function b(o){var n={};var m;var l=0;var o;var s=0;while(o&&l0){var n=l[4].pop();var o=n[20]&64;var s=n[20]&7;if(o){var m={_ObjectID:"SMBiosTables.processorInfo"};m.Processor=q[n[1]];m.MaxSpeed=n.readUInt16LE(16)+" Mhz";if(n[31]){m.Cores=n[31]}if(n[33]){m.Threads=n[33]}m.Populated=1;m.Status=t[s];m.Socket=n._strings[n[0]-1];m.Manufacturer=n._strings[n[3]-1];m.Version=n._strings[n[12]-1];r.push(m)}}return(r)};this.memoryInfo=function f(k){if(!k){throw ("no data")}var n={_ObjectID:"SMBiosTables.memoryInfo"};if(k[16]){var l=k[16].peek();n.location=memoryLocation[l[0]];if((n.maxCapacityKb=l.readUInt32LE(3))==2147483648){n.maxCapacityKb="A really big number"}}return(n)};this.systemInfo=function i(k){if(!k){throw ("no data")}var l={_ObjectID:"SMBiosTables.systemInfo"};if(k[1]){var m=k[1].peek();var n=m.slice(4,20);l.uuid=[zeroLeftPad(n.readUInt32LE(0).toString(16),8),zeroLeftPad(n.readUInt16LE(4).toString(16),4),zeroLeftPad(n.readUInt16LE(6).toString(16),4),zeroLeftPad(n.readUInt16BE(8).toString(16),4),zeroLeftPad(n.slice(10).toString("hex").toLowerCase(),12)].join("-");l.wakeReason=wakeReason[m[20]]}return(l)};this.systemSlots=function j(k){if(!k){throw ("no data")}var l=[];if(k[9]){while(k[9].length>0){var m=k[9].pop();l.push({name:m._strings[m[0]-1]})}}return(l)};this.amtInfo=function c(l){if(!l){throw ("no data")}var n={AMT:false};if(l[130]&&l[130].peek().slice(0,4).toString()=="$AMT"){var k=l[130].peek();n.AMT=k[4]?true:false;if(n.AMT){n.enabled=k[5]?true:false;n.storageRedirection=k[6]?true:false;n.serialOverLan=k[7]?true:false;n.kvm=k[14]?true:false;if(l[131].peek()&&l[131].peek().slice(52,56).toString()=="vPro"){var o=l[131].peek();if(o[0]&4){n.TXT=(o[0]&8)?true:false}if(o[0]&16){n.VMX=(o[0]&32)?true:false}n.MEBX=o.readUInt16LE(10).toString()+"."+o.readUInt16LE(8).toString()+"."+o.readUInt16LE(6).toString()+"."+o.readUInt16LE(4).toString();var m=o.slice(20,32);n.ManagementEngine=m.readUInt16LE(6).toString()+"."+m.readUInt16LE(4).toString()+"."+m.readUInt16LE(2).toString()+"."+m.readUInt16LE(0).toString()}}}return(n)};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();
\ No newline at end of file
diff --git a/agents/modules_meshcmd_min/user-sessions.min.js b/agents/modules_meshcmd_min/user-sessions.min.js
deleted file mode 100644
index a059a1fc..00000000
--- a/agents/modules_meshcmd_min/user-sessions.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var NOTIFY_FOR_THIS_SESSION=0;var NOTIFY_FOR_ALL_SESSIONS=1;var WM_WTSSESSION_CHANGE=689;var WM_POWERBROADCAST=536;var PBT_POWERSETTINGCHANGE=32787;var PBT_APMSUSPEND=4;var PBT_APMRESUMESUSPEND=7;var PBT_APMRESUMEAUTOMATIC=18;var PBT_APMPOWERSTATUSCHANGE=10;var WTS_CONSOLE_CONNECT=(1);var WTS_CONSOLE_DISCONNECT=(2);var WTS_REMOTE_CONNECT=(3);var WTS_REMOTE_DISCONNECT=(4);var WTS_SESSION_LOGON=(5);var WTS_SESSION_LOGOFF=(6);var WTS_SESSION_LOCK=(7);var WTS_SESSION_UNLOCK=(8);var WTS_SESSION_REMOTE_CONTROL=(9);var WTS_SESSION_CREATE=(10);var WTS_SESSION_TERMINATE=(11);var GUID_ACDC_POWER_SOURCE;var GUID_BATTERY_PERCENTAGE_REMAINING;var GUID_CONSOLE_DISPLAY_STATE;function UserSessions(){this._ObjectID="user-sessions";require("events").EventEmitter.call(this,true).createEvent("changed").createEvent("locked").createEvent("unlocked");this.enumerateUsers=function h(){var s=require("promise");var r=new s(function(t,p){this.__resolver=t;this.__rejector=p});r.__handler=function o(p){r.__resolver(p)};try{this.Current(r.__handler)}catch(q){r.__rejector(q)}r.parent=this;return(r)};if(process.platform=="win32"){this._serviceHooked=false;this._marshal=require("_GenericMarshal");this._kernel32=this._marshal.CreateNativeProxy("Kernel32.dll");this._kernel32.CreateMethod("GetLastError");try{this._wts=this._marshal.CreateNativeProxy("Wtsapi32.dll");this._wts.CreateMethod("WTSEnumerateSessionsA");this._wts.CreateMethod("WTSQuerySessionInformationA");this._wts.CreateMethod("WTSRegisterSessionNotification");this._wts.CreateMethod("WTSUnRegisterSessionNotification");this._wts.CreateMethod("WTSFreeMemory")}catch(i){}this._advapi=this._marshal.CreateNativeProxy("Advapi32.dll");this._advapi.CreateMethod("AllocateAndInitializeSid");this._advapi.CreateMethod("CheckTokenMembership");this._advapi.CreateMethod("FreeSid");this._user32=this._marshal.CreateNativeProxy("user32.dll");this._user32.CreateMethod({method:"RegisterPowerSettingNotification",threadDispatch:1});this._user32.CreateMethod("UnregisterPowerSettingNotification");this._rpcrt=this._marshal.CreateNativeProxy("Rpcrt4.dll");this._rpcrt.CreateMethod("UuidFromStringA");this._rpcrt.StringToUUID=function n(o){var p=n.us._marshal.CreateVariable(16);if(n.us._rpcrt.UuidFromStringA(n.us._marshal.CreateVariable(o),p).Val==0){return(p)}else{throw ("Could not convert string to UUID")}};this._rpcrt.StringToUUID.us=this;GUID_ACDC_POWER_SOURCE=this._rpcrt.StringToUUID("5d3e9a59-e9D5-4b00-a6bd-ff34ff516548");GUID_BATTERY_PERCENTAGE_REMAINING=this._rpcrt.StringToUUID("a7ad8041-b45a-4cae-87a3-eecbb468a9e1");GUID_CONSOLE_DISPLAY_STATE=this._rpcrt.StringToUUID("6fe69556-704a-47a0-8f24-c28d936fda47");this.SessionStates=["Active","Connected","ConnectQuery","Shadow","Disconnected","Idle","Listening","Reset","Down","Init"];this.InfoClass={WTSInitialProgram:0,WTSApplicationName:1,WTSWorkingDirectory:2,WTSOEMId:3,WTSSessionId:4,WTSUserName:5,WTSWinStationName:6,WTSDomainName:7,WTSConnectState:8,WTSClientBuildNumber:9,WTSClientName:10,WTSClientDirectory:11,WTSClientProductId:12,WTSClientHardwareId:13,WTSClientAddress:14,WTSClientDisplay:15,WTSClientProtocolType:16,WTSIdleTime:17,WTSLogonTime:18,WTSIncomingBytes:19,WTSOutgoingBytes:20,WTSIncomingFrames:21,WTSOutgoingFrames:22,WTSClientInfo:23,WTSSessionInfo:24,WTSSessionInfoEx:25,WTSConfigInfo:26,WTSValidationInfo:27,WTSSessionAddressV4:28,WTSIsRemoteSession:29};this.isRoot=function k(){var r=this._marshal.CreateVariable(6);r.toBuffer().writeInt8(5,5);var p=this._marshal.CreatePointer();var o=false;if(this._advapi.AllocateAndInitializeSid(r,2,32,544,0,0,0,0,0,0,p).Val!=0){var q=this._marshal.CreateInteger();if(this._advapi.CheckTokenMembership(0,p.Deref(),q).Val!=0){if(q.toBuffer().readUInt32LE()!=0){o=true}}this._advapi.FreeSid(p.Deref())}return o};this.getSessionAttribute=function j(s,o){var p=this._marshal.CreatePointer();var q=this._marshal.CreateVariable(4);if(this._wts.WTSQuerySessionInformationA(0,s,o,p,q).Val==0){throw ("Error calling WTSQuerySessionInformation: "+this._kernel32.GetLastError.Val)}var r=p.Deref().String;this._wts.WTSFreeMemory(p.Deref());return(r)};this.Current=function f(o){var u={};var t=this._marshal.CreatePointer();var p=this._marshal.CreateVariable(4);if(this._wts.WTSEnumerateSessionsA(0,0,1,t,p).Val==0){throw ("Error calling WTSEnumerateSessionsA: "+this._kernel32.GetLastError().Val)}for(var q=0;q= 0) {printf \"%s:%s\\n\", $1, $3}' /etc/passwd\nexit\n");o.waitExit();var p=o.stdout.str.split("\n");var r={},s;for(var q in p){s=p[q].split(":");if(s[0]){r[s[0]]=s[1]}}return(r)};this._uids=function c(){var o=require("child_process").execFile("/bin/sh",["sh"]);o.stdout.str="";o.stdout.on("data",function(t){this.str+=t.toString()});o.stdin.write("awk -F: '($3 >= 0) {printf \"%s:%s\\n\", $1, $3}' /etc/passwd\nexit\n");o.waitExit();var p=o.stdout.str.split("\n");var r={},s;for(var q in p){s=p[q].split(":");if(s[0]){r[s[1]]=s[0]}}return(r)};this.Self=function m(){var q=require("promise");var o=new q(function(r,p){this.__resolver=r;this.__rejector=p;this.__child=require("child_process").execFile("/usr/bin/id",["id","-u"]);this.__child.promise=this;this.__child.stdout._txt="";this.__child.stdout.on("data",function(s){this._txt+=s.toString()});this.__child.on("exit",function(s){try{parseInt(this.stdout._txt)}catch(t){this.promise.__rejector("invalid uid");return}var u=parseInt(this.stdout._txt);this.promise.__resolver(u)})});return(o)};this.Current=function f(o){var p={};p._ObjectID="UserSession";Object.defineProperty(p,"_callback",{value:o});Object.defineProperty(p,"_child",{value:require("child_process").execFile("/usr/bin/last",["last","-f","/var/run/utmp"])});p._child.Parent=p;p._child._txt="";p._child.on("exit",function(q){var u=this._txt.split("\n");var A=[];var D={};for(var t in u){if(u[t]){var B=getTokens(u[t]);var z={Username:B[0],SessionId:B[1]};if(B[3].includes("still logged in")){z.State="Active"}else{z.LastActive=B[3]}A.push(z)}}A.pop();var C={};var y=[];for(var t in A){if(A[t].Username!="reboot"){D[A[t].SessionId]=A[t];if(C[A[t].Username]==null){C[A[t].Username]=-1}}}try{require("promise")}catch(r){Object.defineProperty(D,"Active",{value:showActiveOnly(D)});if(this.Parent._callback){this.Parent._callback.call(this.Parent,D)}return}var x=require("promise");for(var v in C){var w=new x(function(E,s){this.__username=v;this.__resolver=E;this.__rejector=s;this.__child=require("child_process").execFile("/usr/bin/id",["id","-u",v]);this.__child.promise=this;this.__child.stdout._txt="";this.__child.stdout.on("data",function(F){this._txt+=F.toString()});this.__child.on("exit",function(F){try{parseInt(this.stdout._txt)}catch(G){this.promise.__rejector("invalid uid");return}var H=parseInt(this.stdout._txt);this.promise.__resolver(H)})});y.push(w)}x.all(y).then(function(E){var F={};for(var s in E){F[E[s].__username]=E[s]._internal.completedArgs[0]}for(var s in D){D[s].uid=F[D[s].Username]}Object.defineProperty(D,"Active",{value:showActiveOnly(D)});if(p._callback){p._callback.call(p,D)}},function(s){Object.defineProperty(D,"Active",{value:showActiveOnly(D)});if(p._callback){p._callback.call(p,D)}})});p._child.stdout.Parent=p._child;p._child.stdout.on("data",function(q){this.Parent._txt+=q.toString()});return(p)};this._recheckLoggedInUsers=function a(){this.enumerateUsers().then(function(o){if(o.Active.length>0){if(this.parent._linux_lock_watcher!=null&&this.parent._linux_lock_watcher.uid!=o.Active[0].uid){delete this.parent._linux_lock_watcher}this.parent._linux_lock_watcher=new g(process.env.XDG_CURRENT_DESKTOP=="Unity"?"com.ubuntu.Upstart0_6":"org.gnome.ScreenSaver",o.Active[0].uid);this.parent._linux_lock_watcher.user_session=this.parent;this.parent._linux_lock_watcher.on("signal",function(r){var q=this.user_session.enumerateUsers();q.signalData=r.data[0];q.then(function(p){switch(this.signalData){case true:case"desktop-lock":this.parent.emit("locked",p.Active[0]);break;case false:case"desktop-unlock":this.parent.emit("unlocked",p.Active[0]);break}})})}else{if(this.parent._linux_lock_watcher!=null){delete this.parent._linux_lock_watcher}}})};this.on("changed",this._recheckLoggedInUsers);this._recheckLoggedInUsers()}else{if(process.platform=="darwin"){this._users=function(){var o=require("child_process").execFile("/usr/bin/dscl",["dscl",".","list","/Users","UniqueID"]);o.stdout.str="";o.stdout.on("data",function(t){this.str+=t.toString()});o.stdin.write("exit\n");o.waitExit();var q=o.stdout.str.split("\n");var r,p;var s={};for(p=0;p0;++r){if(!u[s[r].split(" ")[0]]){try{u[s[r].split(" ")[0]]={Username:s[r].split(" ")[0],State:s[r].split("still logged in").length>1?"Active":"Inactive",uid:t.uid[s[r].split(" ")[0]]}}catch(q){}}else{if(u[s[r].split(" ")[0]].State!="Active"&&s[r].split("still logged in").length>1){u[s[r].split(" ")[0]].State="Active"}}}Object.defineProperty(u,"Active",{value:showActiveOnly(u)});if(o){o.call(this,u)}}}}}if(process.platform=="linux"||process.platform=="darwin"){this._self=function b(){var o=require("child_process").execFile("/usr/bin/id",["id","-u"]);o.stdout.str="";o.stdout.on("data",function(p){this.str+=p.toString()});o.waitExit();return(parseInt(o.stdout.str))};this.isRoot=function k(){return(this._self()==0)};this.consoleUid=function e(){var o=process.platform=="darwin"?"console":((process.env.DISPLAY)?process.env.DISPLAY:":0");var p=require("child_process").execFile("/bin/sh",["sh"]);p.stdout.str="";p.stdout.on("data",function(u){this.str+=u.toString()});p.stdin.write("who\nexit\n");p.waitExit();var s=p.stdout.str.split("\n");var t,q,r;for(q in s){t=s[q].split(" ");for(r=1;r0){return(parseInt(this._users()[t[0]]))}}}throw ("nobody logged into console")}}}function showActiveOnly(c){var b=[];var e={};var f=[];var d;for(var a in c){if(c[a].State=="Active"){b.push(c[a]);d=(c[a].Domain?(c[a].Domain+"\\"):"")+c[a].Username;if(!e[d]){e[d]=d}}}for(var a in e){f.push(a)}Object.defineProperty(b,"usernames",{value:f});return(b)}function getTokens(d){var a=[];var b;a.push(d.substring(0,(b=d.indexOf(" "))));while(d[++b]==" "){}a.push(d.substring(b,(b=d.substring(b).indexOf(" ")+b)));while(d[++b]==" "){}a.push(d.substring(b,(b=d.substring(b).indexOf(" ")+b)));while(d[++b]==" "){}var c=d.substring(b).trim();a.push(c);return(a)}module.exports=new UserSessions();
\ No newline at end of file
diff --git a/agents/modules_meshcore/amt-manage.js b/agents/modules_meshcore/amt-manage.js
index 16c503a3..60096c71 100644
--- a/agents/modules_meshcore/amt-manage.js
+++ b/agents/modules_meshcore/amt-manage.js
@@ -34,6 +34,7 @@ function AmtManager(agent, db, isdebug) {
var osamtstack = null;
var amtpolicy = null;
var obj = this;
+ var mestate;
obj.state = 0;
obj.lmsstate = 0;
obj.onStateChange = null;
@@ -92,7 +93,7 @@ function AmtManager(agent, db, isdebug) {
amtMei.getLanInterfaceSettings(0, function (result) { if (result) { amtMeiTmpState.net0 = result; } });
amtMei.getLanInterfaceSettings(1, function (result) { if (result) { amtMeiTmpState.net1 = result; } });
amtMei.getUuid(function (result) { if ((result != null) && (result.uuid != null)) { amtMeiTmpState.UUID = result.uuid; } });
- amtMei.getDnsSuffix(function (result) { if (result != null) { amtMeiTmpState.dns = result; } if (func != null) { func(amtMeiTmpState); } });
+ amtMei.getDnsSuffix(function (result) { if (result != null) { amtMeiTmpState.DNS = result; } if (func != null) { func(amtMeiTmpState); } });
} catch (e) { if (func != null) { func(null); } return; }
}
@@ -167,7 +168,7 @@ function AmtManager(agent, db, isdebug) {
var amtver = null;
try { for (var i in amtGetVersionResult.Versions) { if (amtGetVersionResult.Versions[i].Description == 'AMT') amtver = parseInt(amtGetVersionResult.Versions[i].Version.split('.')[0]); } } catch (e) { }
if ((amtver != null) && (amtver >= 12)) {
- debug('KVM data channel setup');
+ //debug('KVM data channel setup');
kvmGetData('skip'); // Clear any previous data, this is a dummy read to about handling old data.
obj.kvmTempTimer = setInterval(function () { kvmGetData(); }, 2000); // Start polling for KVM data.
kvmSetData(JSON.stringify({ action: 'restart', ver: 1 })); // Send a restart command to advise the console if present that MicroLMS just started.
@@ -431,6 +432,60 @@ function AmtManager(agent, db, isdebug) {
});
}
+ //
+ // Activate Intel AMT to ACM
+ //
+
+ obj.activeToACM = function (mestate) {
+ //debug('ProvisioningState: ' + JSON.stringify(mestate.ProvisioningState));
+ if (mestate.ProvisioningState != 0) return; // Can't activate unless in "PRE" activation mode.
+ var trustedFqdn = null;
+ //debug('Wired Interface: ' + JSON.stringify(mestate.net0));
+ if ((mestate.net0 == null) && (mestate.net0.enabled != 0)) return; // Can't activate unless wired interface is active
+ if (mestate.DNS) { trustedFqdn = mestate.DNS; } // If Intel AMT has a trusted DNS suffix set, use that one.
+ else {
+ // Look for the DNS suffix for the Intel AMT Ethernet interface
+ var interfaces = require('os').networkInterfaces();
+ for (var i in interfaces) {
+ for (var j in interfaces[i]) {
+ if ((interfaces[i][j].mac == mestate.net0.mac) && (interfaces[i][j].fqdn != null) && (interfaces[i][j].fqdn != '')) { trustedFqdn = interfaces[i][j].fqdn; }
+ }
+ }
+ }
+ if (trustedFqdn == null) return; // No trusted DNS suffix.
+ //debug('TrustedFqdn: ' + trustedFqdn);
+
+ // Fetch Intel AMT realm and activation nonce and get ready to ACM activation...
+ if (osamtstack != null) {
+ //debug('Trying to get Intel AMT activation information...');
+ osamtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], activeToACM2, trustedFqdn);
+ } else {
+ //debug('ACM Activation: Trying to get local account info...');
+ amtMei.getLocalSystemAccount(function (x) {
+ if ((x != null) && x.user && x.pass) {
+ //debug('Intel AMT local account info: User=' + x.user + ', Pass=' + x.pass + '.');
+ var transport = require('amt-wsman-duk');
+ var wsman = require('amt-wsman');
+ var amt = require('amt');
+ oswsstack = new wsman(transport, '127.0.0.1', 16992, x.user, x.pass, false);
+ osamtstack = new amt(oswsstack);
+ //debug('Trying to get Intel AMT activation information...');
+ osamtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], activeToACM2, trustedFqdn);
+ } else {
+ //debug('Unable to get $$OsAdmin password.');
+ }
+ });
+ }
+ }
+
+ function activeToACM2(stack, name, responses, status, trustedFqdn) {
+ debug('activeToACM2: ' + trustedFqdn);
+ if (status != 200) return;
+ var fwNonce = responses['IPS_HostBasedSetupService'].response['ConfigurationNonce'];
+ var digestRealm = responses['AMT_GeneralSettings'].response['DigestRealm'];
+ agent.SendCommand({ "action": "acmactivate", "nonce": fwNonce, "realm": digestRealm, "fqdn": trustedFqdn });
+ }
+
//
// Activate Intel AMT to CCM
//
@@ -444,21 +499,25 @@ function AmtManager(agent, db, isdebug) {
obj.activeToCCM = function (adminpass) {
if ((adminpass == null) || (adminpass == '')) { adminpass = 'P@0s' + makePass(23); }
intelAmtAdminPass = adminpass;
- //debug('Trying to get local account info...');
- amtMei.getLocalSystemAccount(function (x) {
- if ((x != null) && x.user && x.pass) {
- //debug('Intel AMT local account info: User=' + x.user + ', Pass=' + x.pass + '.');
- var transport = require('amt-wsman-duk');
- var wsman = require('amt-wsman');
- var amt = require('amt');
- oswsstack = new wsman(transport, '127.0.0.1', 16992, x.user, x.pass, false);
- osamtstack = new amt(oswsstack);
- //debug('Trying to get Intel AMT activation information...');
- osamtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], activeToCCMEx2, adminpass);
- } else {
- debug('Unable to get $$OsAdmin password.');
- }
- });
+ if (osamtstack != null) {
+ osamtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], activeToCCMEx2, adminpass);
+ } else {
+ //debug('Trying to get local account info...');
+ amtMei.getLocalSystemAccount(function (x) {
+ if ((x != null) && x.user && x.pass) {
+ //debug('Intel AMT local account info: User=' + x.user + ', Pass=' + x.pass + '.');
+ var transport = require('amt-wsman-duk');
+ var wsman = require('amt-wsman');
+ var amt = require('amt');
+ oswsstack = new wsman(transport, '127.0.0.1', 16992, x.user, x.pass, false);
+ osamtstack = new amt(oswsstack);
+ //debug('Trying to get Intel AMT activation information...');
+ osamtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], activeToCCMEx2, adminpass);
+ } else {
+ //debug('Unable to get $$OsAdmin password.');
+ }
+ });
+ }
}
var activeToCCMEx2 = function(stack, name, responses, status, adminpass) {
@@ -518,13 +577,7 @@ function AmtManager(agent, db, isdebug) {
try { amtstack.BatchEnum(null, wsmanQuery, wsmanPassTestResponse); } catch (ex) { debug(ex); }
} else if ((amtpolicy.type == 3) && (meinfo.ProvisioningState == 0)) {
// ACM Activation Policy
- // TODO: Check that we have wired ethernet enabled and that the DNS domain suffix matches a server certificate...
-
- // TODO: Check that a trusted hash matches the server cert root hash...
-
- // TODO: Fetch Intel AMT Realm and Nonce and get ready to ACM activation...
-
- //console.log(meinfo);
+ obj.activeToACM(meinfo);
} else {
// Other possible cases...
}
diff --git a/agents/modules_meshcore/toaster.js b/agents/modules_meshcore/toaster.js
deleted file mode 100644
index 4053ad4c..00000000
--- a/agents/modules_meshcore/toaster.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-Copyright 2018-2019 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.
-*/
-
-var toasters = {};
-
-function Toaster()
-{
- this._ObjectID = 'toaster';
- this.Toast = function Toast(title, caption)
- {
- var retVal = {};
- var emitter = require('events').inherits(retVal);
- emitter.createEvent('Dismissed');
-
- retVal.title = title;
- retVal.caption = caption;
-
- if (process.platform == 'win32')
- {
- emitter.createEvent('Clicked');
-
- var session = require('user-sessions').Current();
- for (var i in session) {
- console.log(session[i]);
- }
- try {
- console.log('Attempting Toast Mechanism 1');
- retVal._child = require('ScriptContainer').Create({ processIsolation: true, sessionId: session.Active[0].SessionId });
- }
- catch (e) {
- console.log(e);
- console.log('Attempting Toast Mechanism 2');
- retVal._child = require('ScriptContainer').Create({ processIsolation: true });
- }
- retVal._child.parent = retVal;
-
- retVal._child.on('exit', function (code) { this.parent.emit('Dismissed'); delete this.parent._child; });
- retVal._child.addModule('win-console', getJSModule('win-console'));
- retVal._child.addModule('win-message-pump', getJSModule('win-message-pump'));
-
- var str = "\
- try{\
- var toast = require('win-console');\
- var balloon = toast.SetTrayIcon({ szInfo: '" + caption + "', szInfoTitle: '" + title + "', balloonOnly: true });\
- balloon.on('ToastDismissed', function(){process.exit();});\
- }\
- catch(e)\
- {\
- require('ScriptContainer').send(e);\
- }\
- require('ScriptContainer').send('done');\
- ";
- retVal._child.ExecuteString(str);
- toasters[retVal._hashCode()] = retVal;
- retVal.on('Dismissed', function () { delete toasters[this._hashCode()]; });
- console.log('Returning');
- return (retVal);
- }
- else
- {
- if(!require('fs').existsSync('/usr/bin/notify-send'))
- {
- throw ('Toast not supported on this platform');
- }
- Object.defineProperty(retVal, '_sessions', {
- value: require('user-sessions').Current(function onCurrentSession(sessions)
- {
- this._cchild = require('child_process').execFile('/usr/bin/whoami', ['whoami'], { type: require('child_process').SpawnTypes.TERM });
- this._cchild.stdout.on('data', function (chunk)
- {
- if (chunk.toString().split('\r\n')[0] == 'root')
- {
- if (sessions[':0'].State != 'Connected' && sessions[':0'].State != 'Active')
- {
- // No logged in user owns the display
- this.parent.parent.Parent.emit('Dismissed');
- return;
- }
-
- // We root, so we need to direct to DISPLAY=:0
- this.parent.parent._notify = require('child_process').execFile('/bin/sh', ['sh'], { type: require('child_process').SpawnTypes.TERM });
- this.parent.parent._notify.stdin.write('su - ' + sessions[':0'].Username + ' -c "DISPLAY=:0 notify-send \'' + this.parent.parent.Parent.title + '\' \'' + this.parent.parent.Parent.caption + '\'"\n');
- this.parent.parent._notify.stdin.write('exit\n');
- this.parent.parent._notify.stdout.on('data', function (chunk) { });
- }
- else
- {
- // We ain't root, so that means we can just call send-notify directly
- this.parent.parent._notify = require('child_process').execFile('/usr/bin/notify-send', ['notify-send', this.parent.parent.Parent.title, this.parent.parent.Parent.caption], { type: require('child_process').SpawnTypes.TERM });
- this.parent.parent._notify.stdout.on('data', function (chunk) { });
- }
-
- // NOTIFY-SEND has a bug where timeouts don't work, so the default is 10 seconds
- this.parent.parent.Parent._timeout = setTimeout(function onFakeDismissed(obj)
- {
- obj.emit('Dismissed');
- }, 10000, this.parent.parent.Parent);
- });
- this._cchild.parent = this;
- })
- });
- retVal._sessions.Parent = retVal;
-
- toasters[retVal._hashCode()] = retVal;
- retVal.on('Dismissed', function () { delete toasters[this._hashCode()]; });
-
- return (retVal);
- }
- };
-}
-
-module.exports = new Toaster();
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/amt-lme.min.js b/agents/modules_meshcore_min/amt-lme.min.js
deleted file mode 100644
index 6e19dfe3..00000000
--- a/agents/modules_meshcore_min/amt-lme.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var MemoryStream=require("MemoryStream");var lme_id=0;var lme_port_offset=0;var xmlParser=require("amt-xml");var APF_DISCONNECT=1;var APF_SERVICE_REQUEST=5;var APF_SERVICE_ACCEPT=6;var APF_USERAUTH_REQUEST=50;var APF_USERAUTH_FAILURE=51;var APF_USERAUTH_SUCCESS=52;var APF_GLOBAL_REQUEST=80;var APF_REQUEST_SUCCESS=81;var APF_REQUEST_FAILURE=82;var APF_CHANNEL_OPEN=90;var APF_CHANNEL_OPEN_CONFIRMATION=91;var APF_CHANNEL_OPEN_FAILURE=92;var APF_CHANNEL_WINDOW_ADJUST=93;var APF_CHANNEL_DATA=94;var APF_CHANNEL_CLOSE=97;var APF_PROTOCOLVERSION=192;function lme_object(){this.ourId=++lme_id;this.amtId=-1;this.LME_CHANNEL_STATUS="LME_CS_FREE";this.txWindow=0;this.rxWindow=0;this.localPort=0;this.errorCount=0}function stream_bufferedWrite(){var a=require("events").inherits(this);this.buffer=[];this._readCheckImmediate=undefined;this._ObjectID="bufferedWriteStream";a.createEvent("close");a.createEvent("drain");a.createEvent("error");a.createEvent("finish");a.createEvent("pipe");a.createEvent("unpipe");a.createEvent("readable");this.isEmpty=function(){return(this.buffer.length==0)};this.isWaiting=function(){return(this._readCheckImmediate==undefined)};this.write=function(c){for(var b in arguments){if(typeof(arguments[b])=="function"){this.once("drain",arguments[b]);break}}var d=Buffer.alloc(c.length);c.copy(d);this.buffer.push({offset:0,data:d});this.emit("readable");return(this.buffer.length==0?true:false)};this.read=function(){var f=arguments.length==0?undefined:arguments[0];var b=0;var d=[];while((f==undefined||b0){var c=this.buffer[0].data.length-this.buffer[0].offset;var e=this.buffer[0].offset;if(c>(f-b)){d.push(this.buffer[0].data.slice(e,e+f-b));this.buffer[0].offset+=(f-b);b+=(f-b)}else{d.push(this.buffer[0].data.slice(e));b+=c;this.buffer.shift()}}this._readCheckImmediate=setImmediate(function(g){g._readCheckImmediate=undefined;if(g.buffer.length==0){g.emit("drain")}else{g.emit("readable")}},this);return(Buffer.concat(d))}}function lme_heci(c){var a=require("events").inherits(this);a.createEvent("error");a.createEvent("connect");a.createEvent("notify");a.createEvent("bind");if((c!=null)&&(c.debug==true)){lme_port_offset=-100}var b=require("heci");this.INITIAL_RXWINDOW_SIZE=4096;this._ObjectID="lme";this._LME=b.create();this._LME._binded={};this._LME.LMS=this;this._LME.on("error",function(d){this.LMS.emit("error",d)});this._LME.on("connect",function(){this.on("data",function(k){var l=k.readUInt8(0);switch(l){default:console.log("Unhandled LME Command "+l+", "+k.length+" byte(s).");break;case APF_SERVICE_REQUEST:var A=k.readUInt32BE(1);var z=k.slice(5,A+5);if(z=="pfwd@amt.intel.com"||z=="auth@amt.intel.com"){var G=Buffer.alloc(5+A);G.writeUInt8(6,0);G.writeUInt32BE(A,1);G.write(z.toString(),5);this.write(G)}else{}break;case APF_GLOBAL_REQUEST:var A=k.readUInt32BE(1);var z=k.slice(5,A+5).toString();switch(z){case"tcpip-forward":var w=k.readUInt32BE(A+6);var H=k.readUInt32BE(A+10+w);if(this[z]==undefined){this[z]={}}if(this[z][H]!=null){for(var t in this.sockets){var h=this.sockets[t];if(h.localPort==H){this.sockets[t].end();delete this.sockets[t]}}}if(this[z][H]==null){this[z][H]=require("net").createServer();this[z][H].HECI=this;try{if(lme_port_offset==0){this[z][H].listen({port:H,host:"127.0.0.1"})}else{this[z][H].listen({port:(H+lme_port_offset)})}}catch(p){console.log("Binding error, LMS port "+(H+lme_port_offset)+": "+p)}this[z][H].on("connection",function(e){this.HECI.LMS.bindDuplexStream(e,e.remoteFamily,e.localPort-lme_port_offset)});this._binded[H]=true;this.LMS.emit("bind",this._binded)}var G=Buffer.alloc(5);G.writeUInt8(81,0);G.writeUInt32BE(H,1);this.write(G);break;case"cancel-tcpip-forward":var G=Buffer.alloc(1);G.writeUInt8(APF_REQUEST_SUCCESS,0);this.write(G);break;case"udp-send-to@amt.intel.com":var G=Buffer.alloc(1);G.writeUInt8(APF_REQUEST_FAILURE,0);this.write(G);break;default:break}break;case APF_CHANNEL_OPEN_CONFIRMATION:var J=k.readUInt32BE(1);var N=k.readUInt32BE(5);var O=k.readUInt32BE(9);if(this.sockets[J]!=undefined){this.sockets[J].lme.amtId=N;this.sockets[J].lme.rxWindow=O;this.sockets[J].lme.txWindow=O;this.sockets[J].lme.LME_CHANNEL_STATUS="LME_CS_CONNECTED";this.sockets[J].bufferedStream=new stream_bufferedWrite();this.sockets[J].bufferedStream.socket=this.sockets[J];this.sockets[J].bufferedStream.on("readable",function(){if(this.socket.lme.txWindow>0){var e=this.read(this.socket.lme.txWindow);var i=Buffer.alloc(9+e.length);i.writeUInt8(APF_CHANNEL_DATA,0);i.writeUInt32BE(this.socket.lme.amtId,1);i.writeUInt32BE(e.length,5);e.copy(i,9);this.socket.lme.txWindow-=e.length;this.socket.HECI.write(i)}});this.sockets[J].bufferedStream.on("drain",function(){this.socket.resume()});this.sockets[J].on("data",function(e){if(!this.bufferedStream.write(e)){this.pause()}});this.sockets[J].on("end",function(){var e=Buffer.alloc(5);e.writeUInt8(APF_CHANNEL_CLOSE,0);e.writeUInt32BE(this.lme.amtId,1);this.HECI.write(e)});this.sockets[J].resume()}break;case APF_PROTOCOLVERSION:var x=k.readUInt32BE(1);var y=k.readUInt32BE(5);var L=k.readUInt32BE(9);var G=Buffer.alloc(93);G.writeUInt8(192,0);G.writeUInt32BE(1,1);G.writeUInt32BE(0,5);G.writeUInt32BE(L,9);this.write(G);break;case APF_CHANNEL_WINDOW_ADJUST:var K=k.readUInt32BE(1);var g=k.readUInt32BE(5);if(this.sockets[K]!=undefined){this.sockets[K].lme.txWindow+=g;if(!this.sockets[K].bufferedStream.isEmpty()&&this.sockets[K].bufferedStream.isWaiting()){this.sockets[K].bufferedStream.emit("readable")}}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_WINDOW_ADJUST")}break;case APF_CHANNEL_DATA:var K=k.readUInt32BE(1);var n=k.readUInt32BE(5);var m=k.slice(9,9+n);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].pendingBytes.push(m.length);this.sockets[K].write(m,function(){var i=this.pendingBytes.shift();var e=Buffer.alloc(9);e.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);e.writeUInt32BE(this.lme.amtId,1);e.writeUInt32BE(i,5);this.HECI.write(e)})}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){var h=this.insockets[K];if(h.data==null){h.data=m.toString()}else{h.data+=m.toString()}h.rxWindow+=n;var s=parseHttp(h.data);if((s!=null)||(h.data.length>=8000)){var B=null;try{B=xmlParser.ParseWsman(s)}catch(o){}if(B!=null){this.LMS.emit("notify",B,h.options,_lmsNotifyToString(B),_lmsNotifyToCode(B))}var f=Buffer.alloc(5);f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if(h.rxWindow>6000){var f=Buffer.alloc(9);f.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);f.writeUInt32BE(h.amtId,1);f.writeUInt32BE(h.rxWindow,5);this.write(f);h.rxWindow=0}}}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_DATA")}}break;case APF_CHANNEL_OPEN_FAILURE:var K=k.readUInt32BE(1);var M=k.readUInt32BE(5);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].end();delete this.sockets[K]}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){delete this.insockets[K]}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_OPEN_FAILURE")}}break;case APF_CHANNEL_CLOSE:var K=k.readUInt32BE(1);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].end();var d=this.sockets[K].lme.amtId;var f=Buffer.alloc(5);delete this.sockets[K];f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){delete this.insockets[K]}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_CLOSE")}}break;case APF_CHANNEL_OPEN:var A=k.readUInt32BE(1);var z=k.slice(5,A+5).toString();var j=k.readUInt32BE(A+5);var u=k.readUInt32BE(A+9);var r=k.readUInt32BE(A+17);var q=k.slice(A+21,A+21+r).toString();var I=k.readUInt32BE(A+21+r);var D=k.readUInt32BE(A+25+r);var C=k.slice(A+29+r,A+29+r+D).toString();var E=k.readUInt32BE(A+29+r+D);if(this.insockets==null){this.insockets={}}var F=++lme_id;var v=new lme_object();v.ourId=F;v.amtId=j;v.txWindow=u;v.rxWindow=0;v.options={target:q,targetPort:I,source:C,sourcePort:E};this.insockets[F]=v;var f=Buffer.alloc(17);f.writeUInt8(APF_CHANNEL_OPEN_CONFIRMATION,0);f.writeUInt32BE(j,1);f.writeUInt32BE(F,5);f.writeUInt32BE(4000,9);f.writeUInt32BE(4294967295,13);this.write(f);break}});this.LMS.emit("connect");this.resume()});this.bindDuplexStream=function(e,h,g){var j=e;j.pendingBytes=[];j.HECI=this._LME;j.LMS=this;j.lme=new lme_object();j.lme.Socket=j;j.localPort=g;var d=new MemoryStream();d.writeUInt8(90);d.writeUInt32BE(15);d.write("forwarded-tcpip");d.writeUInt32BE(j.lme.ourId);d.writeUInt32BE(this.INITIAL_RXWINDOW_SIZE);d.writeUInt32BE(4294967295);for(var f=0;f<2;++f){if(h=="IPv6"){d.writeUInt32BE(3);d.write("::1")}else{d.writeUInt32BE(9);d.write("127.0.0.1")}d.writeUInt32BE(g)}this._LME.write(d.buffer);if(this._LME.sockets==undefined){this._LME.sockets={}}this._LME.sockets[j.lme.ourId]=j;j.pause()};this._LME.connect(b.GUIDS.LME,{noPipeline:0})}function parseHttp(c){var d=c.indexOf("\r\n\r\n");if((d==-1)||(c.length<(d+2))){return null}var b=require("http-headers")(c.substring(0,d),true);var a=parseInt(b["content-length"]);if(c.length>=a+d+4){return c.substring(d+4,d+4+a)}return null}function _lmsNotifyToCode(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}return b}function _lmsNotifyToString(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}if(lmsEvents[b]){return lmsEvents[b]}return null}var lmsEvents={iAMT0001:"System Defense Policy %1s triggered.",iAMT0002:"Agent Presence Agent %1s not started.",iAMT0003:"Agent Presence Agent %1s stopped.",iAMT0004:"Agent Presence Agent %1s running.",iAMT0005:"Agent Presence Agent %1s expired.",iAMT0006:"Agent Presence Agent %1s suspended.",iAMT0007:"Host software attempt to disable AMT Network link detected.",iAMT0008:"Host software attempt to disable AMT Network link detected -- Host Network link blocked.",iAMT0009:"AMT clock or FLASH wear-out protection disabled.",iAMT0010:"Intel(R) AMT Network Interface %1s heuristics defense slow threshold trespassed.",iAMT0011:"Intel(R) AMT Network Interface %1s heuristics defense fast threshold trespassed.",iAMT0012:"Intel(R) AMT Network Interface %1s heuristics defense factory defined threshold trespassed.",iAMT0013:"Intel(R) AMT Network Interface %1s heuristics defense Encounter timeout expired.",iAMT0014:"General certificate error.",iAMT0015:"Certificate expired.",iAMT0016:"No trusted root certificate.",iAMT0017:"Not configured to work with server certificate.",iAMT0018:"Certificate revoked.",iAMT0019:"RSA exponent too large.",iAMT0020:"RSA modulus too large.",iAMT0021:"Unsupported digest.",iAMT0022:"Distinguished name too long.",iAMT0023:"Key usage missing.",iAMT0024:"General SSL handshake error.",iAMT0025:"General 802.1x error.",iAMT0026:"AMT Diagnostic AlertEAC error - General NAC error.",iAMT0027:"AMT Diagnostic AlertEAC error - attempt to get a NAC posture while AMT NAC is disabled.",iAMT0028:"AMT Diagnostic AlertEAC error - attempt to get a posture of an unsupported type.",iAMT0029:"Audit log storage is 50% full.",iAMT0030:"Audit log storage is 75% full.",iAMT0031:"Audit log storage is 85% full.",iAMT0032:"Audit log storage is 95% full.",iAMT0033:"Audit log storage is full.",iAMT0034:"Firmware Update Event - Partial.",iAMT0035:"Firmware Update Event - Failure.",iAMT0036:"Remote connectivity initiated.",iAMT0037:"ME Presence event.","iAMT0038-0":"AMT is being unprovisioned using BIOS command.","iAMT0038-1":"AMT is being unprovisioned using Local MEI command.","iAMT0038-2":"AMT is being unprovisioned using Local WS-MAN/SOAP command.","iAMT0038-3":"AMT is being unprovisioned using Remote WS-MAN/SOAP command.",iAMT0039:"HW Asset Error.",iAMT0050:"User Notification Alert - General Notification.","iAMT0050-16":"User Notification Alert - Circuit Breaker notification (CB Drop TX filter hit.).","iAMT0050-17":"User Notification Alert - Circuit Breaker notification (CB Rate Limit TX filter hit.).","iAMT0050-18":"User Notification Alert - Circuit Breaker notification (CB Drop RX filter hit.).","iAMT0050-19":"User Notification Alert - Circuit Breaker notification (CB Rate Limit RX filter hit.).","iAMT0050-32":"User Notification Alert - EAC notification.","iAMT0050-48":"User Notification Alert - Remote diagnostics - (Remote Redirection session started - SOL).","iAMT0050-49":"User Notification Alert - Remote diagnostics - (Remote Redirection session stopped - SOL).","iAMT0050-50":"User Notification Alert - Remote diagnostics. (Remote Redirection session started - IDE-R).","iAMT0050-51":"User Notification Alert - Remote diagnostics. (Remote Redirection session stopped - IDE-R).","iAMT0050-66":"User Notification Alert - WLAN notification (Host profile mismatch - Management Interface ignored).","iAMT0050-67":"User Notification Alert - WLAN notification (Management device overrides host radio).","iAMT0050-68":"User Notification Alert - WLAN notification (Host profile security mismatch).","iAMT0050-69":"User Notification Alert - WLAN notification (Management device relinquishes control over host Radio).",iAMT0051:"User Notification Alert - SecIo event.","iAMT0051-0":"User Notification Alert - SecIo event semaphore at host.","iAMT0051-1":"User Notification Alert - semaphore at ME.","iAMT0051-2":"User Notification Alert - SecIo event - semaphore timeout.",iAMT0052:"User Notification Alert - KVM session event.","iAMT0052-0":"User Notification Alert - KVM session requested.","iAMT0052-1":"User Notification Alert - KVM session started.","iAMT0052-2":"User Notification Alert - KVM session stopped.","iAMT0052-3":"User Notification Alert - KVM data channel.",iAMT0053:"User Notification Alert - RCS notification.","iAMT0053-50":"User Notification Alert - RCS notification (HW button pressed. Connection initiated automatically).","iAMT0053-52":"User Notification Alert - RCS notification (HW button pressed. Connection wasn't initiated automatically).","iAMT0053-53":"User Notification Alert - RCS notification (Contracts updated).",iAMT0054:"User Notification Alert - WLAN notification. Wireless Profile sync enablement state changed.",iAMT0055:"User Notification Alert - Provisioning state change notification.","iAMT0055-0":"User Notification Alert - Provisioning state change notification - Pre-configuration.","iAMT0055-1":"User Notification Alert - Provisioning state change notification - In configuration.","iAMT0055-2":"User Notification Alert - Provisioning state change notification - Post-configuration.","iAMT0055-3":"User Notification Alert - Provisioning state change notification - Unprovision process has started.",iAMT0056:"User Notification Alert - System Defense change notification.",iAMT0057:"User Notification Alert - Network State change notification.",iAMT0058:"User Notification Alert - Remote Access change notification.","iAMT0058-1":"User Notification Alert - Remote Access change notification - tunnel is closed.",iAMT0059:"User Notification Alert - KVM enabled event.","iAMT0059-0":"User Notification Alert - KVM enabled event - KVM disabled.","iAMT0059-1":"User Notification Alert - KVM enabled event - KVM enabled (both from MEBx and PTNI).",iAMT0060:"User Notification Alert - SecIO configuration event.",iAMT0061:"ME FW reset occurred.",iAMT0062:"User Notification Alert - IpSyncEnabled event.","iAMT0062-0":"User Notification Alert - IpSyncEnabled event - IpSync disabled.","iAMT0062-1":"User Notification Alert - IpSyncEnabled event - IpSync enabled.",iAMT0063:"User Notification Alert - HTTP Proxy sync enabled event.","iAMT0063-0":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync disabled.","iAMT0063-1":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync enabled.",iAMT0064:"User Notification Alert - User Consent event.","iAMT0064-1":"User Notification Alert - User Consent event - User Consent granted.","iAMT0064-2":"User Notification Alert - User Consent event - User Consent ended.","iAMT0067-0":"Graceful Remote Control Operation - Shutdown.","iAMT0067-1":"Graceful Remote Control Operation - Reset.","iAMT0067-2":"Graceful Remote Control Operation - Hibernate.","iAMT0068-0":"Link Protection Notification - No link protection.","iAMT0068-1":"Link Protection Notification - Passive link protection.","iAMT0068-2":"Link Protection Notification - High link protection.","iAMT0069-0":"Local Time Sync Enablement Notification - Local Time Sync Disabled.","iAMT0069-1":"Local Time Sync Enablement Notification - Local Time Sync Enabled.",iAMT0070:"Host Reset Triggered by WD Expiration Notification.",PLAT0004:"The chassis %1s was opened.",PLAT0005:"The chassis %1s was closed.",PLAT0006:"The drive bay %1s was opened.",PLAT0007:"The drive bay %1s was closed.",PLAT0008:"The I/O card area %1s was opened.",PLAT0009:"The I/O card area %1s was closed.",PLAT0010:"The processor area %1s was opened.",PLAT0011:"The processor area %1s was closed.",PLAT0012:"The LAN %1s has been disconnected.",PLAT0013:"The LAN %1s has been connected.",PLAT0016:"The permission to insert package %1s has been granted.",PLAT0017:"The permission to insert package %1s has been removed.",PLAT0018:"The fan card area %1s is open.",PLAT0019:"The fan card area %1s is closed.",PLAT0022:"The computer system %1s has detected a secure mode violation.",PLAT0024:"The computer system %1s has detected a pre-boot user password violation.",PLAT0026:"The computer system %1s has detected a pre-boot setup password violation.",PLAT0028:"The computer system %1s has detected a network boot password violation.",PLAT0030:"The computer system %1s has detected a password violation.",PLAT0032:"The management controller %1s has detected an out-of-band password violation.",PLAT0034:"The processor %1s has been added.",PLAT0035:"The processor %1s has been removed.",PLAT0036:"An over-temperature condition has been detected on the processor %1s.",PLAT0037:"An over-temperature condition has been removed on the processor %1s.",PLAT0038:"The processor %1s is operating in a degraded State.",PLAT0039:"The processor %1s is no longer operating in a degraded State.",PLAT0040:"The processor %1s has failed.",PLAT0042:"The processor %1s has failed.",PLAT0044:"The processor %1s has failed.",PLAT0046:"The processor %1s has failed.",PLAT0048:"The processor %1s has failed.",PLAT0060:"The processor %1s has been enabled.",PLAT0061:"The processor %1s has been disabled.",PLAT0062:"The processor %1s has a configuration mismatch.",PLAT0064:"A terminator has been detected on the processor %1s.",PLAT0084:"The Power Supply %1s has been added.",PLAT0085:"The Power Supply %1s has been removed.",PLAT0086:"The Power Supply %1s has failed.",PLAT0088:"Failure predicted on power supply %1s.",PLAT0096:"The input to power supply %1s has been lost or fallen out of range.",PLAT0098:"The power supply %1s is operating in an input state that is out of range.",PLAT0099:"The power supply %1s has returned to a normal input state.",PLAT0100:"The power supply %1s has lost input.",PLAT0104:"The power supply %1s has a configuration mismatch.",PLAT0106:"Power supply %1s has been disabled.",PLAT0107:"Power supply %1s has been enabled.",PLAT0108:"Power supply %1s has been power cycled.",PLAT0110:"Power supply %1s has encountered an error during power down.",PLAT0112:"Power supply %1s has lost power.",PLAT0114:"Soft power control has failed for power supply %1s.",PLAT0116:"Power supply %1s has failed.",PLAT0118:"Failure predicted on power supply %1s.",PLAT0120:"Memory subsystem failure.",PLAT0122:"DIMM missing.",PLAT0124:"Memory error detected & corrected for DIMM %1s.",PLAT0128:"Memory DIMM %1s added.",PLAT0129:"Memory DIMM %1s removed.",PLAT0130:"Memory DIMM %1s enabled.",PLAT0131:"Memory DIMM %1s disabled.",PLAT0134:"Memory parity error for DIMM %1s.",PLAT0136:"Memory scrub failure for DIMM %1s.",PLAT0138:"Memory uncorrectable error detected for DIMM %1s.",PLAT0140:"Memory sparing initiated for DIMM %1s.",PLAT0141:"Memory sparing concluded for DIMM %1s.",PLAT0142:"Memory DIMM %1s Throttled.",PLAT0144:"Memory logging limit reached for DIMM %1s.",PLAT0145:"Memory logging limit removed for DIMM %1s.",PLAT0146:"An over-temperature condition has been detected on the Memory DIMM %1s.",PLAT0147:"An over-temperature condition has been removed on the Memory DIMM %1s.",PLAT0162:"The drive %1s has been added.",PLAT0163:"The drive %1s has been removed.",PLAT0164:"The drive %1s has been disabled due to a detected fault.",PLAT0167:"The drive %1s has been enabled.",PLAT0168:"Failure predicted on drive %1s.",PLAT0170:"Hot spare enabled for %1s.",PLAT0171:"Hot spare disabled for %1s.",PLAT0172:"Consistency check has begun for %1s.",PLAT0173:"Consistency check completed for %1s.",PLAT0174:"Array %1s is in critical condition.",PLAT0176:"Array %1s has failed.",PLAT0177:"Array %1s has been restored.",PLAT0178:"Rebuild in progress for array %1s.",PLAT0179:"Rebuild completed for array %1s.",PLAT0180:"Rebuild Aborted for array %1s.",PLAT0184:"The system %1s encountered a POST error.",PLAT0186:"The system %1s encountered a firmware hang.",PLAT0188:"The system %1s encountered firmware progress.",PLAT0192:"The log %1s has been disabled.",PLAT0193:"The log %1s has been enabled.",PLAT0194:"The log %1s has been disabled.",PLAT0195:"The log %1s has been enabled.",PLAT0196:"The log %1s has been disabled.",PLAT0198:"The log %1s has been enabled.",PLAT0200:"The log %1s has been cleared.",PLAT0202:"The log %1s is full.",PLAT0203:"The log %1s is no longer full.",PLAT0204:"The log %1s is almost full.",PLAT0208:"The log %1s has a configuration error.",PLAT0210:"The system %1s has been reconfigured.",PLAT0212:"The system %1s has encountered an OEM system boot event.",PLAT0214:"The system %1s has encountered an unknown system hardware fault.",PLAT0216:"The system %1s has generated an auxiliary log entry.",PLAT0218:"The system %1s has executed a PEF action.",PLAT0220:"The system %1s has synchronized the system clock.",PLAT0222:"A diagnostic interrupt has occurred on system %1s.",PLAT0224:"A bus timeout has occurred on system %1s.",PLAT0226:"An I/O channel check NMI has occurred on system %1s.",PLAT0228:"A software NMI has occurred on system %1s.",PLAT0230:"System %1s has recovered from an NMI.",PLAT0232:"A PCI PERR has occurred on system %1s.",PLAT0234:"A PCI SERR has occurred on system %1s.",PLAT0236:"An EISA fail safe timeout occurred on system %1s.",PLAT0238:"A correctable bus error has occurred on system %1s.",PLAT0240:"An uncorrectable bus error has occurred on system %1s.",PLAT0242:"A fatal NMI error has occurred on system %1s.",PLAT0244:"A fatal bus error has occurred on system %1s.",PLAT0246:"A bus on system %1s is operating in a degraded state.",PLAT0247:"A bus on system %1s is no longer operating in a degraded state.",PLAT0248:"The power button %1s has been pressed.",PLAT0249:"The power button %1s has been released.",PLAT0250:"The sleep button %1s has been pressed.",PLAT0251:"The sleep button %1s has been released.",PLAT0252:"The reset button %1s has been pressed.",PLAT0253:"The reset button %1s has been released.",PLAT0254:"The latch to %1s has been opened.",PLAT0255:"The latch to %1s has been closed.",PLAT0256:"The service request %1s has been enabled.",PLAT0257:"The service request %1s has been completed.",PLAT0258:"Power control of system %1s has failed.",PLAT0262:"The network port %1s has been connected.",PLAT0263:"The network port %1s has been disconnected.",PLAT0266:"The connector %1s has encountered a configuration error.",PLAT0267:"The connector %1s configuration error has been repaired.",PLAT0272:"Power on for system %1s.",PLAT0274:"Power cycle hard requested for system %1s.",PLAT0276:"Power cycle soft requested for system %1s.",PLAT0278:"PXE boot requested for system %1s.",PLAT0280:"Diagnostics boot requested for system %1s.",PLAT0282:"System restart requested for system %1s.",PLAT0284:"System restart begun for system %1s.",PLAT0286:"No bootable media available for system %1s.",PLAT0288:"Non-bootable media selected for system %1s.",PLAT0290:"PXE server not found for system %1s.",PLAT0292:"User timeout on boot for system %1s.",PLAT0296:"System %1s boot from floppy initiated.",PLAT0298:"System %1s boot from local drive initiated.",PLAT0300:"System %1s boot from PXE on network port initiated.",PLAT0302:"System %1s boot diagnostics initiated.",PLAT0304:"System %1s boot from CD initiated.",PLAT0306:"System %1s boot from ROM initiated.",PLAT0312:"System %1s boot initiated.",PLAT0320:"Critical stop during OS load on system %1s.",PLAT0322:"Run-time critical stop on system %1s.",PLAT0324:"OS graceful stop on system %1s.",PLAT0326:"OS graceful shutdown begun on system %1s.",PLAT0327:"OS graceful shutdown completed on system %1s.",PLAT0328:"Agent not responding on system %1s.",PLAT0329:"Agent has begun responding on system %1s.",PLAT0330:"Fault in slot on system %1s.",PLAT0331:"Fault condition removed on system %1s.",PLAT0332:"Identifying slot on system %1s.",PLAT0333:"Identify stopped on slot for system %1s.",PLAT0334:"Package installed in slot for system %1s.",PLAT0336:"Slot empty system %1s.",PLAT0338:"Slot in system %1s is ready for installation.",PLAT0340:"Slot in system %1s is ready for removal.",PLAT0342:"Power is off on slot of system %1s.",PLAT0344:"Power is on for slot of system %1s.",PLAT0346:"Removal requested for slot of system %1s.",PLAT0348:"Interlock activated on slot of system %1s.",PLAT0349:"Interlock de-asserted on slot of system %1s.",PLAT0350:"Slot disabled on system %1s.",PLAT0351:"Slot enabled on system %1s.",PLAT0352:"Slot of system %1s holds spare.",PLAT0353:"Slot of system %1s no longer holds spare.",PLAT0354:"Computer system %1s enabled.",PLAT0356:"Computer system %1s is in sleep - light mode.",PLAT0358:"Computer system %1s is in hibernate.",PLAT0360:"Computer system %1s is in standby.",PLAT0362:"Computer system %1s is in soft off mode.",PLAT0364:"Computer system %1s is in hard off mode.",PLAT0366:"Computer system %1s is sleeping.",PLAT0368:"Watchdog timer expired for %1s.",PLAT0370:"Reboot of system initiated by watchdog %1s.",PLAT0372:"Powering off system initiated by watchdog %1s.",PLAT0374:"Power cycle of system initiated by watchdog %1s.",PLAT0376:"Watchdog timer interrupt occurred for %1s.",PLAT0378:"A page alert has been generated for system %1s.",PLAT0380:"A LAN alert has been generated for system %1s.",PLAT0382:"An event trap has been generated for system %1s.",PLAT0384:"An SNMP trap has been generated for system %1s.",PLAT0390:"%1s detected as present.",PLAT0392:"%1s detected as absent.",PLAT0394:"%1s has been disabled.",PLAT0395:"%1s has been enabled.",PLAT0396:"Heartbeat lost for LAN %1s.",PLAT0397:"Heartbeat detected for LAN %1s.",PLAT0398:"Sensor %1s is unavailable or degraded on management system.",PLAT0399:"Sensor %1s has returned to normal on management system.",PLAT0400:"Controller %1s is unavailable or degraded on management system.",PLAT0401:"Controller %1s has returned to normal on management system.",PLAT0402:"Management system %1s is off-line.",PLAT0404:"Management system %1s is disabled.",PLAT0405:"Management system %1s is enabled.",PLAT0406:"Sensor %1s has failed on management system.",PLAT0408:"FRU %1s has failed on management system.",PLAT0424:"The battery %1s is critically low.",PLAT0427:"The battery %1s is no longer critically low.",PLAT0430:"The battery %1s has been removed from unit.",PLAT0431:"The battery %1s has been added.",PLAT0432:"The battery %1s has failed.",PLAT0434:"Session audit is deactivated on system %1s.",PLAT0435:"Session audit is activated on system %1s.",PLAT0436:"A hardware change occurred on system %1s.",PLAT0438:"A firmware or software change occurred on system %1s.",PLAT0440:"A hardware incompatibility was detected on system %1s.",PLAT0442:"A firmware or software incompatibility was detected on system %1s.",PLAT0444:"Invalid or unsupported hardware was detected on system %1s.",PLAT0446:"Invalid or unsupported firmware or software was detected on system %1s.",PLAT0448:"A successful hardware change was detected on system %1s.",PLAT0450:"A successful software or firmware change was detected on system %1s.",PLAT0464:"FRU %1s not installed on system.",PLAT0465:"FRU %1s installed on system.",PLAT0466:"Activation requested for FRU %1s on system.",PLAT0467:"FRU %1s on system is active.",PLAT0468:"Activation in progress for FRU %1s on system.",PLAT0470:"Deactivation request for FRU %1s on system.",PLAT0471:'FRU %1s on system is in standby or "hot spare" state.',PLAT0472:"Deactivation in progress for FRU %1s on system.",PLAT0474:"Communication lost with FRU %1s on system.",PLAT0476:"Numeric sensor %1s going low (lower non-critical).",PLAT0478:"Numeric sensor %1s going high (lower non-critical).",PLAT0480:"Numeric sensor %1s going low (lower critical).",PLAT0482:"Numeric sensor %1s going high (lower critical).",PLAT0484:"Numeric sensor %1s going low (lower non-recoverable).",PLAT0486:"Numeric sensor %1s going high (lower non-critical).",PLAT0488:"Numeric sensor %1s going low (upper non-critical).",PLAT0490:"Numeric sensor %1s going high (upper non-critical).",PLAT0492:"Numeric sensor %1s going low (upper critical).",PLAT0494:"Numeric sensor %1s going high (upper critical).",PLAT0496:"Numeric sensor %1s going low (upper non-recoverable).",PLAT0498:"Numeric sensor %1s going high (upper non-recoverable).",PLAT0500:"Sensor %1s has transitioned to idle.",PLAT0502:"Sensor %1s has transitioned to active.",PLAT0504:"Sensor %1s has transitioned to busy.",PLAT0508:"Sensor %1s has asserted.",PLAT0509:"Sensor %1s has de-asserted.",PLAT0510:"Sensor %1s is asserting predictive failure.",PLAT0511:"Sensor %1s is de-asserting predictive failure.",PLAT0512:"Sensor %1s has indicated limit exceeded.",PLAT0513:"Sensor %1s has indicated limit no longer exceeded.",PLAT0514:"Sensor %1s has indicated performance met.",PLAT0516:"Sensor %1s has indicated performance lags.",PLAT0518:"Sensor %1s has transitioned to normal state.",PLAT0520:"Sensor %1s has transitioned from normal to non-critical state.",PLAT0522:"Sensor %1s has transitioned to critical from a less severe state.",PLAT0524:"Sensor %1s has transitioned to non-recoverable from a less severe state.",PLAT0526:"Sensor %1s has transitioned to non-critical from a more severe state.",PLAT0528:"Sensor %1s has transitioned to critical from a non-recoverable state.",PLAT0530:"Sensor %1s has transitioned to non-recoverable.",PLAT0532:"Sensor %1s indicates a monitor state.",PLAT0534:"Sensor %1s has an informational state.",PLAT0536:"Device %1s has been added.",PLAT0537:"Device %1s has been removed from unit.",PLAT0538:"Device %1s has been enabled.",PLAT0539:"Device %1s has been disabled.",PLAT0540:"Sensor %1s has indicated a running state.",PLAT0544:"Sensor %1s has indicated a power off state.",PLAT0546:"Sensor %1s has indicated an on-line state.",PLAT0548:"Sensor %1s has indicated an off-line state.",PLAT0550:"Sensor %1s has indicated an off-duty state.",PLAT0552:"Sensor %1s has indicated a degraded state.",PLAT0554:"Sensor %1s has indicated a power save state.",PLAT0556:"Sensor %1s has indicated an install error.",PLAT0558:"Redundancy %1s has been lost.",PLAT0560:"Redundancy %1s has been reduced.",PLAT0561:"Redundancy %1s has been restored.",PLAT0562:"%1s has transitioned to a D0 power state.",PLAT0564:"%1s has transitioned to a D1 power state.",PLAT0566:"%1s has transitioned to a D2 power state.",PLAT0568:"%1s has transitioned to a D3 power state.",PLAT0720:"The System %1s encountered firmware progress - memory initialization entry.",PLAT0721:"The System %1s encountered firmware progress - memory initialization exit.",PLAT0722:"The System %1s encountered firmware progress - hard drive initialization entry.",PLAT0723:"The System %1s encountered firmware progress - hard drive initialization exit.",PLAT0724:"The System %1s encountered firmware progress - user authentication.",PLAT0728:"The System %1s encountered firmware progress - USR resource configuration entry.",PLAT0729:"The System %1s encountered firmware progress - USR resource configuration exit.",PLAT0730:"The System %1s encountered firmware progress - PCI recource configuration entry.",PLAT0731:"The System %1s encountered firmware progress - PCI recource configuration exit.",PLAT0732:"The System %1s encountered firmware progress - Option ROM initialization entry.",PLAT0733:"The System %1s encountered firmware progress - Option ROM initialization entry exit.",PLAT0734:"The System %1s encountered firmware progress -video initialization entry entry.",PLAT0735:"The System %1s encountered firmware progress - video initialization entry exit.",PLAT0736:"The System %1s encountered firmware progress - cache initialization entry.",PLAT0737:"The System %1s encountered firmware progress - cache initialization exit.",PLAT0738:"The System %1s encountered firmware progress - keyboard controller initialization entry.",PLAT0739:"The System %1s encountered firmware progress - keyboard controller initialization exit.",PLAT0740:"The System %1s encountered firmware progress - motherboard initialization entry.",PLAT0741:"The System %1s encountered firmware progress - motherboard initialization exit.",PLAT0742:"The System %1s encountered firmware progress - floppy disk initialization entry.",PLAT0743:"The System %1s encountered firmware progress - floppy disk initialization exit.",PLAT0744:"The System %1s encountered firmware progress - keyboard test entry.",PLAT0745:"The System %1s encountered firmware progress - keyboard test exit.",PLAT0746:"The System %1s encountered firmware progress - pointing device test entry.",PLAT0747:"The System %1s encountered firmware progress - pointing device test exit.",PLAT0750:"The System %1s encountered firmware progress - dock enable entry.",PLAT0751:"The System %1s encountered firmware progress - dock enable exit.",PLAT0752:"The System %1s encountered firmware progress - dock disable entry.",PLAT0753:"The System %1s encountered firmware progress - dock disable exit.",PLAT0760:"The System %1s encountered firmware progress - start OS boot process.",PLAT0762:"The System %1s encountered firmware progress - call OS wake vector.",PLAT0764:"The System %1s encountered firmware progress - unrecoverable keyboard failure.",PLAT0766:"The System %1s encountered firmware progress - no video device detected.",PLAT0768:"The System %1s encountered firmware progress - SMART alert detected on drive.",PLAT0770:"The System %1s encountered firmware progress - unrecoverable boot device failure.",PLAT0789:"Corrupt BIOS detected.",PLAT0790:"The System %1s encountered PCI configuration failure.",PLAT0791:"The System %1s encountered a video subsystem failure.",PLAT0792:"The System %1s encountered a storage subsystem failure.",PLAT0793:"The System %1s encountered a USB subsystem failure.",PLAT0794:"The System %1s has detected no memory in the system.",PLAT0795:"The System %1s encountered a motherboard failure.",PLAT0796:"The System %1s encountered a memory Regulator Voltage Bad.",PLAT0797:"%1s PCI reset is not deasserting.",PLAT0798:"%1s Non-Motherboard Regulator Failure.",PLAT0799:"%1s Power Supply Cable failure.",PLAT0800:"%1s Motherboard regulator failure.",PLAT0801:"%1s System component compatibility mismatch."};module.exports=lme_heci;
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/amt-manage.min.js b/agents/modules_meshcore_min/amt-manage.min.js
deleted file mode 100644
index 380ac1ea..00000000
--- a/agents/modules_meshcore_min/amt-manage.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function AmtManager(c,p,u){var J=function(P){c.SendCommand({action:"msg",type:"console",value:P})};var q=function(P){if(u){J("amt-manager: "+P+"
")}};var g=null,h=0;var e=null,f=0;var d=null;var F=null;var E=null;var j=null;var D=this;D.state=0;D.lmsstate=0;D.onStateChange=null;D.setDebug=function(P){u=P};D.setPolicy=function(P){if(JSON.stringify(j)!=JSON.stringify(P)){j=P;if(l==null){D.applyPolicy()}}};var I=0;D.reset=function(){++I;g=null,h=0,e=null,f=0,D.state=0,D.lmsstate=0;try{var P=require("amt-mei");g=new P();g.on("error",function(R){q("MEI error");g=null;h=-1;D.state=-1;D.onStateChange(h)});g.getVersion(function(R){if(R==null){h=-1;D.state=-1;if(D.onStateChange!=null){D.onStateChange(h)}if(I<10){setTimeout(D.reset,10000)}}else{d=R;h=2;D.state=2;I=0;if(D.onStateChange!=null){D.onStateChange(h)}D.lmsreset()}})}catch(Q){q("MEI exception: "+Q);g=null;h=-1;D.state=-1}};var i=null;D.getAmtInfo=function(Q){if((g==null)||(h<2)){if(Q!=null){Q(null)}return}try{i={Flags:0};g.getProtocolVersion(function(R){if(R!=null){i.MeiVersion=R}});g.getVersion(function(R){if(R){i.Versions={};for(var S in R.Versions){i.Versions[R.Versions[S].Description]=R.Versions[S].Version}}});g.getProvisioningMode(function(R){if(R){i.ProvisioningMode=R.mode}});g.getProvisioningState(function(R){if(R){i.ProvisioningState=R.state}});g.getEHBCState(function(R){if((R!=null)&&(R.EHBC==true)){i.Flags+=1}});g.getControlMode(function(R){if(R!=null){if(R.controlMode==1){i.Flags+=2}if(R.controlMode==2){i.Flags+=4}}});g.getLanInterfaceSettings(0,function(R){if(R){i.net0=R}});g.getLanInterfaceSettings(1,function(R){if(R){i.net1=R}});g.getUuid(function(R){if((R!=null)&&(R.uuid!=null)){i.UUID=R.uuid}});g.getDnsSuffix(function(R){if(R!=null){i.dns=R}if(Q!=null){Q(i)}})}catch(P){if(Q!=null){Q(null)}return}};var s=function(S){if((S==null)||(S.Body==null)||(S.Body.MessageID==null)||(S.Body.MessageArguments==null)){return null}var P=S.Body.MessageID,Q=S.Body.MessageArguments[0],R=null;switch(P){case"iAMT0050":if(Q=="48"){R="Intel® AMT Serial-over-LAN connected"}else{if(Q=="49"){R="Intel® AMT Serial-over-LAN disconnected"}}break;case"iAMT0052":if(Q=="1"){R="Intel® AMT KVM connected"}else{if(Q=="2"){R="Intel® AMT KVM disconnected"}}break;default:break}if(R!=null){c.SendCommand({action:"msg",type:"notify",value:R,tag:"general"})}};D.lmsreset=function(){var P=null,Q=0;D.lmsstate=0;try{var S=require("amt-lme");Q=1;D.lmsstate=1;P=new S();P.on("error",function(T){Q=0;D.lmsstate=0;P=null;q("LMS error");K(1)});P.on("connect",function(){Q=2;D.lmsstate=2;q("LMS connected");K(2)});P.on("notify",function(U,V,W,T){if(T=="iAMT0052-3"){x()}else{s(U)}})}catch(R){Q=-1;D.lmsstate=-1;P=null}};var K=function(P){if((g==null)||(h<2)||(d==null)){return}g.getLocalSystemAccount(function(W){if(W==null){return}var U=require("amt-wsman-duk");var V=require("amt-wsman");var Q=require("amt");F=new V(U,"127.0.0.1",16992,W.user,W.pass,false);E=new Q(F);h=3;D.state=3;if(D.onStateChange!=null){D.onStateChange(h)}if(l==null){D.applyPolicy()}var R=null;try{for(var T in d.Versions){if(d.Versions[T].Description=="AMT"){R=parseInt(d.Versions[T].Version.split(".")[0])}}}catch(S){}if((R!=null)&&(R>=12)){q("KVM data channel setup");x("skip");D.kvmTempTimer=setInterval(function(){x()},2000);z(JSON.stringify({action:"restart",ver:1}))}})};var x=function(P){E.IPS_KVMRedirectionSettingData_DataChannelRead(D.kvmDataGetResponse,P)};var w=function(S,Q,R,T,U){if((U!="skip")&&(T==200)&&(R.Body.ReturnValue==0)){var V=null;try{V=Buffer.from(R.Body.DataMessage,"base64").toString()}catch(P){return}if(V!=null){D.kvmProcessData(R.Body.RealmsBitmap,R.Body.MessageId,V)}}};var M=null;var y=function(S,R,U){var P=null;try{P=JSON.parse(U)}catch(Q){}if((P!=null)&&(P.action)){if(P.action=="present"){z(JSON.stringify({action:"present",ver:1,platform:process.platform}))}if(P.action=="offer"){M={};var T=require("ILibWebRTC");M.webrtc=T.createConnection();M.webrtc.on("connected",function(){});M.webrtc.on("disconnected",function(){D.webRtcCleanUp()});M.webrtc.on("dataChannel",function(V){M.rtcchannel=V;M.kvm=mesh.getRemoteDesktopStream();M.kvm.pipe(M.rtcchannel,{dataTypeSkip:1,end:false});M.rtcchannel.on("end",function(){D.webRtcCleanUp()});M.rtcchannel.on("data",function(W){D.kvmCtrlData(this,W)});M.rtcchannel.pipe(M.kvm,{dataTypeSkip:1,end:false})});z(JSON.stringify({action:"answer",ver:1,sdp:M.webrtc.setOffer(P.sdp)}))}}};var v=function(Q,S){if(S.length>0&&S.charCodeAt(0)!=123){if(D.fileupload!=null){S=Buffer.from(S,"base64");var Y=S.readUInt32BE(0);if((Y==16777216)||(Y==16777217)){fs.writeSync(D.fileupload.fp,S.slice(4));Q.write({action:"upload",sub:"ack",reqid:D.fileupload.reqid});if(Y==16777217){fs.closeSync(D.fileupload.fp);D.fileupload=null}}}return}q("KVM Ctrl Data: "+S);try{S=JSON.parse(S)}catch(V){q("Invalid JSON: "+S);return}if((S.path!=null)&&(process.platform!="win32")&&(S.path[0]!="/")){S.path="/"+S.path}switch(S.action){case"ping":Q.write({action:"pong"});break;case"lock":if(process.platform=="win32"){var R=require("child_process");R.execFile(process.env.windir+"\\system32\\cmd.exe",["/c","RunDll32.exe user32.dll,LockWorkStation"],{type:1})}break;case"ls":var ab=getDirectoryInfo(S.path);if(S.reqid!=undefined){ab.reqid=S.reqid}Q.write(ab);break;case"mkdir":fs.mkdirSync(S.path);break;case"rm":for(var Z in S.delfiles){var X=G.join(S.path,S.delfiles[Z]);try{fs.unlinkSync(X)}catch(U){q(U)}}break;case"rename":try{fs.renameSync(G.join(S.path,S.oldname),G.join(S.path,S.newname))}catch(U){q(U)}break;case"download":var ad=0;if(S.sub=="start"){if(D.filedownload!=null){Q.write({action:"download",sub:"cancel",id:D.filedownload.id});delete D.filedownload}D.filedownload={id:S.id,path:S.path,ptr:0};try{D.filedownload.f=fs.openSync(D.filedownload.path,"rbN")}catch(U){Q.write({action:"download",sub:"cancel",id:D.filedownload.id});delete D.filedownload}if(D.filedownload){Q.write({action:"download",sub:"start",id:S.id})}}else{if((D.filedownload!=null)&&(S.id==D.filedownload.id)){if(S.sub=="startack"){ad=8}else{if(S.sub=="stop"){delete D.filedownload}else{if(S.sub=="ack"){ad=1}}}}}while(ad>0){ad--;var P=Buffer.alloc(4096);var aa=fs.readSync(D.filedownload.f,P,4,4092,null);D.filedownload.ptr+=aa;if(aa<4092){P.writeInt32BE(16777217,0);fs.closeSync(D.filedownload.f);delete D.filedownload;ad=0}else{P.writeInt32BE(16777216,0)}Q.write(P.slice(0,aa+4).toString("base64"))}break;case"upload":if(S.sub=="start"){if(D.fileupload!=null){fs.closeSync(D.fileupload.fp)}if(!S.path||!S.name){break}D.fileupload={reqid:S.reqid};var W=G.join(S.path,S.name);try{D.fileupload.fp=fs.openSync(W,"wbN")}catch(U){}if(D.fileupload.fp){Q.write({action:"upload",sub:"start",reqid:D.fileupload.reqid})}else{D.fileupload=null;Q.write({action:"upload",sub:"error",reqid:D.fileupload.reqid})}}else{if(S.sub=="cancel"){if(D.fileupload!=null){fs.closeSync(D.fileupload.fp);D.fileupload=null}}}break;case"copy":for(var Z in S.names){var ac=G.join(S.scpath,S.names[Z]),T=G.join(S.dspath,S.names[Z]);if(ac!=T){try{fs.copyFileSync(ac,T)}catch(U){}}}break;case"move":for(var Z in S.names){var ac=G.join(S.scpath,S.names[Z]),T=G.join(S.dspath,S.names[Z]);if(ac!=T){try{fs.copyFileSync(ac,T);fs.unlinkSync(ac)}catch(U){}}}break;default:q("Invalid KVM command: "+S);break}};var L=function(){q("webRtcCleanUp");if(M==null){return}if(M.rtcchannel){try{M.rtcchannel.close()}catch(P){}try{M.rtcchannel.removeAllListeners("data")}catch(P){}try{M.rtcchannel.removeAllListeners("end")}catch(P){}delete M.rtcchannel}if(M.webrtc){try{M.webrtc.close()}catch(P){}try{M.webrtc.removeAllListeners("connected")}catch(P){}try{M.webrtc.removeAllListeners("disconnected")}catch(P){}try{M.webrtc.removeAllListeners("dataChannel")}catch(P){}delete M.webrtc}if(M.kvm){try{M.kvm.end()}catch(P){}delete M.kvm}M=null};var z=function(P){E.IPS_KVMRedirectionSettingData_DataChannelWrite(Buffer.from(P).toString("base64"),function(){})};var r=function(P,Q){if(fs.existsSync(P)){if(Q==true){fs.readdirSync(D.path.join(P,"*")).forEach(function(S,T){var R=D.path.join(P,S);if(fs.statSync(R).isDirectory()){r(R,true)}else{fs.unlinkSync(R)}})}fs.unlinkSync(P)}};var G={join:function(){var R=[];for(var P in arguments){var Q=arguments[P];if(Q!=null){while(Q.endsWith("/")||Q.endsWith("\\")){Q=Q.substring(0,Q.length-1)}if(P!=0){while(Q.startsWith("/")||Q.startsWith("\\")){Q=Q.substring(1)}}R.push(Q)}}if(R.length==0){return"/"}return R.join("/")}};function C(P){return require("MD5Stream").create().syncHash(P).toString("hex")}D.deactivateCCM=function(){g.unprovision(1,function(P){if(P==0){q("Success deactivating Intel AMT CCM.");c.SendCommand({action:"coreinfo",intelamt:{state:0,flags:0}});l=setTimeout(D.applyPolicy,8000)}else{q("Intel AMT CCM deactivation error: "+P)}})};function A(Q){var S="",R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var P=0;P";k.AMT_RemoteAccessService_AddRemoteAccessPolicyRule(2,0,"AAAAAAAAAAo=",[Q],null,function(U,S,T,V){if(V!=200){q("Add AddRemoteAccessPolicyRule Error "+V)}else{n(P)}})}function n(P){var R=[];if((j.ciraserver!=null)&&(j.ciraserver.home!=null)){R=j.ciraserver.home}var Q=P.AMT_EnvironmentDetectionSettingData.response;Q.DetectionStrings=B(Q.DetectionStrings);if(o(Q.DetectionStrings,R)==false){Q.DetectionStrings=R;k.Put("AMT_EnvironmentDetectionSettingData",Q,function(U,S,T,V){if(V!=200){q("Put AMT_EnvironmentDetectionSettingData Error "+V)}},0,1)}}function o(P,Q){if(P==Q){return true}if(P==null){P=[]}if(Q==null){Q=[]}if(P.length!=Q.length){return false}for(var R in P){if(Q.indexOf(P[R])==-1){return false}}return true}function B(P){if(!P||P==null||typeof P=="object"){return P}return[P]}}module.exports=AmtManager;
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/amt-mei.min.js b/agents/modules_meshcore_min/amt-mei.min.js
deleted file mode 100644
index f3bea3f5..00000000
--- a/agents/modules_meshcore_min/amt-mei.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var Q=require("queue");function amt_heci(){var d=require("events").inherits(this);d.createEvent("error");var u=require("heci");var y=function(E){require("MeshAgent").SendCommand({action:"msg",type:"console",value:E})};this._ObjectID="pthi";this._rq=new Q();this._setupPTHI=function b(){this._amt=u.create();this._amt.BiosVersionLen=65;this._amt.UnicodeStringLen=20;this._amt.Parent=this;this._amt.on("error",function F(H){if(this.Parent._rq.isEmpty()){this.Parent.emit("error",H)}else{var J=this.Parent._rq.deQueue();var I=J.optional;var G=J.func;I.unshift({Status:-1});G.apply(this.Parent,I);if(!this.Parent._rq.isEmpty()){this.connect(u.GUIDS.AMT,{noPipeline:1})}}});this._amt.on("connect",function E(){this.on("data",function G(I){var J=this.Parent.getCommand(I);var L=this.Parent._rq.deQueue();var K=L.optional;var H=L.func;K.unshift(J);H.apply(this.Parent,K);if(this.Parent._rq.isEmpty()){this.Parent._amt.disconnect();this.Parent._amt=null}else{this.write(this.Parent._rq.peekQueue().send)}});this.write(this.Parent._rq.peekQueue().send)})};function B(E){var F=E.indexOf("\0");if(F>=0){return E.substring(0,F)}else{return E}}this.getCommand=function g(E){var F=E.length==0?(this._rq.peekQueue().cmd|8388608):E.readUInt32LE(4);var G={IsResponse:(F&8388608)==8388608?true:false,Command:(F&8388607),Status:E.length!=0?E.readUInt32LE(12):-1,Data:E.length!=0?E.slice(16):null};return(G)};this.sendCommand=function x(){if(arguments.length<3||typeof(arguments[0])!="number"||typeof(arguments[1])!="object"||typeof(arguments[2])!="function"){throw ("invalid parameters")}var E=[];for(var G=3;G0){N.BiosVersion=N.BiosVersion.substring(0,N.BiosVersion.indexOf("\0"))}L.unshift(N)}else{L.unshift(null)}I.apply(this,L)},E,G)};function D(G,F){if((F==null)&&(typeof(F)!="number")){return null}if(G==null){G=""}var H="";for(var E=0;E0){J.unshift(I.Data.slice(2,2+K).toString())}else{J.unshift(null)}}else{J.unshift(null)}H.apply(this,J)},E,G)};this.getHashHandles=function k(E){var G=[];for(var F=1;F0){this.getCertHashEntry(G.shift(),this._getHashEntrySink,F,H,E,G)}else{H.unshift(E);F.apply(this,H)}};this.getLocalSystemAccount=function m(E){var G=[];for(var F=1;F>24)&255)+"."+((K>>16)&255)+"."+((K>>8)&255)+"."+(K&255);O.unshift(N);L.apply(this,O)}else{O.unshift(null);L.apply(this,O)}},E,J)};this.unprovision=function C(H,E){var I=[];for(var G=2;G>4)&15;f.provisioningState=b[19]&3;var e=(b[16]*256)+b[17];var c=((b[19]&4)!=0)?true:false;f.openPorts=[e];f.address=g.address;if(c==true){f.openPorts=[16992,16993]}if(d!==undefined){d(h,f)}}};this.parseIPv4Range=function(f){if(f==undefined||f==null){return null}var g=f.split("-");if(g.length==2){return{min:this.parseIpv4Addr(g[0]),max:this.parseIpv4Addr(g[1])}}g=f.split("/");if(g.length==2){var c=this.parseIpv4Addr(g[0]),e=parseInt(g[1]),d=0;if(e<=16||e>32){return null}e=32-e;for(var b=0;b>24)&255)+"."+((b>>16)&255)+"."+((b>>8)&255)+"."+(b&255)};this.scan=function(d,g){var c=this.parseIPv4Range(d);var e=this.buildRmcpPing(0);var f=this.dgram.createSocket({type:"udp4"});f.parent=this;f.scanResults=[];f.on("error",function(i){console.log("Error:"+i)});f.on("message",function(i,j){if(j.size>4){this.parent.parseRmcpPacket(this,i,j,function(l,k){l.scanResults.push(k)})}});f.on("listening",function(){for(var j=c.min;j<=c.max;j++){f.send(e,623,f.parent.IPv4NumToStr(j))}});f.bind({address:"0.0.0.0",port:0,exclusive:true});var h=setTimeout(function b(){f.close();f.parent.emit("found",f.scanResults);delete f},g)}}module.exports=AMTScanner;
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/amt-wsman-duk.min.js b/agents/modules_meshcore_min/amt-wsman-duk.min.js
deleted file mode 100644
index b12434af..00000000
--- a/agents/modules_meshcore_min/amt-wsman-duk.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function CreateWsmanComm(){var a={};a.PendingAjax=[];a.ActiveAjaxCount=0;a.MaxActiveAjaxCount=1;a.FailAllError=0;a.digest=null;a.RequestCount=0;if(arguments.length==1&&typeof(arguments[0]=="object")){a.host=arguments[0].host;a.port=arguments[0].port;a.authToken=arguments[0].authToken;a.tls=arguments[0].tls}else{a.host=arguments[0];a.port=arguments[1];a.user=arguments[2];a.pass=arguments[3];a.tls=arguments[4]}a.PerformAjax=function(d,c,f,e,g,b){if((a.ActiveAjaxCount==0||((a.ActiveAjaxCount=a.MaxActiveAjaxCount||a.PendingAjax.length==0){return}var b=a.PendingAjax.shift();a.PerformAjaxEx(b[0],b[1],b[2],b[3],b[4]);a.PerformNextAjax()};a.PerformAjaxEx=function(d,c,g,h,b){if(a.FailAllError!=0){if(a.FailAllError!=999){a.gotNextMessagesError({status:a.FailAllError},"error",null,[d,c,g])}return}if(!d){d=""}if(a.digest==null){if(a.authToken){a.digest=require("http-digest").create({authToken:a.authToken})}else{a.digest=require("http-digest").create(a.user,a.pass)}a.digest.http=require("http")}var f={protocol:(a.tls==1?"https:":"http:"),method:"POST",host:a.host,path:"/wsman",port:a.port,rejectUnauthorized:false,checkServerIdentity:function(i){console.log("checkServerIdentity",JSON.stringify(i))}};var e=a.digest.request(f);e.on("error",function(i){a.gotNextMessagesError({status:600},"error",null,[d,c,g])});e.on("response",function(i){if(i.statusCode!=200){a.gotNextMessagesError({status:i.statusCode},"error",null,[d,c,g])}else{i.acc="";i.on("data",function(j){this.acc+=j});i.on("end",function(){a.gotNextMessages(i.acc,"success",{status:i.statusCode},[d,c,g])})}});e.end(d);a.ActiveAjaxCount++;return e};a.pendingAjaxCall=[];a.gotNextMessages=function(c,e,d,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(d.status!=200){b[1](null,d.status,b[2]);return}b[1](c,200,b[2]);a.PerformNextAjax()};a.gotNextMessagesError=function(d,e,c,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(a.FailAllError!=999){b[1]({Header:{HttpError:d.status}},d.status,b[2])}a.PerformNextAjax()};a.CancelAllQueries=function(b){while(a.PendingAjax.length>0){var c=a.PendingAjax.shift();c[1](null,b,c[2])}};return a}module.exports=CreateWsmanComm;
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/amt-wsman.min.js b/agents/modules_meshcore_min/amt-wsman.min.js
deleted file mode 100644
index e8afb796..00000000
--- a/agents/modules_meshcore_min/amt-wsman.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+''+C+""+w+""+v+"";p.PerformAjax(s+"",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if((v==null)||(v=="null")){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="";return t}return p}module.exports=WsmanStackCreateService;
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/amt-xml.min.js b/agents/modules_meshcore_min/amt-xml.min.js
deleted file mode 100644
index c8fe1c88..00000000
--- a/agents/modules_meshcore_min/amt-xml.min.js
+++ /dev/null
@@ -1 +0,0 @@
-try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(v){if(v==null){return null}var m=new _treeBuilder(),q=null,y=v.split("<"),t=[],h=null,g=null;for(var n in y){var z=y[n].split(">"),A=z[0].split(" "),l=A[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],r,s=l.split(" ")[0].split(":"),r=(s.length>1)?s[1]:s[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:r,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(A.length>0){var u=false;for(var o in A){if(A[o]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";q=m.pop();u=true;break}var p=A[o].indexOf("=");if(p>0){var b=A[o].substring(0,p);var d=A[o].substring(p+2,A[o].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var w={name:b,value:d};if(c!=null){w.namespace=c}m.peek().attributes.push(w)}}if(u){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(z[1]){m.peek().textContent=z[1]}}else{q=m.pop()}}}return q};
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/amt.min.js b/agents/modules_meshcore_min/amt.min.js
deleted file mode 100644
index 6984729b..00000000
--- a/agents/modules_meshcore_min/amt.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function AmtStackCreateService(R){var J=new Object();J._ObjectID="AMT";J.wsman=R;J.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"];J.PendingEnums=[];J.PendingBatchOperations=0;J.ActiveEnumsCount=0;J.MaxActiveEnumsCount=1;J.onProcessChanged=null;var n=0;var m=0;J.GetPendingActions=function(){return(J.PendingEnums.length*2)+(J.ActiveEnumsCount)+J.wsman.comm.PendingAjax.length+J.wsman.comm.ActiveAjaxCount+J.PendingBatchOperations};function r(){var S=J.GetPendingActions();if(n=J.MaxActiveEnumsCount||J.PendingEnums.length==0){return}var T=J.PendingEnums.shift();J.Enum(T[0],T[1],T[2]);d(0)}J.BatchEnum=function(S,V,T,X,U,W){J.PendingBatchOperations+=(V.length*2);b(S,x(V),T,X,{},U,W);r()};function x(S){return JSON.parse(JSON.stringify(S))}function b(S,X,T,aa,Z,U,Y){J.PendingBatchOperations-=2;var W=X.shift(),V=J.Enum;if(W[0]=="*"){V=J.Get;W=W.substring(1)}V(W,function(ad,ab,ac,ae,af){af[2][ab]={response:(ac==null?null:ac.Body),responses:ac,status:ae};if(af[1].length==0||ae==401||(U!=true&&ae!=200&&ae!=400)){J.PendingBatchOperations-=(X.length*2);r();T.call(J,J,S,af[2],ae,aa)}else{r();b(S,X,T,aa,af[2],Y)}},[S,X,Z],Y);r()}J.BatchGet=function(S,U,T,W,V){h({name:S,names:U,callback:T,current:0,responses:{},tag:W,pri:V});r()};function h(S){if(S.names.length<=S.current){S.callback.call(J,J,S.name,S.responses,200,S.tag)}else{J.wsman.ExecGet(J.CompleteName(S.names[S.current]),function(V,U,T,W){g(S,T,W)},S.pri);S.current++}r()}function g(S,T,U){if(T==null||U!=200){S.callback.call(J,J,S.name,null,U,S.tag)}else{S.responses[T.Header.Method]=T;h(S)}}J.CompleteName=function(S){if(S.indexOf("AMT_")==0){return J.pfx[0]+S}if(S.indexOf("CIM_")==0){return J.pfx[1]+S}if(S.indexOf("IPS_")==0){return J.pfx[2]+S}};J.CompleteExecResponse=function(S){if(S&&S!=null&&S.Body&&(S.Body.ReturnValue!=undefined)){S.Body.ReturnValueStr=J.AmtStatusToStr(S.Body.ReturnValue)}return S};J.RequestPowerStateChange=function(T,S){J.CIM_PowerManagementService_RequestPowerStateChange(T,'http://schemas.xmlsoap.org/ws/2004/08/addressinghttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystemCIM_ComputerSystemManagedSystem',null,null,S)};J.SetBootConfigRole=function(T,S){J.CIM_BootService_SetBootConfigRole('http://schemas.xmlsoap.org/ws/2004/08/addressinghttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSettingIntel(r) AMT: Boot Configuration 0',T,S)};J.CancelAllQueries=function(S){J.wsman.CancelAllQueries(S)};J.AMT_AgentPresenceWatchdog_RegisterAgent=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},S,V,T,U)};J.AMT_AgentPresenceWatchdog_AssertPresence=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AssertShutdown=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AddAction=function(X,W,V,T,S,U,aa,Y,Z){J.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U,aa,Y,Z)};J.AMT_AgentPresenceWatchdog_DeleteAllActions=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},S,V,T,U)};J.AMT_AgentPresenceWatchdogAction_GetActionEac=function(S){J.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},S)};J.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(S){J.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},S)};J.AMT_AgentPresenceWatchdogVA_AssertPresence=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AddAction=function(X,W,V,T,S,U){J.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U)};J.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(S,T){J.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:S},T)};J.AMT_AlarmClockService_AddAlarm=function s(S,T){var V=S.InstanceID;var X=S.ElementName;var Y=S.StartTime.Datetime;var W=S.Interval?S.Interval.Datetime:undefined;var U=S.DeleteOnCompletion;var Z=''+V+""+X+''+Y+""+((W!=undefined)?(''+W+""):"")+""+U+"";J.wsman.ExecMethodXml(J.CompleteName("AMT_AlarmClockService"),"AddAlarm",Z,T)};J.AMT_AuditLog_ClearLog=function(S){J.Exec("AMT_AuditLog","ClearLog",{},S)};J.AMT_AuditLog_RequestStateChange=function(T,U,S){J.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_AuditLog_ReadRecords=function(T,S,U){J.Exec("AMT_AuditLog","ReadRecords",{StartIndex:T},S,U)};J.AMT_AuditLog_SetAuditLock=function(V,T,U,S){J.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:V,Flag:T,Handle:U},S)};J.AMT_AuditLog_ExportAuditLogSignature=function(T,S){J.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:T},S)};J.AMT_AuditLog_SetSigningKeyMaterial=function(W,V,U,T,S){J.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:W,SigningKey:V,LengthOfCertificates:U,Certificates:T},S)};J.AMT_AuditPolicyRule_SetAuditPolicy=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuthorizationService_AddUserAclEntryEx=function(V,U,W,S,X,T){J.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:V,DigestPassword:U,KerberosUserSid:W,AccessPermission:S,Realms:X},T)};J.AMT_AuthorizationService_EnumerateUserAclEntries=function(T,S){J.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:T},S)};J.AMT_AuthorizationService_GetUserAclEntryEx=function(T,S,U){J.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:T},S,U)};J.AMT_AuthorizationService_UpdateUserAclEntryEx=function(W,V,U,X,S,Y,T){J.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:W,DigestUsername:V,DigestPassword:U,KerberosUserSid:X,AccessPermission:S,Realms:Y},T)};J.AMT_AuthorizationService_RemoveUserAclEntry=function(T,S){J.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:T},S)};J.AMT_AuthorizationService_SetAdminAclEntryEx=function(U,T,S){J.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:U,DigestPassword:T},S)};J.AMT_AuthorizationService_GetAdminAclEntry=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},S)};J.AMT_AuthorizationService_GetAdminAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},S)};J.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},S)};J.AMT_AuthorizationService_SetAclEnabledState=function(U,T,S,V){J.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:U,Enabled:T},S,V)};J.AMT_AuthorizationService_GetAclEnabledState=function(T,S,U){J.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:T},S,U)};J.AMT_EndpointAccessControlService_RequestStateChange=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_EndpointAccessControlService_GetPosture=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:T},S)};J.AMT_EndpointAccessControlService_GetPostureHash=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:T},S)};J.AMT_EndpointAccessControlService_UpdatePostureState=function(T,S){J.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:T},S)};J.AMT_EndpointAccessControlService_GetEacOptions=function(S){J.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},S)};J.AMT_EndpointAccessControlService_SetEacOptions=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:T,PostureHashAlgorithm:U},S)};J.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:T},S)};J.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:T},S)};J.AMT_EthernetPortSettings_SetLinkPreference=function(T,U,S){J.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:T,Timeout:U},S)};J.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(T,S){J.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:T},S)};J.AMT_KerberosSettingData_GetCredentialCacheState=function(S){J.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},S)};J.AMT_KerberosSettingData_SetCredentialCacheState=function(T,S){J.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:T},S)};J.AMT_MessageLog_CancelIteration=function(T,S){J.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:T},S)};J.AMT_MessageLog_RequestStateChange=function(T,U,S){J.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_MessageLog_ClearLog=function(S){J.Exec("AMT_MessageLog","ClearLog",{},S)};J.AMT_MessageLog_GetRecords=function(T,U,S,V){J.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:T,MaxReadRecords:U},S,V)};J.AMT_MessageLog_GetRecord=function(T,U,S){J.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:T,PositionToNext:U},S)};J.AMT_MessageLog_PositionAtRecord=function(T,U,V,S){J.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:T,MoveAbsolute:U,RecordNumber:V},S)};J.AMT_MessageLog_PositionToFirstRecord=function(S,T){J.Exec("AMT_MessageLog","PositionToFirstRecord",{},S,T)};J.AMT_MessageLog_FreezeLog=function(T,S){J.Exec("AMT_MessageLog","FreezeLog",{Freeze:T},S)};J.AMT_PublicKeyManagementService_AddCRL=function(U,T,S){J.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:U,SerialNumbers:T},S)};J.AMT_PublicKeyManagementService_ResetCRLList=function(S,T){J.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:S},T)};J.AMT_PublicKeyManagementService_AddCertificate=function(T,S,U){J.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:T},S,U)};J.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:T},S)};J.AMT_PublicKeyManagementService_AddKey=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:T},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(U,T,V,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:U,DNName:T,Usage:V},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(T,V,U,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:T,SigningAlgorithm:V,NullSignedCertificateRequest:U},S)};J.AMT_PublicKeyManagementService_GenerateKeyPair=function(T,U,S){J.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:T,KeyLength:U},S)};J.AMT_RedirectionService_RequestStateChange=function(T,S){J.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:T},S)};J.AMT_RedirectionService_TerminateSession=function(T,S){J.Exec("AMT_RedirectionService","TerminateSession",{SessionType:T},S)};J.AMT_RemoteAccessService_AddMpServer=function(S,X,Z,T,V,aa,Y,W,U){J.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:S,InfoFormat:X,Port:Z,AuthMethod:T,Certificate:V,Username:aa,Password:Y,CN:W},U)};J.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(V,W,T,U,S){J.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:V,TunnelLifeTime:W,ExtendedData:T,MpServer:U},S)};J.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(S,T){J.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_CommitChanges=function(S,T,U){J.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:S},T,U)};J.AMT_SetupAndConfigurationService_Unprovision=function(T,S){J.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:T},S)};J.AMT_SetupAndConfigurationService_PartialUnprovision=function(S,T){J.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(S,T){J.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(T,S){J.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:T},S)};J.AMT_SetupAndConfigurationService_SetMEBxPassword=function(T,S){J.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:T},S)};J.AMT_SetupAndConfigurationService_SetTLSPSK=function(T,U,S){J.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:T,PPS:U},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},S)};J.AMT_SetupAndConfigurationService_GetUuid=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUuid",{},S)};J.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},S)};J.AMT_SystemDefensePolicy_GetTimeout=function(S){J.Exec("AMT_SystemDefensePolicy","GetTimeout",{},S)};J.AMT_SystemDefensePolicy_SetTimeout=function(T,S){J.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:T},S)};J.AMT_SystemDefensePolicy_UpdateStatistics=function(T,V,S,X,U,W){J.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:T,ResetOnRead:V},S,X,U,W)};J.AMT_SystemPowerScheme_SetPowerScheme=function(S,T,U){J.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},S,U,0,{InstanceID:T})};J.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(S,T){J.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},S,T)};J.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(T,V,W,S,U){J.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:T,Tm1:V,Tm2:W},S,U)};J.AMT_TLSCredentialContext_Create=function t(T,U,S,V){J.Create("AMT_TLSCredentialContext",{ElementInContext:T,ElementProvidingContext:U},S,V)};J.AMT_UserInitiatedConnectionService_RequestStateChange=function(T,U,S){J.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_WebUIService_RequestStateChange=function(T,V,S,U){J.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:T,TimeoutPeriod:V},S,U)};J.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:S},T)};J.CIM_Account_RequestStateChange=function(T,U,S){J.Exec("CIM_Account","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_AccountManagementService_CreateAccount=function(U,S,T){J.Exec("CIM_AccountManagementService","CreateAccount",{System:U,AccountTemplate:S},T)};J.CIM_BootConfigSetting_ChangeBootOrder=function(T,S){J.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:T},S)};J.CIM_BootService_SetBootConfigRole=function(S,U,T){J.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:S,Role:U},T,0,1)};J.CIM_Card_ConnectorPower=function(T,U,S){J.Exec("CIM_Card","ConnectorPower",{Connector:T,PoweredOn:U},S)};J.CIM_Card_IsCompatible=function(T,S){J.Exec("CIM_Card","IsCompatible",{ElementToCheck:T},S)};J.CIM_Chassis_IsCompatible=function(T,S){J.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:T},S)};J.CIM_Fan_SetSpeed=function(T,S){J.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:T},S)};J.CIM_KVMRedirectionSAP_RequestStateChange=function(T,U,S){J.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:T},S)};J.CIM_MediaAccessDevice_LockMedia=function(T,S){J.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:T},S)};J.CIM_MediaAccessDevice_SetPowerState=function(T,U,S){J.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_MediaAccessDevice_Reset=function(S){J.Exec("CIM_MediaAccessDevice","Reset",{},S)};J.CIM_MediaAccessDevice_EnableDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:T},S)};J.CIM_MediaAccessDevice_OnlineDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:T},S)};J.CIM_MediaAccessDevice_QuiesceDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:T},S)};J.CIM_MediaAccessDevice_SaveProperties=function(S){J.Exec("CIM_MediaAccessDevice","SaveProperties",{},S)};J.CIM_MediaAccessDevice_RestoreProperties=function(S){J.Exec("CIM_MediaAccessDevice","RestoreProperties",{},S)};J.CIM_MediaAccessDevice_RequestStateChange=function(T,U,S){J.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_PhysicalFrame_IsCompatible=function(T,S){J.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:T},S)};J.CIM_PhysicalPackage_IsCompatible=function(T,S){J.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:T},S)};J.CIM_PowerManagementService_RequestPowerStateChange=function(U,T,V,W,S){J.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:U,ManagedElement:T,Time:V,TimeoutPeriod:W},S,0,1)};J.CIM_PowerSupply_SetPowerState=function(T,U,S){J.Exec("CIM_PowerSupply","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_PowerSupply_Reset=function(S){J.Exec("CIM_PowerSupply","Reset",{},S)};J.CIM_PowerSupply_EnableDevice=function(T,S){J.Exec("CIM_PowerSupply","EnableDevice",{Enabled:T},S)};J.CIM_PowerSupply_OnlineDevice=function(T,S){J.Exec("CIM_PowerSupply","OnlineDevice",{Online:T},S)};J.CIM_PowerSupply_QuiesceDevice=function(T,S){J.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:T},S)};J.CIM_PowerSupply_SaveProperties=function(S){J.Exec("CIM_PowerSupply","SaveProperties",{},S)};J.CIM_PowerSupply_RestoreProperties=function(S){J.Exec("CIM_PowerSupply","RestoreProperties",{},S)};J.CIM_PowerSupply_RequestStateChange=function(T,U,S){J.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Processor_SetPowerState=function(T,U,S){J.Exec("CIM_Processor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Processor_Reset=function(S){J.Exec("CIM_Processor","Reset",{},S)};J.CIM_Processor_EnableDevice=function(T,S){J.Exec("CIM_Processor","EnableDevice",{Enabled:T},S)};J.CIM_Processor_OnlineDevice=function(T,S){J.Exec("CIM_Processor","OnlineDevice",{Online:T},S)};J.CIM_Processor_QuiesceDevice=function(T,S){J.Exec("CIM_Processor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Processor_SaveProperties=function(S){J.Exec("CIM_Processor","SaveProperties",{},S)};J.CIM_Processor_RestoreProperties=function(S){J.Exec("CIM_Processor","RestoreProperties",{},S)};J.CIM_Processor_RequestStateChange=function(T,U,S){J.Exec("CIM_Processor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RecordLog_ClearLog=function(S){J.Exec("CIM_RecordLog","ClearLog",{},S)};J.CIM_RecordLog_RequestStateChange=function(T,U,S){J.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RedirectionService_RequestStateChange=function(T,U,S){J.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Sensor_SetPowerState=function(T,U,S){J.Exec("CIM_Sensor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Sensor_Reset=function(S){J.Exec("CIM_Sensor","Reset",{},S)};J.CIM_Sensor_EnableDevice=function(T,S){J.Exec("CIM_Sensor","EnableDevice",{Enabled:T},S)};J.CIM_Sensor_OnlineDevice=function(T,S){J.Exec("CIM_Sensor","OnlineDevice",{Online:T},S)};J.CIM_Sensor_QuiesceDevice=function(T,S){J.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Sensor_SaveProperties=function(S){J.Exec("CIM_Sensor","SaveProperties",{},S)};J.CIM_Sensor_RestoreProperties=function(S){J.Exec("CIM_Sensor","RestoreProperties",{},S)};J.CIM_Sensor_RequestStateChange=function(T,U,S){J.Exec("CIM_Sensor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_StatisticalData_ResetSelectedStats=function(T,S){J.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:T},S)};J.CIM_Watchdog_KeepAlive=function(S){J.Exec("CIM_Watchdog","KeepAlive",{},S)};J.CIM_Watchdog_SetPowerState=function(T,U,S){J.Exec("CIM_Watchdog","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Watchdog_Reset=function(S){J.Exec("CIM_Watchdog","Reset",{},S)};J.CIM_Watchdog_EnableDevice=function(T,S){J.Exec("CIM_Watchdog","EnableDevice",{Enabled:T},S)};J.CIM_Watchdog_OnlineDevice=function(T,S){J.Exec("CIM_Watchdog","OnlineDevice",{Online:T},S)};J.CIM_Watchdog_QuiesceDevice=function(T,S){J.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:T},S)};J.CIM_Watchdog_SaveProperties=function(S){J.Exec("CIM_Watchdog","SaveProperties",{},S)};J.CIM_Watchdog_RestoreProperties=function(S){J.Exec("CIM_Watchdog","RestoreProperties",{},S)};J.CIM_Watchdog_RequestStateChange=function(T,U,S){J.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_WiFiPort_SetPowerState=function(T,U,S){J.Exec("CIM_WiFiPort","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_WiFiPort_Reset=function(S){J.Exec("CIM_WiFiPort","Reset",{},S)};J.CIM_WiFiPort_EnableDevice=function(T,S){J.Exec("CIM_WiFiPort","EnableDevice",{Enabled:T},S)};J.CIM_WiFiPort_OnlineDevice=function(T,S){J.Exec("CIM_WiFiPort","OnlineDevice",{Online:T},S)};J.CIM_WiFiPort_QuiesceDevice=function(T,S){J.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:T},S)};J.CIM_WiFiPort_SaveProperties=function(S){J.Exec("CIM_WiFiPort","SaveProperties",{},S)};J.CIM_WiFiPort_RestoreProperties=function(S){J.Exec("CIM_WiFiPort","RestoreProperties",{},S)};J.CIM_WiFiPort_RequestStateChange=function(T,U,S){J.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_HostBasedSetupService_Setup=function(W,X,V,T,Y,U,S){J.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:W,NetworkAdminPassword:X,McNonce:V,Certificate:T,SigningAlgorithm:Y,DigitalSignature:U},S)};J.IPS_HostBasedSetupService_AddNextCertInChain=function(V,T,U,S){J.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:V,IsLeafCertificate:T,IsRootCertificate:U},S)};J.IPS_HostBasedSetupService_AdminSetup=function(V,W,U,X,T,S){J.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:V,NetworkAdminPassword:W,McNonce:U,SigningAlgorithm:X,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(U,V,T,S){J.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:U,SigningAlgorithm:V,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_DisableClientControlMode=function(S,T){J.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:S},T)};J.IPS_KVMRedirectionSettingData_TerminateSession=function(S){J.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelRead=function(S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelWrite=function(T,S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:T},S)};J.IPS_OptInService_StartOptIn=function(S){J.Exec("IPS_OptInService","StartOptIn",{},S)};J.IPS_OptInService_CancelOptIn=function(S){J.Exec("IPS_OptInService","CancelOptIn",{},S)};J.IPS_OptInService_SendOptInCode=function(T,S){J.Exec("IPS_OptInService","SendOptInCode",{OptInCode:T},S)};J.IPS_OptInService_StartService=function(S){J.Exec("IPS_OptInService","StartService",{},S)};J.IPS_OptInService_StopService=function(S){J.Exec("IPS_OptInService","StopService",{},S)};J.IPS_OptInService_RequestStateChange=function(T,U,S){J.Exec("IPS_OptInService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_RequestStateChange=function(T,U,S){J.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_ClearLog=function(S,T){J.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:S},T)};J.IPS_SecIOService_RequestStateChange=function(T,U,S){J.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AmtStatusToStr=function(S){if(J.AmtStatusCodes[S]){return J.AmtStatusCodes[S]}else{return"UNKNOWN_ERROR"}};J.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};J.GetMessageLog=function(S,T){J.AMT_MessageLog_PositionToFirstRecord(k,[S,T,[]])};function k(U,S,T,V,W){if(V!=200||T.Body.ReturnValue!="0"){W[0](J,null,W[2],V);return}J.AMT_MessageLog_GetRecords(T.Body.IterationIdentifier,390,l,W)}function l(Z,W,Y,aa,ac){if(aa!=200||Y.Body.ReturnValue!="0"){ac[0](J,null,ac[2],aa);return}var U,V,ae,T,S=ac[2],ab=new Date(),ad,X=Y.Body.RecordArray;if(typeof X==="string"){Y.Body.RecordArray=[Y.Body.RecordArray]}for(U in X){T=Buffer.from(X[U],"base64");if(T!=null){ad=M(T,0);if((ad>0)&&(ad<4294967295)){ae={DeviceAddress:T[4],EventSensorType:T[5],EventType:T[6],EventOffset:T[7],EventSourceType:T[8],EventSeverity:T[9],SensorNumber:T[10],Entity:T[11],EntityInstance:T[12],EventData:[],Time:new Date((ad+(ab.getTimezoneOffset()*60))*1000)};for(V=13;V<21;V++){ae.EventData.push(T[V])}ae.EntityStr=o[ae.Entity];ae.Desc=j(ae.EventSensorType,ae.EventOffset,ae.EventData,ae.Entity);if(!ae.EntityStr){ae.EntityStr="Unknown"}S.push(ae)}}}if(Y.Body.NoMoreRecords!=true){J.AMT_MessageLog_GetRecords(Y.Body.IterationIdentifier,390,l,[ac[0],S,ac[2]])}else{ac[0](J,S,ac[2])}}var f="Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var p="Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split("|");var q="Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split("|");var o="Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split("|");J.RealmNames="||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split("|");J.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};function j(V,U,T,S){if(V==15){if(T[0]==235){return"Invalid Data"}if(U==0){return p[T[1]]}return q[T[1]]}if(V==18&&T[0]==170){return"Agent watchdog "+char2hex(T[4])+char2hex(T[3])+char2hex(T[2])+char2hex(T[1])+"-"+char2hex(T[6])+char2hex(T[5])+"-... changed to "+J.WatchdogCurrentStates[T[7]]}if(V==6){return"Authentication failed "+(T[1]+(T[2]<<8))+" times. The system may be under attack."}if(V==30){return"No bootable media"}if(V==32){return"Operating system lockup or power interrupt"}if(V==35){return"System boot failure"}if(V==37){return"System firmware started (at least one CPU is properly executing)."}return"Unknown Sensor Type #"+V}var a={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",20:"Security Audit Log",21:"Network Time",22:"Network Administration",23:"Storage Administration",24:"Event Manager",25:"Circuit Breaker Manager",26:"Agent Presence Manager",27:"Wireless Configuration",28:"EAC",29:"KVM",30:"User Opt-In Events",32:"Screen Blanking",33:"Watchdog Events",1600:"Provisioning Started",1601:"Provisioning Completed",1602:"ACL Entry Added",1603:"ACL Entry Modified",1604:"ACL Entry Removed",1605:"ACL Access with Invalid Credentials",1606:"ACL Entry State",1607:"TLS State Changed",1608:"TLS Server Certificate Set",1609:"TLS Server Certificate Remove",1610:"TLS Trusted Root Certificate Added",1611:"TLS Trusted Root Certificate Removed",1612:"TLS Preshared Key Set",1613:"Kerberos Settings Modified",1614:"Kerberos Master Key Modified",1615:"Flash Wear out Counters Reset",1616:"Power Package Modified",1617:"Set Realm Authentication Mode",1618:"Upgrade Client to Admin Control Mode",1619:"Unprovisioning Started",1700:"Performed Power Up",1701:"Performed Power Down",1702:"Performed Power Cycle",1703:"Performed Reset",1704:"Set Boot Options",1800:"IDER Session Opened",1801:"IDER Session Closed",1802:"IDER Enabled",1803:"IDER Disabled",1804:"SoL Session Opened",1805:"SoL Session Closed",1806:"SoL Enabled",1807:"SoL Disabled",1808:"KVM Session Started",1809:"KVM Session Ended",1810:"KVM Enabled",1811:"KVM Disabled",1812:"VNC Password Failed 3 Times",1900:"Firmware Updated",1901:"Firmware Update Failed",2000:"Security Audit Log Cleared",2001:"Security Audit Policy Modified",2002:"Security Audit Log Disabled",2003:"Security Audit Log Enabled",2004:"Security Audit Log Exported",2005:"Security Audit Log Recovered",2100:"Intel(R) ME Time Set",2200:"TCPIP Parameters Set",2201:"Host Name Set",2202:"Domain Name Set",2203:"VLAN Parameters Set",2204:"Link Policy Set",2205:"IPv6 Parameters Set",2300:"Global Storage Attributes Set",2301:"Storage EACL Modified",2302:"Storage FPACL Modified",2303:"Storage Write Operation",2400:"Alert Subscribed",2401:"Alert Unsubscribed",2402:"Event Log Cleared",2403:"Event Log Frozen",2500:"CB Filter Added",2501:"CB Filter Removed",2502:"CB Policy Added",2503:"CB Policy Removed",2504:"CB Default Policy Set",2505:"CB Heuristics Option Set",2506:"CB Heuristics State Cleared",2600:"Agent Watchdog Added",2601:"Agent Watchdog Removed",2602:"Agent Watchdog Action Set",2700:"Wireless Profile Added",2701:"Wireless Profile Removed",2702:"Wireless Profile Updated",2800:"EAC Posture Signer SET",2801:"EAC Enabled",2802:"EAC Disabled",2803:"EAC Posture State",2804:"EAC Set Options",2900:"KVM Opt-in Enabled",2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3000:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};J.GetAuditLogExtendedDataStr=function(T,S){if((T==1602||T==1604)&&S[0]==0){return w(S).splice(2,2+S[1]).toString()}if(T==1603){if(S[1]==0){return w(S).splice(3).toString()}return null}if(T==1605){return["Invalid ME access","Invalid MEBx access"][S[0]]}if(T==1606){var U=["Disabled","Enabled"][S[0]];if(S[1]==0){U+=", "+S[3]}return U}if(T==1607){return"Remote "+["NoAuth","ServerAuth","MutualAuth"][S[0]]+", Local "+["NoAuth","ServerAuth","MutualAuth"][S[1]]}if(T==1617){return J.RealmNames[L(S,0)]+", "+["NoAuth","Auth","Disabled"][S[4]]}if(T==1619){return["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][S[0]]}if(T==1900){return"From "+N(S,0)+"."+N(S,2)+"."+N(S,4)+"."+N(S,6)+" to "+N(S,8)+"."+N(S,10)+"."+N(S,12)+"."+N(S,14)}if(T==2100){var V=new Date();V.setTime(L(S,0)*1000+(new Date().getTimezoneOffset()*60000));return V.toLocaleString()}if(T==3000){return"From "+["None","KVM","All"][S[0]]+" to "+["None","KVM","All"][S[1]]}if(T==3001){return["Success","Failed 3 times"][S[0]]}return null};J.GetAuditLog=function(S){J.AMT_AuditLog_ReadRecords(1,i,[S,[]])};function I(S){if(!S||S==null||typeof S=="object"){return S}return[S]}function N(T,S){return(T[S]<<8)+T[S+1]}function L(T,S){return(T[S]*16777216)+(T[S+1]<<16)+(T[S+2]<<8)+T[S+3]}function M(T,S){return(T[S+3]*16777216)+(T[S+2]<<16)+(T[S+1]<<8)+T[S]}function v(S){return Buffer.from(S).toString("base64")}function u(T){var U=null;try{U=Buffer.from(T,"base64").toString()}catch(S){console.log(S)}return U}function w(S){var U=[];for(var T in S){U.push(S[T])}return U}function i(ab,W,aa,ac,ae){if(ac!=200){ae[0](J,[],ac);return}var Y,V,S,ah,Z=ae[1],ad=new Date(),af;if(aa.Body.RecordsReturned>0){aa.Body.EventRecords=I(aa.Body.EventRecords);for(V in aa.Body.EventRecords){S=null;try{S=Buffer.from(aa.Body.EventRecords[V],"base64")}catch(T){console.log(T+" "+aa.Body.EventRecords[V])}ah={AuditAppID:N(S,0),EventID:N(S,2),InitiatorType:S[4]};ah.AuditApp=a[ah.AuditAppID];ah.Event=a[(ah.AuditAppID*100)+ah.EventID];if(!ah.Event){ah.Event="#"+ah.EventID}if(ah.InitiatorType==0){var ag=S[5];ah.Initiator=S.slice(6,6+ag).toString();Y=6+ag}if(ah.InitiatorType==1){ah.KerberosUserInDomain=L(S,5);var ag=S[9];ah.Initiator=G(S.slice(10,10+ag));Y=10+ag}if(ah.InitiatorType==2){ah.Initiator="Local";Y=5}if(ah.InitiatorType==3){ah.Initiator="KVM Default Port";Y=5}af=L(S,Y);ah.Time=new Date((af+(ad.getTimezoneOffset()*60))*1000);Y+=4;ah.MCLocationType=S[Y++];var X=S[Y++];ah.NetAddress=S.slice(Y,Y+X).toString();Y+=X;var U=S[Y++];ah.Ex=S.slice(Y,Y+U);ah.ExStr=J.GetAuditLogExtendedDataStr((ah.AuditAppID*100)+ah.EventID,ah.Ex);Z.push(ah)}}if(aa.Body.TotalRecordCount>Z.length){J.AMT_AuditLog_ReadRecords(Z.length+1,i,[ae[0],Z])}else{ae[0](J,Z,ac)}}function C(U){if(U===undefined||U===null){return null}var V="";for(var T in U){var S=U[T];if(!S){continue}if(S.__parameterType==="reference"){V+=O(T,S)}else{V+=H(T,S)}}return V}function H(V,U){if(U===undefined||U===null){return null}var T=!!U.__namespace;var Z=T?"";for(var X in U){if(!U.hasOwnProperty(X)||X.indexOf("__")===0){continue}if(typeof U[X]==="function"||Array.isArray(U[X])){continue}if(typeof U[X]==="object"){console.error("only convert one level down...")}else{Y+=Z+X+">"+U[X].toString()+S+X+">"}}Y+="";return Y}function O(T,S){if(S===undefined||S===null){return null}var U="/wsman"+S.__resourceUri+"";for(var V in S){if(!S.hasOwnProperty(V)||V.indexOf("__")===0){continue}if(typeof S[V]==="function"||typeof S[V]==="object"||Array.isArray(S[V])){continue}U+=''+S[V].toString()+""}U+="";return U}function G(U){var T="S-"+U.charCodeAt(0)+"-"+U.charCodeAt(7);for(var S=2;S<(U.length/4);S++){T+="-"+M(U,S*4)}return T}function F(V){if(!V||V==null){return null}var U=V.split("-");if(U.length<4||(U[0]!="s"&&U[0]!="S")){return null}for(var S=1;S0?this[this.length-1]:undefined)}})}catch(e){}function dbus(a,b){this._ObjectID="linux-dbus";require("events").EventEmitter.call(this,true).createEvent("signal");Object.defineProperty(this,"uid",{value:b});this._child=require("child_process").execFile("/bin/sh",["sh"],{type:require("child_process").SpawnTypes.TERM,uid:b==null?-1:b});this._child.stdin.write("dbus-monitor --session \"type='signal', interface='"+a+'\'" | ( while read X; do echo "$X"; done )\n');this._child.stdout.dbus=this;this._child.stdout.on("data",function(c){if(!this.ready){this.ready=true;return}var f=[];var g=c.toString().split("\r\n");for(var d in g){if(g[d]==""){this.dbus.preParseRecords(f);f=[]}else{f.push(g[d])}}});this.preParseRecords=function(d){var f=[];for(var c in d){if(d[c].startsWith("signal ")){if(f.length>0){this.parseRecords(f)}f=[]}f.push(d[c])}if(f.length>0){this.parseRecords(f)}};this.parseRecords=function(d){if(d[0].startsWith("signal ")){var g={};var h=d[0].split(" ");h.shift();for(var c in h){var f=h[c].split("=");if(f.length==2){g[f[0]]=f[1]}}d.shift();g.data=d;this.parseSignal(g)}};this.parseSignal=function(f){var c=f.data;f.data=[];for(var d=0;d0?this[this.length-1]:undefined)}})}catch(e){}try{Object.defineProperty(String.prototype,"replaceAll",{value:function replaceAll(b,a){return(this.split(b).join(a))}})}catch(e){}var RSMB=1381190978;var memoryLocation={1:"Other",2:"Unknown",3:"System Board",4:"ISA",5:"EISA",6:"PCI",7:"MCA",8:"PCMCIA",9:"Proprietary",10:"NuBus",160:"PC-98/C20",161:"PC-98/C24",162:"PC-98/E",163:"PC-98/LB"};var wakeReason=["Reserved","Other","Unknown","APM Timer","Modem Ring","LAN","Power Switch","PCI","AC Power"];function zeroLeftPad(c,b){if((b==null)&&(typeof(b)!="number")){return null}if(c==null){c=""}var d="";for(var a=0;a1){var r=v[1].split("\x0A\x0A")[0].split("\x0A");var s=[];for(var t in r){var u=r[t].trim().replaceAll(" ","").replaceAll("\x09","");if(!(u[0]=='"')){s.push(u)}}p.write(Buffer.from(s.join(""),"hex"));p.write(Buffer.from("00","hex"))}else{p.write(Buffer.from("0000","hex"))}}var q=p.buffer;q.ms=p;return(q)}}this._parse=function b(o){var n={};var m;var l=0;var o;var s=0;while(o&&l0){var n=l[4].pop();var o=n[20]&64;var s=n[20]&7;if(o){var m={_ObjectID:"SMBiosTables.processorInfo"};m.Processor=q[n[1]];m.MaxSpeed=n.readUInt16LE(16)+" Mhz";if(n[31]){m.Cores=n[31]}if(n[33]){m.Threads=n[33]}m.Populated=1;m.Status=t[s];m.Socket=n._strings[n[0]-1];m.Manufacturer=n._strings[n[3]-1];m.Version=n._strings[n[12]-1];r.push(m)}}return(r)};this.memoryInfo=function f(k){if(!k){throw ("no data")}var n={_ObjectID:"SMBiosTables.memoryInfo"};if(k[16]){var l=k[16].peek();n.location=memoryLocation[l[0]];if((n.maxCapacityKb=l.readUInt32LE(3))==2147483648){n.maxCapacityKb="A really big number"}}return(n)};this.systemInfo=function i(k){if(!k){throw ("no data")}var l={_ObjectID:"SMBiosTables.systemInfo"};if(k[1]){var m=k[1].peek();var n=m.slice(4,20);l.uuid=[zeroLeftPad(n.readUInt32LE(0).toString(16),8),zeroLeftPad(n.readUInt16LE(4).toString(16),4),zeroLeftPad(n.readUInt16LE(6).toString(16),4),zeroLeftPad(n.readUInt16BE(8).toString(16),4),zeroLeftPad(n.slice(10).toString("hex").toLowerCase(),12)].join("-");l.wakeReason=wakeReason[m[20]]}return(l)};this.systemSlots=function j(k){if(!k){throw ("no data")}var l=[];if(k[9]){while(k[9].length>0){var m=k[9].pop();l.push({name:m._strings[m[0]-1]})}}return(l)};this.amtInfo=function c(l){if(!l){throw ("no data")}var n={AMT:false};if(l[130]&&l[130].peek().slice(0,4).toString()=="$AMT"){var k=l[130].peek();n.AMT=k[4]?true:false;if(n.AMT){n.enabled=k[5]?true:false;n.storageRedirection=k[6]?true:false;n.serialOverLan=k[7]?true:false;n.kvm=k[14]?true:false;if(l[131].peek()&&l[131].peek().slice(52,56).toString()=="vPro"){var o=l[131].peek();if(o[0]&4){n.TXT=(o[0]&8)?true:false}if(o[0]&16){n.VMX=(o[0]&32)?true:false}n.MEBX=o.readUInt16LE(10).toString()+"."+o.readUInt16LE(8).toString()+"."+o.readUInt16LE(6).toString()+"."+o.readUInt16LE(4).toString();var m=o.slice(20,32);n.ManagementEngine=m.readUInt16LE(6).toString()+"."+m.readUInt16LE(4).toString()+"."+m.readUInt16LE(2).toString()+"."+m.readUInt16LE(0).toString()}}}return(n)};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();
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/toaster.min.js b/agents/modules_meshcore_min/toaster.min.js
deleted file mode 100644
index 407f7047..00000000
--- a/agents/modules_meshcore_min/toaster.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var toasters={};function Toaster(){this._ObjectID="toaster";this.Toast=function a(l,b){var h={};var d=require("events").inherits(h);d.createEvent("Dismissed");h.title=l;h.caption=b;if(process.platform=="win32"){d.createEvent("Clicked");var j=require("user-sessions").Current();for(var f in j){console.log(j[f])}try{console.log("Attempting Toast Mechanism 1");h._child=require("ScriptContainer").Create({processIsolation:true,sessionId:j.Active[0].SessionId})}catch(c){console.log(c);console.log("Attempting Toast Mechanism 2");h._child=require("ScriptContainer").Create({processIsolation:true})}h._child.parent=h;h._child.on("exit",function(e){this.parent.emit("Dismissed");delete this.parent._child});h._child.addModule("win-console",getJSModule("win-console"));h._child.addModule("win-message-pump",getJSModule("win-message-pump"));var k=" try{ var toast = require('win-console'); var balloon = toast.SetTrayIcon({ szInfo: '"+b+"', szInfoTitle: '"+l+"', balloonOnly: true }); balloon.on('ToastDismissed', function(){process.exit();}); } catch(e) { require('ScriptContainer').send(e); } require('ScriptContainer').send('done'); ";h._child.ExecuteString(k);toasters[h._hashCode()]=h;h.on("Dismissed",function(){delete toasters[this._hashCode()]});console.log("Returning");return(h)}else{if(!require("fs").existsSync("/usr/bin/notify-send")){throw ("Toast not supported on this platform")}Object.defineProperty(h,"_sessions",{value:require("user-sessions").Current(function g(e){this._cchild=require("child_process").execFile("/usr/bin/whoami",["whoami"],{type:require("child_process").SpawnTypes.TERM});this._cchild.stdout.on("data",function(i){if(i.toString().split("\r\n")[0]=="root"){if(e[":0"].State!="Connected"&&e[":0"].State!="Active"){this.parent.parent.Parent.emit("Dismissed");return}this.parent.parent._notify=require("child_process").execFile("/bin/sh",["sh"],{type:require("child_process").SpawnTypes.TERM});this.parent.parent._notify.stdin.write("su - "+e[":0"].Username+" -c \"DISPLAY=:0 notify-send '"+this.parent.parent.Parent.title+"' '"+this.parent.parent.Parent.caption+"'\"\n");this.parent.parent._notify.stdin.write("exit\n");this.parent.parent._notify.stdout.on("data",function(n){})}else{this.parent.parent._notify=require("child_process").execFile("/usr/bin/notify-send",["notify-send",this.parent.parent.Parent.title,this.parent.parent.Parent.caption],{type:require("child_process").SpawnTypes.TERM});this.parent.parent._notify.stdout.on("data",function(n){})}this.parent.parent.Parent._timeout=setTimeout(function m(n){n.emit("Dismissed")},10000,this.parent.parent.Parent)});this._cchild.parent=this})});h._sessions.Parent=h;toasters[h._hashCode()]=h;h.on("Dismissed",function(){delete toasters[this._hashCode()]});return(h)}}}module.exports=new Toaster();
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/wifi-scanner-windows.min.js b/agents/modules_meshcore_min/wifi-scanner-windows.min.js
deleted file mode 100644
index 752e15ac..00000000
--- a/agents/modules_meshcore_min/wifi-scanner-windows.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function _Scan(){var f=this.Marshal.CreatePointer();this.Native.WlanEnumInterfaces(this.Handle,0,f);var a=f.Deref().Deref(0,4).toBuffer().readUInt32LE(0);var d=f.Deref().Deref(8,532);var c=d.Deref(16,512).AnsiString;var e;switch(d.Deref(528,4).toBuffer().readUInt32LE(0)){case 0:e="NOT READY";break;case 1:e="CONNECTED";break;case 2:e="AD-HOC";break;case 3:e="DISCONNECTING";break;case 4:e="DISCONNECTED";break;case 5:e="ASSOCIATING";break;case 6:e="DISCOVERING";break;case 7:e="AUTHENTICATING";break;default:e="UNKNOWN";break}var b=d.Deref(0,16);if(this.Native.WlanScan(this.Handle,b,0,0,0).Val==0){return(true)}else{return(false)}}function AccessPoint(d,a,c,b){this.ssid=d;this.bssid=a;this.rssi=c;this.lq=b}AccessPoint.prototype.toString=function(){return(this.ssid+" ["+this.bssid+"]: "+this.lq)};function OnNotify(g){var h=g.Deref(0,4).toBuffer().readUInt32LE(0);var f=g.Deref(4,4).toBuffer().readUInt32LE(0);var c=g.Deref(8,16);if((h&8)&&(f==7)){var a=this.Parent.Marshal.CreatePointer();var k=this.Parent.Native.GetBSSList(this.Parent.Handle,c,0,3,0,0,a).Val;if(k==0){var n=a.Deref().Deref(0,4).toBuffer().readUInt32LE(0);var j=a.Deref().Deref(4,4).toBuffer().readUInt32LE(0);for(i=0;i"){g=""}}if(j.startsWith("Signal level=")){f=j.slice(13,j.length-4)}else{if(j.startsWith("Quality=")){f=j.slice(8,10);var k=j.slice(11,13)}}}this.parent.parent.emit("accessPoint",new AccessPoint(g,e,f))}})}}}}}module.exports=WiFiScanner;
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/win-console.min.js b/agents/modules_meshcore_min/win-console.min.js
deleted file mode 100644
index e2197744..00000000
--- a/agents/modules_meshcore_min/win-console.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var TrayIconFlags={NIF_MESSAGE:1,NIF_ICON:2,NIF_TIP:4,NIF_STATE:8,NIF_INFO:16,NIF_GUID:32,NIF_REALTIME:64,NIF_SHOWTIP:128,NIM_ADD:0,NIM_MODIFY:1,NIM_DELETE:2,NIM_SETFOCUS:3,NIM_SETVERSION:4};var NOTIFYICON_VERSION_4=4;var MessageTypes={WM_APP:32768,WM_USER:1024};function WindowsConsole(){if(process.platform=="win32"){this._ObjectID="win-console";this._Marshal=require("_GenericMarshal");this._kernel32=this._Marshal.CreateNativeProxy("kernel32.dll");this._user32=this._Marshal.CreateNativeProxy("user32.dll");this._kernel32.CreateMethod("GetConsoleWindow");this._kernel32.CreateMethod("GetCurrentThread");this._user32.CreateMethod("ShowWindow");this._user32.CreateMethod("LoadImageA");this._user32.CreateMethod({method:"GetMessageA",threadDispatch:1});this._shell32=this._Marshal.CreateNativeProxy("Shell32.dll");this._shell32.CreateMethod("Shell_NotifyIconA");this._handle=this._kernel32.GetConsoleWindow();this.minimize=function(){this._user32.ShowWindow(this._handle,6)};this.restore=function(){this._user32.ShowWindow(this._handle,9)};this.hide=function(){this._user32.ShowWindow(this._handle,0)};this.show=function(){this._user32.ShowWindow(this._handle,5)};this._loadicon=function(c){var b=this._user32.LoadImageA(0,this._Marshal.CreateVariable(c),1,0,0,16|32768|64);return(b)};this.SetTrayIcon=function a(h){var b=this._Marshal.CreateVariable(this._Marshal.PointerSize==4?508:528);b.toBuffer().writeUInt32LE(b._size,0);var n=TrayIconFlags.NIF_TIP|TrayIconFlags.NIF_MESSAGE;h.filter=MessageTypes.WM_APP+1;b.Deref(this._Marshal.PointerSize==4?16:24,4).toBuffer().writeUInt32LE(h.filter);if(!h.noBalloon){n|=TrayIconFlags.NIF_INFO}if(h.icon){n|=TrayIconFlags.NIF_ICON;var c=b.Deref(this._Marshal.PointerSize==4?20:32,this._Marshal.PointerSize);h.icon.pointerBuffer().copy(c.toBuffer())}b.Deref(this._Marshal.PointerSize*2,4).toBuffer().writeUInt32LE(1);b.Deref(this._Marshal.PointerSize==4?12:20,4).toBuffer().writeUInt32LE(n);b.Deref(this._Marshal.PointerSize==4?416:432,4).toBuffer().writeUInt32LE(NOTIFYICON_VERSION_4);var m=b.Deref(this._Marshal.PointerSize==4?24:40,128);var k=b.Deref(this._Marshal.PointerSize==4?160:176,256);var l=b.Deref(this._Marshal.PointerSize==4?420:436,64);if(h.szTip){Buffer.from(h.szTip).copy(m.toBuffer())}if(h.szInfo){Buffer.from(h.szInfo).copy(k.toBuffer())}if(h.szInfoTitle){Buffer.from(h.szInfoTitle).copy(l.toBuffer())}var d=require("win-message-pump");retVal={_ObjectID:"WindowsConsole.TrayIcon",MessagePump:new d(h)};var j=require("events").inherits(retVal);j.createEvent("ToastClicked");j.createEvent("IconHover");j.createEvent("ToastDismissed");retVal.Options=h;retVal.MessagePump.TrayIcon=retVal;retVal.MessagePump.NotifyData=b;retVal.MessagePump.WindowsConsole=this;retVal.MessagePump.on("exit",function e(o){console.log("Pump Exited");if(this.TrayIcon){this.TrayIcon.remove()}});retVal.MessagePump.on("hwnd",function f(o){h.hwnd=o;o.pointerBuffer().copy(this.NotifyData.Deref(this.WindowsConsole._Marshal.PointerSize,this.WindowsConsole._Marshal.PointerSize).toBuffer());if(this.WindowsConsole._shell32.Shell_NotifyIconA(TrayIconFlags.NIM_ADD,this.NotifyData).Val==0){}});retVal.MessagePump.on("message",function g(p){if(p.message==this.TrayIcon.Options.filter){var o=false;if(p.wparam==1&&p.lparam==1029){this.TrayIcon.emit("ToastClicked");o=true}if(p.wparam==1&&p.lparam==512){this.TrayIcon.emit("IconHover");o=true}if(this.TrayIcon.Options.balloonOnly&&p.wparam==1&&(p.lparam==1028||p.lparam==1029)){this.TrayIcon.emit("ToastDismissed");this.TrayIcon.remove();o=true}}});retVal.remove=function i(){this.MessagePump.WindowsConsole._shell32.Shell_NotifyIconA(TrayIconFlags.NIM_DELETE,this.MessagePump.NotifyData);this.MessagePump.stop();delete this.MessagePump.TrayIcon;delete this.MessagePump};return(retVal)}}}module.exports=new WindowsConsole();
\ No newline at end of file
diff --git a/agents/modules_meshcore_min/win-terminal.min.js b/agents/modules_meshcore_min/win-terminal.min.js
deleted file mode 100644
index a954e934..00000000
--- a/agents/modules_meshcore_min/win-terminal.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var promise=require("promise");var duplex=require("stream").Duplex;var SW_HIDE=0;var SW_MINIMIZE=6;var STARTF_USESHOWWINDOW=1;var STD_INPUT_HANDLE=-10;var STD_OUTPUT_HANDLE=-11;var EVENT_CONSOLE_CARET=16385;var EVENT_CONSOLE_END_APPLICATION=16391;var WINEVENT_OUTOFCONTEXT=0;var WINEVENT_SKIPOWNPROCESS=2;var CREATE_NEW_PROCESS_GROUP=512;var EVENT_CONSOLE_UPDATE_REGION=16386;var EVENT_CONSOLE_UPDATE_SIMPLE=16387;var EVENT_CONSOLE_UPDATE_SCROLL=16388;var EVENT_CONSOLE_LAYOUT=16389;var EVENT_CONSOLE_START_APPLICATION=16390;var KEY_EVENT=1;var MAPVK_VK_TO_VSC=0;var WM_QUIT=18;var GM=require("_GenericMarshal");var si=GM.CreateVariable(GM.PointerSize==4?68:104);var pi=GM.CreateVariable(GM.PointerSize==4?16:24);si.Deref(0,4).toBuffer().writeUInt32LE(GM.PointerSize==4?68:104);si.Deref(GM.PointerSize==4?48:64,2).toBuffer().writeUInt16LE(SW_HIDE|SW_MINIMIZE);si.Deref(GM.PointerSize==4?44:60,4).toBuffer().writeUInt32LE(STARTF_USESHOWWINDOW);var MSG=GM.CreateVariable(GM.PointerSize==4?28:48);function windows_terminal(){this._ObjectID="windows_terminal";this._user32=GM.CreateNativeProxy("User32.dll");this._user32.CreateMethod("DispatchMessageA");this._user32.CreateMethod("GetMessageA");this._user32.CreateMethod("MapVirtualKeyA");this._user32.CreateMethod("PostThreadMessageA");this._user32.CreateMethod("SetWinEventHook");this._user32.CreateMethod("ShowWindow");this._user32.CreateMethod("TranslateMessage");this._user32.CreateMethod("UnhookWinEvent");this._user32.CreateMethod("VkKeyScanA");this._user32.terminal=this;this._kernel32=GM.CreateNativeProxy("Kernel32.dll");this._kernel32.CreateMethod("AllocConsole");this._kernel32.CreateMethod("CreateProcessA");this._kernel32.CreateMethod("CloseHandle");this._kernel32.CreateMethod("FillConsoleOutputAttribute");this._kernel32.CreateMethod("FillConsoleOutputCharacterA");this._kernel32.CreateMethod("GetConsoleScreenBufferInfo");this._kernel32.CreateMethod("GetConsoleWindow");this._kernel32.CreateMethod("GetLastError");this._kernel32.CreateMethod("GetStdHandle");this._kernel32.CreateMethod("GetThreadId");this._kernel32.CreateMethod("ReadConsoleOutputA");this._kernel32.CreateMethod("SetConsoleCursorPosition");this._kernel32.CreateMethod("SetConsoleScreenBufferSize");this._kernel32.CreateMethod("SetConsoleWindowInfo");this._kernel32.CreateMethod("TerminateProcess");this._kernel32.CreateMethod("WaitForSingleObject");this._kernel32.CreateMethod("WriteConsoleInputA");var b=0;var c=0;this._scrx=0;this._scry=0;this.SendCursorUpdate=function(){var f=GM.CreateVariable(22);if(this._kernel32.GetConsoleScreenBufferInfo(this._stdoutput,f).Val==0){return}if(f.Deref(4,2).toBuffer().readUInt16LE()!=this.currentX||f.Deref(6,2).toBuffer().readUInt16LE()!=this.currentY){this.currentX=f.Deref(4,2).toBuffer().readUInt16LE();this.currentY=f.Deref(6,2).toBuffer().readUInt16LE()}};this.ClearScreen=function(){var g=GM.CreateVariable(22);if(this._kernel32.GetConsoleScreenBufferInfo(this._stdoutput,g).Val==0){return}var h=GM.CreateVariable(4);var i=g.Deref(0,2).toBuffer().readUInt16LE(0)*g.Deref(2,2).toBuffer().readUInt16LE(0);var f=GM.CreateVariable(4);if(this._kernel32.FillConsoleOutputCharacterA(this._stdoutput,32,i,h.Deref(0,4).toBuffer().readUInt32LE(),f).Val==0){return}if(this._kernel32.GetConsoleScreenBufferInfo(this._stdoutput,g).Val==0){return}if(this._kernel32.FillConsoleOutputAttribute(this._stdoutput,g.Deref(8,2).toBuffer().readUInt16LE(0),i,h.Deref(0,4).toBuffer().readUInt32LE(),f).Val==0){return}this._kernel32.SetConsoleCursorPosition(this._stdoutput,h.Deref(0,4).toBuffer().readUInt32LE());var j=GM.CreateVariable(8);var k=g.Deref(10,8).toBuffer();j.Deref(4,2).toBuffer().writeUInt16LE(k.readUInt16LE(4)-k.readUInt16LE(0));j.Deref(6,2).toBuffer().writeUInt16LE(k.readUInt16LE(6)-k.readUInt16LE(2));this._kernel32.SetConsoleWindowInfo(this._stdoutput,1,j)};this.Start=function d(g,f){this.stopping=null;if(this._kernel32.GetConsoleWindow().Val==0){if(this._kernel32.AllocConsole().Val==0){throw ("AllocConsole failed with: "+this._kernel32.GetLastError().Val)}}this._stdinput=this._kernel32.GetStdHandle(STD_INPUT_HANDLE);this._stdoutput=this._kernel32.GetStdHandle(STD_OUTPUT_HANDLE);this._connected=false;var h=GM.CreateVariable(4);h.Deref(0,2).toBuffer().writeUInt16LE(g);h.Deref(2,2).toBuffer().writeUInt16LE(f);var i=GM.CreateVariable(8);i.Deref(4,2).toBuffer().writeUInt16LE(g-1);i.Deref(6,2).toBuffer().writeUInt16LE(f-1);if(this._kernel32.SetConsoleWindowInfo(this._stdoutput,1,i).Val==0){throw ("Failed to set Console Screen Size")}if(this._kernel32.SetConsoleScreenBufferSize(this._stdoutput,h.Deref(0,4).toBuffer().readUInt32LE()).Val==0){throw ("Failed to set Console Buffer Size")}this._user32.ShowWindow(this._kernel32.GetConsoleWindow().Val,SW_HIDE);this.ClearScreen();this._hookThread().then(function(){this.terminal.StartCommand()},console.log);this._stream=new duplex({write:function(j,k){if(!this.terminal.connected){if(!this._promise.chunk){this._promise.chunk=[]}if(typeof(j)=="string"){this._promise.chunk.push(j)}else{this._promise.chunk.push(Buffer.alloc(j.length));j.copy(this._promise.chunk.peek())}this._promise.chunk.peek().flush=k;this._promise.then(function(){var l;while(this.chunk.length>0){l=this.chunk.shift();this.terminal._WriteBuffer(l);l.flush()}})}else{this.terminal._WriteBuffer(j);k()}return(true)},"final":function(j){var k=this.terminal._stop();k.__flush=j;k.then(function(){this.__flush()})}});this._stream.terminal=this;this._stream._promise=new promise(function(k,j){this._res=k;this._rej=j});this._stream._promise.terminal=this;return(this._stream)};this._stop=function(){if(this.stopping){return(this.stopping)}this._ConsoleWinEventProc.removeAllListeners("GlobalCallback");this.stopping=new promise(function(h,g){this._res=h;this._rej=g});var f=this._kernel32.GetThreadId(this._user32.SetWinEventHook.async.thread()).Val;this._user32.PostThreadMessageA(f,WM_QUIT,0,0);this._stream.emit("end");return(this.stopping)};this._hookThread=function(){var g=new promise(function(i,h){this._res=i;this._rej=h});g.terminal=this;this._ConsoleWinEventProc=GM.GetGenericGlobalCallback(7);this._ConsoleWinEventProc.terminal=this;var f=this._user32.SetWinEventHook.async(EVENT_CONSOLE_CARET,EVENT_CONSOLE_END_APPLICATION,0,this._ConsoleWinEventProc,0,0,WINEVENT_OUTOFCONTEXT|WINEVENT_SKIPOWNPROCESS);f.ready=g;f.terminal=this;f.then(function(h){if(h.Val==0){this.ready._rej("Error calling SetWinEventHook")}else{this.terminal.hwinEventHook=h;this.ready._res();this.terminal._GetMessage()}});this._ConsoleWinEventProc.on("GlobalCallback",function(j,i,k,n,l,m,p){if(!this.terminal.hwinEventHook||this.terminal.hwinEventHook.Val!=j.Val){return}var h=null;switch(i.Val){case EVENT_CONSOLE_CARET:break;case EVENT_CONSOLE_UPDATE_REGION:if(!this.terminal.connected){this.terminal.connected=true;this.terminal._stream._promise._res()}if(this.terminal._scrollTimer==null){h=this.terminal._GetScreenBuffer(LOWORD(n.Val),HIWORD(n.Val),LOWORD(l.Val),HIWORD(l.Val));this.terminal._SendDataBuffer(h)}break;case EVENT_CONSOLE_UPDATE_SIMPLE:var o={data:[Buffer.alloc(1,LOWORD(l.Val))],attributes:[HIWORD(l.Val)],width:1,height:1,x:LOWORD(n.Val),y:HIWORD(n.Val)};this.terminal._SendDataBuffer(o);break;case EVENT_CONSOLE_UPDATE_SCROLL:this.terminal._SendScroll(n.Val,l.Val);break;case EVENT_CONSOLE_LAYOUT:break;case EVENT_CONSOLE_START_APPLICATION:break;case EVENT_CONSOLE_END_APPLICATION:if(n.Val==this.terminal._hProcessID){this.terminal._hProcess=null;this.terminal._stop().then(function(){console.log("STOPPED")})}break;default:console.log("Unknown event: "+i.Val);break}});return(g)};this._GetMessage=function(){if(this._user32.abort){console.log("aborting loop");return}this._user32.GetMessageA.async(this._user32.SetWinEventHook.async,MSG,0,0,0).then(function(f){if(f.Val!=0){if(f.Val==-1){}else{this.nativeProxy._user32.TranslateMessage.async(this.nativeProxy.user32.SetWinEventHook.async,MSG).then(function(){this.nativeProxy._user32.DispatchMessageA.async(this.nativeProxy.user32.SetWinEventHook.async,MSG).then(function(){this.nativeProxy.terminal._GetMessage()},console.log)},console.log)}}else{this.nativeProxy.UnhookWinEvent.async(this.nativeProxy.terminal._user32.SetWinEventHook.async,this.nativeProxy.terminal.hwinEventHook).then(function(){if(this.nativeProxy.terminal._hProcess==null){return}this.nativeProxy.terminal.stopping._res();if(this.nativeProxy.terminal._kernel32.TerminateProcess(this.nativeProxy.terminal._hProcess,1067).Val==0){var g=this.nativeProxy.terminal._kernel32.GetLastError().Val;console.log("Unable to kill Terminal Process, error: "+g)}this.nativeProxy.terminal.stopping=null},function(g){console.log("REJECTED_UnhookWinEvent: "+g)})}},function(f){console.log("REJECTED_GETMessage: "+f)})};this._WriteBuffer=function(f){for(var g=0;gl;++j){this._stream.push(Buffer.from("\r\n"))}var f=this._GetScreenBuffer(0,0,m-1,l-1);this._SendDataBuffer(f);this._scrollTimer=setTimeout(function(p,o,n){var i=p._GetScreenBuffer(0,0,o-1,n-1);p._SendDataBuffer(i);p._scrollTimer=null},250,this,m,l)};this.StartCommand=function e(){if(this._kernel32.CreateProcessA(GM.CreateVariable(process.env.windir+"\\system32\\cmd.exe"),0,0,0,1,CREATE_NEW_PROCESS_GROUP,0,0,si,pi).Val==0){console.log("Error Spawning CMD");return}this._kernel32.CloseHandle(pi.Deref(GM.PointerSize,GM.PointerSize).Deref());this._hProcess=pi.Deref(0,GM.PointerSize).Deref();this._hProcessID=pi.Deref(GM.PointerSize==4?8:16,4).toBuffer().readUInt32LE()}}function LOWORD(a){return(a&65535)}function HIWORD(a){return((a>>16)&65535)}function GetEsc(b,a){return(Buffer.from("\x1B["+a.join(";")+b))}function MeshConsole(a){require("MeshAgent").SendCommand({action:"msg",type:"console",value:JSON.stringify(a)})}function TranslateLine(r,s,f,a){var m,l,e,q,j,c,n,k,d,p,h,b,g=[],o=[GetEsc("H",[s,r])];if(typeof a=="number"){a=[a]}for(m=0;m>2);d=(a[m]&112)>>4;d=((d&1)<<2)+(d&2)+((d&4)>>2);p=(a[m]&16384);h=(a[m]&8)>>3;b=(a[m]&128);if(p!=q){if(p!=0){g.push(7)}else{g.push(0);l=7;e=0;j=0;c=0}q=p}if(k!=l){g.push(k+30);l=k}if(d!=e){g.push(d+40);e=d}if(h!=j){g.push(2-h);j=h}if(b!=c){if(b==0){g.push(e+40)}else{g.push(e+100);c=b}}if(g.length>0){o.push(GetEsc("m",g));g=[]}n=a[m]}o.push(Buffer.from(String.fromCharCode(f[m])))}return Buffer.concat(o)}module.exports=new windows_terminal();
\ No newline at end of file
diff --git a/meshagent.js b/meshagent.js
index 3cdc678a..8ff51653 100644
--- a/meshagent.js
+++ b/meshagent.js
@@ -1200,6 +1200,13 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
}
break;
}
+ case 'acmactivate':
+ {
+ // Agent is asking the server to sign an Intel AMT ACM activation request
+ //console.log(command);
+ // TODO
+ break;
+ }
case 'diagnostic':
{
if (typeof command.value == 'object') {
diff --git a/meshuser.js b/meshuser.js
index eb9089ec..c093bc94 100644
--- a/meshuser.js
+++ b/meshuser.js
@@ -1600,7 +1600,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (common.validateString(command.amtpolicy.password, 0, 32) == false) break; // Check the amtpolicy.password
if (common.validateInt(command.amtpolicy.cirasetup, 0, 2) == false) break; // Check the amtpolicy.cirasetup
}
- console.log('meshamtpolicy', command);
mesh = parent.meshes[command.meshid];
change = '';
if (mesh) {
diff --git a/public/scripts/amt-desktop-0.0.2-slow.js b/public/scripts/amt-desktop-0.0.2-slow.js
deleted file mode 100644
index 0d19b0ed..00000000
--- a/public/scripts/amt-desktop-0.0.2-slow.js
+++ /dev/null
@@ -1,834 +0,0 @@
-/**
-* @description Remote Desktop
-* @author Ylian Saint-Hilaire
-* @version v0.0.2g
-*/
-
-// Construct a MeshServer object
-var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
- var obj = {};
- obj.canvasid = divid;
- obj.CanvasId = Q(divid);
- obj.scrolldiv = scrolldiv;
- obj.canvas = Q(divid).getContext("2d");
- obj.protocol = 2; // KVM
- obj.state = 0;
- obj.acc = "";
- obj.ScreenWidth = 960;
- obj.ScreenHeight = 700;
- obj.width = 0;
- obj.height = 0;
- obj.rwidth = 0;
- obj.rheight = 0;
- obj.bpp = 2; // Bytes per pixel (1 or 2 supported)
- obj.useZRLE = true;
- obj.showmouse = true;
- obj.buttonmask = 0;
- obj.localKeyMap = true;
- //obj.inbytes = 0;
- //obj.outbytes = 0;
- obj.spare = null;
- obj.sparew = 0;
- obj.spareh = 0;
- obj.sparew2 = 0;
- obj.spareh2 = 0;
- obj.sparecache = {};
- obj.ZRLEfirst = 1;
- obj.onScreenSizeChange = null;
- obj.frameRateDelay = 0;
- // ###BEGIN###{DesktopRotation}
- obj.noMouseRotate = false;
- obj.rotation = 0;
- // ###END###{DesktopRotation}
- // ###BEGIN###{DesktopInband}
- obj.kvmDataSupported = false;
- obj.onKvmData = null;
- obj.onKvmDataPending = [];
- obj.onKvmDataAck = -1;
- obj.holding = false;
- obj.lastKeepAlive = Date.now();
- // ###END###{DesktopInband}
-
- // ###BEGIN###{DesktopFocus}
- obj.mx = 0; // Last mouse x position
- obj.my = 0; // Last mouse y position
- obj.ox = -1; // Old mouse x position
- obj.oy = -1; // Old mouse y position
- obj.focusmode = 0;
- // ###END###{DesktopFocus}
- // ###BEGIN###{Inflate}
- obj.inflate = ZLIB.inflateInit(-15);
- // ###END###{Inflate}
-
- // Private method
- obj.Debug = function (msg) { console.log(msg); }
-
- obj.xxStateChange = function (newstate) {
- if (newstate == 0) {
- obj.canvas.fillStyle = '#000000';
- obj.canvas.fillRect(0, 0, obj.width, obj.height);
- obj.canvas.canvas.width = obj.rwidth = obj.width = 640;
- obj.canvas.canvas.height = obj.rheight = obj.height = 400;
- QS(obj.canvasid).cursor = 'default';
- } else {
- QS(obj.canvasid).cursor = obj.showmouse ?'default':'none';
- }
- }
-
- obj.ProcessData = function (data) {
- if (!data) return;
- // obj.Debug("KRecv(" + data.length + "): " + rstr2hex(data));
- //obj.inbytes += data.length;
- //obj.Debug("KRecv(" + obj.inbytes + ")");
- obj.acc += data;
- while (obj.acc.length > 0) {
- //obj.Debug("KAcc(" + obj.acc.length + "): " + rstr2hex(obj.acc));
- var cmdsize = 0;
- if (obj.state == 0 && obj.acc.length >= 12) {
- // Getting handshake & version
- cmdsize = 12;
- //if (obj.acc.substring(0, 4) != "RFB ") { return obj.Stop(); }
- //var version = parseFloat(obj.acc.substring(4, 11));
- //obj.Debug("KVersion: " + version);
- obj.state = 1;
- obj.send("RFB 003.008\n");
- }
- else if (obj.state == 1 && obj.acc.length >= 1) {
- // Getting security options
- cmdsize = obj.acc.charCodeAt(0) + 1;
- obj.send(String.fromCharCode(1)); // Send the "None" security type. Since we already authenticated using redirection digest auth, we don't need to do this again.
- obj.state = 2;
- }
- else if (obj.state == 2 && obj.acc.length >= 4) {
- // Getting security response
- cmdsize = 4;
- if (ReadInt(obj.acc, 0) != 0) { return obj.Stop(); }
- obj.send(String.fromCharCode(1)); // Send share desktop flag
- obj.state = 3;
- }
- else if (obj.state == 3 && obj.acc.length >= 24) {
- // Getting server init
- // ###BEGIN###{DesktopRotation}
- obj.rotation = 0; // We don't currently support screen init while rotated.
- // ###END###{DesktopRotation}
- var namelen = ReadInt(obj.acc, 20);
- if (obj.acc.length < 24 + namelen) return;
- cmdsize = 24 + namelen;
- obj.canvas.canvas.width = obj.rwidth = obj.width = obj.ScreenWidth = ReadShort(obj.acc, 0);
- obj.canvas.canvas.height = obj.rheight = obj.height = obj.ScreenHeight = ReadShort(obj.acc, 2);
-
- // These are all values we don't really need, we are going to only run in RGB565 or RGB332 and not use the flexibility provided by these settings.
- // Makes the javascript code smaller and maybe a bit faster.
- /*
- obj.xbpp = obj.acc.charCodeAt(4);
- obj.depth = obj.acc.charCodeAt(5);
- obj.bigend = obj.acc.charCodeAt(6);
- obj.truecolor = obj.acc.charCodeAt(7);
- obj.rmax = ReadShort(obj.acc, 8);
- obj.gmax = ReadShort(obj.acc, 10);
- obj.bmax = ReadShort(obj.acc, 12);
- obj.rsh = obj.acc.charCodeAt(14);
- obj.gsh = obj.acc.charCodeAt(15);
- obj.bsh = obj.acc.charCodeAt(16);
- var name = obj.acc.substring(24, 24 + namelen);
- obj.Debug("name: " + name);
- obj.Debug("width: " + obj.width + ", height: " + obj.height);
- obj.Debug("bits-per-pixel: " + obj.xbpp);
- obj.Debug("depth: " + obj.depth);
- obj.Debug("big-endian-flag: " + obj.bigend);
- obj.Debug("true-colour-flag: " + obj.truecolor);
- obj.Debug("rgb max: " + obj.rmax + "," + obj.gmax + "," + obj.bmax);
- obj.Debug("rgb shift: " + obj.rsh + "," + obj.gsh + "," + obj.bsh);
- */
-
- // SetEncodings, with AMT we can't omit RAW, must be specified.
- // Intel AMT supports encodings: RAW (0), ZRLE (16), Desktop Size (0xFFFFFF21, -223)
-
- var supportedEncodings = '';
- if (obj.useZRLE) supportedEncodings += IntToStr(16);
- supportedEncodings += IntToStr(0);
- // ###BEGIN###{DesktopInband}
- supportedEncodings += IntToStr(1092);
- // ###END###{DesktopInband}
-
- obj.send(String.fromCharCode(2, 0) + ShortToStr((supportedEncodings.length / 4) + 1) + supportedEncodings + IntToStr(-223)); // Supported Encodings + Desktop Size
-
- // Set the pixel encoding to something much smaller
- // obj.send(String.fromCharCode(0, 0, 0, 0, 16, 16, 0, 1) + ShortToStr(31) + ShortToStr(63) + ShortToStr(31) + String.fromCharCode(11, 5, 0, 0, 0, 0)); // Setup 16 bit color RGB565 (This is the default, so we don't need to set it)
- if (obj.bpp == 1) obj.send(String.fromCharCode(0, 0, 0, 0, 8, 8, 0, 1) + ShortToStr(7) + ShortToStr(7) + ShortToStr(3) + String.fromCharCode(5, 2, 0, 0, 0, 0)); // Setup 8 bit color RGB332
-
- obj.state = 4;
- obj.parent.xxStateChange(3);
- _SendRefresh();
- //obj.timer = setInterval(obj.xxOnTimer, 50);
-
- // ###BEGIN###{DesktopFocus}
- obj.ox = -1; // Old mouse x position
- // ###END###{DesktopFocus}
-
- if (obj.onScreenSizeChange != null) { obj.onScreenSizeChange(obj, obj.ScreenWidth, obj.ScreenHeight); }
- }
- else if (obj.state == 4) {
- switch (obj.acc.charCodeAt(0)) {
- case 0: // FramebufferUpdate
- if (obj.acc.length < 4) return;
- obj.state = 100 + ReadShort(obj.acc, 2); // Read the number of tiles that are going to be sent, add 100 and use that as our protocol state.
- cmdsize = 4;
- break;
- case 2: // This is the bell, do nothing.
- cmdsize = 1;
- break;
- case 3: // This is ServerCutText
- if (obj.acc.length < 8) return;
- var len = ReadInt(obj.acc, 4) + 8;
- if (obj.acc.length < len) return;
- cmdsize = handleServerCutText(obj.acc);
- break;
- }
- }
- else if (obj.state > 100 && obj.acc.length >= 12) {
- var x = ReadShort(obj.acc, 0),
- y = ReadShort(obj.acc, 2),
- width = ReadShort(obj.acc, 4),
- height = ReadShort(obj.acc, 6),
- s = width * height,
- encoding = ReadInt(obj.acc, 8);
-
- if (encoding < 17) {
- if (width < 1 || width > 64 || height < 1 || height > 64) { console.log("Invalid tile size (" + width + "," + height + "), disconnecting."); return obj.Stop(); }
-
- // Set the spare bitmap to the rigth size if it's not already. This allows us to recycle the spare most if not all the time.
- if (obj.sparew != width || obj.spareh != height) {
- obj.sparew = obj.sparew2 = width;
- obj.spareh = obj.spareh2 = height;
- // ###BEGIN###{DesktopRotation}
- if (obj.rotation == 1 || obj.rotation == 3) { obj.sparew2 = height, obj.spareh2 = width; }
- // ###END###{DesktopRotation}
- var xspacecachename = obj.sparew2 + 'x' + obj.spareh2;
- obj.spare = obj.sparecache[xspacecachename];
- if (!obj.spare) { obj.sparecache[xspacecachename] = obj.spare = obj.canvas.createImageData(obj.sparew2, obj.spareh2); }
- }
-
- }
-
- if (encoding == 0xFFFFFF21) {
- // Desktop Size (0xFFFFFF21, -223)
- obj.canvas.canvas.width = obj.rwidth = obj.width = width;
- obj.canvas.canvas.height = obj.rheight = obj.height = height;
- obj.send(String.fromCharCode(3, 0, 0, 0, 0, 0) + ShortToStr(obj.width) + ShortToStr(obj.height)); // FramebufferUpdateRequest
- cmdsize = 12;
- if (obj.onScreenSizeChange != null) { obj.onScreenSizeChange(obj, obj.ScreenWidth, obj.ScreenHeight); }
- // obj.Debug("New desktop width: " + obj.width + ", height: " + obj.height);
- }
- else if (encoding == 0) {
- // RAW encoding
- var ptr = 12, cs = 12 + (s * obj.bpp);
- if (obj.acc.length < cs) return; // Check we have all the data needed and we can only draw 64x64 tiles.
- cmdsize = cs;
-
- // CRITICAL LOOP, optimize this as much as possible
- for (var i = 0; i < s; i++) { _setPixel(obj.acc.charCodeAt(ptr++) + ((obj.bpp == 2) ? (obj.acc.charCodeAt(ptr++) << 8) : 0), i); }
- _putImage(obj.spare, x, y);
- }
- else if (encoding == 16) {
- // ZRLE encoding
- if (obj.acc.length < 16) return;
- var datalen = ReadInt(obj.acc, 12);
- if (obj.acc.length < (16 + datalen)) return;
- //obj.Debug("RECT ZRLE (" + x + "," + y + "," + width + "," + height + ") LEN = " + datalen);
- //obj.Debug("RECT ZRLE LEN: " + ReadShortX(obj.acc, 17) + ", DATA: " + rstr2hex(obj.acc.substring(16)));
-
- // Process the ZLib header if this is the first block
- var ptr = 16, delta = 5, dx = 0;
-
- if (datalen > 5 && obj.acc.charCodeAt(ptr) == 0 && ReadShortX(obj.acc, ptr + 1) == (datalen - delta)) {
- // This is an uncompressed ZLib data block
- _decodeLRE(obj.acc, ptr + 5, x, y, width, height, s, datalen);
- }
- // ###BEGIN###{Inflate}
- else {
- // This is compressed ZLib data, decompress and process it.
- var arr = obj.inflate.inflate(obj.acc.substring(ptr, ptr + datalen - dx));
- if (arr.length > 0) { _decodeLRE(arr, 0, x, y, width, height, s, arr.length); } else { obj.Debug("Invalid deflate data"); }
- }
- // ###END###{Inflate}
-
- cmdsize = 16 + datalen;
- }
- else {
- obj.Debug("Unknown Encoding: " + encoding);
- return obj.Stop();
- }
- if (--obj.state == 100) {
- obj.state = 4;
- if (obj.frameRateDelay == 0) {
- _SendRefresh(); // Ask for new frame
- } else {
- setTimeout(_SendRefresh, obj.frameRateDelay); // Hold x miliseconds before asking for a new frame
- }
- }
- }
-
- if (cmdsize == 0) return;
- obj.acc = obj.acc.substring(cmdsize);
- }
- }
-
- function _decodeLRE(data, ptr, x, y, width, height, s, datalen) {
- var subencoding = data.charCodeAt(ptr++), index, v, runlengthdecode, palette = {}, rlecount = 0, runlength = 0, i;
- // obj.Debug("RECT RLE (" + (datalen - 5) + ", " + subencoding + "):" + rstr2hex(data.substring(21, 21 + (datalen - 5))));
- if (subencoding == 0) {
- // RAW encoding
- for (i = 0; i < s; i++) { _setPixel(data.charCodeAt(ptr++) + ((obj.bpp == 2) ? (data.charCodeAt(ptr++) << 8) : 0), i); }
- _putImage(obj.spare, x, y);
- }
- else if (subencoding == 1) {
- // Solid color tile
- v = data.charCodeAt(ptr++) + ((obj.bpp == 2) ? (data.charCodeAt(ptr++) << 8) : 0);
- obj.canvas.fillStyle = 'rgb(' + ((obj.bpp == 1) ? ((v & 224) + ',' + ((v & 28) << 3) + ',' + _fixColor((v & 3) << 6)) : (((v >> 8) & 248) + ',' + ((v >> 3) & 252) + ',' + ((v & 31) << 3))) + ')';
-
- // ###BEGIN###{DesktopRotation}
- var xx = _rotX(x, y);
- y = _rotY(x, y);
- x = xx;
- // ###END###{DesktopRotation}
-
- obj.canvas.fillRect(x, y, width, height);
- }
- else if (subencoding > 1 && subencoding < 17) { // Packed palette encoded tile
- // Read the palette
- var br = 4, bm = 15; // br is BitRead and bm is BitMask. By adjusting these two we can support all the variations in this encoding.
- for (i = 0; i < subencoding; i++) { palette[i] = data.charCodeAt(ptr++) + ((obj.bpp == 2) ? (data.charCodeAt(ptr++) << 8) : 0); }
-
- // Compute bits to read & bit mark
- if (subencoding == 2) { br = 1; bm = 1; } else if (subencoding <= 4) { br = 2; bm = 3; }
-
- // Display all the bits
- while (rlecount < s && ptr < data.length) { v = data.charCodeAt(ptr++); for (i = (8 - br) ; i >= 0; i -= br) { _setPixel(palette[(v >> i) & bm], rlecount++); } }
- _putImage(obj.spare, x, y);
- }
- else if (subencoding == 128) { // RLE encoded tile
- while (rlecount < s && ptr < data.length) {
- // Get the run color
- v = data.charCodeAt(ptr++) + ((obj.bpp == 2) ? (data.charCodeAt(ptr++) << 8) : 0);
-
- // Decode the run length. This is the fastest and most compact way I found to do this.
- runlength = 1; do { runlength += (runlengthdecode = data.charCodeAt(ptr++)); } while (runlengthdecode == 255);
-
- // Draw a run
- while (--runlength >= 0) { _setPixel(v, rlecount++); }
- }
- _putImage(obj.spare, x, y);
- }
- else if (subencoding > 129) { // Palette RLE encoded tile
- // Read the palette
- for (i = 0; i < (subencoding - 128) ; i++) { palette[i] = data.charCodeAt(ptr++) + ((obj.bpp == 2) ? (data.charCodeAt(ptr++) << 8) : 0); }
-
- // Decode RLE on palette
- while (rlecount < s && ptr < data.length) {
- // Setup the run, get the color index and get the color from the palette.
- runlength = 1; index = data.charCodeAt(ptr++); v = palette[index % 128];
-
- // If the index starts with high order bit 1, this is a run and decode the run length.
- if (index > 127) { do { runlength += (runlengthdecode = data.charCodeAt(ptr++)); } while (runlengthdecode == 255); }
-
- // Draw a run
- while (--runlength >= 0) { _setPixel(v, rlecount++); }
- }
- _putImage(obj.spare, x, y);
- }
- }
-
- // ###BEGIN###{DesktopInband}
- obj.hold = function (holding) {
- if (obj.holding == holding) return;
- obj.holding = holding;
- obj.canvas.fillStyle = '#000000';
- obj.canvas.fillRect(0, 0, obj.width, obj.height); // Paint black
- if (obj.holding == false) {
- // Go back to normal operations
- // Set canvas size and ask for full screen refresh
- if ((obj.canvas.canvas.width != obj.width) || (obj.canvas.canvas.height != obj.height)) {
- obj.canvas.canvas.width = obj.width; obj.canvas.canvas.height = obj.height;
- if (obj.onScreenSizeChange != null) { obj.onScreenSizeChange(obj, obj.ScreenWidth, obj.ScreenHeight); } // ???
- }
- obj.Send(String.fromCharCode(3, 0, 0, 0, 0, 0) + ShortToStr(obj.width) + ShortToStr(obj.height)); // FramebufferUpdateRequest
- } else {
- obj.UnGrabMouseInput();
- obj.UnGrabKeyInput();
- }
- }
- // ###END###{DesktopInband}
-
- function _putImage(i, x, y) {
- // ###BEGIN###{DesktopInband}
- if (obj.holding == true) return;
- // ###END###{DesktopInband}
- // ###BEGIN###{DesktopRotation}
- var xx = _arotX(x, y);
- y = _arotY(x, y);
- x = xx;
- // ###END###{DesktopRotation}
- obj.canvas.putImageData(i, x, y);
- }
-
- function _setPixel(v, p) {
- var pp = p * 4;
-
- // ###BEGIN###{DesktopRotation}
- if (obj.rotation > 0) {
- if (obj.rotation == 1) {
- var x = p % obj.sparew;
- var y = Math.floor(p / obj.sparew);
- p = (x * obj.sparew2) + (obj.sparew2 - 1 - y);
- pp = p * 4;
- }
- else if (obj.rotation == 2) { pp = (obj.sparew * obj.spareh * 4) - 4 - pp; }
- else if (obj.rotation == 3) {
- var x = p % obj.sparew;
- var y = Math.floor(p / obj.sparew);
- p = ((obj.sparew2 - 1 - x) * obj.sparew2) + (y);
- pp = p * 4;
- }
- }
- // ###END###{DesktopRotation}
-
- if (obj.bpp == 1) {
- // Set 8bit color RGB332
- obj.spare.data[pp++] = v & 224;
- obj.spare.data[pp++] = (v & 28) << 3;
- obj.spare.data[pp++] = _fixColor((v & 3) << 6);
- } else {
- // Set 16bit color RGB565
- obj.spare.data[pp++] = (v >> 8) & 248;
- obj.spare.data[pp++] = (v >> 3) & 252;
- obj.spare.data[pp++] = (v & 31) << 3;
- }
- obj.spare.data[pp] = 0xFF; // Set alpha channel to opaque.
- }
-
- // ###BEGIN###{DesktopRotation}
- function _arotX(x, y) {
- if (obj.rotation == 0) return x;
- if (obj.rotation == 1) return obj.canvas.canvas.width - obj.sparew2 - y;
- if (obj.rotation == 2) return obj.canvas.canvas.width - obj.sparew2 - x;
- if (obj.rotation == 3) return y;
- return 0;
- }
-
- function _arotY(x, y) {
- if (obj.rotation == 0) return y;
- if (obj.rotation == 1) return x;
- if (obj.rotation == 2) return obj.canvas.canvas.height - obj.spareh2 - y;
- if (obj.rotation == 3) return obj.canvas.canvas.height - obj.spareh - x;
- return 0;
- }
-
- function _crotX(x, y) {
- if (obj.rotation == 0) return x;
- if (obj.rotation == 1) return y;
- if (obj.rotation == 2) return obj.canvas.canvas.width - x;
- if (obj.rotation == 3) return obj.canvas.canvas.height - y;
- return 0;
- }
-
- function _crotY(x, y) {
- if (obj.rotation == 0) return y;
- if (obj.rotation == 1) return obj.canvas.canvas.width - x;
- if (obj.rotation == 2) return obj.canvas.canvas.height - y;
- if (obj.rotation == 3) return x;
- return 0;
- }
-
- function _rotX(x, y) {
- if (obj.rotation == 0) return x;
- if (obj.rotation == 1) return x;
- if (obj.rotation == 2) return x - obj.canvas.canvas.width;
- if (obj.rotation == 3) return x - obj.canvas.canvas.height;
- return 0;
- }
-
- function _rotY(x, y) {
- if (obj.rotation == 0) return y;
- if (obj.rotation == 1) return y - obj.canvas.canvas.width;
- if (obj.rotation == 2) return y - obj.canvas.canvas.height;
- if (obj.rotation == 3) return y;
- return 0;
- }
-
- obj.tcanvas = null;
- obj.setRotation = function (x) {
- while (x < 0) { x += 4; }
- var newrotation = x % 4;
- //console.log('hard-rot: ' + newrotation);
- // ###BEGIN###{DesktopInband}
- if (obj.holding == true) { obj.rotation = newrotation; return; }
- // ###END###{DesktopInband}
-
- if (newrotation == obj.rotation) return true;
- var rw = obj.canvas.canvas.width;
- var rh = obj.canvas.canvas.height;
- if (obj.rotation == 1 || obj.rotation == 3) { rw = obj.canvas.canvas.height; rh = obj.canvas.canvas.width; }
-
- // Copy the canvas, put it back in the correct direction
- if (obj.tcanvas == null) obj.tcanvas = document.createElement('canvas');
- var tcanvasctx = obj.tcanvas.getContext('2d');
- tcanvasctx.setTransform(1, 0, 0, 1, 0, 0);
- tcanvasctx.canvas.width = rw;
- tcanvasctx.canvas.height = rh;
- tcanvasctx.rotate((obj.rotation * -90) * Math.PI / 180);
- if (obj.rotation == 0) tcanvasctx.drawImage(obj.canvas.canvas, 0, 0);
- if (obj.rotation == 1) tcanvasctx.drawImage(obj.canvas.canvas, -obj.canvas.canvas.width, 0);
- if (obj.rotation == 2) tcanvasctx.drawImage(obj.canvas.canvas, -obj.canvas.canvas.width, -obj.canvas.canvas.height);
- if (obj.rotation == 3) tcanvasctx.drawImage(obj.canvas.canvas, 0, -obj.canvas.canvas.height);
-
- // Change the size and orientation and copy the canvas back into the rotation
- if (obj.rotation == 0 || obj.rotation == 2) { obj.canvas.canvas.height = rw; obj.canvas.canvas.width = rh; }
- if (obj.rotation == 1 || obj.rotation == 3) { obj.canvas.canvas.height = rh; obj.canvas.canvas.width = rw; }
- obj.canvas.setTransform(1, 0, 0, 1, 0, 0);
- obj.canvas.rotate((newrotation * 90) * Math.PI / 180);
- obj.rotation = newrotation;
- obj.canvas.drawImage(obj.tcanvas, _rotX(0, 0), _rotY(0, 0));
-
- obj.width = obj.canvas.canvas.width;
- obj.height = obj.canvas.canvas.height;
- if (obj.onScreenResize != null) obj.onScreenResize(obj, obj.width, obj.height, obj.CanvasId);
- return true;
- }
- // ###END###{DesktopRotation}
-
- function _fixColor(c) { return (c > 127) ? (c + 32) : c; }
-
- function _SendRefresh() {
- // ###BEGIN###{DesktopInband}
- if (obj.holding == true) return;
- // ###END###{DesktopInband}
- // ###BEGIN###{DesktopFocus}
- if (obj.focusmode > 0) {
- // Request only pixels around the last mouse position
- var df = obj.focusmode * 2;
- obj.send(String.fromCharCode(3, 1) + ShortToStr(Math.max(Math.min(obj.ox, obj.mx) - obj.focusmode, 0)) + ShortToStr(Math.max(Math.min(obj.oy, obj.my) - obj.focusmode, 0)) + ShortToStr(df + Math.abs(obj.ox - obj.mx)) + ShortToStr(df + Math.abs(obj.oy - obj.my))); // FramebufferUpdateRequest
- obj.ox = obj.mx;
- obj.oy = obj.my;
- } else {
- // ###END###{DesktopFocus}
- // Request the entire screen
- obj.send(String.fromCharCode(3, 1, 0, 0, 0, 0) + ShortToStr(obj.rwidth) + ShortToStr(obj.rheight)); // FramebufferUpdateRequest
- // ###BEGIN###{DesktopFocus}
- }
- // ###END###{DesktopFocus}
- }
-
- obj.Start = function () {
- //obj.Debug("KVM-Start");
- obj.state = 0;
- obj.acc = "";
- obj.ZRLEfirst = 1;
- //obj.inbytes = 0;
- //obj.outbytes = 0;
- // ###BEGIN###{Inflate}
- obj.inflate.inflateReset();
- // ###END###{Inflate}
- // ###BEGIN###{DesktopInband}
- obj.onKvmDataPending = [];
- obj.onKvmDataAck = -1;
- obj.kvmDataSupported = false;
- // ###END###{DesktopInband}
- for (var i in obj.sparecache) { delete obj.sparecache[i]; }
- }
-
- obj.Stop = function () {
- obj.UnGrabMouseInput();
- obj.UnGrabKeyInput();
- obj.parent.Stop();
- }
-
- obj.send = function (x) {
- //obj.Debug("KSend(" + x.length + "): " + rstr2hex(x));
- //obj.outbytes += x.length;
- obj.parent.send(x);
- }
-
- var convertAmtKeyCodeTable = {
- "Pause": 19,
- "CapsLock": 20,
- "Space": 32,
- "Quote": 39,
- "Minus": 45,
- "NumpadMultiply": 42,
- "NumpadAdd": 43,
- "PrintScreen": 44,
- "Comma": 44,
- "NumpadSubtract": 45,
- "NumpadDecimal": 46,
- "Period": 46,
- "Slash": 47,
- "NumpadDivide": 47,
- "Semicolon": 59,
- "Equal": 61,
- "OSLeft": 91,
- "BracketLeft": 91,
- "OSRight": 91,
- "Backslash": 92,
- "BracketRight": 93,
- "ContextMenu": 93,
- "Backquote": 96,
- "NumLock": 144,
- "ScrollLock": 145,
- "Backspace": 0xff08,
- "Tab": 0xff09,
- "Enter": 0xff0d,
- "NumpadEnter": 0xff0d,
- "Escape": 0xff1b,
- "Delete": 0xffff,
- "Home": 0xff50,
- "PageUp": 0xff55,
- "PageDown": 0xff56,
- "ArrowLeft": 0xff51,
- "ArrowUp": 0xff52,
- "ArrowRight": 0xff53,
- "ArrowDown": 0xff54,
- "End": 0xff57,
- "Insert": 0xff63,
- "F1": 0xffbe,
- "F2": 0xffbf,
- "F3": 0xffc0,
- "F4": 0xffc1,
- "F5": 0xffc2,
- "F6": 0xffc3,
- "F7": 0xffc4,
- "F8": 0xffc5,
- "F9": 0xffc6,
- "F10": 0xffc7,
- "F11": 0xffc8,
- "F12": 0xffc9,
- "ShiftLeft": 0xffe1,
- "ShiftRight": 0xffe2,
- "ControlLeft": 0xffe3,
- "ControlRight": 0xffe4,
- "AltLeft": 0xffe9,
- "AltRight": 0xffea,
- "MetaLeft": 0xffe7,
- "MetaRight": 0xffe8
- }
- function convertAmtKeyCode(e) {
- if (e.code.startsWith('Key') && e.code.length == 4) { return e.code.charCodeAt(3) + ((e.shiftKey == false) ? 32 : 0); }
- if (e.code.startsWith('Digit') && e.code.length == 6) { return e.code.charCodeAt(5); }
- if (e.code.startsWith('Numpad') && e.code.length == 7) { return e.code.charCodeAt(6); }
- return convertAmtKeyCodeTable[e.code];
- }
-
- /*
- Intel AMT only recognizes a small subset of keysym characters defined in the keysymdef.h so you don’t need to
- implement all the languages (this is taken care by the USB Scancode Extension in RFB4.0 protocol).
- The only subset recognized by the FW is the defined by the following sets : XK_LATIN1 , XK_MISCELLANY, XK_3270, XK_XKB_KEYS, XK_KATAKANA.
- In addition to keysymdef.h symbols there are 6 japanese extra keys that we do support:
-
- #define XK_Intel_EU_102kbd_backslash_pipe_45 0x17170056 // European 102-key: 45 (backslash/pipe), usb Usage: 0x64
- #define XK_Intel_JP_106kbd_yen_pipe 0x1717007d // Japanese 106-key: 14 (Yen/pipe), usb Usage: 0x89
- #define XK_Intel_JP_106kbd_backslash_underbar 0x17170073 // Japanese 106-key: 56 (backslash/underbar), usb Usage: 0x87
- #define XK_Intel_JP_106kbd_NoConvert 0x1717007b // Japanese 106-key: 131 (NoConvert), usb Usage: 0x8b
- #define XK_Intel_JP_106kbd_Convert 0x17170079 // Japanese 106-key: 132 (Convert), usb Usage: 0x8a
- #define XK_Intel_JP_106kbd_Hirigana_Katakana 0x17170070 // Japanese 106-key: 133 (Hirigana/Katakana), usb Usage: 0x88
- */
-
- function _keyevent(d, e) {
- if (!e) { e = window.event; }
-
- if (e.code && (obj.localKeyMap == false)) {
- // For new browsers, this mapping is keyboard language independent
- var k = convertAmtKeyCode(e);
- if (k != null) { obj.sendkey(k, d); }
- } else {
- // For older browsers, this mapping works best for EN-US keyboard
- var k = e.keyCode, kk = k;
- if (e.shiftKey == false && k >= 65 && k <= 90) kk = k + 32;
- if (k >= 112 && k <= 124) kk = k + 0xFF4E;
- if (k == 8) kk = 0xff08; // Backspace
- if (k == 9) kk = 0xff09; // Tab
- if (k == 13) kk = 0xff0d; // Return
- if (k == 16) kk = 0xffe1; // Shift (Left)
- if (k == 17) kk = 0xffe3; // Ctrl (Left)
- if (k == 18) kk = 0xffe9; // Alt (Left)
- if (k == 27) kk = 0xff1b; // ESC
- if (k == 33) kk = 0xff55; // PageUp
- if (k == 34) kk = 0xff56; // PageDown
- if (k == 35) kk = 0xff57; // End
- if (k == 36) kk = 0xff50; // Home
- if (k == 37) kk = 0xff51; // Left
- if (k == 38) kk = 0xff52; // Up
- if (k == 39) kk = 0xff53; // Right
- if (k == 40) kk = 0xff54; // Down
- if (k == 45) kk = 0xff63; // Insert
- if (k == 46) kk = 0xffff; // Delete
- if (k >= 96 && k <= 105) kk = k - 48; // Key pad numbers
- if (k == 106) kk = 42; // Pad *
- if (k == 107) kk = 43; // Pad +
- if (k == 109) kk = 45; // Pad -
- if (k == 110) kk = 46; // Pad .
- if (k == 111) kk = 47; // Pad /
- if (k == 186) kk = 59; // ;
- if (k == 187) kk = 61; // =
- if (k == 188) kk = 44; // ,
- if (k == 189) kk = 45; // -
- if (k == 190) kk = 46; // .
- if (k == 191) kk = 47; // /
- if (k == 192) kk = 96; // `
- if (k == 219) kk = 91; // [
- if (k == 220) kk = 92; // \
- if (k == 221) kk = 93; // ]t
- if (k == 222) kk = 39; // '
- //console.log('Key' + d + ": " + k + " = " + kk);
- obj.sendkey(kk, d);
- }
- return obj.haltEvent(e);
- }
-
- obj.sendkey = function (k, d) {
- if (typeof k == 'object') { for (var i in k) { obj.sendkey(k[i][0], k[i][1]); } }
- else { obj.send(String.fromCharCode(4, d, 0, 0) + IntToStr(k)); }
- }
-
- function handleServerCutText(acc) {
- if (acc.length < 8) return 0;
- var len = ReadInt(obj.acc, 4) + 8;
- if (acc.length < len) return 0;
- // ###BEGIN###{DesktopInband}
- if (obj.onKvmData != null) {
- var d = acc.substring(8, len);
- if ((d.length >= 16) && (d.substring(0, 15) == '\0KvmDataChannel')) {
- if (obj.kvmDataSupported == false) { obj.kvmDataSupported = true; console.log('KVM Data Channel Supported.'); }
- if (((obj.onKvmDataAck == -1) && (d.length == 16)) || (d.charCodeAt(15) != 0)) { obj.onKvmDataAck = true; }
- //if (urlvars && urlvars['kvmdatatrace']) { console.log('KVM-Recv(' + (d.length - 16) + '): ' + d.substring(16)); }
- if (d.length >= 16) { obj.onKvmData(d.substring(16)); } // Event the data and ack
- if ((obj.onKvmDataAck == true) && (obj.onKvmDataPending.length > 0)) { obj.sendKvmData(obj.onKvmDataPending.shift()); } // Send pending data
- }
- }
- // ###END###{DesktopInband}
- return len;
- }
-
- // ###BEGIN###{DesktopInband}
- obj.sendKvmData = function (x) {
- if (obj.onKvmDataAck !== true) {
- obj.onKvmDataPending.push(x);
- } else {
- //if (urlvars && urlvars['kvmdatatrace']) { console.log('KVM-Send(' + x.length + '): ' + x); }
- x = '\0KvmDataChannel\0' + x;
- obj.send(String.fromCharCode(6, 0, 0, 0) + IntToStr(x.length) + x);
- obj.onKvmDataAck = false;
- }
- }
-
- // Send a HWKVM keep alive if it's not been sent in the last 5 seconds.
- obj.sendKeepAlive = function () {
- if (obj.lastKeepAlive < Date.now() - 5000) { obj.lastKeepAlive = Date.now(); obj.send(String.fromCharCode(6, 0, 0, 0) + IntToStr(16) + '\0KvmDataChannel\0'); }
- }
- // ###END###{DesktopInband}
-
- obj.SendCtrlAltDelMsg = function () { obj.sendcad(); }
- obj.sendcad = function () { obj.sendkey([[0xFFE3, 1], [0xFFE9, 1], [0xFFFF, 1], [0xFFFF, 0], [0xFFE9, 0], [0xFFE3, 0]]); } // Control down, Alt down, Delete down, Delete up , Alt up , Control up
-
- var _MouseInputGrab = false;
- var _KeyInputGrab = false;
-
- obj.GrabMouseInput = function () {
- if (_MouseInputGrab == true) return;
- var c = obj.canvas.canvas;
- c.onmouseup = obj.mouseup;
- c.onmousedown = obj.mousedown;
- c.onmousemove = obj.mousemove;
- //if (navigator.userAgent.match(/mozilla/i)) c.DOMMouseScroll = obj.xxDOMMouseScroll; else c.onmousewheel = obj.xxMouseWheel;
- _MouseInputGrab = true;
- }
-
- obj.UnGrabMouseInput = function () {
- if (_MouseInputGrab == false) return;
- var c = obj.canvas.canvas;
- c.onmousemove = null;
- c.onmouseup = null;
- c.onmousedown = null;
- //if (navigator.userAgent.match(/mozilla/i)) c.DOMMouseScroll = null; else c.onmousewheel = null;
- _MouseInputGrab = false;
- }
-
- obj.GrabKeyInput = function () {
- if (_KeyInputGrab == true) return;
- document.onkeyup = obj.handleKeyUp;
- document.onkeydown = obj.handleKeyDown;
- document.onkeypress = obj.handleKeys;
- _KeyInputGrab = true;
- }
-
- obj.UnGrabKeyInput = function () {
- if (_KeyInputGrab == false) return;
- document.onkeyup = null;
- document.onkeydown = null;
- document.onkeypress = null;
- _KeyInputGrab = false;
- }
-
- obj.handleKeys = function (e) { return obj.haltEvent(e); }
- obj.handleKeyUp = function (e) { return _keyevent(0, e); }
- obj.handleKeyDown = function (e) { return _keyevent(1, e); }
- obj.haltEvent = function (e) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
-
- // RFB "PointerEvent" and mouse handlers
- obj.mousedblclick = function (e) { }
- obj.mousedown = function (e) { obj.buttonmask |= (1 << e.button); return obj.mousemove(e); }
- obj.mouseup = function (e) { obj.buttonmask &= (0xFFFF - (1 << e.button)); return obj.mousemove(e); }
- obj.mousemove = function (e) {
- if (obj.state != 4) return true;
- var ScaleFactorHeight = (obj.canvas.canvas.height / Q(obj.canvasid).offsetHeight);
- var ScaleFactorWidth = (obj.canvas.canvas.width / Q(obj.canvasid).offsetWidth);
- var Offsets = obj.getPositionOfControl(Q(obj.canvasid));
- obj.mx = ((event.pageX - Offsets[0]) * ScaleFactorWidth);
- obj.my = ((event.pageY - Offsets[1]) * ScaleFactorHeight);
- if (event.addx) { obj.mx += event.addx; }
- if (event.addy) { obj.my += event.addy; }
-
- // ###BEGIN###{DesktopRotation}
- if (obj.noMouseRotate != true) {
- obj.mx2 = _crotX(obj.mx, obj.my);
- obj.my = _crotY(obj.mx, obj.my);
- obj.mx = obj.mx2;
- }
- // ###END###{DesktopRotation}
-
- obj.send(String.fromCharCode(5, obj.buttonmask) + ShortToStr(obj.mx) + ShortToStr(obj.my));
-
- // ###BEGIN###{DesktopFocus}
- // Update focus area if we are in focus mode
- QV('DeskFocus', obj.focusmode);
- if (obj.focusmode != 0) {
- var x = Math.min(obj.mx, obj.canvas.canvas.width - obj.focusmode),
- y = Math.min(obj.my, obj.canvas.canvas.height - obj.focusmode),
- df = obj.focusmode * 2,
- c = Q(obj.canvasid),
- qx = c.offsetHeight / obj.canvas.canvas.height,
- qy = c.offsetWidth / obj.canvas.canvas.width,
- q = QS('DeskFocus'),
- ppos = obj.getPositionOfControl(Q(obj.canvasid).parentElement);
- q.left = (Math.max(((x - obj.focusmode) * qx), 0) + (pos[0] - ppos[0])) + 'px';
- q.top = (Math.max(((y - obj.focusmode) * qy), 0) + (pos[1] - ppos[1])) + 'px';
- q.width = ((df * qx) - 6) + 'px';
- q.height = ((df * qx) - 6) + 'px';
- }
- // ###END###{DesktopFocus}
-
- return obj.haltEvent(e);
- }
-
- obj.getPositionOfControl = function (Control) {
- var Position = Array(2);
- Position[0] = Position[1] = 0;
- while (Control) {
- Position[0] += Control.offsetLeft;
- Position[1] += Control.offsetTop;
- Control = Control.offsetParent;
- }
- return Position;
- }
-
- return obj;
-}