CyberChef/Shellcode.js

94 lines
180 KiB
JavaScript
Raw Permalink Normal View History

/**
* CyberChef - The Cyber Swiss Army Knife
*
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* Copyright 2016 Crown Copyright
*
* 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.
*/!function(e){var t={};function A(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,A),n.l=!0,n.exports}A.m=e,A.c=t,A.d=function(e,t,r){A.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},A.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},A.t=function(e,t){if(1&t&&(e=A(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(A.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)A.d(r,n,function(t){return e[t]}.bind(null,n));return r},A.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return A.d(t,"a",t),t},A.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},A.p="",A(A.s=1511)}({0:function(e,t,A){"use strict";var r=A(15),n=A.n(r),u=A(10),S=A(7),D=A(19),P=A(18);function B(e,t,A,r,n,u,S){try{var D=e[u](S),P=D.value}catch(e){return void A(e)}D.done?t(P):Promise.resolve(P).then(r,n)}function i(e){return function(){var t=this,A=arguments;return new Promise(function(r,n){var u=e.apply(t,A);function S(e){B(u,r,n,S,D,"next",e)}function D(e){B(u,r,n,S,D,"throw",e)}S(void 0)})}}function a(e,t){for(var A=0;A<t.length;A++){var r=t[A];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var C=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,A,r;return t=e,A=null,r=[{key:"chr",value:function(e){if(e>65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),A=e.charCodeAt(1);if(t>=55296&&t<56320&&A>=56320&&A<57344)return 1024*(t-55296)+A-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new Array(t);return r.fill(A),Array.prototype.map.call(e,function(e,t){r[t]=e}),r}},{key:"truncate",value:function(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-A.length)+A),e}},{key:"hex",value:function(t){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(t="string"==typeof t?e.ord(t):t).toString(16).padStart(A,"0")}},{key:"bin",value:function(t){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(t="string"==typeof t?e.ord(t):t).toString(2).padStart(A,"0")}},{key:"printable",value:function(t){var A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==typeof window&&window.app&&!window.app.options.treatAsUtf8&&(t=e.byteArrayToChars(e.strToByteArray(t)));return t=t.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var D=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,t&&this._parseConfig(t)}var t,A,r;return t=e,r=[{key:"prepare",value:function(e,t){var A;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return n.a.parseEscapedChars(e);case"byteArray":return"string"==typeof e?(e=e.replace(/\s+/g,""),Object(u.c)(e)):e;case"number":if(A=parseFloat(e),isNaN(A))throw"Invalid ingredient value. Not a number: "+n.a.truncate(e.toString(),10);return A;default:return e}}}],(A=[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0}},{key:"config",get:function(){return this._value}},{key:"value",set:function(t){this._value=e.prepare(t,this.type)},get:function(){return this._value}}])&&S(t.prototype,A),r&&S(t,r),e}();function P(e,t){for(var A=0;A<t.length;A++){var r=t[A];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var B=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}var t,A,n;return t=e,(A=[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"inputType",set:function(e){this._inputType=r.a.typeEnum(e)},get:function(){return r.a.enumLookup(this._inputType)}},{key:"outputType",set:function(e){this._outputType=r.a.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)},get:function(){return r.a.enumLookup(this._outputType)}},{key:"presentType",set:function(e){this._presentType=r.a.typeEnum(e)},get:function(){return r.a.enumLookup(this._presentType)}},{key:"args",set:function(e){var t=this;e.forEach(function(e){var A=new D(e);t.addIngredient(A)})},get:function(){return this._ingList.map(function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),t})}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map(function(e){return e.config})}}},{key:"ingValues",set:function(e){var t=this;e.forEach(function(e,A){t._ingList[A].value=e})},get:function(){return this._ingList.map(function(e){return e.value})}},{key:"breakpoint",set:function(e){this._breakpoint=!!e},get:function(){return this._breakpoint}},{key:"disabled",set:function(e){this._disabled=!!e},get:function(){return this._disabled}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}])&&P(t.prototype,A),n&&P(t,n),e}();t.a=B},10:function(e,t,A){"use strict";A.d(t,"c",function(){return n}),A.d(t,"b",function(){return u}),A.d(t,"a",function(){return S});var r=A(0);
/**
* Base64 functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";"string"==typeof e&&(e=r.a.strToByteArray(e)),t=r.a.expandAlphRange(t).join("");for(var A,n,u,S,D,P,B,i="",a=0;a<e.length;)S=(A=e[a++])>>2,D=(3&A)<<4|(n=e[a++])>>4,P=(15&n)<<2|(u=e[a++])>>6,B=63&u,isNaN(n)?P=B=64:isNaN(u)&&(B=64),i+=t.charAt(S)+t.charAt(D)+t.charAt(P)+t.charAt(B);return i}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e)return"string"===A?"":[];t=t||"A-Za-z0-9+/=",t=r.a.expandAlphRange(t).join("");var u,S,D,P,B,i,a=[],C=0;if(n){var o=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(o,"")}for(;C<e.length;)u=t.indexOf(e.charAt(C++))<<2|(P=-1===(P=t.indexOf(e.charAt(C++)||"="))?64:P)>>4,S=(15&P)<<4|(B=-1===(B=t.indexOf(e.charAt(C++)||"="))?64:B)>>2,D=(3&B)<<6|(i=-1===(i=t.indexOf(e.charAt(C++)||"="))?64:i),a.push(u),64!==B&&a.push(S),64!==i&&a.push(D);return"string"===A?r.a.byteArrayToUtf8(a):a}var S=[{name:"Standard (RFC 4648): A-Za-z0-9+/=",value:"A-Za-z0-9+/="},{name:"URL safe (RFC 4648 §5): A-Za-z0-9-_",value:"A-Za-z0-9-_"},{name:"Filename safe: A-Za-z0-9+-=",value:"A-Za-z0-9+\\-="},{name:"itoa64: ./0-9A-Za-z=",value:"./0-9A-Za-z="},{name:"XML: A-Za-z0-9_.",value:"A-Za-z0-9_."},{name:"y64: A-Za-z0-9._-",value:"A-Za-z0-9._-"},{name:"z64: 0-9a-zA-Z+/=",value:"0-9a-zA-Z+/="},{name:"Radix-64 (RFC 4880): 0-9A-Za-z+/=",value:"0-9A-Za-z+/="},{name:"Uuencoding: [space]-_",value:" -_"},{name:"Xxencoding: +-0-9A-Za-z",value:"+\\-0-9A-Za-z"},{name:"BinHex: !-,-0-689@A-NP-VX-Z[`a-fh-mp-r",value:"!-,-0-689@A-NP-VX-Z[`a-fh-mp-r"},{name:"ROT13: N-ZA-Mn-za-m0-9+/=",value:"N-ZA-Mn-za-m0-9+/="},{name:"UNIX crypt: ./0-9A-Za-z",value:"./0-9A-Za-z"}]},12:function(e,t,A){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}
/**
* Custom error type for handling Dish type errors.
* i.e. where the Dish cannot be successfully translated between types
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/var P=function(e){function t(){var e,A,u,D;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var P=arguments.length,B=new Array(P),i=0;i<P;i++)B[i]=arguments[i];return u=this,(A=!(D=(e=n(t)).call.apply(e,[this].concat(B)))||"object"!==r(D)&&"function"!=typeof D?S(u):D).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(S(S(A)),t),A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,D(Error)),t}();t.a=P},14:function(e,t,A){var r,n;!function(u,S){"use strict";void 0===(n="function"==typeof(r=function(){var e=function(){},t="undefined",A=["trace","debug","info","warn","error"];function r(e,t){var A=e[t];if("function"==typeof A.bind)return A.bind(e);try{return Function.prototype.bind.call(A,e)}catch(t){return function(){return Function.prototype.apply.apply(A,[e,arguments])}}}function n(t,r){for(var n=0;n<A.length;n++){var u=A[n];this[u]=n<t?e:this.methodFactory(u,t,r)}this.log=this.debug}function u(A,u,S){return function(A){"debug"===A&&(A="log");return typeof console!==t&&(void 0!==console[A]?r(console,A):void 0!==console.log?r(console,"log"):e)}(A)||function(e,A,r){return function(){typeof console!==t&&(n.call(this,A,r),this[e].apply(this,arguments))}}.apply(this,arguments)}function S(e,r,S){var D,P=this,B="loglevel";function i(){var e;if(typeof window!==t){try{e=window.localStorage[B]}catch(e){}if(typeof e===t)try{var A=window.document.cookie,r=A.indexOf(encodeURIComponent(B)+"=");-1!==r&&(e=/^([^;]+)/.exec(A.slice(r))[1])}catch(e){}return void 0===P.levels[e]&&(e=void 0),e}}e&&(B+=":"+e),P.name=e,P.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},P.methodFactory=S||u,P.getLevel=function(){return D},P.setLevel=function(r,u){if("string"==typeof r&&void 0!==P.levels[r.toUpperCase()]&&(r=P.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=P.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(D=r,!1!==u&&function(e){var r=(A[e]||"silent").toUpperCase();if(typeof window===t)return;try{return void(window.localStorage[B]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(B)+"="+r+";"}catch(e){}}(r),n.call(P,r,e),typeof console===t&&r<P.levels.SILENT)return"No console available for logging"},P.setDefaultLevel=function(e){i()||P.setLevel(e,!1)},P.enableAll=function(e){P.setLevel(P.levels.TRACE,e)},P.disableAll=function(e){P.setLevel(P.levels.SILENT,e)};var a=i();null==a&&(a=null==r?"WARN":r),P.setLevel(a,!1)}var D=new S,P={};D.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=P[e];return t||(t=P[e]=new S(e,D.getLevel(),D.methodFactory)),t};var B=typeof window!==t?window.log:void 0;return D.noConflict=function(){return typeof window!==t&&window.log===D&&(window.log=B),D},D.getLoggers=function(){return P},D})?r.call(t,A,t,e):r)||(e.exports=n)}()},15:function(e,t,A){!function(e){var t,A,r,n=String.fromCharCode;function u(e){for(var t,A,r=[],n=0,u=e.length;n<u;)(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<u?56320==(64512&(A=e.charCodeAt(n++)))?r.push(((1023&t)<<10)+(1023&A)+65536):(r.push(t),n--):r.push(t);return r}function S(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function D(e,t){return n(e>>t&63|128)}function P(e){if(0==(4294967168&e))return n(e);var t="";return 0==(4294965248&e)?t=n(e>>6&31|192):0==(4294901760&e)?(S(e),t=n(e>>12&15|224),t+=D(e,6)):0==(4292870144&e)&&(t=n(e>>18&7|240),t+=D(e,12),t+=D(e,6)),t+=n(63&e|128)}function B(){if(r>=A)throw Error("Invalid byte index");var e=255&t[r];if(r++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function i(){var e,n;if(r>A)throw Error("Invalid byte index");if(r==A)return!1;if(e=255&t[r],r++,0==(128&e))return e;if(192==(224&e)){if((n=(31&e)<<6|B())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&e)){if((n=(15&
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/var pe=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=Re(this,Oe(t).call(this))).name="Disassemble x86",e.module="Shellcode",e.description="Disassembly is the process of translating machine language into assembly language.<br><br>This operation supports 64-bit, 32-bit and 16-bit code written for Intel or AMD x86 processors. It is particularly useful for reverse engineering shellcode.<br><br>Input should be in hexadecimal.",e.infoURL="https://wikipedia.org/wiki/X86",e.inputType="string",e.outputType="string",e.args=[{name:"Bit mode",type:"option",value:["64","32","16"]},{name:"Compatibility",type:"option",value:["Full x86 architecture","Knights Corner","Larrabee","Cyrix","Geode","Centaur","X86/486"]},{name:"Code Segment (CS)",type:"number",value:16},{name:"Offset (IP)",type:"number",value:0},{name:"Show instruction hex",type:"boolean",value:!0},{name:"Show instruction position",type:"boolean",value:!0}],e}var A,E,F;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ve(e,t)}(t,r["a"]),A=t,(E=[{key:"run",value:function(e,t){var A=Te(t,6),r=A[0],E=A[1],F=A[2],M=A[3],s=A[4],c=A[5];switch(r){case"64":se(2);break;case"32":se(1);break;case"16":se(0);break;default:throw new ce.a("Invalid mode value")}switch(E){case"Full x86 architecture":Be(0);break;case"Knights Corner":Be(1);break;case"Larrabee":Be(2);break;case"Cyrix":Be(3);break;case"Geode":Be(4);break;case"Centaur":Be(5);break;case"X86/486":Be(6)}return function(e){var t=e.split(":");void 0!==t[1]&&(B=parseInt(t[0].slice(t[0].length-4),16),e=t[1]);var A=e.length;A>=9&&2==u&&(D=parseInt(e.slice(A-16,A-8),16)),A>=5&&u>=1&&!(1==u&B>=36)?P=parseInt(e.slice(A-8),16):A>=1&&u>=0&&(P=4294901760&P|parseInt(e.slice(A-4),16)),P<0&&(P+=4294967296)}(F+":"+M),C=s,function(e){o=e}(c),function(e){n=[],S=0;for(var t=e.length,A=0,r=0,u=0,D=0;A<t;A+=8){if(D=parseInt(e.slice(A,A+8),16),isNaN(D))return!1;t-A<8&&(D<<=8-t-A<<2),u=D,D=(D^=2147483648&D)>>24|D<<8&2147483647,n[r++]=255&(u>>24&128|D),D=D>>24|D<<8&2147483647,n[r++]=255&(u>>16&128|D),D=D>>24|D<<8&2147483647,n[r++]=255&(u>>8&128|D),D=D>>24|D<<8&2147483647,n[r++]=255&(128&u|D)}for(t>>=1;t<n.length;n.pop());}(e.replace(/\s/g,"")),function(){for(var e="",t="",A=n.length,r=D,u=P;S<A;){if(e=Me(),o&&(t+=a+" "),C){for(i=i.toUpperCase();i.length<32;i+=" ");t+=i+""}t+=e+"\r\n",a="",i=""}return S=0,P=u,D=r,t}()}}])&&fe(A.prototype,E),F&&fe(A,F),t}(),Ne="undefined"==typeof self?{}:self.OpModules||{};Ne.Shellcode={"Disassemble x86":pe};t.default=Ne},18:function(e,t,A){"use strict";A.d(t,"b",function(){return n}),A.d(t,"a",function(){return u});var r=A(0);
/**
* Binary functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(!e)return"";t=r.a.charRep(t);for(var n="",u=0;u<e.length;u++)n+=e[u].toString(2).padStart(A,"0")+t;return t.length?n.slice(0,-t.length):n}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,n=r.a.regexRep(t);e=e.replace(n,"");for(var u=[],S=0;S<e.length;S+=A)u.push(parseInt(e.substr(S,A),2));return u}},19:function(e,t,A){"use strict";A.d(t,"a",function(){return n});var r=A(0);
/**
* Decimal functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";t=r.a.charRep(t);var A=[],n=e.split(t);""===n[n.length-1]&&(n=n.slice(0,n.length-1));for(var u=0;u<n.length;u++)A[u]=parseInt(n[u],10);return A}},3:function(e,t,A){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}
/**
* Custom error type for handling operation input errors.
* i.e. where the operation can handle the error and print a message to the screen.
*
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/var P=function(e){function t(){var e,A,u,D;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var P=arguments.length,B=new Array(P),i=0;i<P;i++)B[i]=arguments[i];return u=this,(A=!(D=(e=n(t)).call.apply(e,[this].concat(B)))||"object"!==r(D)&&"function"!=typeof D?S(u):D).type="OperationError",Error.captureStackTrace&&Error.captureStackTrace(S(S(A)),t),A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,D(Error)),t}();t.a=P},4:function(e,t,A){var r;!function(n){"use strict";var u,S=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,D=Math.ceil,P=Math.floor,B="[BigNumber Error] ",i=B+"Number primitive has more than 15 significant digits: ",a=1e14,C=14,o=9007199254740991,E=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],F=1e7,M=1e9;function s(e){var t=0|e;return e>0||e===t?t:t-1}function c(e){for(var t,A,r=1,n=e.length,u=e[0]+"";r<n;){for(t=e[r++]+"",A=C-t.length;A--;t="0"+t);u+=t}for(n=u.length;48===u.charCodeAt(--n););return u.slice(0,n+1||1)}function l(e,t){var A,r,n=e.c,u=t.c,S=e.s,D=t.s,P=e.e,B=t.e;if(!S||!D)return null;if(A=n&&!n[0],r=u&&!u[0],A||r)return A?r?0:-D:S;if(S!=D)return S;if(A=S<0,r=P==B,!n||!u)return r?0:!n^A?1:-1;if(!r)return P>B^A?1:-1;for(D=(P=n.length)<(B=u.length)?P:B,S=0;S<D;S++)if(n[S]!=u[S])return n[S]>u[S]^A?1:-1;return P==B?0:P>B^A?1:-1}function T(e,t,A,r){if(e<t||e>A||e!==(e<0?D(e):P(e)))throw Error(B+(r||"Argument")+("number"==typeof e?e<t||e>A?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function f(e){var t=e.c.length-1;return s(e.e/C)==t&&e.c[t]%2!=0}function R(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function O(e,t,A){var r,n;if(t<0){for(n=A+".";++t;n+=A);e=n+e}else if(++t>(r=e.length)){for(n=A,t-=r;--t;n+=A);e+=n}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(u=function e(t){var A,r,n,u,V,p,N,h,U,L=K.prototype={constructor:K,toString:null,valueOf:null},I=new K(1),v=20,y=4,g=-7,d=21,Q=-1e7,b=1e7,m=!1,X=1,H=0,w={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},W="0123456789abcdefghijklmnopqrstuvwxyz";function K(e,t){var A,u,D,B,a,E,F,M,s=this;if(!(s instanceof K))return new K(e,t);if(null==t){if(e instanceof K)return s.s=e.s,s.e=e.e,void(s.c=(e=e.c)?e.slice():e);if((E="number"==typeof e)&&0*e==0){if(s.s=1/e<0?(e=-e,-1):1,e===~~e){for(B=0,a=e;a>=10;a/=10,B++);return s.e=B,void(s.c=[e])}M=String(e)}else{if(M=String(e),!S.test(M))return n(s,M,E);s.s=45==M.charCodeAt(0)?(M=M.slice(1),-1):1}(B=M.indexOf("."))>-1&&(M=M.replace(".","")),(a=M.search(/e/i))>0?(B<0&&(B=a),B+=+M.slice(a+1),M=M.substring(0,a)):B<0&&(B=M.length)}else{if(T(t,2,W.length,"Base"),M=String(e),10==t)return x(s=new K(e instanceof K?e:M),v+s.e+1,y);if(E="number"==typeof e){if(0*e!=0)return n(s,M,E,t);if(s.s=1/e<0?(M=M.slice(1),-1):1,K.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(i+e);E=!1}else s.s=45===M.charCodeAt(0)?(M=M.slice(1),-1):1;for(A=W.slice(0,t),B=a=0,F=M.length;a<F;a++)if(A.indexOf(u=M.charAt(a))<0){if("."==u){if(a>B){B=F;continue}}else if(!D&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){D=!0,a=-1,B=0;continue}return n(s,String(e),E,t)}(B=(M=r(M,t,10,s.s)).indexOf("."))>-1?M=M.replace(".",""):B=M.length}for(a=0;48===M.charCodeAt(a);a++);for(F=M.length;48===M.charCodeAt(--F););if(M=M.slice(a,++F)){if(F-=a,E&&K.DEBUG&&F>15&&(e>o||e!==P(e)))throw Error(i+s.s*e);if((B=B-a-1)>b)s.c=s.e=null;else if(B<Q)s.c=[s.e=0];else{if(s.e=B,s.c=[],a=(B+1)%C,B<0&&(a+=C),a<F){for(a&&s.c.push(+M.slice(0,a)),F-=C;a<F;)s.c.push(+M.slice(a,a+=C));M=M.slice(a),a=C-M.length}else a-=F;for(;a--;M+="0");s.c.push(+M)}}else s.c=[s.e=0]}function G(e,t,A,r){var n,u,S,D,P;if(null==A?A=y:T(A,0,8),!e.c)return e.toString();if(n=e.c[0],S=e.e,null==t)P=c(e.c),P=1==r||2==r&&(S<=g||S>=d)?R(P,S):O(P,S,"0");els
/**
* Hexadecimal functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(!e)return"";for(var r="",n=0;n<e.length;n++)r+=e[n].toString(16).padStart(A,"0")+t;return"0x"===t&&(r="0x"+r),"\\x"===t&&(r="\\x"+r),t.length?r.slice(0,-t.length):r}function u(e){if(!e)return"";for(var t=[],A=0;A<e.length;A++)t.push((e[A]>>>4).toString(16)),t.push((15&e[A]).toString(16));return t.join("")}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("None"!==t){var n="Auto"===t?/[^a-f\d]/gi:r.a.regexRep(t);e=e.replace(n,"")}for(var u=[],S=0;S<e.length;S+=A)u.push(parseInt(e.substr(S,A),16));return u}var D=["Space","Comma","Semi-colon","Colon","Line feed","CRLF","0x","\\x","None"],P=["Auto"].concat(D)},9:function(e,t,A){"use strict";var r=A(0),n=A(12),u=A(4),S=A.n(u),D=A(14),P=A.n(D);function B(e,t,A,r,n,u,S){try{var D=e[u](S),P=D.value}catch(e){return void A(e)}D.done?t(P):Promise.resolve(P).then(r,n)}function i(e){return function(){var t=this,A=arguments;return new Promise(function(r,n){var u=e.apply(t,A);function S(e){B(u,r,n,S,D,"next",e)}function D(e){B(u,r,n,S,D,"throw",e)}S(void 0)})}}function a(e,t){for(var A=0;A<t.length;A++){var r=t[A];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @author Matt C [matt@artemisbot.uk]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var C=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.value=[],this.type=e.BYTE_ARRAY,t&&t.hasOwnProperty("value")&&t.hasOwnProperty("type")&&this.set(t.value,t.type)}var t,A,u;return t=e,A=[{key:"set",value:function(t,A){if("string"==typeof A&&(A=e.typeEnum(A)),P.a.debug("Dish type: "+e.enumLookup(A)),this.value=t,this.type=A,!this.valid()){var u=r.a.truncate(JSON.stringify(this.value),13);throw new n.a("Data is not a valid ".concat(e.enumLookup(A),": ").concat(u))}}},{key:"get",value:function(){var t=i(regeneratorRuntime.mark(function t(A){var r,n=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.length>1&&void 0!==n[1]&&n[1],"string"==typeof A&&(A=e.typeEnum(A)),this.type===A){t.next=5;break}return t.next=5,this._translate(A,r);case 5:return t.abrupt("return",this.value);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"_translate",value:function(){var t=i(regeneratorRuntime.mark(function t(A){var u,D,B=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:u=B.length>1&&void 0!==B[1]&&B[1],P.a.debug("Translating Dish from ".concat(e.enumLookup(this.type)," to ").concat(e.enumLookup(A))),D=u?r.a.byteArrayToChars:r.a.byteArrayToUtf8,t.prev=3,t.t0=this.type,t.next=t.t0===e.STRING?7:t.t0===e.NUMBER?9:t.t0===e.HTML?11:t.t0===e.ARRAY_BUFFER?13:t.t0===e.BIG_NUMBER?15:t.t0===e.JSON?17:t.t0===e.FILE?19:t.t0===e.LIST_FILE?24:30;break;case 7:return this.value=this.value?r.a.strToByteArray(this.value):[],t.abrupt("break",31);case 9:return this.value="number"==typeof this.value?r.a.strToByteArray(this.value.toString()):[],t.abrupt("break",31);case 11:return this.value=this.value?r.a.strToByteArray(r.a.unescapeHtml(r.a.stripHtmlTags(this.value,!0))):[],t.abrupt("break",31);case 13:return this.value=Array.prototype.slice.call(new Uint8Array(this.value)),t.abrupt("break",31);case 15:return this.value=S.a.isBigNumber(this.value)?r.a.strToByteArray(this.value.toFixed()):[],t.abrupt("break",31);case 17:return this.value=this.value?r.a.strToByteArray(JSON.stringify(this.value,null,4)):[],t.abrupt("break",31);case 19:return t.next=21,r.a.readFile(this.value);case 21:return this.value=t.sent,this.value=Array.prototype.slice.call(this.value),t.abrupt("break",31);case 24:return t.next=26,Promise.all(this.value.map(function(){var e=i(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.a.readFile(t));case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()));case 26:return this.value=t.sent,this.value=this.value.map(function(e){return Array.prototype.slice.call(e)}),this.value=[].concat.apply([],this.value),t.abrupt("break",31);case 30:return t.abrupt("break",31);case 31:t.next=36;break;case 33:throw t.prev=33,t.t1=t.catch(3),new n.a("Error translating from ".concat(e.enumLookup(this.type)," to byteArray: ").concat(t.t1));case 36:this.type=e.BYTE_ARRAY,t.prev=37,t.t2=A,t.next=t.t2===e.STRING?41:t.t2===e.HTML?41:t.t2===e.NUMBER?44:t.t2===e.ARRAY_BUFFER?47:t.t2===e.BIG_NUMBER?50:t.t2===e.JSON?53:t.t2===e.FILE?56:t.t2===e.LIST_FILE?58:61;break;case 41:return this.value=this.value?D(this.value):"",this.type=e.STRING,t.abrupt("break",62);case 44:return this.value=this.value?parseFloat(D(this.value)):0,this.type=e.NUMBER,t.abrupt("break",62);case 47:return this.value=new Uint8Array(this.value).buffer,this.type=e.ARRAY_BUFFER,t.abrupt("break",62);case 50:try{this.value=new S.a(D(this.value))}catch(e){this.value=new S.a(NaN)}return this.type=e.BIG_NUMBER,t.abrupt("break",62);case 53:return this.value=JSON.parse(D(this.value)),this.type=e.JSON,t.abrupt("break",62);case 56:return this.value=new File(this.value,"unknown"),t.abrupt("break",62);case 58:return this.value=[new File(this.value,"unknown")],this.type=e.LIST_FILE,t.abrupt("break",