/**
* Given an existing operation name, this script generates a skeleton for that op
* in the new ESM format.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/*eslint no-console: ["off"] */
import process from "process";
import fs from "fs";
import path from "path";
import EscapeString from "../../operations/EscapeString";
if (process.argv.length < 4) {
console.log("Pass an operation name and legacy filename as arguments.");
console.log("Example> node --experimental-modules src/core/config/scripts/portOperation.mjs 'XOR' 'BitwiseOp'");
process.exit(0);
}
const dir = path.join(process.cwd() + "/src/core/config/");
if (!fs.existsSync(dir)) {
console.log("\nCWD: " + process.cwd());
console.log("Error: portOperation.mjs should be run from the project root");
console.log("Example> node --experimental-modules src/core/config/scripts/portOperation.mjs");
process.exit(1);
}
/**
* Main function
*/
function main() {
const opName = process.argv[2];
const legacyFilename = path.join(dir, `../operations/legacy/${process.argv[3]}.js`);
if (!OP_CONFIG.hasOwnProperty(opName)) {
console.log(`${opName} cannot be found.`);
process.exit(0);
}
const op = OP_CONFIG[opName];
const moduleName = opName.replace(/\w\S*/g, txt => {
return txt.charAt(0).toUpperCase() + txt.substr(1);
}).replace(/[\s-/]/g, "");
let legacyFile = "";
// Read legacy file
try {
legacyFile = fs.readFileSync(legacyFilename, {encoding: "utf8"});
} catch (err) {
console.log("Unable to read legacy file.");
console.log("Example> node --experimental-modules src/core/config/scripts/portOperation.mjs 'XOR' 'BitwiseOp'");
process.exit(0);
}
const author = legacyFile.match(/@author [^\n]+/)[0];
const copyright = legacyFile.match(/@copyright [^\n]+/)[0];
const utilsUsed = /Utils/.test(legacyFile);
const esc = new EscapeString();
const desc = esc.run(op.description, ["Special chars", "Double"]);
const patterns = op.hasOwnProperty("patterns") ? `
this.patterns = ${JSON.stringify(op.patterns, null, 4).split("\n").join("\n ")};` : "";
// Attempt to find the operation run function based on the JSDoc comment
const regex = `\\* ${opName} operation[^:]+:(?: function ?\\(input, args\\))? ?{([\\s\\S]+?)\n }`;
let runFunc = "\n";
try {
runFunc = legacyFile.match(new RegExp(regex, "im"))[1];
} catch (err) {}
// List all constants in legacyFile
const constants = [];
try {
const constantsRegex = /\* @constant[^/]+\/\s+([^\n]+)/gim;
let m;
while ((m = constantsRegex.exec(legacyFile)) !== null) {
constants.push(m[1]);
}
} catch (err) {}
const template = `/**
* ${author}
* ${copyright}
* @license Apache-2.0
*/
import Operation from "../Operation";
${utilsUsed ? 'import Utils from "../Utils";\n' : ""}
/**
* ${opName} operation
*/
class ${moduleName} extends Operation {
/**
* ${moduleName} constructor
*/
constructor() {
super();
this.name = "${opName}";${op.flowControl ? "\n this.flowControl = true;" : ""}
this.module = "${op.module}";
this.description = "${desc}";
this.inputType = "${op.inputType}";
this.outputType = "${op.outputType}";${op.manualBake ? "\n this.manualBake = true;" : ""}
this.args = ${JSON.stringify(op.args, null, 4).split("\n").join("\n ")};${patterns}
}
/**
* @param {${op.inputType}} input
* @param {Object[]} args
* @returns {${op.outputType}}
*/
run(input, args) {${runFunc}
}
${op.highlight ? `
/**
* Highlight ${opName}
*
* @param {Object[]} pos
* @param {number} pos[].start
* @param {number} pos[].end
* @param {Object[]} args
* @returns {Object[]} pos
*/
highlight(pos, args) {
return pos;
}
` : ""}${op.highlightReverse ? `
/**
* Highlight ${opName} in reverse
*
* @param {Object[]} pos
* @param {number} pos[].start
* @param {number} pos[].end
* @param {Object[]} args
* @returns {Object[]} pos
*/
highlightReverse(pos, args) {
return pos;
}
` : ""}
}
export default ${moduleName};
`;
console.log("\nLegacy operation config\n-----------------------\n");
console.log(JSON.stringify(op, null, 4));
console.log("\n-----------------------\n");
console.log("\nPotentially related constants\n-----------------------\n");
console.log(constants.join("\n"));
console.log("\n-----------------------\n");
const filename = path.join(dir, `../operations/${moduleName}.mjs`);
if (fs.existsSync(filename)) {
console.log(`\x1b[31m\u274c ${filename} already exists. It has NOT been overwritten.\x1b[0m`);
process.exit(0);
}
fs.writeFileSync(filename, template);
console.log("\x1b[32m\u2714\x1b[0m Operation written to \x1b[32m" + filename + "\x1b[0m");
if (runFunc === "\n") {
console.log("\x1b[31m\u274c The run function could not be located automatically.\x1b[0m You will have to copy it accross manually.");
} else {
console.log("\x1b[32m\u2714\x1b[0m The run function was copied across. Double check that it was copied correctly. It may rely on other functions which have not been copied.");
}
console.log(`\nOpen \x1b[32m${legacyFilename}\x1b[0m and copy any relevant code over. Make sure you check imports, args and highlights. Code required by multiple operations should be stored in /src/core/lib/.\n\nDont't forget to run \x1b[36mgrunt lint\x1b[0m!`);
}
const OP_CONFIG = {
"Magic": {
module: "Default",
description: "The Magic operation attempts to detect various properties of the input data and suggests which operations could help to make more sense of it.
Options
Depth: If an operation appears to match the data, it will be run and the result will be analysed further. This argument controls the maximum number of levels of recursion.
Intensive mode: When this is turned on, various operations like XOR, bit rotates, and character encodings are brute-forced to attempt to detect valid data underneath. To improve performance, only the first 100 bytes of the data is brute-forced.
Extensive language support: At each stage, the relative byte frequencies of the data will be compared to average frequencies for a number of languages. The default set consists of ~40 of the most commonly used languages on the Internet. The extensive list consists of 284 languages and can result in many languages matching the data if their byte frequencies are similar.",
inputType: "ArrayBuffer",
outputType: "html",
flowControl: true,
args: [
{
name: "Depth",
type: "number",
value: 3
},
{
name: "Intensive mode",
type: "boolean",
value: false
},
{
name: "Extensive language support",
type: "boolean",
value: false
}
]
},
"Fork": {
module: "Default",
description: "Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.
For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.",
inputType: "string",
outputType: "string",
flowControl: true,
args: [
{
name: "Split delimiter",
type: "binaryShortString",
value: "\\n"
},
{
name: "Merge delimiter",
type: "binaryShortString",
value: "\\n"
},
{
name: "Ignore errors",
type: "boolean",
value: false
}
]
},
"Merge": {
module: "Default",
description: "Consolidate all branches back into a single trunk. The opposite of Fork.",
inputType: "string",
outputType: "string",
flowControl: true,
args: []
},
"Register": {
module: "Default",
description: "Extract data from the input and store it in registers which can then be passed into subsequent operations as arguments. Regular expression capture groups are used to select the data to extract.
To use registers in arguments, refer to them using the notation $Rn where n is the register number, starting at 0.
For example:
Input: Test
Extractor: (.*)
Argument: $R0 becomes Test
Registers can be escaped in arguments using a backslash. e.g. \\$R0 would become $R0 rather than Test.",
inputType: "string",
outputType: "string",
flowControl: true,
args: [
{
name: "Extractor",
type: "binaryString",
value: "([\\s\\S]*)"
},
{
name: "Case insensitive",
type: "boolean",
value: true
},
{
name: "Multiline matching",
type: "boolean",
value: false
},
]
},
"Jump": {
module: "Default",
description: "Jump forwards or backwards to the specified Label",
inputType: "string",
outputType: "string",
flowControl: true,
args: [
{
name: "Label name",
type: "string",
value: ""
},
{
name: "Maximum jumps (if jumping backwards)",
type: "number",
value: 10
}
]
},
"Conditional Jump": {
module: "Default",
description: "Conditionally jump forwards or backwards to the specified Label based on whether the data matches the specified regular expression.",
inputType: "string",
outputType: "string",
flowControl: true,
args: [
{
name: "Match (regex)",
type: "string",
value: ""
},
{
name: "Invert match",
type: "boolean",
value: false
},
{
name: "Label name",
type: "shortString",
value: ""
},
{
name: "Maximum jumps (if jumping backwards)",
type: "number",
value: 10
}
]
},
"Label": {
module: "Default",
description: "Provides a location for conditional and fixed jumps to redirect execution to.",
inputType: "string",
outputType: "string",
flowControl: true,
args: [
{
name: "Name",
type: "shortString",
value: ""
}
]
},
"Return": {
module: "Default",
description: "End execution of operations at this point in the recipe.",
inputType: "string",
outputType: "string",
flowControl: true,
args: []
},
"Comment": {
module: "Default",
description: "Provides a place to write comments within the flow of the recipe. This operation has no computational effect.",
inputType: "string",
outputType: "string",
flowControl: true,
args: [
{
name: "",
type: "text",
value: ""
}
]
},
"From Base64": {
module: "Default",
description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.
This operation decodes data from an ASCII Base64 string back into its raw format.
e.g. aGVsbG8= becomes hello",
highlight: "func",
highlightReverse: "func",
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Alphabet",
type: "editableOption",
value: "Base64.ALPHABET_OPTIONS"
},
{
name: "Remove non-alphabet chars",
type: "boolean",
value: "Base64.REMOVE_NON_ALPH_CHARS"
}
],
patterns: [
{
match: "^(?:[A-Z\\d+/]{4})+(?:[A-Z\\d+/]{2}==|[A-Z\\d+/]{3}=)?$",
flags: "i",
args: ["A-Za-z0-9+/=", false]
},
{
match: "^[A-Z\\d\\-_]{20,}$",
flags: "i",
args: ["A-Za-z0-9-_", false]
},
{
match: "^(?:[A-Z\\d+\\-]{4}){5,}(?:[A-Z\\d+\\-]{2}==|[A-Z\\d+\\-]{3}=)?$",
flags: "i",
args: ["A-Za-z0-9+\\-=", false]
},
{
match: "^(?:[A-Z\\d./]{4}){5,}(?:[A-Z\\d./]{2}==|[A-Z\\d./]{3}=)?$",
flags: "i",
args: ["./0-9A-Za-z=", false]
},
{
match: "^[A-Z\\d_.]{20,}$",
flags: "i",
args: ["A-Za-z0-9_.", false]
},
{
match: "^(?:[A-Z\\d._]{4}){5,}(?:[A-Z\\d._]{2}--|[A-Z\\d._]{3}-)?$",
flags: "i",
args: ["A-Za-z0-9._-", false]
},
{
match: "^(?:[A-Z\\d+/]{4}){5,}(?:[A-Z\\d+/]{2}==|[A-Z\\d+/]{3}=)?$",
flags: "i",
args: ["0-9a-zA-Z+/=", false]
},
{
match: "^(?:[A-Z\\d+/]{4}){5,}(?:[A-Z\\d+/]{2}==|[A-Z\\d+/]{3}=)?$",
flags: "i",
args: ["0-9A-Za-z+/=", false]
},
{
match: "^[ !\"#$%&'()*+,\\-./\\d:;<=>?@A-Z[\\\\\\]^_]{20,}$",
flags: "",
args: [" -_", false]
},
{
match: "^[A-Z\\d+\\-]{20,}$",
flags: "i",
args: ["+\\-0-9A-Za-z", false]
},
{
match: "^[!\"#$%&'()*+,\\-0-689@A-NP-VX-Z[`a-fh-mp-r]{20,}$",
flags: "",
args: ["!-,-0-689@A-NP-VX-Z[`a-fh-mp-r", false]
},
{
match: "^(?:[N-ZA-M\\d+/]{4}){5,}(?:[N-ZA-M\\d+/]{2}==|[N-ZA-M\\d+/]{3}=)?$",
flags: "i",
args: ["N-ZA-Mn-za-m0-9+/=", false]
},
{
match: "^[A-Z\\d./]{20,}$",
flags: "i",
args: ["./0-9A-Za-z", false]
},
]
},
"To Base64": {
module: "Default",
description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.
This operation encodes data in an ASCII Base64 string.
e.g. hello becomes aGVsbG8=",
highlight: "func",
highlightReverse: "func",
inputType: "ArrayBuffer",
outputType: "string",
args: [
{
name: "Alphabet",
type: "editableOption",
value: "Base64.ALPHABET_OPTIONS"
},
]
},
"From Base58": {
module: "Default",
description: "Base58 (similar to Base64) is a notation for encoding arbitrary byte data. It differs from Base64 by removing easily misread characters (i.e. l, I, 0 and O) to improve human readability.
This operation decodes data from an ASCII string (with an alphabet of your choosing, presets included) back into its raw form.
e.g. StV1DL6CwTryKyV becomes hello world
Base58 is commonly used in cryptocurrencies (Bitcoin, Ripple, etc).",
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Alphabet",
type: "editableOption",
value: "Base58.ALPHABET_OPTIONS"
},
{
name: "Remove non-alphabet chars",
type: "boolean",
value: "Base58.REMOVE_NON_ALPH_CHARS"
}
],
patterns: [
{
match: "^[1-9A-HJ-NP-Za-km-z]{20,}$",
flags: "",
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", false]
},
{
match: "^[1-9A-HJ-NP-Za-km-z]{20,}$",
flags: "",
args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz", false]
},
]
},
"To Base58": {
module: "Default",
description: "Base58 (similar to Base64) is a notation for encoding arbitrary byte data. It differs from Base64 by removing easily misread characters (i.e. l, I, 0 and O) to improve human readability.
This operation encodes data in an ASCII string (with an alphabet of your choosing, presets included).
e.g. hello world becomes StV1DL6CwTryKyV
Base58 is commonly used in cryptocurrencies (Bitcoin, Ripple, etc).",
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Alphabet",
type: "editableOption",
value: "Base58.ALPHABET_OPTIONS"
},
]
},
"From Base32": {
module: "Default",
description: "Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Alphabet",
type: "binaryString",
value: "Base64.BASE32_ALPHABET"
},
{
name: "Remove non-alphabet chars",
type: "boolean",
value: "Base64.REMOVE_NON_ALPH_CHARS"
}
],
patterns: [
{
match: "^(?:[A-Z2-7]{8})+(?:[A-Z2-7]{2}={6}|[A-Z2-7]{4}={4}|[A-Z2-7]{5}={3}|[A-Z2-7]{7}={1})?$",
flags: "",
args: ["A-Z2-7=", false]
},
]
},
"To Base32": {
module: "Default",
description: "Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Alphabet",
type: "binaryString",
value: "Base64.BASE32_ALPHABET"
}
]
},
"Show Base64 offsets": {
module: "Default",
description: "When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.
This operation shows all possible offsets for a given string so that each possible encoding can be considered.",
inputType: "byteArray",
outputType: "html",
args: [
{
name: "Alphabet",
type: "binaryString",
value: "Base64.ALPHABET"
},
{
name: "Show variable chars and padding",
type: "boolean",
value: "Base64.OFFSETS_SHOW_VARIABLE"
}
]
},
"Disassemble x86": {
module: "Shellcode",
description: "Disassembly is the process of translating machine language into assembly language.
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.
Input should be in hexadecimal.",
inputType: "string",
outputType: "string",
args: [
{
name: "Bit mode",
type: "option",
value: "Shellcode.MODE"
},
{
name: "Compatibility",
type: "option",
value: "Shellcode.COMPATIBILITY"
},
{
name: "Code Segment (CS)",
type: "number",
value: 16
},
{
name: "Offset (IP)",
type: "number",
value: 0
},
{
name: "Show instruction hex",
type: "boolean",
value: true
},
{
name: "Show instruction position",
type: "boolean",
value: true
}
]
},
"XOR": {
module: "Default",
description: "XOR the input with the given key.
e.g. fe023da5
Options
Null preserving: If the current byte is 0x00 or the same as the key, skip it.
Scheme:
fe023da5",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Key",
type: "toggleString",
value: "",
toggleValues: "BitwiseOp.KEY_FORMAT"
}
]
},
"OR": {
module: "Default",
description: "OR the input with the given key.fe023da5",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Key",
type: "toggleString",
value: "",
toggleValues: "BitwiseOp.KEY_FORMAT"
}
]
},
"ADD": {
module: "Default",
description: "ADD the input with the given key (e.g. fe023da5), MOD 255",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Key",
type: "toggleString",
value: "",
toggleValues: "BitwiseOp.KEY_FORMAT"
}
]
},
"SUB": {
module: "Default",
description: "SUB the input with the given key (e.g. fe023da5), MOD 255",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Key",
type: "toggleString",
value: "",
toggleValues: "BitwiseOp.KEY_FORMAT"
}
]
},
"Sum": {
module: "Default",
description: "Adds together a list of numbers. If an item in the string is not a number it is excluded from the list.0x0a 8 .5 becomes 18.5",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Delimiter",
type: "option",
value: "Arithmetic.DELIM_OPTIONS"
}
]
},
"Subtract": {
module: "Default",
description: "Subtracts a list of numbers. If an item in the string is not a number it is excluded from the list.0x0a 8 .5 becomes 1.5",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Delimiter",
type: "option",
value: "Arithmetic.DELIM_OPTIONS"
}
]
},
"Multiply": {
module: "Default",
description: "Multiplies a list of numbers. If an item in the string is not a number it is excluded from the list.0x0a 8 .5 becomes 40",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Delimiter",
type: "option",
value: "Arithmetic.DELIM_OPTIONS"
}
]
},
"Divide": {
module: "Default",
description: "Divides a list of numbers. If an item in the string is not a number it is excluded from the list.0x0a 8 .5 becomes 2.5",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Delimiter",
type: "option",
value: "Arithmetic.DELIM_OPTIONS"
}
]
},
"Mean": {
module: "Default",
description: "Computes the mean (average) of a number list. If an item in the string is not a number it is excluded from the list.0x0a 8 .5 .5 becomes 4.75",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Delimiter",
type: "option",
value: "Arithmetic.DELIM_OPTIONS"
}
]
},
"Median": {
module: "Default",
description: "Computes the median of a number list. If an item in the string is not a number it is excluded from the list.0x0a 8 1 .5 becomes 4.5",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Delimiter",
type: "option",
value: "Arithmetic.DELIM_OPTIONS"
}
]
},
"Standard Deviation": {
module: "Default",
description: "Computes the standard deviation of a number list. If an item in the string is not a number it is excluded from the list.0x0a 8 .5 becomes 4.089281382128433",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Delimiter",
type: "option",
value: "Arithmetic.DELIM_OPTIONS"
}
]
},
"To Table": {
module: "Default",
description: "Data can be split on different characters and rendered as an HTML or ASCII table with an optional header row.\\t to support TSV (Tab Separated Values) or | for PSV (Pipe Separated Values).ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a becomes the UTF-8 encoded string Γειά σου",
highlight: "func",
highlightReverse: "func",
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.HEX_DELIM_OPTIONS"
}
],
patterns: [
{
match: "^(?:[\\dA-F]{2})+$",
flags: "i",
args: ["None"]
},
{
match: "^[\\dA-F]{2}(?: [\\dA-F]{2})*$",
flags: "i",
args: ["Space"]
},
{
match: "^[\\dA-F]{2}(?:,[\\dA-F]{2})*$",
flags: "i",
args: ["Comma"]
},
{
match: "^[\\dA-F]{2}(?:;[\\dA-F]{2})*$",
flags: "i",
args: ["Semi-colon"]
},
{
match: "^[\\dA-F]{2}(?::[\\dA-F]{2})*$",
flags: "i",
args: ["Colon"]
},
{
match: "^[\\dA-F]{2}(?:\\n[\\dA-F]{2})*$",
flags: "i",
args: ["Line feed"]
},
{
match: "^[\\dA-F]{2}(?:\\r\\n[\\dA-F]{2})*$",
flags: "i",
args: ["CRLF"]
},
{
match: "^[\\dA-F]{2}(?:0x[\\dA-F]{2})*$",
flags: "i",
args: ["0x"]
},
{
match: "^[\\dA-F]{2}(?:\\\\x[\\dA-F]{2})*$",
flags: "i",
args: ["\\x"]
}
]
},
"To Hex": {
module: "Default",
description: "Converts the input string to hexadecimal bytes separated by the specified delimiter.Γειά σου becomes ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a",
highlight: "func",
highlightReverse: "func",
inputType: "ArrayBuffer",
outputType: "string",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.HEX_DELIM_OPTIONS"
}
]
},
"From Octal": {
module: "Default",
description: "Converts an octal byte string back into its raw value.316 223 316 265 316 271 316 254 40 317 203 316 277 317 205 becomes the UTF-8 encoded string Γειά σου",
highlight: false,
highlightReverse: false,
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.DELIM_OPTIONS"
}
],
patterns: [
{
match: "^(?:[0-7]{1,2}|[123][0-7]{2})(?: (?:[0-7]{1,2}|[123][0-7]{2}))*$",
flags: "",
args: ["Space"]
},
{
match: "^(?:[0-7]{1,2}|[123][0-7]{2})(?:,(?:[0-7]{1,2}|[123][0-7]{2}))*$",
flags: "",
args: ["Comma"]
},
{
match: "^(?:[0-7]{1,2}|[123][0-7]{2})(?:;(?:[0-7]{1,2}|[123][0-7]{2}))*$",
flags: "",
args: ["Semi-colon"]
},
{
match: "^(?:[0-7]{1,2}|[123][0-7]{2})(?::(?:[0-7]{1,2}|[123][0-7]{2}))*$",
flags: "",
args: ["Colon"]
},
{
match: "^(?:[0-7]{1,2}|[123][0-7]{2})(?:\\n(?:[0-7]{1,2}|[123][0-7]{2}))*$",
flags: "",
args: ["Line feed"]
},
{
match: "^(?:[0-7]{1,2}|[123][0-7]{2})(?:\\r\\n(?:[0-7]{1,2}|[123][0-7]{2}))*$",
flags: "",
args: ["CRLF"]
},
]
},
"To Octal": {
module: "Default",
description: "Converts the input string to octal bytes separated by the specified delimiter.Γειά σου becomes 316 223 316 265 316 271 316 254 40 317 203 316 277 317 205",
highlight: false,
highlightReverse: false,
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.DELIM_OPTIONS"
}
]
},
"From Charcode": {
module: "Default",
description: "Converts unicode character codes back into text.0393 03b5 03b9 03ac 20 03c3 03bf 03c5 becomes Γειά σου",
highlight: "func",
highlightReverse: "func",
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.DELIM_OPTIONS"
},
{
name: "Base",
type: "number",
value: "ByteRepr.CHARCODE_BASE"
}
]
},
"To Charcode": {
module: "Default",
description: "Converts text to its unicode character code equivalent.Γειά σου becomes 0393 03b5 03b9 03ac 20 03c3 03bf 03c5",
highlight: "func",
highlightReverse: "func",
inputType: "string",
outputType: "string",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.DELIM_OPTIONS"
},
{
name: "Base",
type: "number",
value: "ByteRepr.CHARCODE_BASE"
}
]
},
"From Binary": {
module: "Default",
description: "Converts a binary string back into its raw form.01001000 01101001 becomes Hi",
highlight: "func",
highlightReverse: "func",
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.BIN_DELIM_OPTIONS"
}
],
patterns: [
{
match: "^(?:[01]{8})+$",
flags: "",
args: ["None"]
},
{
match: "^(?:[01]{8})(?: [01]{8})*$",
flags: "",
args: ["Space"]
},
{
match: "^(?:[01]{8})(?:,[01]{8})*$",
flags: "",
args: ["Comma"]
},
{
match: "^(?:[01]{8})(?:;[01]{8})*$",
flags: "",
args: ["Semi-colon"]
},
{
match: "^(?:[01]{8})(?::[01]{8})*$",
flags: "",
args: ["Colon"]
},
{
match: "^(?:[01]{8})(?:\\n[01]{8})*$",
flags: "",
args: ["Line feed"]
},
{
match: "^(?:[01]{8})(?:\\r\\n[01]{8})*$",
flags: "",
args: ["CRLF"]
},
]
},
"To Binary": {
module: "Default",
description: "Displays the input data as a binary string.Hi becomes 01001000 01101001",
highlight: "func",
highlightReverse: "func",
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.BIN_DELIM_OPTIONS"
}
]
},
"From Decimal": {
module: "Default",
description: "Converts the data from an ordinal integer array back into its raw form.72 101 108 108 111 becomes Hello",
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.DELIM_OPTIONS"
}
],
patterns: [
{
match: "^(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])(?: (?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5]))*$",
flags: "",
args: ["Space"]
},
{
match: "^(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])(?:,(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5]))*$",
flags: "",
args: ["Comma"]
},
{
match: "^(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])(?:;(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5]))*$",
flags: "",
args: ["Semi-colon"]
},
{
match: "^(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])(?::(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5]))*$",
flags: "",
args: ["Colon"]
},
{
match: "^(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])(?:\\n(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5]))*$",
flags: "",
args: ["Line feed"]
},
{
match: "^(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])(?:\\r\\n(?:\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5]))*$",
flags: "",
args: ["CRLF"]
},
]
},
"To Decimal": {
module: "Default",
description: "Converts the input data to an ordinal integer array.Hello becomes 72 101 108 108 111",
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Delimiter",
type: "option",
value: "ByteRepr.DELIM_OPTIONS"
}
]
},
"From Hexdump": {
module: "Default",
description: "Attempts to convert a hexdump back into raw data. This operation supports many different hexdump variations, but probably not all. Make sure you verify that the data it gives you is correct before continuing analysis.",
highlight: "func",
highlightReverse: "func",
inputType: "string",
outputType: "byteArray",
args: [],
patterns: [
{
match: "^(?:(?:[\\dA-F]{4,16}:?)?\\s*((?:[\\dA-F]{2}\\s){1,8}(?:\\s|[\\dA-F]{2}-)(?:[\\dA-F]{2}\\s){1,8}|(?:[\\dA-F]{2}\\s|[\\dA-F]{4}\\s)+)[^\\n]*\\n?)+$",
flags: "i",
args: []
},
]
},
"To Hexdump": {
module: "Default",
description: "Creates a hexdump of the input data, displaying both the hexadecimal values of each byte and an ASCII representation alongside.",
highlight: "func",
highlightReverse: "func",
inputType: "ArrayBuffer",
outputType: "string",
args: [
{
name: "Width",
type: "number",
value: "Hexdump.WIDTH"
},
{
name: "Upper case hex",
type: "boolean",
value: "Hexdump.UPPER_CASE"
},
{
name: "Include final length",
type: "boolean",
value: "Hexdump.INCLUDE_FINAL_LENGTH"
}
]
},
"From Base": {
module: "Default",
description: "Converts a number to decimal from a given numerical base.",
inputType: "string",
outputType: "BigNumber",
args: [
{
name: "Radix",
type: "number",
value: "Base.DEFAULT_RADIX"
}
]
},
"To Base": {
module: "Default",
description: "Converts a decimal number to a given numerical base.",
inputType: "BigNumber",
outputType: "string",
args: [
{
name: "Radix",
type: "number",
value: "Base.DEFAULT_RADIX"
}
]
},
"From HTML Entity": {
module: "Default",
description: "Converts HTML entities back to characters& becomes &", // tags required to stop the browser just printing &
inputType: "string",
outputType: "string",
args: [],
patterns: [
{
match: "&(?:#\\d{2,3}|#x[\\da-f]{2}|[a-z]{2,6});",
flags: "i",
args: []
},
]
},
"To HTML Entity": {
module: "Default",
description: "Converts characters to HTML entities& becomes &", // tags required to stop the browser just printing &
inputType: "string",
outputType: "string",
args: [
{
name: "Convert all characters",
type: "boolean",
value: "HTML.CONVERT_ALL"
},
{
name: "Convert to",
type: "option",
value: "HTML.CONVERT_OPTIONS"
}
]
},
"Strip HTML tags": {
module: "Default",
description: "Removes all HTML tags from the input.",
inputType: "string",
outputType: "string",
args: [
{
name: "Remove indentation",
type: "boolean",
value: "HTML.REMOVE_INDENTATION"
},
{
name: "Remove excess line breaks",
type: "boolean",
value: "HTML.REMOVE_LINE_BREAKS"
}
]
},
"URL Decode": {
module: "URL",
description: "Converts URI/URL percent-encoded characters back to their raw values.%3d becomes =",
inputType: "string",
outputType: "string",
args: [],
patterns: [
{
match: ".*(?:%[\\da-f]{2}.*){4}",
flags: "i",
args: []
},
]
},
"URL Encode": {
module: "URL",
description: "Encodes problematic characters into percent-encoding, a format supported by URIs/URLs.= becomes %3d",
inputType: "string",
outputType: "string",
args: [
{
name: "Encode all special chars",
type: "boolean",
value: "URL_.ENCODE_ALL"
}
]
},
"Parse URI": {
module: "URL",
description: "Pretty prints complicated Uniform Resource Identifier (URI) strings for ease of reading. Particularly useful for Uniform Resource Locators (URLs) with a lot of arguments.",
inputType: "string",
outputType: "string",
args: []
},
"Unescape Unicode Characters": {
module: "Default",
description: "Converts unicode-escaped character notation back into raw characters.\\u%uU+\\u03c3\\u03bf\\u03c5 becomes σου",
inputType: "string",
outputType: "string",
args: [
{
name: "Prefix",
type: "option",
value: "Unicode.PREFIXES"
}
]
},
"Escape Unicode Characters": {
module: "Default",
description: "Converts characters to their unicode-escaped notations.\\u%uU+σου becomes \\u03C3\\u03BF\\u03C5",
inputType: "string",
outputType: "string",
args: [
{
name: "Prefix",
type: "option",
value: "Unicode.PREFIXES"
},
{
name: "Encode all chars",
type: "boolean",
value: false
},
{
name: "Padding",
type: "number",
value: 4
},
{
name: "Uppercase hex",
type: "boolean",
value: true
}
],
patterns: [
{
match: "\\\\u(?:[\\da-f]{4,6})",
flags: "i",
args: ["\\u"]
},
{
match: "%u(?:[\\da-f]{4,6})",
flags: "i",
args: ["%u"]
},
{
match: "U\\+(?:[\\da-f]{4,6})",
flags: "i",
args: ["U+"]
},
]
},
"From Quoted Printable": {
module: "Default",
description: "Converts QP-encoded text back to standard text.",
inputType: "string",
outputType: "byteArray",
args: [],
patterns: [
{
match: "^[\\x21-\\x3d\\x3f-\\x7e \\t]*(?:=[\\da-f]{2}|=\\r?\\n)(?:[\\x21-\\x3d\\x3f-\\x7e \\t]|=[\\da-f]{2}|=\\r?\\n)*$",
flags: "i",
args: []
},
]
},
"To Quoted Printable": {
module: "Default",
description: "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.mnchen-3ya decodes to münchen",
inputType: "string",
outputType: "string",
args: [
{
name: "Internationalised domain name",
type: "boolean",
value: "Punycode.IDN"
}
]
},
"To Punycode": {
module: "Encodings",
description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.münchen encodes to mnchen-3ya",
inputType: "string",
outputType: "string",
args: [
{
name: "Internationalised domain name",
type: "boolean",
value: "Punycode.IDN"
}
]
},
"From Hex Content": {
module: "Default",
description: "Translates hexadecimal bytes in text back to raw bytes.foo|3d|bar becomes foo=bar.",
inputType: "string",
outputType: "byteArray",
args: []
},
"To Hex Content": {
module: "Default",
description: "Converts special characters in a string to hexadecimal.foo=bar becomes foo|3d|bar.",
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Convert",
type: "option",
value: "ByteRepr.HEX_CONTENT_CONVERT_WHICH"
},
{
name: "Print spaces between bytes",
type: "boolean",
value: "ByteRepr.HEX_CONTENT_SPACES_BETWEEN_BYTES"
},
]
},
"Change IP format": {
module: "JSBN",
description: "Convert an IP address from one format to another, e.g. 172.20.23.54 to ac141736",
inputType: "string",
outputType: "string",
args: [
{
name: "Input format",
type: "option",
value: "IP.IP_FORMAT_LIST"
},
{
name: "Output format",
type: "option",
value: "IP.IP_FORMAT_LIST"
}
]
},
"Parse IP range": {
module: "JSBN",
description: "Given a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0), this operation provides network information and enumerates all IP addresses in the range.crypto.getRandomValues() method if available. If this cannot be found, it falls back to a Fortuna-based PRNG algorithm.",
inputType: "string",
outputType: "string",
args: [
{
name: "Number of bytes",
type: "number",
value: "Cipher.PRNG_BYTES"
},
{
name: "Output as",
type: "option",
value: "Cipher.PRNG_OUTPUT"
}
]
},
"Derive PBKDF2 key": {
module: "Ciphers",
description: "PBKDF2 is a password-based key derivation function. It is part of RSA Laboratories' Public-Key Cryptography Standards (PKCS) series, specifically PKCS #5 v2.0, also published as Internet Engineering Task Force's RFC 2898.(ax + b) % 26, and converted back to a letter.",
highlight: true,
highlightReverse: true,
inputType: "string",
outputType: "string",
args: [
{
name: "a",
type: "number",
value: "Cipher.AFFINE_A"
},
{
name: "b",
type: "number",
value: "Cipher.AFFINE_B"
}
]
},
"Affine Cipher Decode": {
module: "Ciphers",
description: "The Affine cipher is a type of monoalphabetic substitution cipher. To decrypt, each letter in an alphabet is mapped to its numeric equivalent, decrypted by a mathematical function, and converted back to a letter.",
highlight: true,
highlightReverse: true,
inputType: "string",
outputType: "string",
args: [
{
name: "a",
type: "number",
value: "Cipher.AFFINE_A"
},
{
name: "b",
type: "number",
value: "Cipher.AFFINE_B"
}
]
},
"Atbash Cipher": {
module: "Ciphers",
description: "Atbash is a mono-alphabetic substitution cipher originally used to encode the Hebrew alphabet. It has been modified here for use with the Latin alphabet.",
highlight: true,
highlightReverse: true,
inputType: "string",
outputType: "string",
args: []
},
"Rotate right": {
module: "Default",
description: "Rotates each byte to the right by the number of bits specified, optionally carrying the excess bits over to the next byte. Currently only supports 8-bit values.",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Amount",
type: "number",
value: "Rotate.ROTATE_AMOUNT"
},
{
name: "Carry through",
type: "boolean",
value: "Rotate.ROTATE_CARRY"
}
]
},
"Rotate left": {
module: "Default",
description: "Rotates each byte to the left by the number of bits specified, optionally carrying the excess bits over to the next byte. Currently only supports 8-bit values.",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Amount",
type: "number",
value: "Rotate.ROTATE_AMOUNT"
},
{
name: "Carry through",
type: "boolean",
value: "Rotate.ROTATE_CARRY"
}
]
},
"ROT13": {
module: "Default",
description: "A simple caesar substitution cipher which rotates alphabet characters by the specified amount (default 13).",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Rotate lower case chars",
type: "boolean",
value: "Rotate.ROT13_LOWERCASE"
},
{
name: "Rotate upper case chars",
type: "boolean",
value: "Rotate.ROT13_UPPERCASE"
},
{
name: "Amount",
type: "number",
value: "Rotate.ROT13_AMOUNT"
},
]
},
"ROT47": {
module: "Default",
description: "A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",
highlight: true,
highlightReverse: true,
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "Amount",
type: "number",
value: "Rotate.ROT47_AMOUNT"
},
]
},
"Strip HTTP headers": {
module: "HTTP",
description: "Removes HTTP headers from a request or response by looking for the first instance of a double newline.",
inputType: "string",
outputType: "string",
args: []
},
"Parse User Agent": {
module: "HTTP",
description: "Attempts to identify and categorise information contained in a user-agent string.",
inputType: "string",
outputType: "string",
args: []
},
"Format MAC addresses": {
module: "Default",
description: "Displays given MAC addresses in multiple different formats.0x00) from the input.",
inputType: "byteArray",
outputType: "byteArray",
args: []
},
"Drop bytes": {
module: "Default",
description: "Cuts a slice of the specified number of bytes out of the data.",
inputType: "ArrayBuffer",
outputType: "ArrayBuffer",
args: [
{
name: "Start",
type: "number",
value: "Tidy.DROP_START"
},
{
name: "Length",
type: "number",
value: "Tidy.DROP_LENGTH"
},
{
name: "Apply to each line",
type: "boolean",
value: "Tidy.APPLY_TO_EACH_LINE"
}
]
},
"Take bytes": {
module: "Default",
description: "Takes a slice of the specified number of bytes from the data.",
inputType: "ArrayBuffer",
outputType: "ArrayBuffer",
args: [
{
name: "Start",
type: "number",
value: "Tidy.TAKE_START"
},
{
name: "Length",
type: "number",
value: "Tidy.TAKE_LENGTH"
},
{
name: "Apply to each line",
type: "boolean",
value: "Tidy.APPLY_TO_EACH_LINE"
}
]
},
"Pad lines": {
module: "Default",
description: "Add the specified number of the specified character to the beginning or end of each line",
inputType: "string",
outputType: "string",
args: [
{
name: "Position",
type: "option",
value: "Tidy.PAD_POSITION"
},
{
name: "Length",
type: "number",
value: "Tidy.PAD_LENGTH"
},
{
name: "Character",
type: "binaryShortString",
value: "Tidy.PAD_CHAR"
}
]
},
"Reverse": {
module: "Default",
description: "Reverses the input string.",
inputType: "byteArray",
outputType: "byteArray",
args: [
{
name: "By",
type: "option",
value: "SeqUtils.REVERSE_BY"
}
]
},
"Sort": {
module: "Default",
description: "Alphabetically sorts strings separated by the specified delimiter.710.65.0.456, this will match 10.65.0.45 so always check the original input!",
inputType: "string",
outputType: "string",
args: [
{
name: "IPv4",
type: "boolean",
value: "Extract.INCLUDE_IPV4"
},
{
name: "IPv6",
type: "boolean",
value: "Extract.INCLUDE_IPV6"
},
{
name: "Remove local IPv4 addresses",
type: "boolean",
value: "Extract.REMOVE_LOCAL"
},
{
name: "Display total",
type: "boolean",
value: "Extract.DISPLAY_TOTAL"
}
]
},
"Extract email addresses": {
module: "Regex",
description: "Extracts all email addresses from the input.",
inputType: "string",
outputType: "string",
args: [
{
name: "Display total",
type: "boolean",
value: "Extract.DISPLAY_TOTAL"
}
]
},
"Extract MAC addresses": {
module: "Regex",
description: "Extracts all Media Access Control (MAC) addresses from the input.",
inputType: "string",
outputType: "string",
args: [
{
name: "Display total",
type: "boolean",
value: "Extract.DISPLAY_TOTAL"
}
]
},
"Extract URLs": {
module: "Regex",
description: "Extracts Uniform Resource Locators (URLs) from the input. The protocol (http, ftp etc.) is required otherwise there will be far too many false positives.",
inputType: "string",
outputType: "string",
args: [
{
name: "Display total",
type: "boolean",
value: "Extract.DISPLAY_TOTAL"
}
]
},
"Extract domains": {
module: "Regex",
description: "Extracts domain names.yyyy-mm-dddd/mm/yyyymm/dd/yyyy\\p{} categories and scripts as well as astral codes) and recursive matching.",
inputType: "string",
outputType: "html",
args: [
{
name: "Built in regexes",
type: "populateOption",
value: "Regex.REGEX_PRE_POPULATE",
target: 1,
},
{
name: "Regex",
type: "text",
value: ""
},
{
name: "Case insensitive",
type: "boolean",
value: true
},
{
name: "^ and $ match at newlines",
type: "boolean",
value: true
},
{
name: "Dot matches all",
type: "boolean",
value: false
},
{
name: "Unicode support",
type: "boolean",
value: false
},
{
name: "Astral support",
type: "boolean",
value: false
},
{
name: "Display total",
type: "boolean",
value: "Regex.DISPLAY_TOTAL"
},
{
name: "Output format",
type: "option",
value: "Regex.OUTPUT_FORMAT"
},
]
},
"XPath expression": {
module: "Code",
description: "Extract information from an XML document with an XPath query",
inputType: "string",
outputType: "string",
args: [
{
name: "XPath",
type: "string",
value: "Code.XPATH_INITIAL"
},
{
name: "Result delimiter",
type: "binaryShortString",
value: "Code.XPATH_DELIMITER"
}
]
},
"JPath expression": {
module: "Code",
description: "Extract information from a JSON object with a JPath query.",
inputType: "string",
outputType: "string",
args: [
{
name: "Query",
type: "string",
value: "Code.JPATH_INITIAL"
},
{
name: "Result delimiter",
type: "binaryShortString",
value: "Code.JPATH_DELIMITER"
}
]
},
"CSS selector": {
module: "Code",
description: "Extract information from an HTML document with a CSS selector",
inputType: "string",
outputType: "string",
args: [
{
name: "CSS selector",
type: "string",
value: "Code.CSS_SELECTOR_INITIAL"
},
{
name: "Delimiter",
type: "binaryShortString",
value: "Code.CSS_QUERY_DELIMITER"
},
]
},
"From UNIX Timestamp": {
module: "Default",
description: "Converts a UNIX timestamp to a datetime string.978346800 becomes Mon 1 January 2001 11:00:00 UTCMon 1 January 2001 11:00:00 becomes 978346800a-z becomes abcdefghijklmnopqrstuvwxyz.",
inputType: "string",
outputType: "string",
args: [
{
name: "Delimiter",
type: "binaryString",
value: ""
}
]
},
"Diff": {
module: "Diff",
description: "Compares two inputs (separated by the specified delimiter) and highlights the differences between them.",
inputType: "string",
outputType: "html",
args: [
{
name: "Sample delimiter",
type: "binaryString",
value: "Diff.DIFF_SAMPLE_DELIMITER"
},
{
name: "Diff by",
type: "option",
value: "Diff.DIFF_BY"
},
{
name: "Show added",
type: "boolean",
value: true
},
{
name: "Show removed",
type: "boolean",
value: true
},
{
name: "Ignore whitespace (relevant for word and line)",
type: "boolean",
value: false
}
]
},
"Parse UNIX file permissions": {
module: "Default",
description: "Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.755) or textual (e.g. drwxr-xr-x) format.",
inputType: "string",
outputType: "string",
args: []
},
"Swap endianness": {
module: "Default",
description: "Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.",
highlight: true,
highlightReverse: true,
inputType: "string",
outputType: "string",
args: [
{
name: "Data format",
type: "option",
value: "Endian.DATA_FORMAT"
},
{
name: "Word length (bytes)",
type: "number",
value: "Endian.WORD_LENGTH"
},
{
name: "Pad incomplete words",
type: "boolean",
value: "Endian.PAD_INCOMPLETE_WORDS"
}
]
},
"Microsoft Script Decoder": {
module: "Default",
description: "Decodes Microsoft Encoded Script files that have been encoded with Microsoft's custom encoding. These are often VBS (Visual Basic Script) files that are encoded and renamed with a '.vbe' extention or JS (JScript) files renamed with a '.jse' extention.#@~^RQAAAA==-mD~sX|:/TP{~J:+dYbxL~@!F@*@!+@*@!&@*eEI@#@&@#@&.jm.raY 214Wv:zms/obI0xEAAA==^#~@var my_msg = "Testing <1><2><3>!";\n\nVScript.Echo(my_msg);",
inputType: "string",
outputType: "string",
args: []
},
"Syntax highlighter": {
module: "Code",
description: "Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.",
highlight: true,
highlightReverse: true,
inputType: "string",
outputType: "html",
args: [
{
name: "Language",
type: "option",
value: "Code.LANGUAGES"
},
]
},
"TCP/IP Checksum": {
module: "Hashing",
description: "Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.",
inputType: "byteArray",
outputType: "string",
args: []
},
"Parse colour code": {
module: "Default",
description: "Converts a colour code in a standard format to other standard formats and displays the colour itself.#d9edf7rgba(217,237,247,1)hsla(200,65%,91%,1)cmyk(0.12, 0.04, 0.00, 0.03)window.crypto if available and falling back to Math.random if not.",
inputType: "string",
outputType: "string",
args: []
},
"Substitute": {
module: "Ciphers",
description: "A substitution cipher allowing you to specify bytes to replace with other byte values. This can be used to create Caesar ciphers but is more powerful as any byte value can be substituted, not just letters, and the substitution values need not be in order.\\n or \\x0a.0123456789 can be written as 0-9.",
inputType: "string",
outputType: "string",
args: [
{
name: "Plaintext",
type: "binaryString",
value: "Cipher.SUBS_PLAINTEXT"
},
{
name: "Ciphertext",
type: "binaryString",
value: "Cipher.SUBS_CIPHERTEXT"
}
]
},
"Escape string": {
module: "Default",
description: "Escapes special characters in a string so that they do not cause conflicts. For example, Don't stop me now becomes Don\\'t stop me now.\\n (Line feed/newline)\\r (Carriage return)\\t (Horizontal tab)\\b (Backspace)\\f (Form feed)\\xnn (Hex, where n is 0-f)\\\\ (Backslash)\\' (Single quote)\\" (Double quote)\\unnnn (Unicode character)\\u{nnnnnn} (Unicode code point)Don\\'t stop me now becomes Don't stop me now.\\n (Line feed/newline)\\r (Carriage return)\\t (Horizontal tab)\\b (Backspace)\\f (Form feed)\\xnn (Hex, where n is 0-f)\\\\ (Backslash)\\' (Single quote)\\" (Double quote)\\unnnn (Unicode character)\\u{nnnnnn} (Unicode code point)SOS becomes ... --- ...",
inputType: "string",
outputType: "string",
args: [
{
name: "Format options",
type: "option",
value: "MorseCode.FORMAT_OPTIONS"
},
{
name: "Letter delimiter",
type: "option",
value: "MorseCode.LETTER_DELIM_OPTIONS"
},
{
name: "Word delimiter",
type: "option",
value: "MorseCode.WORD_DELIM_OPTIONS"
}
]
},
"From Morse Code": {
module: "Default",
description: "Translates Morse Code into (upper case) alphanumeric characters.",
inputType: "string",
outputType: "string",
args: [
{
name: "Letter delimiter",
type: "option",
value: "MorseCode.LETTER_DELIM_OPTIONS"
},
{
name: "Word delimiter",
type: "option",
value: "MorseCode.WORD_DELIM_OPTIONS"
}
],
patterns: [
{
match: "(?:^[-. \\n]{5,}$|^[_. \\n]{5,}$|^(?:dash|dot| |\\n){5,}$)",
flags: "i",
args: ["Space", "Line feed"]
},
]
},
"Tar": {
module: "Compression",
description: "Packs the input into a tarball.Key: Value",
"object tags.a:2:{s:1:"a";i:10;i:0;a:1:{s:2:"ab";b:1;}}{"a": 10,0: {"ab": true}}