mirror of
https://github.com/gchq/CyberChef
synced 2025-12-16 00:04:20 +00:00
Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44c2b71e6c | ||
|
|
b806be3f49 | ||
|
|
2750284eea | ||
|
|
5366f1a2eb | ||
|
|
b459c15d74 | ||
|
|
8a02b35d7d | ||
|
|
d4441823aa | ||
|
|
13e9a4f0da | ||
|
|
33471a33d6 | ||
|
|
8e5aa2c393 | ||
|
|
d16bbe1e7e | ||
|
|
610d46a1a4 | ||
|
|
f7acef4642 | ||
|
|
fd5b6c5243 | ||
|
|
a8917e4713 | ||
|
|
7a4ebbf47e | ||
|
|
2e7ce477d7 | ||
|
|
c1a22ef639 | ||
|
|
0a7b78b7ee | ||
|
|
e1cb62848c | ||
|
|
acf5c733c2 | ||
|
|
7c25e29515 | ||
|
|
7c72871c02 | ||
|
|
ddb77c6ab3 | ||
|
|
8502fd246d | ||
|
|
30c6917914 | ||
|
|
33464b3388 | ||
|
|
2205637ad6 | ||
|
|
149198ef1c | ||
|
|
2c40353180 | ||
|
|
a62a6c2aa4 | ||
|
|
4be06f6779 | ||
|
|
03f4740968 | ||
|
|
ea6d80edfb | ||
|
|
68e8a221ff | ||
|
|
cce84c3782 | ||
|
|
c1878ca28b | ||
|
|
e9b7a43b9a | ||
|
|
3921b4f445 | ||
|
|
dfd4cca43f | ||
|
|
69c6c3e790 | ||
|
|
4541d75f49 | ||
|
|
9eda670026 | ||
|
|
d3c13b118d | ||
|
|
8e2345cf9e | ||
|
|
d240d65c5f | ||
|
|
d3473a7462 | ||
|
|
6bfe4ee238 | ||
|
|
e61b7d598e | ||
|
|
eb81b9217e | ||
|
|
4d9bfcad20 | ||
|
|
2387452a56 | ||
|
|
a4772941a7 | ||
|
|
6318f78e29 | ||
|
|
5e6f3cc5b4 | ||
|
|
04f1fa06ad | ||
|
|
8d660e53b2 | ||
|
|
f3864b00fe | ||
|
|
51cc94bf2a | ||
|
|
f63d1354ba | ||
|
|
80362cfa84 | ||
|
|
447a6d7524 | ||
|
|
f022440b4a | ||
|
|
4f5e0c007d | ||
|
|
b83f6591bb | ||
|
|
77a9481cf9 |
@@ -47,6 +47,7 @@
|
||||
"block-spacing": "error",
|
||||
"array-bracket-spacing": "error",
|
||||
"comma-spacing": "error",
|
||||
"spaced-comment": ["error", "always", { "exceptions": ["/"] } ],
|
||||
"comma-style": "error",
|
||||
"computed-property-spacing": "error",
|
||||
"no-trailing-spaces": "warn",
|
||||
|
||||
114
Gruntfile.js
114
Gruntfile.js
@@ -26,7 +26,7 @@ module.exports = function (grunt) {
|
||||
grunt.registerTask("prod",
|
||||
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
||||
[
|
||||
"eslint", "clean:prod", "clean:config", "exec:generateConfig", "webpack:web",
|
||||
"eslint", "clean:prod", "clean:config", "exec:generateConfig", "findModules", "webpack:web",
|
||||
"copy:standalone", "zip:standalone", "clean:standalone", "chmod"
|
||||
]);
|
||||
|
||||
@@ -58,6 +58,19 @@ module.exports = function (grunt) {
|
||||
grunt.registerTask("tests", "test");
|
||||
grunt.registerTask("lint", "eslint");
|
||||
|
||||
grunt.registerTask("findModules",
|
||||
"Finds all generated modules and updates the entry point list for Webpack",
|
||||
function(arg1, arg2) {
|
||||
const moduleEntryPoints = listEntryModules();
|
||||
|
||||
grunt.log.writeln(`Found ${Object.keys(moduleEntryPoints).length} modules.`);
|
||||
|
||||
grunt.config.set("webpack.web.entry",
|
||||
Object.assign({
|
||||
main: "./src/web/index.js"
|
||||
}, moduleEntryPoints));
|
||||
});
|
||||
|
||||
|
||||
// Load tasks provided by each plugin
|
||||
grunt.loadNpmTasks("grunt-eslint");
|
||||
@@ -83,7 +96,53 @@ module.exports = function (grunt) {
|
||||
PKG_VERSION: JSON.stringify(pkg.version),
|
||||
},
|
||||
moduleEntryPoints = listEntryModules(),
|
||||
nodeConsumerTestPath = "~/tmp-cyberchef";
|
||||
nodeConsumerTestPath = "~/tmp-cyberchef",
|
||||
/**
|
||||
* Configuration for Webpack production build. Defined as a function so that it
|
||||
* can be recalculated when new modules are generated.
|
||||
*/
|
||||
webpackProdConf = () => {
|
||||
return {
|
||||
mode: "production",
|
||||
target: "web",
|
||||
entry: Object.assign({
|
||||
main: "./src/web/index.js"
|
||||
}, moduleEntryPoints),
|
||||
output: {
|
||||
path: __dirname + "/build/prod",
|
||||
filename: chunkData => {
|
||||
return chunkData.chunk.name === "main" ? "assets/[name].js": "[name].js";
|
||||
},
|
||||
globalObject: "this"
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin(BUILD_CONSTANTS),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: "index.html",
|
||||
template: "./src/web/html/index.html",
|
||||
chunks: ["main"],
|
||||
compileTime: compileTime,
|
||||
version: pkg.version,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
minifyJS: true,
|
||||
minifyCSS: true
|
||||
}
|
||||
}),
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: "static",
|
||||
reportFilename: "BundleAnalyzerReport.html",
|
||||
openAnalyzer: false
|
||||
}),
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -154,48 +213,7 @@ module.exports = function (grunt) {
|
||||
},
|
||||
webpack: {
|
||||
options: webpackConfig,
|
||||
web: () => {
|
||||
return {
|
||||
mode: "production",
|
||||
target: "web",
|
||||
entry: Object.assign({
|
||||
main: "./src/web/index.js"
|
||||
}, moduleEntryPoints),
|
||||
output: {
|
||||
path: __dirname + "/build/prod",
|
||||
filename: chunkData => {
|
||||
return chunkData.chunk.name === "main" ? "assets/[name].js": "[name].js";
|
||||
},
|
||||
globalObject: "this"
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin(BUILD_CONSTANTS),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: "index.html",
|
||||
template: "./src/web/html/index.html",
|
||||
chunks: ["main"],
|
||||
compileTime: compileTime,
|
||||
version: pkg.version,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
minifyJS: true,
|
||||
minifyCSS: true
|
||||
}
|
||||
}),
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: "static",
|
||||
reportFilename: "BundleAnalyzerReport.html",
|
||||
openAnalyzer: false
|
||||
}),
|
||||
]
|
||||
};
|
||||
},
|
||||
web: webpackProdConf(),
|
||||
},
|
||||
"webpack-dev-server": {
|
||||
options: {
|
||||
@@ -345,7 +363,8 @@ module.exports = function (grunt) {
|
||||
command: "git gc --prune=now --aggressive"
|
||||
},
|
||||
sitemap: {
|
||||
command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml"
|
||||
command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml",
|
||||
sync: true
|
||||
},
|
||||
generateConfig: {
|
||||
command: chainCommands([
|
||||
@@ -354,7 +373,8 @@ module.exports = function (grunt) {
|
||||
"node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs",
|
||||
"node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs",
|
||||
"echo '--- Config scripts finished. ---\n'"
|
||||
])
|
||||
]),
|
||||
sync: true
|
||||
},
|
||||
generateNodeIndex: {
|
||||
command: chainCommands([
|
||||
@@ -362,6 +382,7 @@ module.exports = function (grunt) {
|
||||
"node --experimental-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs",
|
||||
"echo '--- Node index generated. ---\n'"
|
||||
]),
|
||||
sync: true
|
||||
},
|
||||
opTests: {
|
||||
command: "node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs"
|
||||
@@ -381,6 +402,7 @@ module.exports = function (grunt) {
|
||||
`cd ${nodeConsumerTestPath}`,
|
||||
"npm link cyberchef"
|
||||
]),
|
||||
sync: true
|
||||
},
|
||||
teardownNodeConsumers: {
|
||||
command: chainCommands([
|
||||
|
||||
3727
package-lock.json
generated
3727
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
62
package.json
62
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cyberchef",
|
||||
"version": "9.11.0",
|
||||
"version": "9.11.10",
|
||||
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
||||
"author": "n1474335 <n1474335@gmail.com>",
|
||||
"homepage": "https://gchq.github.io/CyberChef",
|
||||
@@ -36,18 +36,18 @@
|
||||
"node >= 10"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/plugin-transform-runtime": "^7.5.5",
|
||||
"@babel/preset-env": "^7.5.5",
|
||||
"autoprefixer": "^9.6.1",
|
||||
"@babel/core": "^7.7.2",
|
||||
"@babel/plugin-transform-runtime": "^7.6.2",
|
||||
"@babel/preset-env": "^7.7.1",
|
||||
"autoprefixer": "^9.7.2",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-loader": "^8.0.6",
|
||||
"babel-plugin-dynamic-import-node": "^2.3.0",
|
||||
"chromedriver": "^77.0.0",
|
||||
"colors": "^1.3.3",
|
||||
"copy-webpack-plugin": "^5.0.4",
|
||||
"chromedriver": "^78.0.1",
|
||||
"colors": "^1.4.0",
|
||||
"copy-webpack-plugin": "^5.0.5",
|
||||
"css-loader": "^3.2.0",
|
||||
"eslint": "^6.2.2",
|
||||
"eslint": "^6.6.0",
|
||||
"exports-loader": "^0.7.0",
|
||||
"file-loader": "^4.2.0",
|
||||
"grunt": "^1.0.4",
|
||||
@@ -55,7 +55,7 @@
|
||||
"grunt-chmod": "~1.1.1",
|
||||
"grunt-concurrent": "^3.0.0",
|
||||
"grunt-contrib-clean": "~2.0.0",
|
||||
"grunt-contrib-connect": "^2.0.0",
|
||||
"grunt-contrib-connect": "^2.1.0",
|
||||
"grunt-contrib-copy": "~1.0.0",
|
||||
"grunt-contrib-watch": "^1.1.0",
|
||||
"grunt-eslint": "^22.0.0",
|
||||
@@ -65,26 +65,26 @@
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"imports-loader": "^0.8.0",
|
||||
"mini-css-extract-plugin": "^0.8.0",
|
||||
"nightwatch": "^1.2.1",
|
||||
"node-sass": "^4.12.0",
|
||||
"nightwatch": "^1.2.4",
|
||||
"node-sass": "^4.13.0",
|
||||
"postcss-css-variables": "^0.13.0",
|
||||
"postcss-import": "^12.0.1",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"prompt": "^1.0.0",
|
||||
"sass-loader": "^8.0.0",
|
||||
"sitemap": "^4.1.1",
|
||||
"sitemap": "^5.1.0",
|
||||
"style-loader": "^1.0.0",
|
||||
"svg-url-loader": "^3.0.1",
|
||||
"url-loader": "^2.1.0",
|
||||
"webpack": "^4.39.3",
|
||||
"webpack-bundle-analyzer": "^3.4.1",
|
||||
"webpack-dev-server": "^3.8.0",
|
||||
"svg-url-loader": "^3.0.2",
|
||||
"url-loader": "^2.2.0",
|
||||
"webpack": "^4.41.2",
|
||||
"webpack-bundle-analyzer": "^3.6.0",
|
||||
"webpack-dev-server": "^3.9.0",
|
||||
"webpack-node-externals": "^1.7.2",
|
||||
"worker-loader": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "^7.4.4",
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"@babel/polyfill": "^7.7.0",
|
||||
"@babel/runtime": "^7.7.2",
|
||||
"arrive": "^2.4.1",
|
||||
"avsc": "^5.4.16",
|
||||
"babel-plugin-transform-builtin-extend": "1.1.2",
|
||||
@@ -97,11 +97,11 @@
|
||||
"bson": "^4.0.2",
|
||||
"chi-squared": "^1.1.0",
|
||||
"codepage": "^1.14.0",
|
||||
"core-js": "^3.2.1",
|
||||
"core-js": "^3.4.1",
|
||||
"crypto-api": "^0.8.5",
|
||||
"crypto-js": "^3.1.9-1",
|
||||
"ctph.js": "0.0.5",
|
||||
"d3": "^5.11.0",
|
||||
"d3": "^5.14.2",
|
||||
"d3-hexbin": "^0.2.2",
|
||||
"diff": "^4.0.1",
|
||||
"es6-promisify": "^6.0.2",
|
||||
@@ -112,8 +112,8 @@
|
||||
"exif-parser": "^0.1.12",
|
||||
"file-saver": "^2.0.2",
|
||||
"geodesy": "^1.1.3",
|
||||
"highlight.js": "^9.15.10",
|
||||
"jimp": "^0.6.4",
|
||||
"highlight.js": "^9.16.2",
|
||||
"jimp": "^0.8.5",
|
||||
"jquery": "3.4.1",
|
||||
"js-crc": "^0.2.0",
|
||||
"js-sha3": "^0.8.0",
|
||||
@@ -122,27 +122,27 @@
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"jsqr": "^1.2.0",
|
||||
"jsrsasign": "8.0.12",
|
||||
"kbpgp": "2.1.3",
|
||||
"kbpgp": "2.1.6",
|
||||
"libbzip2-wasm": "0.0.4",
|
||||
"libyara-wasm": "^1.0.1",
|
||||
"lodash": "^4.17.15",
|
||||
"loglevel": "^1.6.3",
|
||||
"loglevel": "^1.6.6",
|
||||
"loglevel-message-prefix": "^3.0.0",
|
||||
"markdown-it": "^9.1.0",
|
||||
"markdown-it": "^10.0.0",
|
||||
"moment": "^2.24.0",
|
||||
"moment-timezone": "^0.5.26",
|
||||
"moment-timezone": "^0.5.27",
|
||||
"ngeohash": "^0.6.3",
|
||||
"node-forge": "^0.9.1",
|
||||
"node-md6": "^0.1.0",
|
||||
"nodom": "^2.2.0",
|
||||
"nodom": "^2.4.0",
|
||||
"notepack.io": "^2.2.0",
|
||||
"nwmatcher": "^1.4.4",
|
||||
"otp": "^0.1.3",
|
||||
"popper.js": "^1.15.0",
|
||||
"popper.js": "^1.16.0",
|
||||
"qr-image": "^3.2.0",
|
||||
"scryptsy": "^2.1.0",
|
||||
"snackbarjs": "^1.1.0",
|
||||
"sortablejs": "^1.9.0",
|
||||
"sortablejs": "^1.10.1",
|
||||
"split.js": "^1.5.11",
|
||||
"ssdeep.js": "0.0.2",
|
||||
"tesseract.js": "^2.0.0-alpha.15",
|
||||
|
||||
@@ -758,15 +758,15 @@ class Utils {
|
||||
"%7E": "~",
|
||||
"%21": "!",
|
||||
"%24": "$",
|
||||
//"%26": "&",
|
||||
// "%26": "&",
|
||||
"%27": "'",
|
||||
"%28": "(",
|
||||
"%29": ")",
|
||||
"%2A": "*",
|
||||
//"%2B": "+",
|
||||
// "%2B": "+",
|
||||
"%2C": ",",
|
||||
"%3B": ";",
|
||||
//"%3D": "=",
|
||||
// "%3D": "=",
|
||||
"%3A": ":",
|
||||
"%40": "@",
|
||||
"%2F": "/",
|
||||
@@ -1335,14 +1335,14 @@ export function debounce(func, wait, id, scope, args) {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
|
||||
if (!String.prototype.padStart) {
|
||||
String.prototype.padStart = function padStart(targetLength, padString) {
|
||||
targetLength = targetLength>>0; //floor if number or convert non-number to 0;
|
||||
targetLength = targetLength>>0; // floor if number or convert non-number to 0;
|
||||
padString = String((typeof padString !== "undefined" ? padString : " "));
|
||||
if (this.length > targetLength) {
|
||||
return String(this);
|
||||
} else {
|
||||
targetLength = targetLength-this.length;
|
||||
if (targetLength > padString.length) {
|
||||
padString += padString.repeat(targetLength/padString.length); //append to original to ensure we are longer than needed
|
||||
padString += padString.repeat(targetLength/padString.length); // append to original to ensure we are longer than needed
|
||||
}
|
||||
return padString.slice(0, targetLength) + String(this);
|
||||
}
|
||||
@@ -1354,14 +1354,14 @@ if (!String.prototype.padStart) {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd
|
||||
if (!String.prototype.padEnd) {
|
||||
String.prototype.padEnd = function padEnd(targetLength, padString) {
|
||||
targetLength = targetLength>>0; //floor if number or convert non-number to 0;
|
||||
targetLength = targetLength>>0; // floor if number or convert non-number to 0;
|
||||
padString = String((typeof padString !== "undefined" ? padString : " "));
|
||||
if (this.length > targetLength) {
|
||||
return String(this);
|
||||
} else {
|
||||
targetLength = targetLength-this.length;
|
||||
if (targetLength > padString.length) {
|
||||
padString += padString.repeat(targetLength/padString.length); //append to original to ensure we are longer than needed
|
||||
padString += padString.repeat(targetLength/padString.length); // append to original to ensure we are longer than needed
|
||||
}
|
||||
return String(this) + padString.slice(0, targetLength);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import prompt from "prompt";
|
||||
import colors from "colors";
|
||||
@@ -208,7 +208,7 @@ ${result.highlight ? `
|
||||
export default ${moduleName};
|
||||
`;
|
||||
|
||||
//console.log(template);
|
||||
// console.log(template);
|
||||
|
||||
const filename = path.join(dir, `./${moduleName}.mjs`);
|
||||
if (fs.existsSync(filename)) {
|
||||
|
||||
@@ -20,7 +20,7 @@ export const ALPHABET_OPTIONS = [
|
||||
},
|
||||
{
|
||||
name: "IPv6",
|
||||
value: "0-9A-Za-z!#$%&()*+\\-;<=>?@^_`{|~}",
|
||||
value: "0-9A-Za-z!#$%&()*+\\-;<=>?@^_`{|}~",
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export const FILE_SIGNATURES = {
|
||||
4: [0x37, 0x39], // 7|9
|
||||
5: 0x61 // a
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractGIF
|
||||
},
|
||||
{
|
||||
name: "Portable Network Graphics image",
|
||||
@@ -736,7 +736,7 @@ export const FILE_SIGNATURES = {
|
||||
10: 0x56,
|
||||
11: 0x45
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractWAV
|
||||
},
|
||||
{
|
||||
name: "OGG audio",
|
||||
@@ -1282,17 +1282,30 @@ export const FILE_SIGNATURES = {
|
||||
extension: "dylib",
|
||||
mime: "application/octet-stream",
|
||||
description: "",
|
||||
signature: {
|
||||
0: 0xca,
|
||||
1: 0xfe,
|
||||
2: 0xba,
|
||||
3: 0xbe,
|
||||
4: 0x00,
|
||||
5: 0x00,
|
||||
6: 0x00,
|
||||
7: [0x01, 0x02, 0x03]
|
||||
},
|
||||
extractor: null
|
||||
signature: [
|
||||
{
|
||||
0: 0xca,
|
||||
1: 0xfe,
|
||||
2: 0xba,
|
||||
3: 0xbe,
|
||||
4: 0x00,
|
||||
5: 0x00,
|
||||
6: 0x00,
|
||||
7: [0x01, 0x02, 0x03]
|
||||
},
|
||||
{
|
||||
0: 0xce,
|
||||
1: 0xfa,
|
||||
2: 0xed,
|
||||
3: 0xfe,
|
||||
4: 0x07,
|
||||
5: 0x00,
|
||||
6: 0x00,
|
||||
7: 0x00,
|
||||
8: [0x01, 0x02, 0x03]
|
||||
}
|
||||
],
|
||||
extractor: extractMACHO
|
||||
},
|
||||
{
|
||||
name: "MacOS Mach-O 64-bit object",
|
||||
@@ -1305,7 +1318,7 @@ export const FILE_SIGNATURES = {
|
||||
2: 0xed,
|
||||
3: 0xfe
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractMACHO
|
||||
},
|
||||
{
|
||||
name: "Adobe Flash",
|
||||
@@ -1404,7 +1417,7 @@ export const FILE_SIGNATURES = {
|
||||
260: 0x61,
|
||||
261: 0x72
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractTAR
|
||||
},
|
||||
{
|
||||
name: "Roshal Archive",
|
||||
@@ -1444,7 +1457,7 @@ export const FILE_SIGNATURES = {
|
||||
1: 0x5a,
|
||||
2: 0x68
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractBZIP2
|
||||
},
|
||||
{
|
||||
name: "7zip",
|
||||
@@ -1485,7 +1498,7 @@ export const FILE_SIGNATURES = {
|
||||
4: 0x5a,
|
||||
5: 0x0
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractXZ
|
||||
},
|
||||
{
|
||||
name: "Tarball",
|
||||
@@ -1870,7 +1883,7 @@ export const FILE_SIGNATURES = {
|
||||
2: 0x4c,
|
||||
3: 0x69
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractSQLITE
|
||||
},
|
||||
{
|
||||
name: "BitTorrent link",
|
||||
@@ -1993,7 +2006,7 @@ export const FILE_SIGNATURES = {
|
||||
6: 0x4c,
|
||||
7: 0x65
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractEVT
|
||||
},
|
||||
{
|
||||
name: "Windows Event Log",
|
||||
@@ -2009,7 +2022,7 @@ export const FILE_SIGNATURES = {
|
||||
5: 0x6c,
|
||||
6: 0x65
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractEVTX
|
||||
},
|
||||
{
|
||||
name: "Windows Pagedump",
|
||||
@@ -2331,6 +2344,133 @@ export const FILE_SIGNATURES = {
|
||||
19: 0x46
|
||||
},
|
||||
extractor: null
|
||||
},
|
||||
{
|
||||
name: "Bash",
|
||||
extension: "bash",
|
||||
mime: "application/bash",
|
||||
description: "",
|
||||
signature: {
|
||||
0: 0x23, // #!/bin/bash
|
||||
1: 0x21,
|
||||
2: 0x2f,
|
||||
3: 0x62,
|
||||
4: 0x69,
|
||||
5: 0x6e,
|
||||
6: 0x2f,
|
||||
7: 0x62,
|
||||
8: 0x61,
|
||||
9: 0x73,
|
||||
10: 0x68,
|
||||
},
|
||||
extractor: null
|
||||
},
|
||||
{
|
||||
name: "Shell",
|
||||
extension: "sh",
|
||||
mime: "application/sh",
|
||||
description: "",
|
||||
signature: {
|
||||
0: 0x23, // #!/bin/sh
|
||||
1: 0x21,
|
||||
2: 0x2f,
|
||||
3: 0x62,
|
||||
4: 0x69,
|
||||
5: 0x6e,
|
||||
6: 0x2f,
|
||||
7: 0x73,
|
||||
8: 0x68,
|
||||
},
|
||||
extractor: null
|
||||
},
|
||||
{
|
||||
name: "Python",
|
||||
extension: "py,pyc,pyd,pyo,pyw,pyz",
|
||||
mime: "application/python",
|
||||
description: "",
|
||||
signature: {
|
||||
0: 0x23, // #!/usr/bin/python(2|3)
|
||||
1: 0x21,
|
||||
2: 0x2f,
|
||||
3: 0x75,
|
||||
4: 0x73,
|
||||
5: 0x72,
|
||||
6: 0x2f,
|
||||
7: 0x62,
|
||||
8: 0x69,
|
||||
9: 0x6e,
|
||||
10: 0x2f,
|
||||
11: 0x70,
|
||||
12: 0x79,
|
||||
13: 0x74,
|
||||
14: 0x68,
|
||||
15: 0x6f,
|
||||
16: 0x6e,
|
||||
17: [0x32, 0x33, 0xa, 0xd],
|
||||
},
|
||||
extractor: null
|
||||
},
|
||||
{
|
||||
name: "Ruby",
|
||||
extension: "rb",
|
||||
mime: "application/ruby",
|
||||
description: "",
|
||||
signature: {
|
||||
0: 0x23, // #!/usr/bin/ruby
|
||||
1: 0x21,
|
||||
2: 0x2f,
|
||||
3: 0x75,
|
||||
4: 0x73,
|
||||
5: 0x72,
|
||||
6: 0x2f,
|
||||
7: 0x62,
|
||||
8: 0x69,
|
||||
9: 0x6e,
|
||||
10: 0x2f,
|
||||
11: 0x72,
|
||||
12: 0x75,
|
||||
13: 0x62,
|
||||
14: 0x79,
|
||||
},
|
||||
extractor: null
|
||||
},
|
||||
{
|
||||
name: "perl",
|
||||
extension: "pl,pm,t,pod",
|
||||
mime: "application/perl",
|
||||
description: "",
|
||||
signature: {
|
||||
0: 0x23, // #!/usr/bin/perl
|
||||
1: 0x21,
|
||||
2: 0x2f,
|
||||
3: 0x75,
|
||||
4: 0x73,
|
||||
5: 0x72,
|
||||
6: 0x2f,
|
||||
7: 0x62,
|
||||
8: 0x69,
|
||||
9: 0x6e,
|
||||
10: 0x2f,
|
||||
11: 0x70,
|
||||
12: 0x65,
|
||||
13: 0x72,
|
||||
14: 0x6c,
|
||||
},
|
||||
extractor: null
|
||||
},
|
||||
{
|
||||
name: "php",
|
||||
extension: "php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",
|
||||
mime: "application/php",
|
||||
description: "",
|
||||
signature: {
|
||||
0: 0x3c, // <?php
|
||||
1: 0x3f,
|
||||
2: 0x70,
|
||||
3: 0x68,
|
||||
4: 0x70,
|
||||
},
|
||||
extractor: null
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -2440,6 +2580,49 @@ export function extractJPEG(bytes, offset) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GIF extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractGIF(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
|
||||
// Move to application extension block.
|
||||
stream.continueUntil([0x21, 0xff]);
|
||||
|
||||
// Move to Graphic Control Extension for frame #1.
|
||||
stream.continueUntil([0x21, 0xf9]);
|
||||
stream.moveForwardsBy(2);
|
||||
|
||||
while (stream.hasMore()) {
|
||||
// Move to Image descriptor.
|
||||
stream.moveForwardsBy(stream.readInt(1) + 1);
|
||||
|
||||
// Move past Image descriptor to the image data.
|
||||
stream.moveForwardsBy(11);
|
||||
|
||||
// Loop until next Graphic Control Extension.
|
||||
while (stream.getBytes(2) !== [0x21, 0xf9]) {
|
||||
stream.moveBackwardsBy(2);
|
||||
stream.moveForwardsBy(stream.readInt(1));
|
||||
if (!stream.readInt(1))
|
||||
break;
|
||||
stream.moveBackwardsBy(1);
|
||||
}
|
||||
|
||||
// When the end of the file is [0x00, 0x3b], end.
|
||||
if (stream.readInt(1) === 0x3b)
|
||||
break;
|
||||
|
||||
stream.moveForwardsBy(1);
|
||||
}
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Portable executable extractor.
|
||||
* Assumes that the offset refers to an MZ header.
|
||||
@@ -2550,6 +2733,154 @@ export function extractZIP(bytes, offset) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* MACHO extractor
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractMACHO(bytes, offset) {
|
||||
|
||||
// Magic bytes.
|
||||
const MHCIGAM64 = "207250237254";
|
||||
const MHMAGIC64 = "254237250207";
|
||||
const MHCIGAM = "206250237254";
|
||||
|
||||
|
||||
/**
|
||||
* Checks to see if the file is 64-bit.
|
||||
*
|
||||
* @param {string} magic
|
||||
* @returns {bool}
|
||||
*/
|
||||
function isMagic64(magic) {
|
||||
return magic === MHCIGAM64 || magic === MHMAGIC64;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the endianness of the file.
|
||||
*
|
||||
* @param {string} magic
|
||||
* @returns {bool}
|
||||
*/
|
||||
function shouldSwapBytes(magic) {
|
||||
return magic === MHCIGAM || magic === MHCIGAM64;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Jumps through segment information and calculates the sum of the segement sizes.
|
||||
*
|
||||
* @param {Stream} stream
|
||||
* @param {number} offset
|
||||
* @param {string} isSwap
|
||||
* @param {number} ncmds
|
||||
* @returns {number}
|
||||
*/
|
||||
function dumpSegmentCommands(stream, offset, isSwap, ncmds) {
|
||||
let total = 0;
|
||||
const LCSEGEMENT64 = 0x19;
|
||||
const LCSEGEMENT = 0x1;
|
||||
|
||||
for (let i = 0; i < ncmds; i++) {
|
||||
|
||||
// Move to start of segment.
|
||||
stream.moveTo(offset);
|
||||
const cmd = stream.readInt(4, isSwap);
|
||||
if (cmd === LCSEGEMENT64) {
|
||||
|
||||
// Move to size of segment field.
|
||||
stream.moveTo(offset + 48);
|
||||
|
||||
// Extract size of segement.
|
||||
total += stream.readInt(8, isSwap);
|
||||
stream.moveTo(offset + 4);
|
||||
|
||||
// Move to offset of next segment.
|
||||
offset += stream.readInt(4, isSwap);
|
||||
} else if (cmd === LCSEGEMENT) {
|
||||
stream.moveTo(offset + 36);
|
||||
|
||||
// Extract size of segement.
|
||||
total += stream.readInt(4, isSwap);
|
||||
stream.moveTo(offset + 4);
|
||||
offset += stream.readInt(4, isSwap);
|
||||
}
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reads the number of command segments.
|
||||
*
|
||||
* @param {Stream} stream
|
||||
* @param {bool} is64
|
||||
* @param {string} isSwap
|
||||
* @returns {number}
|
||||
*/
|
||||
function dumpMachHeader(stream, is64, isSwap) {
|
||||
let loadCommandsOffset = 28;
|
||||
if (is64)
|
||||
loadCommandsOffset += 4;
|
||||
|
||||
// Move to number of commands field.
|
||||
stream.moveTo(16);
|
||||
const ncmds = stream.readInt(4, isSwap);
|
||||
return dumpSegmentCommands(stream, loadCommandsOffset, isSwap, ncmds);
|
||||
}
|
||||
|
||||
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
const magic = stream.getBytes(4).join("");
|
||||
|
||||
// Move to the end of the final segment.
|
||||
stream.moveTo(dumpMachHeader(stream, isMagic64(magic), shouldSwapBytes(magic) ? "le" : "be"));
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TAR extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractTAR(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
while (stream.hasMore()) {
|
||||
|
||||
// Move to ustar identifier.
|
||||
stream.moveForwardsBy(0x101);
|
||||
if (stream.getBytes(5).join("") !== [0x75, 0x73, 0x74, 0x61, 0x72].join("")) {
|
||||
// Reverse back to the end of the last section.
|
||||
stream.moveBackwardsBy(0x106);
|
||||
break;
|
||||
}
|
||||
|
||||
// Move back to file size field.
|
||||
stream.moveBackwardsBy(0x8a);
|
||||
let fsize = 0;
|
||||
|
||||
// Read file size field.
|
||||
stream.getBytes(11).forEach((element, index) => {
|
||||
fsize += (element - 48).toString();
|
||||
});
|
||||
|
||||
// Round number up from octet to nearest 512.
|
||||
fsize = (Math.ceil(parseInt(fsize, 8) / 512) * 512);
|
||||
|
||||
// Move forwards to the end of that file.
|
||||
stream.moveForwardsBy(fsize + 0x179);
|
||||
}
|
||||
stream.consumeWhile(0x00);
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PNG extractor.
|
||||
*
|
||||
@@ -2602,6 +2933,26 @@ export function extractBMP(bytes, offset) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* WAV extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractWAV(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
|
||||
// Move to file size field.
|
||||
stream.moveTo(4);
|
||||
|
||||
// Move to file size.
|
||||
stream.moveTo(stream.readInt(4, "le") - 4);
|
||||
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* FLV extractor.
|
||||
*
|
||||
@@ -2689,6 +3040,31 @@ export function extractRTF(bytes, offset) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* SQLITE extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractSQLITE(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
|
||||
// Extract the size of the page.
|
||||
stream.moveTo(16);
|
||||
const pageSize = stream.readInt(2);
|
||||
|
||||
// Extract the number of pages.
|
||||
stream.moveTo(28);
|
||||
const numPages = stream.readInt(4);
|
||||
|
||||
// Move to the end of all the pages.
|
||||
stream.moveTo(pageSize*numPages);
|
||||
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PList (XML) extractor.
|
||||
*
|
||||
@@ -2777,6 +3153,43 @@ export function extractGZIP(bytes, offset) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* BZIP2 extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractBZIP2(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
|
||||
// The EOFs shifted between all possible combinations.
|
||||
const lookingfor = [
|
||||
[0x77, 0x24, 0x53, 0x85, 0x09],
|
||||
[0xee, 0x48, 0xa7, 0x0a, 0x12],
|
||||
[0xdc, 0x91, 0x4e, 0x14, 0x24],
|
||||
[0xb9, 0x22, 0x9c, 0x28, 0x48],
|
||||
[0x72, 0x45, 0x38, 0x50, 0x90],
|
||||
[0xbb, 0x92, 0x29, 0xc2, 0x84],
|
||||
[0x5d, 0xc9, 0x14, 0xe1, 0x42],
|
||||
[0x2e, 0xe4, 0x8a, 0x70, 0xa1],
|
||||
[0x17, 0x72, 0x45, 0x38, 0x50]
|
||||
];
|
||||
|
||||
for (let i = 0; i < lookingfor.length; i++) {
|
||||
// Continue until an EOF.
|
||||
stream.continueUntil(lookingfor[i]);
|
||||
if (stream.getBytes(5).join("") === lookingfor[i].join(""))
|
||||
break;
|
||||
|
||||
// Jump back to the start if invalid EOF.
|
||||
stream.moveTo(0);
|
||||
}
|
||||
stream.moveForwardsBy(4);
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Zlib extractor.
|
||||
*
|
||||
@@ -2808,6 +3221,26 @@ export function extractZlib(bytes, offset) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* XZ extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {string}
|
||||
*/
|
||||
export function extractXZ(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
|
||||
// Move forward to EOF marker
|
||||
stream.continueUntil([0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a]);
|
||||
|
||||
// Move over EOF marker
|
||||
stream.moveForwardsBy(7);
|
||||
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ELF extractor.
|
||||
*
|
||||
@@ -3059,3 +3492,53 @@ function readHuffmanCode(stream, table) {
|
||||
|
||||
return codeWithLength & 0xffff;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* EVTX extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractEVTX(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
|
||||
// Move to first ELFCHNK.
|
||||
stream.moveTo(0x28);
|
||||
const total = stream.readInt(4, "le") - 0x2c;
|
||||
stream.moveForwardsBy(total);
|
||||
|
||||
while (stream.hasMore()) {
|
||||
// Loop through ELFCHNKs.
|
||||
if (stream.getBytes(7).join("") !== [0x45, 0x6c, 0x66, 0x43, 0x68, 0x6e, 0x6b].join(""))
|
||||
break;
|
||||
stream.moveForwardsBy(0xfff9);
|
||||
}
|
||||
stream.consumeWhile(0x00);
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* EVT extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractEVT(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
|
||||
// Extract offset of EOF.
|
||||
stream.moveTo(0x14);
|
||||
const eofOffset = stream.readInt(4, "le");
|
||||
stream.moveTo(eofOffset);
|
||||
|
||||
// Extract the size of the EOF.
|
||||
const eofSize = stream.readInt(4, "le");
|
||||
|
||||
// Move past EOF.
|
||||
stream.moveForwardsBy(eofSize-4);
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
@@ -155,19 +155,69 @@ export default class Stream {
|
||||
}
|
||||
|
||||
// val is an array
|
||||
let found = false;
|
||||
while (!found && this.position < this.length) {
|
||||
while (++this.position < this.length && this.bytes[this.position] !== val[0]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the skip forward table from the value to be searched.
|
||||
*
|
||||
* @param {Uint8Array} val
|
||||
* @param {Number} len
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
function preprocess(val, len) {
|
||||
const skiptable = new Array();
|
||||
val.forEach((element, index) => {
|
||||
skiptable[element] = len - index;
|
||||
});
|
||||
return skiptable;
|
||||
}
|
||||
|
||||
const length = val.length;
|
||||
const initial = val[length-1];
|
||||
this.position = length;
|
||||
|
||||
// Get the skip table.
|
||||
const skiptable = preprocess(val, length);
|
||||
let found = true;
|
||||
|
||||
while (this.position < this.length) {
|
||||
// Until we hit the final element of val in the stream.
|
||||
while ((this.position < this.length) && (this.bytes[this.position++] !== initial));
|
||||
|
||||
found = true;
|
||||
for (let i = 1; i < val.length; i++) {
|
||||
if (this.position + i > this.length || this.bytes[this.position + i] !== val[i])
|
||||
|
||||
// Loop through the elements comparing them to val.
|
||||
for (let x = length-1; x >= 0; x--) {
|
||||
if (this.bytes[this.position - length + x] !== val[x]) {
|
||||
found = false;
|
||||
|
||||
// If element is not equal to val's element then jump forward by the correct amount.
|
||||
this.position += skiptable[val[x]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
this.position -= length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Consume bytes if they match the supplied value.
|
||||
*
|
||||
* @param {Number} val
|
||||
*/
|
||||
consumeWhile(val) {
|
||||
while (this.position < this.length) {
|
||||
if (this.bytes[this.position] !== val) {
|
||||
break;
|
||||
}
|
||||
this.position++;
|
||||
}
|
||||
this.bitPos = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Consume the next byte if it matches the supplied value.
|
||||
*
|
||||
|
||||
@@ -63,9 +63,9 @@ class DNSOverHTTPS extends Operation {
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "Validate DNSSEC",
|
||||
name: "Disable DNSSEC validation",
|
||||
type: "boolean",
|
||||
value: true
|
||||
value: false
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -42,15 +42,22 @@ class FromBase62 extends Operation {
|
||||
*/
|
||||
run(input, args) {
|
||||
if (input.length < 1) return [];
|
||||
const ALPHABET = Utils.expandAlphRange(args[0]).join("");
|
||||
const BN = BigNumber.clone({ ALPHABET });
|
||||
const alphabet = Utils.expandAlphRange(args[0]).join("");
|
||||
const BN62 = BigNumber.clone({ ALPHABET: alphabet });
|
||||
|
||||
const re = new RegExp("[^" + ALPHABET.replace(/[[\]\\\-^$]/g, "\\$&") + "]", "g");
|
||||
const re = new RegExp("[^" + alphabet.replace(/[[\]\\\-^$]/g, "\\$&") + "]", "g");
|
||||
input = input.replace(re, "");
|
||||
|
||||
const number = new BN(input, 62);
|
||||
// Read number in using Base62 alphabet
|
||||
const number = new BN62(input, 62);
|
||||
// Copy to new BigNumber object that uses the default alphabet
|
||||
const normalized = new BigNumber(number);
|
||||
|
||||
return Utils.convertToByteArray(number.toString(16), "Hex");
|
||||
// Convert to hex and add leading 0 if required
|
||||
let hex = normalized.toString(16);
|
||||
if (hex.length % 2 !== 0) hex = "0" + hex;
|
||||
|
||||
return Utils.convertToByteArray(hex, "Hex");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class FromMorseCode extends Operation {
|
||||
const letterDelim = Utils.charRep(args[0]);
|
||||
const wordDelim = Utils.charRep(args[1]);
|
||||
|
||||
input = input.replace(/-|‐|−|_|–|—|dash/ig, "<dash>"); //hyphen-minus|hyphen|minus-sign|undersore|en-dash|em-dash
|
||||
input = input.replace(/-|‐|−|_|–|—|dash/ig, "<dash>"); // hyphen-minus|hyphen|minus-sign|undersore|en-dash|em-dash
|
||||
input = input.replace(/\.|·|dot/ig, "<dot>");
|
||||
|
||||
let words = input.split(wordDelim);
|
||||
|
||||
@@ -117,7 +117,7 @@ class GroupIPAddresses extends Operation {
|
||||
|
||||
// Sort IPv6 network dictionaries and print
|
||||
for (networkStr in ipv6Networks) {
|
||||
//ipv6Networks[networkStr] = ipv6Networks[networkStr].sort(); TODO
|
||||
// ipv6Networks[networkStr] = ipv6Networks[networkStr].sort(); TODO
|
||||
|
||||
output += networkStr + "/" + cidr + "\n";
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
import OperationError from "../errors/OperationError";
|
||||
import Operation from "../Operation.mjs";
|
||||
import OperationError from "../errors/OperationError.mjs";
|
||||
|
||||
/**
|
||||
* Lorenz operation
|
||||
@@ -391,7 +391,7 @@ class Lorenz extends Operation {
|
||||
// Chi 2 one back lim - The active character of Chi 2 (2nd Chi wheel) in the previous position
|
||||
lim = parseInt(chiSettings[2][x2bptr-1], 10);
|
||||
if (kt) {
|
||||
//p5 back 2
|
||||
// p5 back 2
|
||||
if (lim===p5[2]) {
|
||||
lim = 0;
|
||||
} else {
|
||||
@@ -413,7 +413,7 @@ class Lorenz extends Operation {
|
||||
lim = 1;
|
||||
if (x2b1lug===s1b1lug) lim=0;
|
||||
if (kt) {
|
||||
//p5 back 2
|
||||
// p5 back 2
|
||||
if (lim===p5[2]) {
|
||||
lim=0;
|
||||
} else {
|
||||
|
||||
@@ -44,12 +44,15 @@ class ToBase62 extends Operation {
|
||||
input = new Uint8Array(input);
|
||||
if (input.length < 1) return "";
|
||||
|
||||
const ALPHABET = Utils.expandAlphRange(args[0]).join("");
|
||||
const BN = BigNumber.clone({ ALPHABET });
|
||||
const alphabet = Utils.expandAlphRange(args[0]).join("");
|
||||
const BN62 = BigNumber.clone({ ALPHABET: alphabet });
|
||||
|
||||
input = toHexFast(input).toUpperCase();
|
||||
|
||||
const number = new BN(input, 16);
|
||||
// Read number in as hex using normal alphabet
|
||||
const normalized = new BigNumber(input, 16);
|
||||
// Copy to BigNumber clone that uses the specified Base62 alphabet
|
||||
const number = new BN62(normalized);
|
||||
|
||||
return number.toString(62);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import NodeDish from "./NodeDish.mjs";
|
||||
import NodeRecipe from "./NodeRecipe.mjs";
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-global-assign: ["off"] */
|
||||
/* eslint no-global-assign: ["off"] */
|
||||
require = require("esm")(module);
|
||||
module.exports = require("./index.mjs");
|
||||
module.exports.File = require("./File.mjs");
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: 0 */
|
||||
/* eslint no-console: 0 */
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
@@ -11,7 +11,7 @@ const chef = require("./cjs.js");
|
||||
const repl = require("repl");
|
||||
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
console.log(`
|
||||
______ __ ________ ____
|
||||
|
||||
@@ -604,7 +604,7 @@ class App {
|
||||
else if (prev[1] > 0) prev[1]--;
|
||||
else prev[0]--;
|
||||
|
||||
//const compareURL = `https://github.com/gchq/CyberChef/compare/v${prev.join(".")}...v${PKG_VERSION}`;
|
||||
// const compareURL = `https://github.com/gchq/CyberChef/compare/v${prev.join(".")}...v${PKG_VERSION}`;
|
||||
|
||||
let compileInfo = `<a href='https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md'>Last build: ${timeSinceCompile.substr(0, 1).toUpperCase() + timeSinceCompile.substr(1)} ago</a>`;
|
||||
|
||||
|
||||
@@ -446,7 +446,6 @@ class HighlighterWaiter {
|
||||
}
|
||||
|
||||
const cssClass = "hl1";
|
||||
//if (colour) cssClass += "-"+colour;
|
||||
|
||||
// Remove HTML tags
|
||||
text = text
|
||||
|
||||
@@ -29,20 +29,20 @@ class InputWaiter {
|
||||
|
||||
// Define keys that don't change the input so we don't have to autobake when they are pressed
|
||||
this.badKeys = [
|
||||
16, //Shift
|
||||
17, //Ctrl
|
||||
18, //Alt
|
||||
19, //Pause
|
||||
20, //Caps
|
||||
27, //Esc
|
||||
33, 34, 35, 36, //PgUp, PgDn, End, Home
|
||||
37, 38, 39, 40, //Directional
|
||||
44, //PrntScrn
|
||||
91, 92, //Win
|
||||
93, //Context
|
||||
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, //F1-12
|
||||
144, //Num
|
||||
145, //Scroll
|
||||
16, // Shift
|
||||
17, // Ctrl
|
||||
18, // Alt
|
||||
19, // Pause
|
||||
20, // Caps
|
||||
27, // Esc
|
||||
33, 34, 35, 36, // PgUp, PgDn, End, Home
|
||||
37, 38, 39, 40, // Directional
|
||||
44, // PrntScrn
|
||||
91, 92, // Win
|
||||
93, // Context
|
||||
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, // F1-12
|
||||
144, // Num
|
||||
145, // Scroll
|
||||
];
|
||||
|
||||
this.inputWorker = null;
|
||||
|
||||
@@ -125,7 +125,7 @@ TestRegister.addApiTests([
|
||||
<a href="https://github.com">Click here</a>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>`.replace(/\n|\s{4}/g, ""); //remove newlines, tabs
|
||||
</html>`.replace(/\n|\s{4}/g, ""); // remove newlines, tabs
|
||||
|
||||
const dish = new Dish(html, Dish.HTML);
|
||||
dish.get(4);
|
||||
|
||||
@@ -73,7 +73,7 @@ TestRegister.addTests([
|
||||
},
|
||||
{
|
||||
name: "To Octal: Γειά σου",
|
||||
input: "Γειά σου", //[206,147,206,181,206,185,206,172,32,207,131,206,191,207,133],
|
||||
input: "Γειά σου", // [206,147,206,181,206,185,206,172,32,207,131,206,191,207,133],
|
||||
expectedOutput: "316 223 316 265 316 271 316 254 40 317 203 316 277 317 205",
|
||||
recipeConfig: [
|
||||
{
|
||||
|
||||
@@ -1099,7 +1099,7 @@ TestRegister.addTests([
|
||||
}
|
||||
]
|
||||
}
|
||||
/*{ // This takes a LONG time to run (over a minute usually).
|
||||
/* { // This takes a LONG time to run (over a minute usually).
|
||||
name: "Scrypt: RFC test vector 4",
|
||||
input: "pleaseletmein",
|
||||
expectedOutput: "2101cb9b6a511aaeaddbbe09cf70f881ec568d574a2ffd4dabe5ee9820adaa478e56fd8f4ba5d09ffa1c6d927c40f4c337304049e8a952fbcbf45c6fa77a41a4",
|
||||
@@ -1115,5 +1115,5 @@ TestRegister.addTests([
|
||||
]
|
||||
}
|
||||
]
|
||||
},*/
|
||||
}, */
|
||||
]);
|
||||
|
||||
@@ -248,7 +248,7 @@ TestRegister.addTests([
|
||||
}
|
||||
]
|
||||
},
|
||||
/*{ This operation only works in a browser
|
||||
/* { This operation only works in a browser
|
||||
name: "Optical Character Recognition",
|
||||
input: "iVBORw0KGgoAAAANSUhEUgAAAUAAAAC0CAIAAABqhmJGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAASuSURBVHhe7dftVdswAIbRzsVAzMM0XabDUCOUxLYsWW4Jp+/pvf9w9GH76CHw4x2IJWAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAI9p8G/PbyY8rL2686g8t+vnqHTyfgIYfvz/26veTXn/UKX8+f0EU9bHrtu/6KfAN/AwEXAj7lFf2TBFw4nae8on+SgIvJ01n/KLzpDK+L3bT/Ap4O+HC+V12mTH+M3gzcLbIY/EO6HfxYp13k09nb6r3UqcdnjoCL3ll72J26h+35Oxy2XvZ0wOLaXq9v2+F1UC+7RZtMZ/DnfX1lwDOPzwUCLo7O2trtDK8H3M/iqoc6bj1subT68XTA/F7bGJooyzKbhTvLPHY8eJLHlbNX1DqYUVfdXbqwJjsCLsans37aNNJM6w68OR0wv9f9ymKw3k67yn2ZZpHlg3a3zis60s6oV+ZvlzMCLoanc3Dsdt9TdWT/lM8OmNjr5KY72jmzq1zfrbvXtVtmRMDF8HTWcgaaqIrD1U4G/MFewxrW262s5jS/Fzpmdts6mnHy+Fwl4GJ0OjsNrG1P/y7CNo3+gEt7jW56MVprNed7A/5w+n6YJ+BieDpnj/jO6pweTz0acGWvmZveL9XOmd3x6wKuTt8PEwRczLRw4eje1XX7c/cDruw1uuneOu2c4aOvzI57mJhRh1xZlQ0BF+Oz9vcF96fuB1zYa7R2b5mD6/XSwdfg8snj4q21+W/L02dfzIxhQMDFyTm6Hd7m+JYP7rPKT5sRuzhOBywm91rUkYc3fV9ltchtr8VmzuGOdfDB9N1tFYefNfdXLmyGjNZkhoCLUQufVqd/7z7rUcLW/XieDvg0s9difNOdRV5ePibt5vTuazusWbF9rs2E5v4mH58LBFyMW7g5OID7s9cMuTygmt9rcNPb5MrAz0lHc3Z9Ht7XZsxqxO36ZtLR/c0+PpMEzLOc/4LhrwmYZ6lfywJ+JgHzJPr9DgLmi23/zdXvcwmYL7YKWL1PJ2AIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmCI9f7+G6yFxVg/GyYwAAAAAElFTkSuQmCC",
|
||||
expectedOutput: "Tesseract.js\n",
|
||||
@@ -262,5 +262,5 @@ TestRegister.addTests([
|
||||
"args": [false]
|
||||
}
|
||||
]
|
||||
}*/
|
||||
} */
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user