mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
fix eslint:recommended errors
this should find most of the imports
This commit is contained in:
parent
ad730d806b
commit
640f555b8a
61 changed files with 269 additions and 44 deletions
|
@ -1,13 +1,21 @@
|
||||||
{
|
{
|
||||||
"extends": "airbnb-base",
|
|
||||||
|
"extends": "eslint:recommended",
|
||||||
"parser": "babel-eslint",
|
"parser": "babel-eslint",
|
||||||
"plugins": ["babel"],
|
"plugins": ["babel"],
|
||||||
|
"rules": {
|
||||||
|
"no-unused-vars": 0,
|
||||||
|
"no-console": 0,
|
||||||
|
"no-cond-assign": 0,
|
||||||
|
"no-unsafe-finally": 0
|
||||||
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"import/resolver": {
|
"import/resolver": {
|
||||||
"webpack": {}
|
"webpack": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true
|
"browser": true,
|
||||||
|
"node": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
"webpack-dev-server": "2.1.0-beta.12"
|
"webpack-dev-server": "2.1.0-beta.12"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"core-js": "^2.4.1",
|
||||||
"esprima": "^3.1.2",
|
"esprima": "^3.1.2",
|
||||||
"estraverse": "^4.2.0",
|
"estraverse": "^4.2.0",
|
||||||
"jquery": "^3.1.1",
|
"jquery": "^3.1.1",
|
||||||
|
|
|
@ -264,3 +264,5 @@ const Categories = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export default Categories;
|
||||||
|
|
|
@ -1,3 +1,39 @@
|
||||||
|
import FlowControl from '../core/FlowControl';
|
||||||
|
import Base64 from '../operations/Base64';
|
||||||
|
import BitwiseOp from '../operations/BitwiseOp';
|
||||||
|
import ByteRepr from '../operations/ByteRepr';
|
||||||
|
import Hexdump from '../operations/Hexdump';
|
||||||
|
import Base from '../operations/Base';
|
||||||
|
import HTML from '../operations/HTML';
|
||||||
|
import URL_ from '../operations/URL';
|
||||||
|
import Unicode from '../operations/Unicode';
|
||||||
|
import QuotedPrintable from '../operations/QuotedPrintable';
|
||||||
|
import Punycode from '../operations/Punycode';
|
||||||
|
import IP from '../operations/IP';
|
||||||
|
import CharEnc from '../operations/CharEnc';
|
||||||
|
import Cipher from '../operations/Cipher';
|
||||||
|
import Rotate from '../operations/Rotate';
|
||||||
|
import HTTP from '../operations/HTTP';
|
||||||
|
import MAC from '../operations/MAC';
|
||||||
|
import StrUtils from '../operations/StrUtils';
|
||||||
|
import Tidy from '../operations/Tidy';
|
||||||
|
import SeqUtils from '../operations/SeqUtils';
|
||||||
|
import Extract from '../operations/Extract';
|
||||||
|
import DateTime from '../operations/DateTime';
|
||||||
|
import Convert from '../operations/Convert';
|
||||||
|
import Compress from '../operations/Compress';
|
||||||
|
import JS from '../operations/JS';
|
||||||
|
import Code from '../operations/Code';
|
||||||
|
import Hash from '../operations/Hash';
|
||||||
|
import Checksum from '../operations/Checksum';
|
||||||
|
import Entropy from '../operations/Entropy';
|
||||||
|
import Numberwang from '../operations/Numberwang';
|
||||||
|
import PublicKey from '../operations/PublicKey';
|
||||||
|
import FileType from '../operations/FileType';
|
||||||
|
import OS from '../operations/OS';
|
||||||
|
import Endian from '../operations/Endian';
|
||||||
|
import UUID from '../operations/UUID';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tell JSHint to ignore "'Object' is not defined" errors in this file, as it references every
|
* Tell JSHint to ignore "'Object' is not defined" errors in this file, as it references every
|
||||||
* single operation object by definition.
|
* single operation object by definition.
|
||||||
|
@ -2784,3 +2820,5 @@ const OperationConfig = {
|
||||||
args: [],
|
args: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default OperationConfig;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import Dish from './Dish';
|
||||||
|
import Recipe from './Recipe';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main controller for CyberChef.
|
* The main controller for CyberChef.
|
||||||
*
|
*
|
||||||
|
@ -7,9 +10,9 @@
|
||||||
*
|
*
|
||||||
* @class
|
* @class
|
||||||
*/
|
*/
|
||||||
const Chef = function () {
|
export default function Chef() {
|
||||||
this.dish = new Dish();
|
this.dish = new Dish();
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from './Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The data being operated on by each operation.
|
* The data being operated on by each operation.
|
||||||
*
|
*
|
||||||
|
@ -9,10 +11,10 @@
|
||||||
* @param {byte_array|string|number} value - The value of the input data.
|
* @param {byte_array|string|number} value - The value of the input data.
|
||||||
* @param {number} type - The data type of value, see Dish enums.
|
* @param {number} type - The data type of value, see Dish enums.
|
||||||
*/
|
*/
|
||||||
const Dish = function (value, type) {
|
export default function Dish(value, type) {
|
||||||
this.value = value || typeof value === 'string' ? value : null;
|
this.value = value || typeof value === 'string' ? value : null;
|
||||||
this.type = type || Dish.BYTE_ARRAY;
|
this.type = type || Dish.BYTE_ARRAY;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import Recipe from './Recipe';
|
||||||
|
import Dish from './Dish';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flow Control operations.
|
* Flow Control operations.
|
||||||
*
|
*
|
||||||
|
@ -170,3 +173,5 @@ const FlowControl = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default FlowControl;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from './Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The arguments to operations.
|
* The arguments to operations.
|
||||||
*
|
*
|
||||||
|
@ -8,7 +10,7 @@
|
||||||
* @class
|
* @class
|
||||||
* @param {Object} ingredient_config
|
* @param {Object} ingredient_config
|
||||||
*/
|
*/
|
||||||
const Ingredient = function (ingredient_config) {
|
export default function Ingredient(ingredient_config) {
|
||||||
this.name = '';
|
this.name = '';
|
||||||
this.type = '';
|
this.type = '';
|
||||||
this.value = null;
|
this.value = null;
|
||||||
|
@ -16,7 +18,7 @@ const Ingredient = function (ingredient_config) {
|
||||||
if (ingredient_config) {
|
if (ingredient_config) {
|
||||||
this._parse_config(ingredient_config);
|
this._parse_config(ingredient_config);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +74,6 @@ Ingredient.prepare = function (data, type) {
|
||||||
} else {
|
} else {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case 'number':
|
case 'number':
|
||||||
var number = parseFloat(data);
|
var number = parseFloat(data);
|
||||||
if (isNaN(number)) {
|
if (isNaN(number)) {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import Dish from './Dish';
|
||||||
|
import Ingredient from './Ingredient';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Operation specified by the user to be run.
|
* The Operation specified by the user to be run.
|
||||||
*
|
*
|
||||||
|
@ -9,7 +12,7 @@
|
||||||
* @param {string} operation_name
|
* @param {string} operation_name
|
||||||
* @param {Object} operation_config
|
* @param {Object} operation_config
|
||||||
*/
|
*/
|
||||||
const Operation = function (operation_name, operation_config) {
|
export default function Operation(operation_name, operation_config) {
|
||||||
this.name = operation_name;
|
this.name = operation_name;
|
||||||
this.description = '';
|
this.description = '';
|
||||||
this.input_type = -1;
|
this.input_type = -1;
|
||||||
|
@ -24,7 +27,7 @@ const Operation = function (operation_name, operation_config) {
|
||||||
if (operation_config) {
|
if (operation_config) {
|
||||||
this._parse_config(operation_config);
|
this._parse_config(operation_config);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import OperationConfig from '../config/OperationConfig';
|
||||||
|
import Operation from './Operation';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Recipe controls a list of Operations and the Dish they operate on.
|
* The Recipe controls a list of Operations and the Dish they operate on.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
|
||||||
/* globals CryptoJS, moment */
|
/* globals CryptoJS, moment */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1156,3 +1158,5 @@ CryptoJS.enc.Hex.parse = function (hexStr) {
|
||||||
|
|
||||||
return new CryptoJS.lib.WordArray.init(words, hexStrLength / 2);
|
return new CryptoJS.lib.WordArray.init(words, hexStrLength / 2);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Utils;
|
||||||
|
|
|
@ -50,3 +50,5 @@ const Base = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Base;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base64 operations.
|
* Base64 operations.
|
||||||
*
|
*
|
||||||
|
@ -361,3 +363,5 @@ const Base64 = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Base64;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals CryptoJS */
|
/* globals CryptoJS */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -298,3 +300,5 @@ const BitwiseOp = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default BitwiseOp;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals app */
|
/* globals app */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -396,3 +398,5 @@ const ByteRepr = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ByteRepr;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals CryptoJS */
|
/* globals CryptoJS */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,3 +46,5 @@ const CharEnc = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default CharEnc;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checksum operations.
|
* Checksum operations.
|
||||||
*
|
*
|
||||||
|
@ -128,3 +130,5 @@ const Checksum = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Checksum;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
/* globals CryptoJS, blowfish */
|
/* globals CryptoJS, blowfish */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -427,3 +428,5 @@ CryptoJS.kdf.OpenSSL.execute = function (password, keySize, ivSize, salt) {
|
||||||
// Return params
|
// Return params
|
||||||
return CryptoJS.lib.CipherParams.create({ key, iv, salt });
|
return CryptoJS.lib.CipherParams.create({ key, iv, salt });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Cipher;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals prettyPrintOne, vkbeautify */
|
/* globals prettyPrintOne, vkbeautify */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -303,3 +305,5 @@ const Code = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Code;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
import Uint8Array from 'core-js/modules/es6.typed.uint8-array';
|
||||||
|
|
||||||
/* globals Zlib, bzip2 */
|
/* globals Zlib, bzip2 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -346,3 +349,5 @@ const Compress = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Compress;
|
||||||
|
|
|
@ -410,3 +410,5 @@ const Convert = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Convert;
|
||||||
|
|
|
@ -452,3 +452,5 @@ const DateTime = {
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default DateTime;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
/**
|
/**
|
||||||
* Endian operations.
|
* Endian operations.
|
||||||
*
|
*
|
||||||
|
@ -92,3 +93,5 @@ const Endian = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Endian;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
/**
|
/**
|
||||||
* Entropy operations.
|
* Entropy operations.
|
||||||
*
|
*
|
||||||
|
@ -164,3 +165,5 @@ const Entropy = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Entropy;
|
||||||
|
|
|
@ -297,3 +297,5 @@ const Extract = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Extract;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File type operations.
|
* File type operations.
|
||||||
*
|
*
|
||||||
|
@ -524,3 +526,5 @@ const FileType = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default FileType;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTML operations.
|
* HTML operations.
|
||||||
*
|
*
|
||||||
|
@ -205,9 +207,9 @@ const HTML = {
|
||||||
l = Math.round(hsl_[2] * 100),
|
l = Math.round(hsl_[2] * 100),
|
||||||
k = 1 - Math.max(r / 255, g / 255, b / 255),
|
k = 1 - Math.max(r / 255, g / 255, b / 255),
|
||||||
c = (1 - r / 255 - k) / (1 - k),
|
c = (1 - r / 255 - k) / (1 - k),
|
||||||
m = (1 - g / 255 - k) / (1 - k), // jshint ignore:line
|
|
||||||
y = (1 - b / 255 - k) / (1 - k);
|
y = (1 - b / 255 - k) / (1 - k);
|
||||||
|
|
||||||
|
m = (1 - g / 255 - k) / (1 - k);
|
||||||
c = isNaN(c) ? '0' : c.toFixed(2);
|
c = isNaN(c) ? '0' : c.toFixed(2);
|
||||||
m = isNaN(m) ? '0' : m.toFixed(2);
|
m = isNaN(m) ? '0' : m.toFixed(2);
|
||||||
y = isNaN(y) ? '0' : y.toFixed(2);
|
y = isNaN(y) ? '0' : y.toFixed(2);
|
||||||
|
|
|
@ -51,3 +51,5 @@ const HTTP = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default HTTP;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals CryptoJS, Checksum */
|
/* globals CryptoJS, Checksum */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -339,3 +341,5 @@ const Hash = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Hash;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals app */
|
/* globals app */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -196,3 +198,5 @@ const Hexdump = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Hexdump;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals BigInteger */
|
/* globals BigInteger */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -802,3 +804,5 @@ const IP = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default IP;
|
||||||
|
|
|
@ -158,3 +158,5 @@ const JS = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default JS;
|
||||||
|
|
|
@ -86,3 +86,5 @@ const MAC = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default MAC;
|
||||||
|
|
|
@ -25,3 +25,5 @@ const Numberwang = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Numberwang;
|
||||||
|
|
|
@ -307,3 +307,5 @@ const OS = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default OS;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals X509, KJUR, ASN1HEX, KEYUTIL, BigInteger */
|
/* globals X509, KJUR, ASN1HEX, KEYUTIL, BigInteger */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1051,3 +1053,5 @@ X509.DN_ATTRHEX = {
|
||||||
'060355080101': 'rsa',
|
'060355080101': 'rsa',
|
||||||
'0603604c0101': 'DPC',
|
'0603604c0101': 'DPC',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default PublicKey;
|
||||||
|
|
|
@ -53,3 +53,5 @@ const Punycode = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Punycode;
|
||||||
|
|
|
@ -266,3 +266,5 @@ const QuotedPrintable = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default QuotedPrintable;
|
||||||
|
|
|
@ -204,3 +204,5 @@ const Rotate = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Rotate;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sequence utility operations.
|
* Sequence utility operations.
|
||||||
*
|
*
|
||||||
|
@ -218,3 +220,5 @@ const SeqUtils = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default SeqUtils;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/* globals JsDiff */
|
/* globals JsDiff */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -502,3 +504,5 @@ const StrUtils = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default StrUtils;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tidy operations.
|
* Tidy operations.
|
||||||
*
|
*
|
||||||
|
@ -240,3 +242,5 @@ const Tidy = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Tidy;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
/* globals unescape */
|
/* globals unescape */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,3 +132,5 @@ const URL_ = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default URL_;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Uint32Array from 'core-js/modules/es6.typed.uint32-array';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UUID operations.
|
* UUID operations.
|
||||||
*
|
*
|
||||||
|
@ -37,3 +39,5 @@ const UUID = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UUID;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unicode operations.
|
* Unicode operations.
|
||||||
*
|
*
|
||||||
|
@ -60,3 +62,5 @@ const Unicode = {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Unicode;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
import Utils from '../../core/Utils';
|
||||||
/**
|
/**
|
||||||
* Waiter to handle events related to the CyberChef controls (i.e. Bake, Step, Save, Load etc.)
|
* Waiter to handle events related to the CyberChef controls (i.e. Bake, Step, Save, Load etc.)
|
||||||
*
|
*
|
||||||
|
@ -9,10 +11,10 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const ControlsWaiter = function (app, manager) {
|
export default function ControlsWaiter(app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,7 +193,9 @@ ControlsWaiter.prototype.save_text_change = function () {
|
||||||
try {
|
try {
|
||||||
const recipe_config = JSON.parse(document.getElementById('save-text').value);
|
const recipe_config = JSON.parse(document.getElementById('save-text').value);
|
||||||
this.initialise_save_link(recipe_config);
|
this.initialise_save_link(recipe_config);
|
||||||
} catch (err) {}
|
} catch (err) {
|
||||||
|
// ignore error
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
|
||||||
|
import Utils from '../../core/Utils';
|
||||||
|
import Chef from '../../core/Chef';
|
||||||
|
import Manager from './Manager';
|
||||||
|
import HTMLCategory from './HTMLCategory';
|
||||||
|
import HTMLOperation from './HTMLOperation';
|
||||||
|
|
||||||
|
|
||||||
/* globals Split */
|
/* globals Split */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +23,7 @@
|
||||||
* @param {String[]} default_favourites - A list of default favourite operations.
|
* @param {String[]} default_favourites - A list of default favourite operations.
|
||||||
* @param {Object} options - Default setting for app options.
|
* @param {Object} options - Default setting for app options.
|
||||||
*/
|
*/
|
||||||
const HTMLApp = function (categories, operations, default_favourites, default_options) {
|
export default function HTMLApp(categories, operations, default_favourites, default_options) {
|
||||||
this.categories = categories;
|
this.categories = categories;
|
||||||
this.operations = operations;
|
this.operations = operations;
|
||||||
this.dfavourites = default_favourites;
|
this.dfavourites = default_favourites;
|
||||||
|
@ -29,7 +38,7 @@ const HTMLApp = function (categories, operations, default_favourites, default_op
|
||||||
this.ing_id = 0;
|
this.ing_id = 0;
|
||||||
|
|
||||||
window.chef = this.chef;
|
window.chef = this.chef;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -356,7 +365,9 @@ HTMLApp.prototype.load_URI_params = function () {
|
||||||
try {
|
try {
|
||||||
const recipe_config = JSON.parse(this.query_string.recipe);
|
const recipe_config = JSON.parse(this.query_string.recipe);
|
||||||
this.set_recipe_config(recipe_config);
|
this.set_recipe_config(recipe_config);
|
||||||
} catch (err) {}
|
} catch (err) {
|
||||||
|
// ignore error
|
||||||
|
}
|
||||||
} else if (this.query_string.op) {
|
} else if (this.query_string.op) {
|
||||||
// If there's no recipe, look for single operations
|
// If there's no recipe, look for single operations
|
||||||
this.manager.recipe.clear_recipe();
|
this.manager.recipe.clear_recipe();
|
||||||
|
@ -382,7 +393,9 @@ HTMLApp.prototype.load_URI_params = function () {
|
||||||
try {
|
try {
|
||||||
const input_data = Utils.from_base64(this.query_string.input);
|
const input_data = Utils.from_base64(this.query_string.input);
|
||||||
this.set_input(input_data);
|
this.set_input(input_data);
|
||||||
} catch (err) {}
|
} catch (err) {
|
||||||
|
// ignore error
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore auto-bake state
|
// Restore auto-bake state
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
* @param {string} name - The name of the category.
|
* @param {string} name - The name of the category.
|
||||||
* @param {boolean} selected - Whether this category is pre-selected or not.
|
* @param {boolean} selected - Whether this category is pre-selected or not.
|
||||||
*/
|
*/
|
||||||
const HTMLCategory = function (name, selected) {
|
export default function HTMLCategory(name, selected) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
this.op_list = [];
|
this.op_list = [];
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const HTMLIngredient = function (config, app, manager) {
|
export default function HTMLIngredient(config, app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ const HTMLIngredient = function (config, app, manager) {
|
||||||
this.target = config.target;
|
this.target = config.target;
|
||||||
this.toggle_values = config.toggle_values;
|
this.toggle_values = config.toggle_values;
|
||||||
this.id = `ing-${this.app.next_ing_id()}`;
|
this.id = `ing-${this.app.next_ing_id()}`;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import HTMLIngredient from './HTMLIngredient';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object to handle the creation of operations.
|
* Object to handle the creation of operations.
|
||||||
*
|
*
|
||||||
|
@ -11,7 +13,7 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const HTMLOperation = function (name, config, app, manager) {
|
export default function HTMLOperation(name, config, app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
|
|
||||||
|
@ -25,7 +27,7 @@ const HTMLOperation = function (name, config, app, manager) {
|
||||||
const ing = new HTMLIngredient(config.args[i], this.app, this.manager);
|
const ing = new HTMLIngredient(config.args[i], this.app, this.manager);
|
||||||
this.ing_list.push(ing);
|
this.ing_list.push(ing);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import Utils from '../../core/Utils';
|
||||||
/**
|
/**
|
||||||
* Waiter to handle events related to highlighting in CyberChef.
|
* Waiter to handle events related to highlighting in CyberChef.
|
||||||
*
|
*
|
||||||
|
@ -8,12 +9,12 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
*/
|
*/
|
||||||
const HighlighterWaiter = function (app) {
|
export default function HighlighterWaiter(app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
this.mouse_button_down = false;
|
this.mouse_button_down = false;
|
||||||
this.mouse_target = null;
|
this.mouse_target = null;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Uint8Array from 'core-js/modules/es6.typed.uint8-array';
|
||||||
|
import Utils from '../../core/Utils';
|
||||||
/**
|
/**
|
||||||
* Waiter to handle events related to the input.
|
* Waiter to handle events related to the input.
|
||||||
*
|
*
|
||||||
|
@ -9,7 +11,7 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const InputWaiter = function (app, manager) {
|
export default function InputWaiter(app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
|
|
||||||
|
@ -30,7 +32,7 @@ const InputWaiter = function (app, manager) {
|
||||||
144, // Num
|
144, // Num
|
||||||
145, //Scroll
|
145, //Scroll
|
||||||
];
|
];
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
|
||||||
|
import WindowWaiter from './WindowWaiter';
|
||||||
|
import ControlsWaiter from './ControlsWaiter';
|
||||||
|
import RecipeWaiter from './RecipeWaiter';
|
||||||
|
import OperationsWaiter from './OperationsWaiter';
|
||||||
|
import InputWaiter from './InputWaiter';
|
||||||
|
import OutputWaiter from './OutputWaiter';
|
||||||
|
import HighlighterWaiter from './HighlighterWaiter';
|
||||||
|
import SeasonalWaiter from './SeasonalWaiter';
|
||||||
|
import OptionsWaiter from './OptionsWaiter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This object controls the Waiters responsible for handling events from all areas of the app.
|
* This object controls the Waiters responsible for handling events from all areas of the app.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
import HTMLOperation from './HTMLOperation';
|
||||||
|
|
||||||
/* globals Sortable */
|
/* globals Sortable */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,13 +14,13 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const OperationsWaiter = function (app, manager) {
|
export default function OperationsWaiter(app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
|
|
||||||
this.options = {};
|
this.options = {};
|
||||||
this.remove_intent = false;
|
this.remove_intent = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waiter to handle events related to the CyberChef options.
|
* Waiter to handle events related to the CyberChef options.
|
||||||
*
|
*
|
||||||
|
@ -8,9 +10,9 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
*/
|
*/
|
||||||
const OptionsWaiter = function (app) {
|
export default function OptionsWaiter(app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Utils from '../../core/Utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waiter to handle events related to the output.
|
* Waiter to handle events related to the output.
|
||||||
*
|
*
|
||||||
|
@ -9,10 +11,10 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const OutputWaiter = function (app, manager) {
|
export default function OutputWaiter(app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
import HTMLOperation from './HTMLOperation';
|
||||||
/* globals Sortable */
|
/* globals Sortable */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,11 +13,11 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const RecipeWaiter = function (app, manager) {
|
export default function RecipeWaiter(app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.remove_intent = false;
|
this.remove_intent = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -405,7 +407,7 @@ RecipeWaiter.prototype.dropdown_toggle_click = function (e) {
|
||||||
* @fires Manager#statechange
|
* @fires Manager#statechange
|
||||||
* @param {event} e
|
* @param {event} e
|
||||||
*/
|
*/
|
||||||
RecipeWaiter.prototype.op_add = function (e) {
|
RecipeWaiter.prototype.op_add = function () {
|
||||||
window.dispatchEvent(this.manager.statechange);
|
window.dispatchEvent(this.manager.statechange);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -417,6 +419,6 @@ RecipeWaiter.prototype.op_add = function (e) {
|
||||||
* @fires Manager#statechange
|
* @fires Manager#statechange
|
||||||
* @param {event} e
|
* @param {event} e
|
||||||
*/
|
*/
|
||||||
RecipeWaiter.prototype.op_remove = function (e) {
|
RecipeWaiter.prototype.op_remove = function () {
|
||||||
window.dispatchEvent(this.manager.statechange);
|
window.dispatchEvent(this.manager.statechange);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import $ from 'jquery';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waiter to handle seasonal events and easter eggs.
|
* Waiter to handle seasonal events and easter eggs.
|
||||||
*
|
*
|
||||||
|
@ -9,10 +11,10 @@
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
* @param {Manager} manager - The CyberChef event manager.
|
* @param {Manager} manager - The CyberChef event manager.
|
||||||
*/
|
*/
|
||||||
const SeasonalWaiter = function (app, manager) {
|
export default function SeasonalWaiter(app, manager) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {HTMLApp} app - The main view object for CyberChef.
|
* @param {HTMLApp} app - The main view object for CyberChef.
|
||||||
*/
|
*/
|
||||||
const WindowWaiter = function (app) {
|
export default function WindowWaiter(app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import HTMLApp from './HTMLApp';
|
||||||
|
import Categories from '../../config/Categories';
|
||||||
|
import OperationConfig from '../../config/OperationConfig';
|
||||||
/* globals moment */
|
/* globals moment */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1185,7 +1185,7 @@ cookie@0.3.1:
|
||||||
version "0.3.1"
|
version "0.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
|
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
|
||||||
|
|
||||||
core-js@^2.4.0:
|
core-js@^2.4.0, core-js@^2.4.1:
|
||||||
version "2.4.1"
|
version "2.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue