MeshCentral/public/scripts/amt-ider-ws-0.0.1-min.js

1 line
11 KiB
JavaScript
Raw Normal View History

2021-03-03 05:48:36 +03:00
var CreateAmtRemoteIder=function(){var l={};function f(){urlvars&&urlvars.idertrace&&console.log(...arguments)}l.protocol=3,l.bytesToAmt=0,l.bytesFromAmt=0,l.rx_timeout=3e4,l.tx_timeout=0,l.heartbeat=2e4,l.version=1,l.acc="",l.inSequence=0,l.outSequence=0,l.iderinfo=null,l.enabled=!1,l.iderStart=0,l.floppy=null,l.cdrom=null,l.floppyReady=!1,l.cdromReady=!1,l.pingTimer=null;var u=String.fromCharCode(0,38,49,128,0,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),h=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),p=String.fromCharCode(0,38,36,128,0,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),R=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),E=String.fromCharCode(0,18,1,128,0,0,0,0,26,10,0,0,0,0,0,0,0,0,0,0),I=String.fromCharCode(0,18,1,128,0,0,0,0,29,10,0,0,0,0,0,0,0,0,0,0),g=String.fromCharCode(0,32,1,128,0,0,0,0,42,24,0,0,0,0,32,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),b=String.fromCharCode(0,40,1,128,0,0,0,0,1,6,0,255,0,0,0,0,42,24,0,0,0,0,2,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),A=(String.fromCharCode(0,0,0,40,0,0,0,8),String.fromCharCode(0,0,3,4,0,8,1,0)),T=String.fromCharCode(0,1,3,4,0,0,0,2),D=String.fromCharCode(0,2,3,4,0,0,0,0),y=String.fromCharCode(0,3,3,4,41,0,0,2),_=String.fromCharCode(0,16,1,8,0,0,8,0,0,1,0,0),k=String.fromCharCode(0,30,3,0),v=String.fromCharCode(1,0,3,0),O=String.fromCharCode(1,5,3,0),X=String.fromCharCode(0,18,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),w=String.fromCharCode(0,18,49,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),F=String.fromCharCode(0,14,1,128,0,0,0,0,1,6,0,255,0,0,0,0);function H(e,r,n,a){var o=null,t=0;160==e&&(o=l.floppy,null!=l.floppy&&(t=l.floppy.size>>9)),176==e&&(o=l.cdrom,null!=l.cdrom&&(t=l.cdrom.size>>11)),n<0||t<r+n?l.SendCommandEndResponse(1,5,e,33,0):0!=n?null!=o&&(160==e?(r<<=9,n<<=9):(r<<=11,n<<=11),null!==i?(console.log("IDERERROR: Read while performing read"),l.Stop()):(i=o,d=e,S=r,c=n,function e(r){var n=c,a=S;c>l.iderinfo.readbfr&&(n=l.iderinfo.readbfr);c-=n;S+=n;var o=new FileReader;o.onload=function(){l.SendDataToHost(d,0==c,this.result,1&r),0<c&&0==C?e(r):(i=null,C&&(l.SendCommand(71),C=!1))};o.readAsBinaryString(i.slice(a,a+n))}(a))):l.SendCommandEndResponse(1,0,e,0,0)}l.xxStateChange=function(e){f("IDER-StateChange",e),0==e&&l.Stop(),3==e&&l.Start()},l.Start=function(){f("IDER-Start"),f(l.floppy,l.cdrom),l.bytesToAmt=0,l.bytesFromAmt=0,l.inSequence=0,l.outSequence=0,l.SendCommand(64,ShortToStrX(l.rx_timeout)+ShortToStrX(l.tx_timeout)+ShortToStrX(l.heartbeat)+IntToStrX(l.version))},l.Stop=function(){f("IDER-Stop"),l.pingTimer&&(clearInterval(l.pingTimer),l.pingTimer=null),l.parent.Stop()},l.ProcessData=function(e){for(l.bytesFromAmt+=e.length,l.acc+=e,f("IDER-ProcessData",l.acc.length,rstr2hex(l.acc));;){var r=l.ProcessDataEx();if(0==r)return;if(l.inSequence!=ReadIntX(l.acc,4))return f("ERROR: Out of sequence",l.inSequence,ReadIntX(l.acc,4)),void l.Stop();l.inSequence++,l.acc=l.acc.substring(r)}},l.SendCommand=function(e,r,n,a){null==r&&(r="");n=50<e&&1==n?2:0;a&&(n+=1);r=String.fromCharCode(e,0,0,n)+IntToStrX(l.outSequence++)+r;l.parent.xxSend(r),l.bytesToAmt+=r.length,75!=e&&f("IDER-SendData",r.length,rstr2hex(r))},l.SendCommandEndResponse=function(e,r,n,a,o){e?l.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,n,80,0,0,0),!0):l.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,r<<4,3,0,0,0,n,81,r,a,o),!0)},l.SendDataToHost=function(e,r,n,a){var o=a?0:n.length;1==r?l.SendCommand(84,String.fromCharCode(0,255&n.length,n.length>>8,0,a?180:181,0,2,0,255&o,o>>8,e,88,133,0,3,0,0,0,e,80,0,0,0,0,0,0)+n,r,a):l.SendCommand(84,String.fromCharCode(0,255&n.length,n.length>>8,0,a?180:181,0,2,0,255&o,o>>8,e,