CyberChef/modules/Yara.js

2 lines
1.3 MiB
JavaScript
Raw Normal View History

2024-03-27 19:51:49 +01:00
/*! For license information please see Yara.js.LICENSE.txt */
(()=>{var A={25704:(A,Q)=>{"use strict";Q.byteLength=function(A){var Q=D(A),I=Q[0],g=Q[1];return 3*(I+g)/4-g},Q.toByteArray=function(A){var Q,I,C=D(A),E=C[0],i=C[1],o=new B(function(A,Q,I){return 3*(Q+I)/4-I}(0,E,i)),w=0,F=i>0?E-4:E;for(I=0;I<F;I+=4)Q=g[A.charCodeAt(I)]<<18|g[A.charCodeAt(I+1)]<<12|g[A.charCodeAt(I+2)]<<6|g[A.charCodeAt(I+3)],o[w++]=Q>>16&255,o[w++]=Q>>8&255,o[w++]=255&Q;return 2===i&&(Q=g[A.charCodeAt(I)]<<2|g[A.charCodeAt(I+1)]>>4,o[w++]=255&Q),1===i&&(Q=g[A.charCodeAt(I)]<<10|g[A.charCodeAt(I+1)]<<4|g[A.charCodeAt(I+2)]>>2,o[w++]=Q>>8&255,o[w++]=255&Q),o},Q.fromByteArray=function(A){for(var Q,g=A.length,B=g%3,C=[],E=16383,D=0,o=g-B;D<o;D+=E)C.push(i(A,D,D+E>o?o:D+E));return 1===B?(Q=A[g-1],C.push(I[Q>>2]+I[Q<<4&63]+"==")):2===B&&(Q=(A[g-2]<<8)+A[g-1],C.push(I[Q>>10]+I[Q>>4&63]+I[Q<<2&63]+"=")),C.join("")};for(var I=[],g=[],B="undefined"!=typeof Uint8Array?Uint8Array:Array,C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E=0;E<64;++E)I[E]=C[E],g[C.charCodeAt(E)]=E;function D(A){var Q=A.length;if(Q%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");return-1===I&&(I=Q),[I,I===Q?0:4-I%4]}function i(A,Q,g){for(var B,C,E=[],D=Q;D<g;D+=3)B=(A[D]<<16&16711680)+(A[D+1]<<8&65280)+(255&A[D+2]),E.push(I[(C=B)>>18&63]+I[C>>12&63]+I[C>>6&63]+I[63&C]);return E.join("")}g["-".charCodeAt(0)]=62,g["_".charCodeAt(0)]=63},33296:(A,Q,I)=>{"use strict";const g=I(25704),B=I(24404),C="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;Q.Buffer=i,Q.INSPECT_MAX_BYTES=50;const E=2147483647;function D(A){if(A>E)throw new RangeError('The value "'+A+'" is invalid for option "size"');const Q=new Uint8Array(A);return Object.setPrototypeOf(Q,i.prototype),Q}function i(A,Q,I){if("number"==typeof A){if("string"==typeof Q)throw new TypeError('The "string" argument must be of type string. Received type number');return F(A)}return o(A,Q,I)}function o(A,Q,I){if("string"==typeof A)return function(A,Q){if("string"==typeof Q&&""!==Q||(Q="utf8"),!i.isEncoding(Q))throw new TypeError("Unknown encoding: "+Q);const I=0|N(A,Q);let g=D(I);const B=g.write(A,Q);return B!==I&&(g=g.slice(0,B)),g}(A,Q);if(ArrayBuffer.isView(A))return function(A){if(v(A,Uint8Array)){const Q=new Uint8Array(A);return G(Q.buffer,Q.byteOffset,Q.byteLength)}return y(A)}(A);if(null==A)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);if(v(A,ArrayBuffer)||A&&v(A.buffer,ArrayBuffer))return G(A,Q,I);if("undefined"!=typeof SharedArrayBuffer&&(v(A,SharedArrayBuffer)||A&&v(A.buffer,SharedArrayBuffer)))return G(A,Q,I);if("number"==typeof A)throw new TypeError('The "value" argument must not be of type number. Received type number');const g=A.valueOf&&A.valueOf();if(null!=g&&g!==A)return i.from(g,Q,I);const B=function(A){if(i.isBuffer(A)){const Q=0|c(A.length),I=D(Q);return 0===I.length||A.copy(I,0,0,Q),I}return void 0!==A.length?"number"!=typeof A.length||P(A.length)?D(0):y(A):"Buffer"===A.type&&Array.isArray(A.data)?y(A.data):void 0}(A);if(B)return B;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof A[Symbol.toPrimitive])return i.from(A[Symbol.toPrimitive]("string"),Q,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A)}function w(A){if("number"!=typeof A)throw new TypeError('"size" argument must be of type number');if(A<0)throw new RangeError('The value "'+A+'" is invalid for option "size"')}function F(A){return w(A),D(A<0?0:0|c(A))}function y(A){const Q=A.length<0?0:0|c(A.length),I=D(Q);for(let g=0;g<Q;g+=1)I[g]=255&A[g];return I}function G(A,Q,I){if(Q<0||A.byteLength<Q)throw new RangeError('"offset" is outside of buffer bounds');if(A.byteLength<Q+(I||0))throw new RangeError('"length" is outside of buffer bounds');let g;return g=void 0===Q&&void 0===I?new Uint8Array(A):void 0===I?new Uint8Array(A,Q):new Uint8Array(A,Q,I),Object.setPrototypeOf(g,i.prototype),g}func