mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 07:05:52 -05:00
Updated MeshCommander
This commit is contained in:
parent
74e3d437dc
commit
833251b03d
@ -45,7 +45,7 @@ m.socketParseState){b=-1;if(void 0==m.socketXHeader.connection||"close"!=m.socke
|
||||
if(0>c)break;b=parseInt(m.socketAccumulator.substring(0,c),16);if(isNaN(b)){m.websocket&&m.websocket.close();break}if(m.socketAccumulator.length<c+2+b+2)break;a=m.socketAccumulator.substring(c+2,c+2+b);m.socketAccumulator=m.socketAccumulator.substring(c+2+b+2);m.socketData+=a}else b=0;0==b&&(c=m.socketXHeader,a=m.socketData,b=parseInt(c.Directive[1]),isNaN(b)&&(b=602),401==b&&3>++m.authcounter?m.challengeParams=m.parseDigest(c["www-authenticate"]):(c=m.pendingAjaxCall.shift(),m.authcounter=0,m.ActiveAjaxCount--,
|
||||
m.gotNextMessages(a,"success",{status:b},c),m.PerformNextAjax()),m.socketParseState=0,m.socketHeader=null)}}}function p(a){0==m.inDataCount&&(m.tlsv1only=1-m.tlsv1only);m.socketState=0;null!=m.socket&&(m.socket.close(),m.socket=null);if(0<m.pendingAjaxCall.length){a=m.pendingAjaxCall.shift();var b=a[5];m.PerformAjaxExNodeJS2(a[0],a[1],a[2],a[3],a[4],--b)}}var m={PendingAjax:[],ActiveAjaxCount:0,MaxActiveAjaxCount:1,FailAllError:0,challengeParams:null,noncecounter:1,authcounter:0,socket:null,socketState:0};
|
||||
m.host=b;m.port=c;m.user=a;m.pass=d;m.tls=e;m.tlsv1only=0;m.cnonce=Math.random().toString(36).substring(7);m.inDataCount=0;m.amtVersion=null;m.digestRealmMatch=null;m.digestRealm=null;m.PerformAjax=function(a,b,c,p,d,e){m.ActiveAjaxCount<m.MaxActiveAjaxCount&&0==m.PendingAjax.length?m.PerformAjaxEx(a,b,c,d,e):1==p?m.PendingAjax.unshift([a,b,c,d,e]):m.PendingAjax.push([a,b,c,d,e])};m.PerformNextAjax=function(){if(!(m.ActiveAjaxCount>=m.MaxActiveAjaxCount||0==m.PendingAjax.length)){var a=m.PendingAjax.shift();
|
||||
m.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);m.PerformNextAjax()}};m.PerformAjaxEx=function(a,b,c,p,d){if(0!=m.FailAllError)m.gotNextMessagesError({status:m.FailAllError},"error",null,[a,b,c,p,d]);else return a||(a=""),m.ActiveAjaxCount++,m.PerformAjaxExNodeJS(a,b,c,p,d)};m.pendingAjaxCall=[];m.PerformAjaxExNodeJS=function(a,b,c,p,d){m.PerformAjaxExNodeJS2(a,b,c,p,d,3)};m.PerformAjaxExNodeJS2=function(a,b,c,p,d,e){0>=e||0!=m.FailAllError?(m.ActiveAjaxCount--,999!=m.FailAllError&&m.gotNextMessages(null,
|
||||
m.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);m.PerformNextAjax()}};m.PerformAjaxEx=function(a,b,c,p,d){if(0!=m.FailAllError)m.gotNextMessagesError({status:m.FailAllError},"error",null,[a,b,c,p,d]);else return a||(a=""),m.ActiveAjaxCount++,m.PerformAjaxExNodeJS(a,b,c,p,d)};m.pendingAjaxCall=[];m.PerformAjaxExNodeJS=function(a,b,c,p,d){m.PerformAjaxExNodeJS2(a,b,c,p,d,5)};m.PerformAjaxExNodeJS2=function(a,b,c,p,d,e){0>=e||0!=m.FailAllError?(m.ActiveAjaxCount--,999!=m.FailAllError&&m.gotNextMessages(null,
|
||||
"error",{status:0==m.FailAllError?408:m.FailAllError},[a,b,c,p,d]),m.PerformNextAjax()):(m.pendingAjaxCall.push([a,b,c,p,d,e]),0==m.socketState?m.xxConnectHttpSocket():2==m.socketState&&m.sendRequest(a,p,d))};m.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var p=c+" "+b+" HTTP/1.1\r\n";if(null!=m.challengeParams){m.digestRealm=m.challengeParams.realm;if(m.digestRealmMatch&&m.digestRealm!=m.digestRealmMatch){m.FailAllError=997;m.CancelAllQueries(997);return}c=hex_md5(hex_md5(m.user+":"+m.challengeParams.realm+
|
||||
":"+m.pass)+":"+m.challengeParams.nonce+":"+m.noncecounter+":"+m.cnonce+":"+m.challengeParams.qop+":"+hex_md5(c+":"+b));p+="Authorization: "+m.renderDigest({username:m.user,realm:m.challengeParams.realm,nonce:m.challengeParams.nonce,uri:b,qop:m.challengeParams.qop,response:c,nc:m.noncecounter++,cnonce:m.cnonce})+"\r\n"}a=p+="Host: "+m.host+":"+m.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==m.socketState&&null!=m.socket&&m.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(p=
|
||||
0;p<a.length;++p)b[p]=a.charCodeAt(p);try{m.socket.send(b.buffer)}catch(d){}}};m.parseDigest=function(a){a=a.substring(7).split(",");for(i in a)a[i]=a[i].trim();return a.reduce(function(a,b){var c=b.split("=");a[c[0]]=c[1].replace(/"/g,"");return a},{})};m.renderDigest=function(a){var b=[];for(i in a)b.push(i);return"Digest "+b.reduce(function(b,c){return b+","+c+'="'+a[c]+'"'},"").substring(1)};m.xxConnectHttpSocket=function(){m.inDataCount=0;m.socketState=1;m.socket=new WebSocket(window.location.protocol.replace("http",
|
||||
@ -186,7 +186,7 @@ function(a){var b=this.getInt(a);a=2<<a-2;b>=a&&(b-=a<<1);return b};d.ByteString
|
||||
a)};d.ByteStringBuffer.prototype.setAt=function(a,b){this.data=this.data.substr(0,this.read+a)+String.fromCharCode(b)+this.data.substr(this.read+a+1);return this};d.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};d.ByteStringBuffer.prototype.copy=function(){var a=d.createBuffer(this.data);a.read=this.read;return a};d.ByteStringBuffer.prototype.compact=function(){0<this.read&&(this.data=this.data.slice(this.read),this.read=0);return this};d.ByteStringBuffer.prototype.clear=
|
||||
function(){this.data="";this.read=0;return this};d.ByteStringBuffer.prototype.truncate=function(a){a=Math.max(0,this.length()-a);this.data=this.data.substr(this.read,a);this.read=0;return this};d.ByteStringBuffer.prototype.toHex=function(){for(var a="",b=this.read;b<this.data.length;++b){var c=this.data.charCodeAt(b);16>c&&(a+="0");a+=c.toString(16)}return a};d.ByteStringBuffer.prototype.toString=function(){return d.decodeUtf8(this.bytes())};d.DataBuffer=function(a,b){b=b||{};this.read=b.readOffset||
|
||||
0;this.growSize=b.growSize||1024;var c=d.isArrayBuffer(a),g=d.isArrayBufferView(a);c||g?(this.data=c?new DataView(a):new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in b?b.writeOffset:this.data.byteLength):(this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==a&&void 0!==a&&this.putBytes(a),"writeOffset"in b&&(this.write=b.writeOffset))};d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()};
|
||||
d.DataBuffer.prototype.accommodate=function(a,b){if(this.length()>=a)return this;b=Math.max(b||this.growSize,a);var c=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),g=new Uint8Array(this.length()+b);g.set(c);this.data=new DataView(g.buffer);return this};d.DataBuffer.prototype.putByte=function(a){this.accommodate(1);this.data.setUint8(this.write++,a);return this};d.DataBuffer.prototype.fillWithByte=function(a,b){this.accommodate(b);for(var c=0;c<b;++c)this.data.setUint8(a);
|
||||
d.DataBuffer.prototype.accommodate=function(a,b){if(this.length()>=a)return this;b=Math.max(b||this.growSize,a);var c=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),d=new Uint8Array(this.length()+b);d.set(c);this.data=new DataView(d.buffer);return this};d.DataBuffer.prototype.putByte=function(a){this.accommodate(1);this.data.setUint8(this.write++,a);return this};d.DataBuffer.prototype.fillWithByte=function(a,b){this.accommodate(b);for(var c=0;c<b;++c)this.data.setUint8(a);
|
||||
return this};d.DataBuffer.prototype.putBytes=function(a,b){if(d.isArrayBufferView(a)){var c=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),g=c.byteLength-c.byteOffset;this.accommodate(g);var p=new Uint8Array(this.data.buffer,this.write);p.set(c);this.write+=g;return this}if(d.isArrayBuffer(a))return c=new Uint8Array(a),this.accommodate(c.byteLength),p=new Uint8Array(this.data.buffer),p.set(c,this.write),this.write+=c.byteLength,this;if(a instanceof d.DataBuffer||"object"===typeof a&&"number"===
|
||||
typeof a.read&&"number"===typeof a.write&&d.isArrayBufferView(a.data))return c=new Uint8Array(a.data.byteLength,a.read,a.length()),this.accommodate(c.byteLength),p=new Uint8Array(a.data.byteLength,this.write),p.set(c),this.write+=c.byteLength,this;a instanceof d.ByteStringBuffer&&(a=a.data,b="binary");b=b||"binary";if("string"===typeof a){if("hex"===b)return this.accommodate(Math.ceil(a.length/2)),c=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.hex.decode(a,c,this.write),this;if("base64"===
|
||||
b)return this.accommodate(3*Math.ceil(a.length/4)),c=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.base64.decode(a,c,this.write),this;"utf8"===b&&(a=d.encodeUtf8(a),b="binary");if("binary"===b||"raw"===b)return this.accommodate(a.length),c=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.raw.decode(c),this;if("utf16"===b)return this.accommodate(2*a.length),c=new Uint16Array(this.data.buffer,this.write),this.write+=d.text.utf16.encode(c),this;throw Error("Invalid encoding: "+
|
||||
@ -198,27 +198,27 @@ this.data.getInt32(this.read,!0);this.read+=4;return a};d.DataBuffer.prototype.g
|
||||
d.DataBuffer.prototype.bytes=function(a){return"undefined"===typeof a?this.data.slice(this.read):this.data.slice(this.read,this.read+a)};d.DataBuffer.prototype.at=function(a){return this.data.getUint8(this.read+a)};d.DataBuffer.prototype.setAt=function(a,b){this.data.setUint8(a,b);return this};d.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};d.DataBuffer.prototype.copy=function(){return new d.DataBuffer(this)};d.DataBuffer.prototype.compact=function(){if(0<this.read){var a=
|
||||
new Uint8Array(this.data.buffer,this.read),b=new Uint8Array(a.byteLength);b.set(a);this.data=new DataView(b);this.write-=this.read;this.read=0}return this};d.DataBuffer.prototype.clear=function(){this.data=new DataView(new ArrayBuffer(0));this.read=this.write=0;return this};d.DataBuffer.prototype.truncate=function(a){this.write=Math.max(0,this.length()-a);this.read=Math.min(this.read,this.write);return this};d.DataBuffer.prototype.toHex=function(){for(var a="",b=this.read;b<this.data.byteLength;++b){var c=
|
||||
this.data.getUint8(b);16>c&&(a+="0");a+=c.toString(16)}return a};d.DataBuffer.prototype.toString=function(a){var b=new Uint8Array(this.data,this.read,this.length());a=a||"utf8";if("binary"===a||"raw"===a)return d.binary.raw.encode(b);if("hex"===a)return d.binary.hex.encode(b);if("base64"===a)return d.binary.base64.encode(b);if("utf8"===a)return d.text.utf8.decode(b);if("utf16"===a)return d.text.utf16.decode(b);throw Error("Invalid encoding: "+a);};d.createBuffer=function(a,b){void 0!==a&&"utf8"===
|
||||
(b||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,b){for(var c="";0<b;)b&1&&(c+=a),b>>>=1,0<b&&(a+=a);return c};d.xorBytes=function(a,b,c){for(var g="",d="",p="",e=0,k=0;0<c;--c,++e)d=a.charCodeAt(e)^b.charCodeAt(e),10<=k&&(g+=p,p="",k=0),p+=String.fromCharCode(d),++k;return g+p};d.hexToBytes=function(a){var b="",c=0;a.length&1&&(c=1,b+=String.fromCharCode(parseInt(a[0],16)));for(;c<a.length;c+=2)b+=String.fromCharCode(parseInt(a.substr(c,2),16));return b};d.bytesToHex=
|
||||
function(a){return d.createBuffer(a).toHex()};d.int32ToBytes=function(a){return String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",g="",d,p,e,k=0;k<a.length;)d=
|
||||
a.charCodeAt(k++),p=a.charCodeAt(k++),e=a.charCodeAt(k++),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0,b)+"\r\n",c=c.substr(b));return g+
|
||||
c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,g,d,p,k=0;k<a.length;)c=e[a.charCodeAt(k++)-43],g=e[a.charCodeAt(k++)-43],d=e[a.charCodeAt(k++)-43],p=e[a.charCodeAt(k++)-43],b+=String.fromCharCode(c<<2|g>>4),64!==d&&(b+=String.fromCharCode((g&15)<<4|d>>2),64!==p&&(b+=String.fromCharCode((d&3)<<6|p)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}};
|
||||
d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(a.length));for(var d=c=c||0,p=0;p<a.length;++p)g[d++]=a.charCodeAt(p);return b?d-c:g};d.binary.hex.encode=d.bytesToHex;d.binary.hex.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(Math.ceil(a.length/2)));c=c||0;var d=0,p=c;a.length&1&&(d=1,g[p++]=parseInt(a[0],16));for(;d<a.length;d+=2)g[p++]=parseInt(a.substr(d,2),16);return b?p-c:g};d.binary.base64.encode=
|
||||
function(a,b){for(var c="",g="",d,p,e,k=0;k<a.byteLength;)d=a[k++],p=a[k++],e=a[k++],c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0,
|
||||
b)+"\r\n",c=c.substr(b));return g+c};d.binary.base64.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var d,p,k,m,u=0,q=c;u<a.length;)d=e[a.charCodeAt(u++)-43],p=e[a.charCodeAt(u++)-43],k=e[a.charCodeAt(u++)-43],m=e[a.charCodeAt(u++)-43],g[q++]=d<<2|p>>4,64!==k&&(g[q++]=(p&15)<<4|k>>2,64!==m&&(g[q++]=(k&3)<<6|m));return b?q-c:g.subarray(0,q)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a);
|
||||
var g=b;g||(g=new Uint8Array(a.length));for(var p=c=c||0,e=0;e<a.length;++e)g[p++]=a.charCodeAt(e);return b?p-c:g};d.text.utf8.decode=function(a){return d.decodeUtf8(String.fromCharCode.apply(null,a))};d.text.utf16.encode=function(a,b,c){var g=b;g||(g=new Uint8Array(2*a.length));for(var d=new Uint16Array(g.buffer),p=c=c||0,e=c,k=0;k<a.length;++k)d[e++]=a.charCodeAt(k),p+=2;return b?p-c:g};d.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))};d.deflate=function(a,
|
||||
(b||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,b){for(var c="";0<b;)b&1&&(c+=a),b>>>=1,0<b&&(a+=a);return c};d.xorBytes=function(a,b,c){for(var d="",g="",p="",e=0,k=0;0<c;--c,++e)g=a.charCodeAt(e)^b.charCodeAt(e),10<=k&&(d+=p,p="",k=0),p+=String.fromCharCode(g),++k;return d+p};d.hexToBytes=function(a){var b="",c=0;a.length&1&&(c=1,b+=String.fromCharCode(parseInt(a[0],16)));for(;c<a.length;c+=2)b+=String.fromCharCode(parseInt(a.substr(c,2),16));return b};d.bytesToHex=
|
||||
function(a){return d.createBuffer(a).toHex()};d.int32ToBytes=function(a){return String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",d="",g,p,e,k=0;k<a.length;)g=
|
||||
a.charCodeAt(k++),p=a.charCodeAt(k++),e=a.charCodeAt(k++),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((g&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(d+=c.substr(0,b)+"\r\n",c=c.substr(b));return d+
|
||||
c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,d,g,p,k=0;k<a.length;)c=e[a.charCodeAt(k++)-43],d=e[a.charCodeAt(k++)-43],g=e[a.charCodeAt(k++)-43],p=e[a.charCodeAt(k++)-43],b+=String.fromCharCode(c<<2|d>>4),64!==g&&(b+=String.fromCharCode((d&15)<<4|g>>2),64!==p&&(b+=String.fromCharCode((g&3)<<6|p)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}};
|
||||
d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(a.length));for(var g=c=c||0,p=0;p<a.length;++p)d[g++]=a.charCodeAt(p);return b?g-c:d};d.binary.hex.encode=d.bytesToHex;d.binary.hex.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(Math.ceil(a.length/2)));c=c||0;var g=0,p=c;a.length&1&&(g=1,d[p++]=parseInt(a[0],16));for(;g<a.length;g+=2)d[p++]=parseInt(a.substr(g,2),16);return b?p-c:d};d.binary.base64.encode=
|
||||
function(a,b){for(var c="",d="",g,p,e,k=0;k<a.byteLength;)g=a[k++],p=a[k++],e=a[k++],c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((g&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(d+=c.substr(0,
|
||||
b)+"\r\n",c=c.substr(b));return d+c};d.binary.base64.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var g,p,k,m,u=0,q=c;u<a.length;)g=e[a.charCodeAt(u++)-43],p=e[a.charCodeAt(u++)-43],k=e[a.charCodeAt(u++)-43],m=e[a.charCodeAt(u++)-43],d[q++]=g<<2|p>>4,64!==k&&(d[q++]=(p&15)<<4|k>>2,64!==m&&(d[q++]=(k&3)<<6|m));return b?q-c:d.subarray(0,q)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a);
|
||||
var g=b;g||(g=new Uint8Array(a.length));for(var p=c=c||0,e=0;e<a.length;++e)g[p++]=a.charCodeAt(e);return b?p-c:g};d.text.utf8.decode=function(a){return d.decodeUtf8(String.fromCharCode.apply(null,a))};d.text.utf16.encode=function(a,b,c){var d=b;d||(d=new Uint8Array(2*a.length));for(var g=new Uint16Array(d.buffer),p=c=c||0,e=c,k=0;k<a.length;++k)g[e++]=a.charCodeAt(k),p+=2;return b?p-c:d};d.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))};d.deflate=function(a,
|
||||
b,c){b=d.decode64(a.deflate(d.encode64(b)).rval);c&&(a=2,b.charCodeAt(1)&32&&(a=6),b=b.substring(a,b.length-4));return b};d.inflate=function(a,b,c){a=a.inflate(d.encode64(b)).rval;return null===a?null:d.decode64(a)};var x=function(a,b,c){if(!a)throw Error("WebStorage not available.");null===c?a=a.removeItem(b):(c=d.encode64(JSON.stringify(c)),a=a.setItem(b,c));if("undefined"!==typeof a&&!0!==a.rval)throw b=Error(a.error.message),b.id=a.error.id,b.name=a.error.name,b;},B=function(a,b){if(!a)throw Error("WebStorage not available.");
|
||||
var c=a.getItem(b);if(a.init)if(null===c.rval){if(c.error){var g=Error(c.error.message);g.id=c.error.id;g.name=c.error.name;throw g;}c=null}else c=c.rval;null!==c&&(c=JSON.parse(d.decode64(c)));return c},k=function(a,b,c,g){var d=B(a,b);null===d&&(d={});d[c]=g;x(a,b,d)},g=function(a,b,c){a=B(a,b);null!==a&&(a=c in a?a[c]:null);return a},K=function(a,b,c){var g=B(a,b);if(null!==g&&c in g){delete g[c];c=!0;for(var d in g){c=!1;break}c&&(g=null);x(a,b,g)}},u=function(a,b){x(a,b,null)},l=function(a,b,
|
||||
c){var g=null;"undefined"===typeof c&&(c=["web","flash"]);var d,p=!1,e=null,k;for(k in c){d=c[k];try{if("flash"===d||"both"===d){if(null===b[0])throw Error("Flash local storage not available.");g=a.apply(this,b);p="flash"===d}if("web"===d||"both"===d)b[0]=localStorage,g=a.apply(this,b),p=!0}catch(h){e=h}if(p)break}if(!p)throw e;return g};d.setItem=function(a,b,c,g,d){l(k,arguments,d)};d.getItem=function(a,b,c,d){return l(g,arguments,d)};d.removeItem=function(a,b,c,g){l(K,arguments,g)};d.clearItems=
|
||||
var c=a.getItem(b);if(a.init)if(null===c.rval){if(c.error){var g=Error(c.error.message);g.id=c.error.id;g.name=c.error.name;throw g;}c=null}else c=c.rval;null!==c&&(c=JSON.parse(d.decode64(c)));return c},k=function(a,b,c,d){var g=B(a,b);null===g&&(g={});g[c]=d;x(a,b,g)},g=function(a,b,c){a=B(a,b);null!==a&&(a=c in a?a[c]:null);return a},K=function(a,b,c){var d=B(a,b);if(null!==d&&c in d){delete d[c];c=!0;for(var g in d){c=!1;break}c&&(d=null);x(a,b,d)}},u=function(a,b){x(a,b,null)},l=function(a,b,
|
||||
c){var d=null;"undefined"===typeof c&&(c=["web","flash"]);var g,p=!1,e=null,k;for(k in c){g=c[k];try{if("flash"===g||"both"===g){if(null===b[0])throw Error("Flash local storage not available.");d=a.apply(this,b);p="flash"===g}if("web"===g||"both"===g)b[0]=localStorage,d=a.apply(this,b),p=!0}catch(h){e=h}if(p)break}if(!p)throw e;return d};d.setItem=function(a,b,c,d,g){l(k,arguments,g)};d.getItem=function(a,b,c,d){return l(g,arguments,d)};d.removeItem=function(a,b,c,d){l(K,arguments,d)};d.clearItems=
|
||||
function(a,b,c){l(u,arguments,c)};d.parseUrl=function(a){var b=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;b.lastIndex=0;b=b.exec(a);if(a=null===b?null:{full:a,scheme:b[1],host:b[2],port:b[3],path:b[4]})a.fullHost=a.host,a.port?80!==a.port&&"http"===a.scheme?a.fullHost+=":"+a.port:443!==a.port&&"https"===a.scheme&&(a.fullHost+=":"+a.port):"http"===a.scheme?a.port=80:"https"===a.scheme&&(a.port=443),a.full=a.scheme+"://"+a.fullHost;return a};var w=null;d.getQueryVariables=function(a){var b=function(a){var b=
|
||||
{};a=a.split("&");for(var c=0;c<a.length;c++){var g=a[c].indexOf("="),d;0<g?(d=a[c].substring(0,g),g=a[c].substring(g+1)):(d=a[c],g=null);d in b||(b[d]=[]);d in Object.prototype||null===g||b[d].push(unescape(g))}return b};"undefined"===typeof a?(null===w&&(w="undefined"!==typeof window&&window.location&&window.location.search?b(window.location.search.substring(1)):{}),a=w):a=b(a);return a};d.parseFragment=function(a){var b=a,c="",g=a.indexOf("?");0<g&&(b=a.substring(0,g),c=a.substring(g+1));a=b.split("/");
|
||||
0<a.length&&""===a[0]&&a.shift();g=""===c?{}:d.getQueryVariables(c);return{pathString:b,queryString:c,path:a,query:g}};d.makeRequest=function(a){var b=d.parseFragment(a),c={path:b.pathString,query:b.queryString,getPath:function(a){return"undefined"===typeof a?b.path:b.path[a]},getQuery:function(a,c){var g;"undefined"===typeof a?g=b.query:(g=b.query[a])&&"undefined"!==typeof c&&(g=g[c]);return g},getQueryLast:function(a,b){var g=c.getQuery(a);return g?g[g.length-1]:b}};return c};d.makeLink=function(a,
|
||||
b,c){a=jQuery.isArray(a)?a.join("/"):a;b=jQuery.param(b||{});c=c||"";return a+(0<b.length?"?"+b:"")+(0<c.length?"#"+c:"")};d.setPath=function(a,b,c){if("object"===typeof a&&null!==a)for(var g=0,d=b.length;g<d;){var p=b[g++];if(g==d)a[p]=c;else{var e=p in a;if(!e||e&&"object"!==typeof a[p]||e&&null===a[p])a[p]={};a=a[p]}}};d.getPath=function(a,b,c){for(var g=0,d=b.length,p=!0;p&&g<d&&"object"===typeof a&&null!==a;){var e=b[g++];(p=e in a)&&(a=a[e])}return p?a:c};d.deletePath=function(a,b){if("object"===
|
||||
typeof a&&null!==a)for(var c=0,g=b.length;c<g;){var d=b[c++];if(c==g)delete a[d];else{if(!(d in a)||"object"!==typeof a[d]||null===a[d])break;a=a[d]}}};d.isEmpty=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};d.format=function(a){var b=/%./g,c,g,d=0,p=[];for(g=0;c=b.exec(a);)switch(g=a.substring(g,b.lastIndex-2),0<g.length&&p.push(g),g=b.lastIndex,c=c[0][1],c){case "s":case "o":d<arguments.length?p.push(arguments[d++ +1]):p.push("<?>");break;case "%":p.push("%");break;default:p.push("<#"+
|
||||
c+"?>")}p.push(a.substring(g));return p.join("")};d.formatNumber=function(a,b,c,g){var d=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;g=void 0===g?".":g;c=0>a?"-":"";var p=parseInt(a=Math.abs(+a||0).toFixed(d),10)+"",e=3<p.length?p.length%3:0;return c+(e?p.substr(0,e)+g:"")+p.substr(e).replace(/(\d{3})(?=\d)/g,"$1"+g)+(d?b+Math.abs(a-p).toFixed(d).slice(2):"")};d.formatSize=function(a){return a=1073741824<=a?d.formatNumber(a/1073741824,2,".","")+" GiB":1048576<=a?d.formatNumber(a/1048576,2,".","")+
|
||||
{};a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),g;0<d?(g=a[c].substring(0,d),d=a[c].substring(d+1)):(g=a[c],d=null);g in b||(b[g]=[]);g in Object.prototype||null===d||b[g].push(unescape(d))}return b};"undefined"===typeof a?(null===w&&(w="undefined"!==typeof window&&window.location&&window.location.search?b(window.location.search.substring(1)):{}),a=w):a=b(a);return a};d.parseFragment=function(a){var b=a,c="",g=a.indexOf("?");0<g&&(b=a.substring(0,g),c=a.substring(g+1));a=b.split("/");
|
||||
0<a.length&&""===a[0]&&a.shift();g=""===c?{}:d.getQueryVariables(c);return{pathString:b,queryString:c,path:a,query:g}};d.makeRequest=function(a){var b=d.parseFragment(a),c={path:b.pathString,query:b.queryString,getPath:function(a){return"undefined"===typeof a?b.path:b.path[a]},getQuery:function(a,c){var d;"undefined"===typeof a?d=b.query:(d=b.query[a])&&"undefined"!==typeof c&&(d=d[c]);return d},getQueryLast:function(a,b){var d=c.getQuery(a);return d?d[d.length-1]:b}};return c};d.makeLink=function(a,
|
||||
b,c){a=jQuery.isArray(a)?a.join("/"):a;b=jQuery.param(b||{});c=c||"";return a+(0<b.length?"?"+b:"")+(0<c.length?"#"+c:"")};d.setPath=function(a,b,c){if("object"===typeof a&&null!==a)for(var d=0,g=b.length;d<g;){var p=b[d++];if(d==g)a[p]=c;else{var e=p in a;if(!e||e&&"object"!==typeof a[p]||e&&null===a[p])a[p]={};a=a[p]}}};d.getPath=function(a,b,c){for(var d=0,g=b.length,p=!0;p&&d<g&&"object"===typeof a&&null!==a;){var e=b[d++];(p=e in a)&&(a=a[e])}return p?a:c};d.deletePath=function(a,b){if("object"===
|
||||
typeof a&&null!==a)for(var c=0,d=b.length;c<d;){var g=b[c++];if(c==d)delete a[g];else{if(!(g in a)||"object"!==typeof a[g]||null===a[g])break;a=a[g]}}};d.isEmpty=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};d.format=function(a){var b=/%./g,c,d,g=0,p=[];for(d=0;c=b.exec(a);)switch(d=a.substring(d,b.lastIndex-2),0<d.length&&p.push(d),d=b.lastIndex,c=c[0][1],c){case "s":case "o":g<arguments.length?p.push(arguments[g++ +1]):p.push("<?>");break;case "%":p.push("%");break;default:p.push("<#"+
|
||||
c+"?>")}p.push(a.substring(d));return p.join("")};d.formatNumber=function(a,b,c,d){var g=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;d=void 0===d?".":d;c=0>a?"-":"";var p=parseInt(a=Math.abs(+a||0).toFixed(g),10)+"",e=3<p.length?p.length%3:0;return c+(e?p.substr(0,e)+d:"")+p.substr(e).replace(/(\d{3})(?=\d)/g,"$1"+d)+(g?b+Math.abs(a-p).toFixed(g).slice(2):"")};d.formatSize=function(a){return a=1073741824<=a?d.formatNumber(a/1073741824,2,".","")+" GiB":1048576<=a?d.formatNumber(a/1048576,2,".","")+
|
||||
" MiB":1024<=a?d.formatNumber(a/1024,0)+" KiB":d.formatNumber(a,0)+" bytes"};d.bytesFromIP=function(a){return-1!==a.indexOf(".")?d.bytesFromIPv4(a):-1!==a.indexOf(":")?d.bytesFromIPv6(a):null};d.bytesFromIPv4=function(a){a=a.split(".");if(4!==a.length)return null;for(var b=d.createBuffer(),c=0;c<a.length;++c){var g=parseInt(a[c],10);if(isNaN(g))return null;b.putByte(g)}return b.getBytes()};d.bytesFromIPv6=function(a){var b=0;a=a.split(":").filter(function(a){0===a.length&&++b;return!0});for(var c=
|
||||
2*(8-a.length+b),g=d.createBuffer(),p=0;8>p;++p)if(a[p]&&0!==a[p].length){var e=d.hexToBytes(a[p]);2>e.length&&g.putByte(0);g.putBytes(e)}else g.fillWithByte(0,c),c=0;return g.getBytes()};d.bytesToIP=function(a){return 4===a.length?d.bytesToIPv4(a):16===a.length?d.bytesToIPv6(a):null};d.bytesToIPv4=function(a){if(4!==a.length)return null;for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c));return b.join(".")};d.bytesToIPv6=function(a){if(16!==a.length)return null;for(var b=[],c=[],g=0,p=0;p<a.length;p+=
|
||||
2){for(var e=d.bytesToHex(a[p]+a[p+1]);"0"===e[0]&&"0"!==e;)e=e.substr(1);if("0"===e){var k=c[c.length-1],h=b.length;k&&h===k.end+1?(k.end=h,k.end-k.start>c[g].end-c[g].start&&(g=c.length-1)):c.push({start:h,end:h})}b.push(e)}0<c.length&&(a=c[g],0<a.end-a.start&&(b.splice(a.start,a.end-a.start+1,""),0===a.start&&b.unshift(""),7===a.end&&b.push("")));return b.join(":")};d.estimateCores=function(a,b){function c(a,k,h){if(0===k){var m=Math.floor(a.reduce(function(a,b){return a+b},0)/a.length);d.cores=
|
||||
Math.max(1,m);URL.revokeObjectURL(e);return b(null,d.cores)}g(h,function(b,g){a.push(p(h,g));c(a,k-1,h)})}function g(a,b){for(var c=[],d=[],p=0;p<a;++p){var k=new Worker(e);k.addEventListener("message",function(g){d.push(g.data);if(d.length===a){for(g=0;g<a;++g)c[g].terminate();b(null,d)}});c.push(k)}for(p=0;p<a;++p)c[p].postMessage(p)}function p(a,b){for(var c=[],g=0;g<a;++g)for(var d=b[g],e=c[g]=[],k=0;k<a;++k)if(g!==k){var z=b[k];(d.st>z.st&&d.st<z.et||z.st>d.st&&z.st<d.et)&&e.push(k)}return c.reduce(function(a,
|
||||
Math.max(1,m);URL.revokeObjectURL(e);return b(null,d.cores)}g(h,function(b,d){a.push(p(h,d));c(a,k-1,h)})}function g(a,b){for(var c=[],d=[],p=0;p<a;++p){var k=new Worker(e);k.addEventListener("message",function(g){d.push(g.data);if(d.length===a){for(g=0;g<a;++g)c[g].terminate();b(null,d)}});c.push(k)}for(p=0;p<a;++p)c[p].postMessage(p)}function p(a,b){for(var c=[],d=0;d<a;++d)for(var g=b[d],e=c[d]=[],k=0;k<a;++k)if(d!==k){var z=b[k];(g.st>z.st&&g.st<z.et||z.st>g.st&&z.st<g.et)&&e.push(k)}return c.reduce(function(a,
|
||||
b){return Math.max(a,b.length)},0)}"function"===typeof a&&(b=a,a={});a=a||{};if("cores"in d&&!a.update)return b(null,d.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&0<navigator.hardwareConcurrency)return d.cores=navigator.hardwareConcurrency,b(null,d.cores);if("undefined"===typeof Worker)return d.cores=1,b(null,d.cores);if("undefined"===typeof Blob)return d.cores=2,b(null,d.cores);var e=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(a){a=
|
||||
Date.now();for(var b=a+4;Date.now()<b;);self.postMessage({st:a,et:b})})}.toString(),")()"],{type:"application/javascript"}));c([],5,16)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var l,n=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.util)return c.util;c.defined.util=!0;for(var m=0;m<e.length;++m)e[m](c);
|
||||
return c.util}},r=a;a=function(b,c){l="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/util",["require","module"],function(){n.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.cipher=a.cipher||{};a.cipher.algorithms=a.cipher.algorithms||{};a.cipher.createCipher=function(b,c){var d=b;"string"===typeof d&&(d=a.cipher.getAlgorithm(d))&&
|
||||
@ -313,9 +313,9 @@ messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){u.me
|
||||
1;0<=E;--E)u.fullMessageLength[E]+=l[1],l[1]=l[0]+(u.fullMessageLength[E]/4294967296>>>0),u.fullMessageLength[E]>>>=0,l[0]=l[1]/4294967296>>>0;d.putBytes(e);c(b,v,d);(2048<d.read||0===d.length())&&d.compact();return u};u.digest=function(){var l=a.util.createBuffer();l.putBytes(d.bytes());l.putBytes(e.substr(0,u.blockLength-(u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize&u.blockLength-1)));a.util.createBuffer();for(var w,y,E=8*u.fullMessageLength[0],x=0;x<u.fullMessageLength.length;++x)w=
|
||||
8*u.fullMessageLength[x+1],y=w/4294967296>>>0,E+=y,l.putInt32(E>>>0),E=w;w={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,h4:b.h4,h5:b.h5,h6:b.h6,h7:b.h7};c(w,v,l);l=a.util.createBuffer();l.putInt32(w.h0);l.putInt32(w.h1);l.putInt32(w.h2);l.putInt32(w.h3);l.putInt32(w.h4);l.putInt32(w.h5);l.putInt32(w.h6);l.putInt32(w.h7);return l};return u};var e=null,l=!1,n=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge=
|
||||
{}),b(forge);var l,n=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha256)return c.sha256;c.defined.sha256=!0;for(var m=0;m<e.length;++m)e[m](c);return c.sha256}},r=a;a=function(b,c){l="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/sha256",["require","module","./util"],function(){n.apply(null,
|
||||
Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var g,e,p,h,m,A,z,D,l,v,q,x,n,T,ba,P,r,B,Z,aa,O,Y,N,H,J,X=d.length();128<=X;){for(J=0;16>J;++J)b[J][0]=d.getInt32()>>>0,b[J][1]=d.getInt32()>>>0;for(;80>J;++J)m=b[J-2],l=m[0],m=m[1],g=((l>>>19|m<<13)^(m>>>29|l<<3)^l>>>6)>>>0,e=((l<<13|m>>>19)^(m<<3|l>>>29)^(l<<26|m>>>6))>>>0,m=b[J-15],l=m[0],m=m[1],p=((l>>>1|m<<31)^(l>>>8|m<<24)^l>>>7)>>>0,h=((l<<31|m>>>1)^(l<<24|m>>>8)^(l<<25|m>>>7))>>>0,l=b[J-7],v=b[J-
|
||||
16],m=e+l[1]+h+v[1],b[J][0]=g+l[0]+p+v[0]+(m/4294967296>>>0)>>>0,b[J][1]=m>>>0;l=a[0][0];v=a[0][1];q=a[1][0];x=a[1][1];n=a[2][0];T=a[2][1];ba=a[3][0];P=a[3][1];r=a[4][0];B=a[4][1];Z=a[5][0];aa=a[5][1];O=a[6][0];Y=a[6][1];N=a[7][0];H=a[7][1];for(J=0;80>J;++J)g=((r>>>14|B<<18)^(r>>>18|B<<14)^(B>>>9|r<<23))>>>0,m=((r<<18|B>>>14)^(r<<14|B>>>18)^(B<<23|r>>>9))>>>0,e=(O^r&(Z^O))>>>0,A=(Y^B&(aa^Y))>>>0,p=((l>>>28|v<<4)^(v>>>2|l<<30)^(v>>>7|l<<25))>>>0,h=((l<<4|v>>>28)^(v<<30|l>>>2)^(v<<25|l>>>7))>>>0,z=
|
||||
(l&q|n&(l^q))>>>0,D=(v&x|T&(v^x))>>>0,m=H+m+A+k[J][1]+b[J][1],g=N+g+e+k[J][0]+b[J][0]+(m/4294967296>>>0)>>>0,e=m>>>0,m=h+D,p=p+z+(m/4294967296>>>0)>>>0,h=m>>>0,N=O,H=Y,O=Z,Y=aa,Z=r,aa=B,m=P+e,r=ba+g+(m/4294967296>>>0)>>>0,B=m>>>0,ba=n,P=T,n=q,T=x,q=l,x=v,m=e+h,l=g+p+(m/4294967296>>>0)>>>0,v=m>>>0;m=a[0][1]+v;a[0][0]=a[0][0]+l+(m/4294967296>>>0)>>>0;a[0][1]=m>>>0;m=a[1][1]+x;a[1][0]=a[1][0]+q+(m/4294967296>>>0)>>>0;a[1][1]=m>>>0;m=a[2][1]+T;a[2][0]=a[2][0]+n+(m/4294967296>>>0)>>>0;a[2][1]=m>>>0;m=
|
||||
Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var e,g,p,h,m,A,z,D,l,v,q,x,n,T,ba,P,r,B,Z,aa,O,Y,N,H,J,X=d.length();128<=X;){for(J=0;16>J;++J)b[J][0]=d.getInt32()>>>0,b[J][1]=d.getInt32()>>>0;for(;80>J;++J)m=b[J-2],l=m[0],m=m[1],e=((l>>>19|m<<13)^(m>>>29|l<<3)^l>>>6)>>>0,g=((l<<13|m>>>19)^(m<<3|l>>>29)^(l<<26|m>>>6))>>>0,m=b[J-15],l=m[0],m=m[1],p=((l>>>1|m<<31)^(l>>>8|m<<24)^l>>>7)>>>0,h=((l<<31|m>>>1)^(l<<24|m>>>8)^(l<<25|m>>>7))>>>0,l=b[J-7],v=b[J-
|
||||
16],m=g+l[1]+h+v[1],b[J][0]=e+l[0]+p+v[0]+(m/4294967296>>>0)>>>0,b[J][1]=m>>>0;l=a[0][0];v=a[0][1];q=a[1][0];x=a[1][1];n=a[2][0];T=a[2][1];ba=a[3][0];P=a[3][1];r=a[4][0];B=a[4][1];Z=a[5][0];aa=a[5][1];O=a[6][0];Y=a[6][1];N=a[7][0];H=a[7][1];for(J=0;80>J;++J)e=((r>>>14|B<<18)^(r>>>18|B<<14)^(B>>>9|r<<23))>>>0,m=((r<<18|B>>>14)^(r<<14|B>>>18)^(B<<23|r>>>9))>>>0,g=(O^r&(Z^O))>>>0,A=(Y^B&(aa^Y))>>>0,p=((l>>>28|v<<4)^(v>>>2|l<<30)^(v>>>7|l<<25))>>>0,h=((l<<4|v>>>28)^(v<<30|l>>>2)^(v<<25|l>>>7))>>>0,z=
|
||||
(l&q|n&(l^q))>>>0,D=(v&x|T&(v^x))>>>0,m=H+m+A+k[J][1]+b[J][1],e=N+e+g+k[J][0]+b[J][0]+(m/4294967296>>>0)>>>0,g=m>>>0,m=h+D,p=p+z+(m/4294967296>>>0)>>>0,h=m>>>0,N=O,H=Y,O=Z,Y=aa,Z=r,aa=B,m=P+g,r=ba+e+(m/4294967296>>>0)>>>0,B=m>>>0,ba=n,P=T,n=q,T=x,q=l,x=v,m=g+h,l=e+p+(m/4294967296>>>0)>>>0,v=m>>>0;m=a[0][1]+v;a[0][0]=a[0][0]+l+(m/4294967296>>>0)>>>0;a[0][1]=m>>>0;m=a[1][1]+x;a[1][0]=a[1][0]+q+(m/4294967296>>>0)>>>0;a[1][1]=m>>>0;m=a[2][1]+T;a[2][0]=a[2][0]+n+(m/4294967296>>>0)>>>0;a[2][1]=m>>>0;m=
|
||||
a[3][1]+P;a[3][0]=a[3][0]+ba+(m/4294967296>>>0)>>>0;a[3][1]=m>>>0;m=a[4][1]+B;a[4][0]=a[4][0]+r+(m/4294967296>>>0)>>>0;a[4][1]=m>>>0;m=a[5][1]+aa;a[5][0]=a[5][0]+Z+(m/4294967296>>>0)>>>0;a[5][1]=m>>>0;m=a[6][1]+Y;a[6][0]=a[6][0]+O+(m/4294967296>>>0)>>>0;a[6][1]=m>>>0;m=a[7][1]+H;a[7][0]=a[7][0]+N+(m/4294967296>>>0)>>>0;a[7][1]=m>>>0;X-=128}}var d=a.sha512=a.sha512||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha512=a.md.algorithms.sha512=d;var e=a.sha384=a.sha512.sha384=a.sha512.sha384||
|
||||
{};e.create=function(){return d.create("SHA-384")};a.md.sha384=a.md.algorithms.sha384=e;a.sha512.sha256=a.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256;a.sha512.sha224=a.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224;d.create=function(b){n||(l=String.fromCharCode(128),l+=a.util.fillString(String.fromCharCode(0),128),k=[[1116352408,
|
||||
3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],
|
||||
@ -1150,25 +1150,25 @@ function termToggleFx(){Q(34).value=["Intel (F10 = ESC+[OM)","Alternate (F10 = E
|
||||
function terminalCaptureToggle(b){if(!xxdialogMode)if(void 0==terminal.m.capture)terminal.m.capture="",c3.value="Stop Capture";else{if(0<terminal.m.capture.length){b="TerminalCapture";var c=new Date;amtsysstate&&(b+="-"+amtsysstate.AMT_GeneralSettings.response.HostName);b+="-"+c.getFullYear()+"-"+("0"+(c.getMonth()+1)).slice(-2)+"-"+("0"+c.getDate()).slice(-2)+"-"+("0"+c.getHours()).slice(-2)+"-"+("0"+c.getMinutes()).slice(-2);saveAs(data2blob(terminal.m.capture),b+".txt")}delete terminal.m.capture;
|
||||
c3.value="Start Capture"}}function terminal_FileSelectHandler(b){haltEvent(b);if(3==terminal.State&&null!=b.dataTransfer&&1==b.dataTransfer.files.length){var c=new FileReader;c.onload=terminal_onSetupBinRead;c.readAsText(b.dataTransfer.files[0])}}function terminal_onSetupBinRead(b){d3pastetextarea.value=b.target.result;setDialogMode(3,"Paste",3,termPaste)}var desktopScreenInfo=null,desktopPollTimer=null,webRtcDesktop=null;
|
||||
function webRtcDesktopReset(){if(null!=webRtcDesktop){null!=webRtcDesktop.softdesktop&&(webRtcDesktop.softdesktop.Stop(),webRtcDesktop.softdesktop=null);if(null!=webRtcDesktop.webchannel){try{webRtcDesktop.webchannel.close()}catch(b){}webRtcDesktop.webchannel=null}if(null!=webRtcDesktop.webrtc){try{webRtcDesktop.webrtc.close()}catch(b){}webRtcDesktop.webrtc=null}webRtcDesktop=null;desktop.m.hold(!1);Q(42).textContent=StatusStrs[desktop.State];p24files=null;p24downloadFileCancel();p24uploadFileCancel();
|
||||
QV("go24",!1);24==currentView&&go(14)}}
|
||||
function connectDesktop(){desktop&&(0==desktop.State?(desktop.m.bpp=2==desktopsettings.encoding||4==desktopsettings.encoding?2:1,desktop.m.graymode=0,6==desktopsettings.encoding&&(desktop.m.graymode=1),5==desktopsettings.encoding&&(desktop.m.graymode=2),desktop.m.useZRLE=3>desktopsettings.encoding,desktop.m.showmouse=desktopsettings.showmouse,desktop.m.onScreenSizeChange=center,desktop.m.onKvmData=function(b){var c=null;try{c=JSON.parse(b)}catch(a){}null!=c&&null!=c.action&&("restart"==c.action?(webRtcDesktopReset(),
|
||||
desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))):"present"==c.action&&null==webRtcDesktop?(webRtcDesktop={platform:c.platform},"undefined"!==typeof RTCPeerConnection?webRtcDesktop.webrtc=new RTCPeerConnection(null):"undefined"!==typeof webkitRTCPeerConnection&&(webRtcDesktop.webrtc=new webkitRTCPeerConnection(null)),webRtcDesktop.webchannel=webRtcDesktop.webrtc.createDataChannel("DataChannel",{}),webRtcDesktop.webchannel.onopen=function(){urlvars&&urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Open");
|
||||
Q(42).textContent=StatusStrs[desktop.State]+", Soft-KVM";desktop.m.hold(!0);webRtcDesktop.webRtcActive=!0;webRtcDesktop.softdesktop=CreateKvmDataChannel(webRtcDesktop.webchannel,CreateAgentRemoteDesktop("Desk",Q(8)),desktop.m);webRtcDesktop.softdesktop.m.setRotation(desktop.m.rotation);desktopsettings.quality&&(webRtcDesktop.softdesktop.m.CompressionLevel=desktopsettings.quality);desktopsettings.scaling&&(webRtcDesktop.softdesktop.m.ScalingLevel=desktopsettings.scaling);webRtcDesktop.softdesktop.Start();
|
||||
QV("go24",!0);downloadFile=null;p24files=webRtcDesktop.softdesktop;p24targetpath="";webRtcDesktop.softdesktop.onControlMsg=onFilesControlData;webRtcDesktop.softdesktop.sendCtrlMsg(JSON.stringify({action:"ls",reqid:1,path:""}))},webRtcDesktop.webchannel.onclose=function(a){urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Closed");webRtcDesktopReset()},webRtcDesktop.webrtc.onicecandidate=function(a){null==a.candidate?desktop.m.sendKvmData(JSON.stringify({action:"offer",ver:1,sdp:webRtcDesktop.webrtcoffer.sdp})):
|
||||
webRtcDesktop.webrtcoffer.sdp+="a="+a.candidate.candidate+"\r\n"},webRtcDesktop.webrtc.oniceconnectionstatechange=function(){null==webRtcDesktop||null==webRtcDesktop.webrtc||"disconnected"!=webRtcDesktop.webrtc.iceConnectionState&&"failed"!=webRtcDesktop.webrtc.iceConnectionState||webRtcDesktopReset()},webRtcDesktop.webrtc.createOffer(function(a){webRtcDesktop.webrtcoffer=a;webRtcDesktop.webrtc.setLocalDescription(a,function(){},webRtcDesktopReset)},webRtcDesktopReset,{mandatory:{OfferToReceiveAudio:!1,
|
||||
OfferToReceiveVideo:!1}})):"answer"==c.action&&null!=webRtcDesktop&&webRtcDesktop.webrtc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:c.sdp}),function(){},webRtcDesktopReset))},desktop.m.frameRateDelay=1==desktopsettings.limitFrameRate?200:0,desktop.m.noMouseRotate=desktopsettings.noMouseRotate,desktop.tlsv1only=amtstack.wsman.comm.tlsv1only,desktop.Start(currentMeshNode._id,16994,"*","*",0),PullDesktopDisplayInfo(),urlvars.norefresh||(desktopPollTimer=setInterval(PullDesktopDisplayInfo,
|
||||
5E3))):(desktop.Stop(),clearInterval(desktopPollTimer),desktopPollTimer=null,PullDesktopDisplayInfo(),webRtcDesktopReset()))}function PullDesktopDisplayInfo(){7<amtversion&&0<desktop.State?amtstack.BatchEnum("",["*IPS_ScreenSettingData","*IPS_KVMRedirectionSettingData"],ProcessDesktopDisplayInfo):(desktopScreenInfo=null,Q(44).innerHTML="")}
|
||||
function ProcessDesktopDisplayInfo(b,c,a,d){200!=d?desktopScreenInfo=null:(desktopScreenInfo=a.IPS_ScreenSettingData.responses.Body,desktopScreenInfo.KVMRSD=a.IPS_KVMRedirectionSettingData.responses.Body,UpdateDesktopDisplayInfo())}
|
||||
QV("go24",!1);24==currentView&&go(14)}}var connectDesktopConsent=!1;
|
||||
function connectDesktop(b){desktop&&!xxdialogMode&&(connectDesktopConsent=!1,0==desktop.State?!0!==b&&5<amtversion&&null!=amtsysstate.IPS_OptInService&&void 0!=amtsysstate.IPS_OptInService.response&&4294967295==amtsysstate.IPS_OptInService.response.OptInRequired?(connectDesktopConsent=!0,amtstack.Get("IPS_OptInService",powerActionResponse0,0,1)):(desktop.m.bpp=2==desktopsettings.encoding||4==desktopsettings.encoding?2:1,desktop.m.graymode=0,6==desktopsettings.encoding&&(desktop.m.graymode=1),5==desktopsettings.encoding&&
|
||||
(desktop.m.graymode=2),desktop.m.useZRLE=3>desktopsettings.encoding,desktop.m.showmouse=desktopsettings.showmouse,desktop.m.onScreenSizeChange=center,desktop.m.onKvmData=function(b){var a=null;try{a=JSON.parse(b)}catch(d){}null!=a&&null!=a.action&&("restart"==a.action?(webRtcDesktopReset(),desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))):"present"==a.action&&null==webRtcDesktop?(webRtcDesktop={platform:a.platform},"undefined"!==typeof RTCPeerConnection?webRtcDesktop.webrtc=new RTCPeerConnection(null):
|
||||
"undefined"!==typeof webkitRTCPeerConnection&&(webRtcDesktop.webrtc=new webkitRTCPeerConnection(null)),webRtcDesktop.webchannel=webRtcDesktop.webrtc.createDataChannel("DataChannel",{}),webRtcDesktop.webchannel.onopen=function(){urlvars&&urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Open");Q(42).textContent=StatusStrs[desktop.State]+", Soft-KVM";desktop.m.hold(!0);webRtcDesktop.webRtcActive=!0;webRtcDesktop.softdesktop=CreateKvmDataChannel(webRtcDesktop.webchannel,CreateAgentRemoteDesktop("Desk",
|
||||
Q(8)),desktop.m);webRtcDesktop.softdesktop.m.setRotation(desktop.m.rotation);desktopsettings.quality&&(webRtcDesktop.softdesktop.m.CompressionLevel=desktopsettings.quality);desktopsettings.scaling&&(webRtcDesktop.softdesktop.m.ScalingLevel=desktopsettings.scaling);webRtcDesktop.softdesktop.Start();QV("go24",!0);downloadFile=null;p24files=webRtcDesktop.softdesktop;p24targetpath="";webRtcDesktop.softdesktop.onControlMsg=onFilesControlData;webRtcDesktop.softdesktop.sendCtrlMsg(JSON.stringify({action:"ls",
|
||||
reqid:1,path:""}))},webRtcDesktop.webchannel.onclose=function(a){urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Closed");webRtcDesktopReset()},webRtcDesktop.webrtc.onicecandidate=function(a){null==a.candidate?desktop.m.sendKvmData(JSON.stringify({action:"offer",ver:1,sdp:webRtcDesktop.webrtcoffer.sdp})):webRtcDesktop.webrtcoffer.sdp+="a="+a.candidate.candidate+"\r\n"},webRtcDesktop.webrtc.oniceconnectionstatechange=function(){null==webRtcDesktop||null==webRtcDesktop.webrtc||"disconnected"!=
|
||||
webRtcDesktop.webrtc.iceConnectionState&&"failed"!=webRtcDesktop.webrtc.iceConnectionState||webRtcDesktopReset()},webRtcDesktop.webrtc.createOffer(function(a){webRtcDesktop.webrtcoffer=a;webRtcDesktop.webrtc.setLocalDescription(a,function(){},webRtcDesktopReset)},webRtcDesktopReset,{mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}})):"answer"==a.action&&null!=webRtcDesktop&&webRtcDesktop.webrtc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:a.sdp}),function(){},webRtcDesktopReset))},
|
||||
desktop.m.frameRateDelay=1==desktopsettings.limitFrameRate?200:0,desktop.m.noMouseRotate=desktopsettings.noMouseRotate,desktop.tlsv1only=amtstack.wsman.comm.tlsv1only,desktop.Start(currentMeshNode._id,16994,"*","*",0),PullDesktopDisplayInfo(),urlvars.norefresh||(desktopPollTimer=setInterval(PullDesktopDisplayInfo,5E3))):(desktop.Stop(),clearInterval(desktopPollTimer),desktopPollTimer=null,PullDesktopDisplayInfo(),webRtcDesktopReset()))}
|
||||
function PullDesktopDisplayInfo(){7<amtversion&&0<desktop.State?amtstack.BatchEnum("",["*IPS_ScreenSettingData","*IPS_KVMRedirectionSettingData"],ProcessDesktopDisplayInfo):(desktopScreenInfo=null,Q(44).innerHTML="")}function ProcessDesktopDisplayInfo(b,c,a,d){200!=d?desktopScreenInfo=null:(desktopScreenInfo=a.IPS_ScreenSettingData.responses.Body,desktopScreenInfo.KVMRSD=a.IPS_KVMRedirectionSettingData.responses.Body,UpdateDesktopDisplayInfo())}
|
||||
function UpdateDesktopDisplayInfo(){for(var b="",c=0,a=0;3>a;a++)1==desktopScreenInfo.IsActive[a]&&(c++,b+='<input type="button" '+(a==desktopScreenInfo.KVMRSD.DefaultScreen?'style="background-color:DodgerBlue"':"")+' value="'+(a+1)+'" title="Switch to screen '+(a+1)+'" onkeypress="return false" onkeydown="return false" onclick="desktopSwitchScreen('+a+')"> ');1<c?Q(44).innerHTML=b+" ":Q(44).innerHTML=""}
|
||||
function desktopSwitchScreen(b){var c=Clone(desktopScreenInfo.KVMRSD);c.DefaultScreen=b;amtstack.Put("IPS_KVMRedirectionSettingData",c,desktopSwitchScreenEx)}function desktopSwitchScreenEx(b,c,a,d){200==d&&(desktopScreenInfo.KVMRSD=a.Body,UpdateDesktopDisplayInfo())}
|
||||
function onDesktopStateChange(b,c){c10.value=0==c?"Connect":"Disconnect";Q(42).textContent=StatusStrs[c];var a=3==c&&!urlvars.kvmviewonly;QE(45,a);QE("deskkeys",a);QE("DeskWD",a);QE(46,a);switch(c){case 0:webRtcDesktopReset();QV("deskRecordIcon",!1);break;case 3:12<=amtversion&&b.m.sendKvmData(JSON.stringify({action:"present",ver:1})),1==b.serverIsRecording&&QV("deskRecordIcon",!0)}center()}
|
||||
function showDesktopSettings(){applyDesktopSettings();setDialogMode(7,"Remote Desktop Settings",3,showDesktopSettingsChanged)}
|
||||
function showDesktopSettings(){xxdialogMode||(applyDesktopSettings(),setDialogMode(7,"Remote Desktop Settings",3,showDesktopSettingsChanged))}
|
||||
function showDesktopSettingsChanged(){desktopsettings.encoding=c11.value;desktopsettings.showmouse=d7showcursor.checked;desktopsettings.showcad=d7showcad.checked;desktopsettings.limitFrameRate=d7limitFrameRate.checked;desktopsettings.noMouseRotate=d7noMouseRotate.checked;desktopsettings.quality=d7bitmapquality.value;desktopsettings.scaling=d7bitmapscaling.value;localStorage.setItem("desktopsettings",JSON.stringify(desktopsettings));applyDesktopSettings();desktop.m.frameRateDelay=1==
|
||||
desktopsettings.limitFrameRate?200:0;0!=desktop.State&&(desktop.Stop(),setTimeout(connectDesktop,50))}
|
||||
function applyDesktopSettings(){c11.value=desktopsettings.encoding;d7showcursor.checked=desktopsettings.showmouse;d7showcad.checked=desktopsettings.showcad;d7limitFrameRate.checked=desktopsettings.limitFrameRate;d7noMouseRotate.checked=desktopsettings.noMouseRotate;desktopsettings.quality&&(d7bitmapquality.value=desktopsettings.quality);desktopsettings.scaling&&(d7bitmapscaling.value=desktopsettings.scaling);QV("d7softkvmsettings",12<=amtversion);QV(45,desktopsettings.showcad);
|
||||
QV("d7gray4",urlvars.kvmgray);QV("d7gray8",urlvars.kvmgray)}var fullscreen=!1,fullscreenonly=!1;
|
||||
function deskToggleFull(b){1==fullscreenonly?(console.log("deskToggleFull1",fullscreenonly,urlvars.kvmonly),fullscreenonly=!1,1==urlvars.kvmonly?console.log("deskToggleFull2"):disconnect()):(fullscreenonly=b,fullscreen=!fullscreen,QV(7,!fullscreen),QV(37,!fullscreen),QV("c5",!fullscreen),QV("c9",fullscreen),fullscreen?(QS(8).left=0,QS(16).padding=0):(QS(8).left="156px",QS(16).padding="8px"),center())}
|
||||
function deskShowTypeDialog(){xxdialogMode||3!=desktop.State||(Q(46).blur(),setDialogMode(11,"Remote Keyboard Entry",3,showDeskTypeEx,'<div>Enter text and click OK to remotely type it using a US english keyboard. Make sure to place the remote cursor at the correct position before proceeding.<div><textarea id=d2typeText style="margin-top:5px;width:100%;height:184px;resize:none" maxlength=2000></textarea>'),Q("d2typeText").focus())}
|
||||
function deskToggleFull(b){xxdialogMode||(1==fullscreenonly?(console.log("deskToggleFull1",fullscreenonly,urlvars.kvmonly),fullscreenonly=!1,1==urlvars.kvmonly?console.log("deskToggleFull2"):disconnect()):(fullscreenonly=b,fullscreen=!fullscreen,QV(7,!fullscreen),QV(37,!fullscreen),QV("c5",!fullscreen),QV("c9",fullscreen),fullscreen?(QS(8).left=0,QS(16).padding=0):(QS(8).left="156px",QS(16).padding=
|
||||
"8px"),center()))}function deskShowTypeDialog(){xxdialogMode||3!=desktop.State||(Q(46).blur(),setDialogMode(11,"Remote Keyboard Entry",3,showDeskTypeEx,'<div>Enter text and click OK to remotely type it using a US english keyboard. Make sure to place the remote cursor at the correct position before proceeding.<div><textarea id=d2typeText style="margin-top:5px;width:100%;height:184px;resize:none" maxlength=2000></textarea>'),Q("d2typeText").focus())}
|
||||
var AmtDeskTypeTimer=null,AmtDeskTypeContent=null,DeskTypeTranslate={39:222,42:106,43:107,44:188,45:189,46:190,47:191,59:186,61:187,91:219,92:220,93:221,96:192,191:111},DeskTypeShiftTranslate={33:49,34:222,35:51,36:52,37:53,38:55,40:57,41:48,58:186,60:188,62:190,63:191,64:50,94:54,95:189,106:56,107:187,123:219,124:220,125:221,126:192};
|
||||
function showDeskTypeEx(){var b=Q("d2typeText").value;Q("d2typeText").value.toUpperCase();var c=[],a;for(a in b){var d=b.charCodeAt(a);c.push([d,1],[d,0])}AmtDeskTypeContent=c;AmtDeskTypeTimer=setInterval(function(){var a=AmtDeskTypeContent.shift();desktop&&desktop.m.sendkey(a[0],a[1]);if(null==desktop||0==AmtDeskTypeContent.length)clearInterval(AmtDeskTypeTimer),AmtDeskTypeContent=null},10)}function sendCAD(){Q(50).checked||desktop.m.sendcad()}
|
||||
var deskkeysset={0:[[65511,1],[65511,0]],1:[[65511,1],[65364,1],[65364,0],[65511,0]],2:[[65511,1],[65362,1],[65362,0],[65511,0]],3:[[65511,1],[108,1],[108,0],[65511,0]],4:[[65511,1],[109,1],[109,0],[65511,0]],5:[[65505,1],[65511,1],[109,1],[109,0],[65511,0],[65505,0]],6:[[65470,1],[65470,0]],7:[[65471,1],[65471,0]],8:[[65472,1],[65472,0]],9:[[65473,1],[65473,0]],10:[[65474,1],[65474,0]],11:[[65475,1],[65475,0]],12:[[65476,1],[65476,0]],13:[[65477,1],[65477,0]],14:[[65478,1],[65478,0]],15:[[65479,
|
||||
@ -1177,7 +1177,7 @@ function deskSendKeys(){if(!Q(50).checked){var b=Q("deskkeys").value;if(null!=b&
|
||||
function deskSaveImage(){if(!xxdialogMode&&3==desktop.State){var b="Desktop",c=new Date;amtsysstate&&(b+="-"+amtsysstate.AMT_GeneralSettings.response.HostName);b+="-"+c.getFullYear()+"-"+("0"+(c.getMonth()+1)).slice(-2)+"-"+("0"+c.getDate()).slice(-2)+"-"+("0"+c.getHours()).slice(-2)+"-"+("0"+c.getMinutes()).slice(-2);Q("Desk").toBlob(function(a){saveAs(a,b+".jpg")})}}
|
||||
function dmousedown(b){xxdialogMode||Q(50).checked||(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousedown(b),desktop.m.sendKeepAlive()):desktop.m.mousedown(b))}function dmouseup(b){xxdialogMode||Q(50).checked||(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mouseup(b),desktop.m.sendKeepAlive()):desktop.m.mouseup(b))}
|
||||
function dmousemove(b){xxdialogMode||Q(50).checked||(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousemove(b),desktop.m.sendKeepAlive()):desktop.m.mousemove(b))}function dmousewheel(b){xxdialogMode||Q(50).checked||null==webRtcDesktop||null==webRtcDesktop.softdesktop||(webRtcDesktop.softdesktop.m.mousewheel(b),desktop.m.sendKeepAlive())}
|
||||
function drotate(b){b=desktop.m.rotation+b;desktop.m.setRotation(b);null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop&&null!=webRtcDesktop.softdesktop.m&&webRtcDesktop.softdesktop.m.setRotation(b);center()}var p24files=null,p24filetree=null,p24targetpath=null,p24filetreelocation=[];
|
||||
function drotate(b){xxdialogMode||(b=desktop.m.rotation+b,desktop.m.setRotation(b),null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop&&null!=webRtcDesktop.softdesktop.m&&webRtcDesktop.softdesktop.m.setRotation(b),center())}var p24files=null,p24filetree=null,p24targetpath=null,p24filetreelocation=[];
|
||||
function onFilesControlData(b){if(0<b.length&&123!=b.charCodeAt(0))p24gotDownloadBinaryData(b);else if(b=JSON.parse(b),"download"==b.action)p24gotDownloadCommand(b);else if("upload"==b.action)p24gotUploadData(b);else if("pong"!=b.action)if(b.path=b.path.replace(/\//g,"\\"),null!=p24filetree&&b.path==p24filetree.path){var c=p24getCheckedNames();p24filetree=b;p24updateFiles(c)}else{for(var c=b.path.split("/").join("\\"),a=p24targetpath.split("/").join("\\");0<c.length&&"\\"==c[0];)c=c.substring(1);
|
||||
for(;0<a.length&&"\\"==a[0];)a=a.substring(1);if(c==a||"\\"==b.path&&""==p24targetpath)p24filetree=b,p24updateFiles()}}function p24getCheckedNames(){for(var b=[],c=document.getElementsByName("fd"),a=0;a<c.length;a++)c[a].checked&&b.push(p24filetree.dir[c[a].value].n);return b}
|
||||
function p24updateFiles(b){var c="",a="",d="<a style=cursor:pointer onclick=p24folderup(0)>Root</a>",e=p24filetree.path.split("\\");p24filetreelocation=[];for(var l in e)""!=e[l]&&p24filetreelocation.push(e[l]);for(l in p24filetreelocation)d+=" / <a style=cursor:pointer onclick=p24folderup("+(parseInt(l)+1)+")>"+p24filetreelocation[l]+"</a>";var e=p24filetreelocation.join("/"),n=p24sort_files(p24filetree.dir);for(l in n){var r=n[l],p=r.n,m;m=70<p.length?'<span title="'+EscapeHtml(p)+'">'+EscapeHtml(p.substring(0,
|
||||
@ -1210,8 +1210,8 @@ function p24uploadNextFile(){uploadFile.xfilePtr++;if(uploadFile.xfiles.length>u
|
||||
uploadFile.xreader.onerror=function(){p24uploadNextFile()};uploadFile.xreader.readAsArrayBuffer(b)}else p24uploadFileCancel(),p24folderup(9999)}function p24uploadFileCancel(b,c){null!=uploadFile&&(uploadFile=null,setDialogMode(0),99==c&&null!=p24files&&p24files.sendCtrlMsg(JSON.stringify({action:"upload",sub:"cancel"})))}
|
||||
function p24gotUploadData(b){if(null!=uploadFile&&parseInt(uploadFile.xfilePtr)==parseInt(b.reqid))if("start"==b.sub)for(p24uploadNextPart(!1),b=0;8>b;b++)p24uploadNextPart(!0);else"ack"==b.sub?p24uploadNextPart(!1):"error"==b.sub&&p24uploadFileCancel()}function ab2str(b){return String.fromCharCode.apply(null,new Uint8Array(b))}
|
||||
function p24uploadNextPart(b){var c=uploadFile.xdata,a=uploadFile.xptr,d=uploadFile.xptr+4096;if(d>c.byteLength){if(1==b)return;d=c.byteLength}a==c.byteLength?p24uploadNextFile():(p24files.sendCtrlMsg(btoa(IntToStr(d!=c.byteLength?16777216:16777217)+ab2str(c.slice(a,d)))),uploadFile.xptr=d,Q("d2progressBar").value=d)}var ider,iderCodeBlock,iderTimer;
|
||||
function iderStart(b){b='<div>Mount disk images on a Intel® AMT computer - Experimental.</div><br /><div style=height:26px><input id=floppyImageInput type=file style=float:right;width:250px accept=".img"><div>Floppy (.img)</div></div><div style=height:26px><input id=cdromImageInput type=file style=float:right;width:250px accept=".iso"><div>CDROM (.iso)</div></div>';b+="<div style=height:26px><select id=iderStartType style=float:right;width:250px><option value=0>On next boot<option value=1>Graceful<option value=2>Immediate</select><div>Session Start</div></div>";
|
||||
setDialogMode(11,"Storage Redirection",3,iderStart2,b);if(b=localStorage.getItem("iderurl"))Q("storageserverurl").value=b.substring(1,b.length-1)}
|
||||
function iderStart(b){!xxdialogMode&&(b='<div>Mount disk images on a Intel® AMT computer - Experimental.</div><br /><div style=height:26px><input id=floppyImageInput type=file style=float:right;width:250px accept=".img"><div>Floppy (.img)</div></div><div style=height:26px><input id=cdromImageInput type=file style=float:right;width:250px accept=".iso"><div>CDROM (.iso)</div></div>',b+="<div style=height:26px><select id=iderStartType style=float:right;width:250px><option value=0>On next boot<option value=1>Graceful<option value=2>Immediate</select><div>Session Start</div></div>",
|
||||
setDialogMode(11,"Storage Redirection",3,iderStart2,b),b=localStorage.getItem("iderurl"))&&(Q("storageserverurl").value=b.substring(1,b.length-1))}
|
||||
function iderStart2(){if(1!=Q("floppyImageInput").files.length&&1!=Q("cdromImageInput").files.length)messagebox("Storage Redirection Error","At least one disk image file must be selected.");else if(1==Q("floppyImageInput").files.length&&0!=Q("floppyImageInput").files[0].size%512)messagebox("Storage Redirection Error","Invalid .img file.");else if(1==Q("cdromImageInput").files.length&&0!=Q("cdromImageInput").files[0].size%2048)messagebox("Storage Redirection Error","Invalid .iso file.");else{var b=
|
||||
null,c=null;1==Q("floppyImageInput").files.length&&(b=Q("floppyImageInput").files[0]);1==Q("cdromImageInput").files.length&&(c=Q("cdromImageInput").files[0]);null==b&&null==c||iderStart3(b,c,Q("iderStartType").value)}}
|
||||
function iderStart3(b,c,a){iderStop();ider=CreateAmtRedirect(CreateAmtRemoteIder());ider.onStateChanged=onIderStateChange;ider.m.floppy=b;ider.m.cdrom=c;ider.m.iderStart=a;ider.m.sectorStats=iderSectorStats;ider.tlsv1only=amtstack.wsman.comm.tlsv1only;ider.Start(currentMeshNode._id,16994,"*","*",0);QV("IDERDiskMapButton",!0)}
|
||||
@ -1220,7 +1220,7 @@ function onIderTimer(){ider.m.Update&&ider.m.Update();-1==ider.m.bytesFromAmt?id
|
||||
function iderSectorStats(b,c,a,d,e){var l=c?Q("cdromHeatMapCanvas"):Q("floppyHeatMapCanvas"),n=l.getContext("2d");if(0==b){heatMapDividor[c]=1;if(0<a)for(;8E3<a/heatMapDividor[c];)heatMapDividor[c]*=2;c?(QV("cdromHeatMap",a),QH("cdromHeatMapText",format("<b>CDROM</b>, blocks are {0} bytes.",2048*heatMapDividor[c]))):(QV("floppyHeatMap",a),QH("floppyHeatMapText",format("<b>Floppy</b>, blocks are {0} bytes.",512*heatMapDividor[c])))}c=heatMapDividor[c];a/=c;d/=c;e/=c;if(0==b)l.height=6*(Math.floor(a/
|
||||
(heatMapWidth/6))+(a%heatMapWidth?1:0)),n.fillStyle="rgba(225,250,225,1)",n.fillRect(0,0,heatMapWidth,6*Math.floor(a/(heatMapWidth/6))),a%heatMapWidth&&n.fillRect(0,6*Math.floor(a/(heatMapWidth/6)),a%(heatMapWidth/6)*6,6),n.fillStyle="rgba(0,0,0,0.3)";else for(b=d;b<d+e;b++)sectorHeat(n,b,6,c)}function sectorHeat(b,c,a,d){b.fillRect(c%(heatMapWidth/a)*a,Math.floor(c/(heatMapWidth/a))*a,a,a)}
|
||||
function iderToggleDiskMap(b){var c="none"!=QS("iderHeatmap").display;null==b&&(b=!c);xxdialogMode&&(b=!1);QS("iderHeatmap").display=b?"":"none"}function onIderDialogPrompt(b,c,a){iderCodeBlock&&(document.body.removeChild(iderCodeBlock),delete iderCodeBlock);c.js&&(b=document.createElement("script"),b.text=c.js,iderCodeBlock=document.body.appendChild(b));setDialogMode(11,"Storage Redirection",a?a:3,onIderDialogPromptOk,c.html)}
|
||||
function onIderDialogPromptOk(b){1==b?window.iderServerCall?ider.m.dialogPrompt(window.iderServerCall()):ider.m.dialogPrompt():iderStop()}function iderServerStart(){iderStop();ider=CreateAmtRemoteServerIder();null!=ider&&(ider.onStateChanged=onIderStateChange,ider.m.sectorStats=iderSectorStats,ider.m.onDialogPrompt=onIderDialogPrompt,ider.tlsv1only=amtstack.wsman.comm.tlsv1only,ider.Start(currentMeshNode._id,16994,"*","*",0))}
|
||||
function onIderDialogPromptOk(b){1==b?window.iderServerCall?ider.m.dialogPrompt(window.iderServerCall()):ider.m.dialogPrompt():iderStop()}function iderServerStart(){xxdialogMode||(iderStop(),ider=CreateAmtRemoteServerIder(),null!=ider&&(ider.onStateChanged=onIderStateChange,ider.m.sectorStats=iderSectorStats,ider.m.onDialogPrompt=onIderDialogPrompt,ider.tlsv1only=amtstack.wsman.comm.tlsv1only,ider.Start(currentMeshNode._id,16994,"*","*",0)))}
|
||||
var xxRemoteAccess=null,xxEnvironementDetection=null,xxCiraServers=null,xxUserInitiatedCira=null,xxUserInitiatedEnabledState={32768:"Disabled",32769:"BIOS enabled",32770:"OS enable",32771:"BIOS & OS enabled"},xxRemoteAccessCredentiaLinks=null,xxMPSUserPass=null,xxPolicies=null;
|
||||
function PullRemoteAccess(){var b="*AMT_EnvironmentDetectionSettingData AMT_ManagementPresenceRemoteSAP AMT_RemoteAccessCredentialContext AMT_RemoteAccessPolicyAppliesToMPS AMT_RemoteAccessPolicyRule *AMT_UserInitiatedConnectionService AMT_MPSUsernamePassword".split(" ");11<amtversion&&b.push("*IPS_HTTPProxyService","IPS_HTTPProxyAccessPoint");amtstack.BatchEnum(null,b,processRemote1)}
|
||||
function processRemote1(b,c,a,d){if(11<amtversion&&400==d){d=200;400==a.IPS_HTTPProxyAccessPoint.status&&delete a.IPS_HTTPProxyAccessPoint;400==a.IPS_HTTPProxyService.status&&delete a.IPS_HTTPProxyService;for(var e in a)200!=a[e].status&&(d=a[e].status)}if(400!=d&&!errcheck(d,b)&&void 0!=a.AMT_UserInitiatedConnectionService&&void 0!=a.AMT_UserInitiatedConnectionService.response){QV("go17",!0);xxRemoteAccess=a;xxEnvironementDetection=a.AMT_EnvironmentDetectionSettingData.response;xxEnvironementDetection.DetectionStrings=
|
||||
@ -1305,11 +1305,12 @@ function showAdvPowerDlgOk(){var b=Q("c38").value;500==b||501==b?amtstack.Reques
|
||||
AvdPowerDlg.BIOSSetup=Q("d24BiosSetup").checked,AvdPowerDlg.BootMediaIndex=Q("c41").value,AvdPowerDlg.FirmwareVerbosity=Q("c43").value,AvdPowerDlg.ForcedProgressEvents=Q("d24ForceProgressEvents").checked,AvdPowerDlg.IDERBootDevice=Q("c42").value,AvdPowerDlg.LockKeyboard=Q("d24LockKeyboard").checked,AvdPowerDlg.LockPowerButton=Q("d24LockPowerButton").checked,AvdPowerDlg.LockResetButton=Q("d24LockResetButton").checked,AvdPowerDlg.LockSleepButton=Q("d24LockSleepButton").checked,
|
||||
AvdPowerDlg.ReflashBIOS=Q("d24ReflashBios").checked,AvdPowerDlg.UseIDER=Q("d24UseIDER").checked,AvdPowerDlg.UseSOL=Q("d24SerialOverLan").checked,AvdPowerDlg.UseSafeMode=Q("d24SafeMode").checked,AvdPowerDlg.UserPasswordBypass=Q("d24UserPasswordBypass").checked,AvdPowerDlg.SecureErase=Q("d24SecureErase").checked,!0===AvdPowerDlg.SecureErase&&0<Q("d24rsepass").value.length&&(AvdPowerDlg.RSEPassword=Q("d24rsepass").value),statusbox("Power Action","Checking state..."),amtstack.Get("IPS_OptInService",powerActionResponse0,
|
||||
0,1))}
|
||||
function powerActionResponse0(b,c,a,d){200!=d?messagebox("Power Action",format("Error #{0}",d)):4294967295==a.Body.OptInRequired&&3!=a.Body.OptInState&&4!=a.Body.OptInState?2==a.Body.OptInState?(d6ConsentText.value="",setDialogMode(6,"User Consent",11,powerActionSendConsent),checkConsentDisplay(),consentChanged()):(statusbox("Power Action","Starting opt-in..."),amtstack.IPS_OptInService_StartOptIn(powerActionResponseC1,0,1)):998==d5actionSelect.value?messagebox("User Consent","User consent not needed."):(statusbox("Power Action",
|
||||
"Getting Boot Settings..."),amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1))}
|
||||
function powerActionResponseC1(b,c,a,d){200!=d?messagebox("Power Action",format("Error #",d)):0!=a.Body.ReturnValue?messagebox("User Consent Error",a.Body.ReturnValueStr.replace(/_/g," ")):(d6ConsentText.value="",setDialogMode(6,"User Consent",11,powerActionSendConsent),checkConsentDisplay(),consentChanged(),amtstack.Enum("CIM_ServiceAvailableToElement",function(a,b,c,d){errcheck(d,a)||(amtsysstate.CIM_ServiceAvailableToElement.responses=c,updateSystemStatus(),null!=amtsysstate.CIM_ServiceAvailableToElement&&
|
||||
null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0<amtsysstate.CIM_ServiceAvailableToElement.responses.length&&2!=amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState&&amtstack.RequestPowerStateChange(2,function(a,b,c,d){}))}))}function powerActionSendConsent(b){0==b?amtstack.IPS_OptInService_CancelOptIn(function(){}):(statusbox("Power Action","Sending user consent..."),amtstack.IPS_OptInService_SendOptInCode(d6ConsentText.value,powerActionResponseC2,0,1))}
|
||||
function powerActionResponseC2(b,c,a,d){200!=d?messagebox("Power Action",format("Error #{0}",d)):0!=a.Body.ReturnValue?amtstack.Get("IPS_OptInService",powerActionResponse0,0,1):998==d5actionSelect.value?messagebox("User Consent","User consent succesful."):(statusbox("Power Action","Checking state..."),amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1))}
|
||||
function powerActionResponse0(b,c,a,d){200!=d?connectDesktopConsent?connectDesktop(!0):messagebox("Power Action",format("Error #{0}",d)):4294967295==a.Body.OptInRequired&&3!=a.Body.OptInState&&4!=a.Body.OptInState?2==a.Body.OptInState?(d6ConsentText.value="",setDialogMode(6,"User Consent",11,powerActionSendConsent),checkConsentDisplay(),consentChanged()):(statusbox("Power Action","Starting opt-in..."),amtstack.IPS_OptInService_StartOptIn(powerActionResponseC1,0,1)):connectDesktopConsent?(setDialogMode(0),connectDesktop(!0)):
|
||||
998==d5actionSelect.value?messagebox("User Consent","User consent not needed."):(statusbox("Power Action","Getting Boot Settings..."),amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1))}
|
||||
function powerActionResponseC1(b,c,a,d){200!=d?connectDesktopConsent?(setDialogMode(0),connectDesktop(!0)):messagebox("Power Action",format("Error #",d)):0!=a.Body.ReturnValue?connectDesktopConsent?(setDialogMode(0),connectDesktop(!0)):messagebox("User Consent Error",a.Body.ReturnValueStr.replace(/_/g," ")):(d6ConsentText.value="",setDialogMode(6,"User Consent",11,powerActionSendConsent),checkConsentDisplay(),consentChanged(),amtstack.Enum("CIM_ServiceAvailableToElement",function(a,b,c,d){errcheck(d,
|
||||
a)||(amtsysstate.CIM_ServiceAvailableToElement.responses=c,updateSystemStatus(),null!=amtsysstate.CIM_ServiceAvailableToElement&&null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0<amtsysstate.CIM_ServiceAvailableToElement.responses.length&&2!=amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState&&amtstack.RequestPowerStateChange(2,function(a,b,c,d){}))}))}
|
||||
function powerActionSendConsent(b){0==b?amtstack.IPS_OptInService_CancelOptIn(function(){}):(statusbox("Power Action","Sending user consent..."),amtstack.IPS_OptInService_SendOptInCode(d6ConsentText.value,powerActionResponseC2,0,1))}
|
||||
function powerActionResponseC2(b,c,a,d){200!=d?messagebox("Power Action",format("Error #{0}",d)):0!=a.Body.ReturnValue?amtstack.Get("IPS_OptInService",powerActionResponse0,0,1):connectDesktopConsent?(setDialogMode(0),connectDesktop(!0)):998==d5actionSelect.value?messagebox("User Consent","User consent succesful."):(statusbox("Power Action","Checking state..."),amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1))}
|
||||
function powerActionResponse1(b,c,a,d){200!=d?messagebox("Power Action",format("Error #{0}",d)):(b=d5actionSelect.value,a=a.Body,a.ConfigurationDataReset=!1,999==b?(a.BIOSPause=AvdPowerDlg.BIOSPause,a.EnforceSecureBoot=AvdPowerDlg.BIOSSecureBoot,a.BIOSSetup=AvdPowerDlg.BIOSSetup,a.BootMediaIndex=AvdPowerDlg.BootMediaIndex,a.FirmwareVerbosity=AvdPowerDlg.FirmwareVerbosity,a.ForcedProgressEvents=AvdPowerDlg.ForcedProgressEvents,a.IDERBootDevice=AvdPowerDlg.IDERBootDevice,a.LockKeyboard=AvdPowerDlg.LockKeyboard,
|
||||
a.LockPowerButton=AvdPowerDlg.LockPowerButton,a.LockResetButton=AvdPowerDlg.LockResetButton,a.LockSleepButton=AvdPowerDlg.LockSleepButton,a.ReflashBIOS=AvdPowerDlg.ReflashBIOS,a.UseIDER=AvdPowerDlg.UseIDER,a.UseSOL=AvdPowerDlg.UseSOL,a.UseSafeMode=AvdPowerDlg.UseSafeMode,a.UserPasswordBypass=AvdPowerDlg.UserPasswordBypass,null!=a.SecureErase&&(a.SecureErase=AvdPowerDlg.SecureErase&&1==amtPowerBootCapabilities.SecureErase,1==a.SecureErase&&AvdPowerDlg.RSEPassword&&(a.RSEPassword=AvdPowerDlg.RSEPassword))):
|
||||
(a.BIOSPause=!1,a.EnforceSecureBoot=!1,a.BIOSSetup=99<b&&104>b,a.BootMediaIndex=0,a.FirmwareVerbosity=0,a.ForcedProgressEvents=!1,a.IDERBootDevice=202==b||203==b?1:0,a.LockKeyboard=!1,a.LockPowerButton=!1,a.LockResetButton=!1,a.LockSleepButton=!1,a.ReflashBIOS=!1,a.UseIDER=199<b&&300>b,a.UseSOL=13==currentView&&8!=b&&300>b,a.UseSafeMode=!1,a.UserPasswordBypass=!1,null!=a.SecureErase&&(a.SecureErase=(104==b||105==b)&&1==amtPowerBootCapabilities.SecureErase,!0===a.SecureErase&&0<rsepass.length&&(a.RSEPassword=
|
||||
|
Loading…
Reference in New Issue
Block a user