mirror of
https://github.com/gchq/CyberChef
synced 2026-01-20 09:23:25 +00:00
Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a177e2ab7e | ||
|
|
8cef6db482 | ||
|
|
79a3128491 | ||
|
|
cb1fe80214 | ||
|
|
19f2e6dae0 | ||
|
|
74394a773d | ||
|
|
d491e95d1c | ||
|
|
881523ce54 | ||
|
|
502a9fbb92 | ||
|
|
cc44fe6557 | ||
|
|
5b1ac3de18 | ||
|
|
5a2a649d8e | ||
|
|
1aef193b40 | ||
|
|
750fa45c04 | ||
|
|
50f2819699 | ||
|
|
ab55b91da1 | ||
|
|
59f7774964 | ||
|
|
b5eb44af9f | ||
|
|
8518fa67f2 | ||
|
|
f6b68f9880 | ||
|
|
f6b2783f8b | ||
|
|
078849041f | ||
|
|
1c711f5e03 | ||
|
|
614af0602a | ||
|
|
e55cfe0bc1 | ||
|
|
2b703b2b9b | ||
|
|
170feaaff2 | ||
|
|
870c2b6d8b | ||
|
|
eee8b7db56 | ||
|
|
3c669a075e | ||
|
|
f528930ad2 | ||
|
|
231322eddf | ||
|
|
8e6763c165 | ||
|
|
f091918575 | ||
|
|
bb077c87b3 | ||
|
|
fe8f8bc712 | ||
|
|
abe87830cd | ||
|
|
7490651a06 | ||
|
|
6220128a74 |
@@ -51,6 +51,7 @@
|
|||||||
"mode": "minimum"
|
"mode": "minimum"
|
||||||
}],
|
}],
|
||||||
"indent": ["error", 4, {
|
"indent": ["error", 4, {
|
||||||
|
"ignoreComments": true,
|
||||||
"ArrayExpression": "first",
|
"ArrayExpression": "first",
|
||||||
"SwitchCase": 1
|
"SwitchCase": 1
|
||||||
}],
|
}],
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ script:
|
|||||||
- grunt node
|
- grunt node
|
||||||
- grunt prod --msg="$COMPILE_MSG"
|
- grunt prod --msg="$COMPILE_MSG"
|
||||||
before_deploy:
|
before_deploy:
|
||||||
|
- grunt exec:sitemap
|
||||||
- grunt copy:ghPages
|
- grunt copy:ghPages
|
||||||
deploy:
|
deploy:
|
||||||
- provider: pages
|
- provider: pages
|
||||||
|
|||||||
18
Gruntfile.js
18
Gruntfile.js
@@ -186,7 +186,10 @@ module.exports = function (grunt) {
|
|||||||
options: webpackConfig,
|
options: webpackConfig,
|
||||||
metaConf: {
|
metaConf: {
|
||||||
target: "node",
|
target: "node",
|
||||||
entry: "./src/core/config/OperationConfig.js",
|
entry: [
|
||||||
|
"babel-polyfill",
|
||||||
|
"./src/core/config/OperationConfig.js"
|
||||||
|
],
|
||||||
output: {
|
output: {
|
||||||
filename: "MetaConfig.js",
|
filename: "MetaConfig.js",
|
||||||
path: __dirname + "/src/core/config/",
|
path: __dirname + "/src/core/config/",
|
||||||
@@ -198,7 +201,10 @@ module.exports = function (grunt) {
|
|||||||
},
|
},
|
||||||
metaConfDev: {
|
metaConfDev: {
|
||||||
target: "node",
|
target: "node",
|
||||||
entry: "./src/core/config/OperationConfig.js",
|
entry: [
|
||||||
|
"babel-polyfill",
|
||||||
|
"./src/core/config/OperationConfig.js"
|
||||||
|
],
|
||||||
output: {
|
output: {
|
||||||
filename: "MetaConfig.js",
|
filename: "MetaConfig.js",
|
||||||
path: __dirname + "/src/core/config/",
|
path: __dirname + "/src/core/config/",
|
||||||
@@ -212,7 +218,8 @@ module.exports = function (grunt) {
|
|||||||
web: {
|
web: {
|
||||||
target: "web",
|
target: "web",
|
||||||
entry: Object.assign({
|
entry: Object.assign({
|
||||||
main: "./src/web/index.js"
|
main: "./src/web/index.js",
|
||||||
|
sitemap: "./src/web/static/sitemap.js"
|
||||||
}, moduleEntryPoints),
|
}, moduleEntryPoints),
|
||||||
output: {
|
output: {
|
||||||
path: __dirname + "/build/prod"
|
path: __dirname + "/build/prod"
|
||||||
@@ -371,7 +378,7 @@ module.exports = function (grunt) {
|
|||||||
expand: true,
|
expand: true,
|
||||||
src: "docs/**",
|
src: "docs/**",
|
||||||
dest: "build/prod/"
|
dest: "build/prod/"
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -400,6 +407,9 @@ module.exports = function (grunt) {
|
|||||||
cleanGit: {
|
cleanGit: {
|
||||||
command: "git gc --prune=now --aggressive"
|
command: "git gc --prune=now --aggressive"
|
||||||
},
|
},
|
||||||
|
sitemap: {
|
||||||
|
command: "node build/prod/sitemap.js > build/prod/sitemap.xml"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
execute: {
|
execute: {
|
||||||
test: "build/test/index.js"
|
test: "build/test/index.js"
|
||||||
|
|||||||
@@ -103,4 +103,4 @@ CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/lice
|
|||||||
[8]: https://gchq.github.io/CyberChef/#recipe=Fork('%5C%5Cn','%5C%5Cn',false)Conditional_Jump('1',false,'base64',10)To_Hex('Space')Return()Label('base64')To_Base64('A-Za-z0-9%2B/%3D')&input=U29tZSBkYXRhIHdpdGggYSAxIGluIGl0ClNvbWUgZGF0YSB3aXRoIGEgMiBpbiBpdA
|
[8]: https://gchq.github.io/CyberChef/#recipe=Fork('%5C%5Cn','%5C%5Cn',false)Conditional_Jump('1',false,'base64',10)To_Hex('Space')Return()Label('base64')To_Base64('A-Za-z0-9%2B/%3D')&input=U29tZSBkYXRhIHdpdGggYSAxIGluIGl0ClNvbWUgZGF0YSB3aXRoIGEgMiBpbiBpdA
|
||||||
[9]: https://gchq.github.io/CyberChef/#recipe=Register('key%3D(%5B%5C%5Cda-f%5D*)',true,false)Find_/_Replace(%7B'option':'Regex','string':'.*data%3D(.*)'%7D,'$1',true,false,true)RC4(%7B'option':'Hex','string':'$R0'%7D,'Hex','Latin1')&input=aHR0cDovL21hbHdhcmV6LmJpei9iZWFjb24ucGhwP2tleT0wZTkzMmE1YyZkYXRhPThkYjdkNWViZTM4NjYzYTU0ZWNiYjMzNGUzZGIxMQ
|
[9]: https://gchq.github.io/CyberChef/#recipe=Register('key%3D(%5B%5C%5Cda-f%5D*)',true,false)Find_/_Replace(%7B'option':'Regex','string':'.*data%3D(.*)'%7D,'$1',true,false,true)RC4(%7B'option':'Hex','string':'$R0'%7D,'Hex','Latin1')&input=aHR0cDovL21hbHdhcmV6LmJpei9iZWFjb24ucGhwP2tleT0wZTkzMmE1YyZkYXRhPThkYjdkNWViZTM4NjYzYTU0ZWNiYjMzNGUzZGIxMQ
|
||||||
[10]: https://gchq.github.io/CyberChef/#recipe=Register('(.%7B32%7D)',true,false)Drop_bytes(0,32,false)AES_Decrypt(%7B'option':'Hex','string':'1748e7179bd56570d51fa4ba287cc3e5'%7D,%7B'option':'Hex','string':'$R0'%7D,'CTR','Hex','Raw',%7B'option':'Hex','string':''%7D)&input=NTFlMjAxZDQ2MzY5OGVmNWY3MTdmNzFmNWI0NzEyYWYyMGJlNjc0YjNiZmY1M2QzODU0NjM5NmVlNjFkYWFjNDkwOGUzMTljYTNmY2Y3MDg5YmZiNmIzOGVhOTllNzgxZDI2ZTU3N2JhOWRkNmYzMTFhMzk0MjBiODk3OGU5MzAxNGIwNDJkNDQ3MjZjYWVkZjU0MzZlYWY2NTI0MjljMGRmOTRiNTIxNjc2YzdjMmNlODEyMDk3YzI3NzI3M2M3YzcyY2Q4OWFlYzhkOWZiNGEyNzU4NmNjZjZhYTBhZWUyMjRjMzRiYTNiZmRmN2FlYjFkZGQ0Nzc2MjJiOTFlNzJjOWU3MDlhYjYwZjhkYWY3MzFlYzBjYzg1Y2UwZjc0NmZmMTU1NGE1YTNlYzI5MWNhNDBmOWU2MjlhODcyNTkyZDk4OGZkZDgzNDUzNGFiYTc5YzFhZDE2NzY3NjlhN2MwMTBiZjA0NzM5ZWNkYjY1ZDk1MzAyMzcxZDYyOWQ5ZTM3ZTdiNGEzNjFkYTQ2OGYxZWQ1MzU4OTIyZDJlYTc1MmRkMTFjMzY2ZjMwMTdiMTRhYTAxMWQyYWYwM2M0NGY5NTU3OTA5OGExNWUzY2Y5YjQ0ODZmOGZmZTljMjM5ZjM0ZGU3MTUxZjZjYTY1MDBmZTRiODUwYzNmMWMwMmU4MDFjYWYzYTI0NDY0NjE0ZTQyODAxNjE1YjhmZmFhMDdhYzgyNTE0OTNmZmRhN2RlNWRkZjMzNjg4ODBjMmI5NWIwMzBmNDFmOGYxNTA2NmFkZDA3MWE2NmNmNjBlNWY0NmYzYTIzMGQzOTdiNjUyOTYzYTIxYTUzZg
|
[10]: https://gchq.github.io/CyberChef/#recipe=Register('(.%7B32%7D)',true,false)Drop_bytes(0,32,false)AES_Decrypt(%7B'option':'Hex','string':'1748e7179bd56570d51fa4ba287cc3e5'%7D,%7B'option':'Hex','string':'$R0'%7D,'CTR','Hex','Raw',%7B'option':'Hex','string':''%7D)&input=NTFlMjAxZDQ2MzY5OGVmNWY3MTdmNzFmNWI0NzEyYWYyMGJlNjc0YjNiZmY1M2QzODU0NjM5NmVlNjFkYWFjNDkwOGUzMTljYTNmY2Y3MDg5YmZiNmIzOGVhOTllNzgxZDI2ZTU3N2JhOWRkNmYzMTFhMzk0MjBiODk3OGU5MzAxNGIwNDJkNDQ3MjZjYWVkZjU0MzZlYWY2NTI0MjljMGRmOTRiNTIxNjc2YzdjMmNlODEyMDk3YzI3NzI3M2M3YzcyY2Q4OWFlYzhkOWZiNGEyNzU4NmNjZjZhYTBhZWUyMjRjMzRiYTNiZmRmN2FlYjFkZGQ0Nzc2MjJiOTFlNzJjOWU3MDlhYjYwZjhkYWY3MzFlYzBjYzg1Y2UwZjc0NmZmMTU1NGE1YTNlYzI5MWNhNDBmOWU2MjlhODcyNTkyZDk4OGZkZDgzNDUzNGFiYTc5YzFhZDE2NzY3NjlhN2MwMTBiZjA0NzM5ZWNkYjY1ZDk1MzAyMzcxZDYyOWQ5ZTM3ZTdiNGEzNjFkYTQ2OGYxZWQ1MzU4OTIyZDJlYTc1MmRkMTFjMzY2ZjMwMTdiMTRhYTAxMWQyYWYwM2M0NGY5NTU3OTA5OGExNWUzY2Y5YjQ0ODZmOGZmZTljMjM5ZjM0ZGU3MTUxZjZjYTY1MDBmZTRiODUwYzNmMWMwMmU4MDFjYWYzYTI0NDY0NjE0ZTQyODAxNjE1YjhmZmFhMDdhYzgyNTE0OTNmZmRhN2RlNWRkZjMzNjg4ODBjMmI5NWIwMzBmNDFmOGYxNTA2NmFkZDA3MWE2NmNmNjBlNWY0NmYzYTIzMGQzOTdiNjUyOTYzYTIxYTUzZg
|
||||||
[11]: https://gchq.github.io/CyberChef/#recipe=XOR(%7B'option':'Hex','string':'3a'%7D,'',false)To_Hexdump(16,false,false)&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4
|
[11]: https://gchq.github.io/CyberChef/#recipe=XOR(%7B'option':'Hex','string':'3a'%7D,'Standard',false)To_Hexdump(16,false,false)&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4
|
||||||
|
|||||||
2131
package-lock.json
generated
2131
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cyberchef",
|
"name": "cyberchef",
|
||||||
"version": "7.5.3",
|
"version": "7.7.5",
|
||||||
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
||||||
"author": "n1474335 <n1474335@gmail.com>",
|
"author": "n1474335 <n1474335@gmail.com>",
|
||||||
"homepage": "https://gchq.github.io/CyberChef",
|
"homepage": "https://gchq.github.io/CyberChef",
|
||||||
@@ -33,7 +33,8 @@
|
|||||||
"babel-core": "^6.26.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-loader": "^7.1.2",
|
"babel-loader": "^7.1.2",
|
||||||
"babel-preset-env": "^1.6.1",
|
"babel-preset-env": "^1.6.1",
|
||||||
"css-loader": "^0.28.7",
|
"css-loader": "^0.28.9",
|
||||||
|
"eslint": "^4.17.0",
|
||||||
"exports-loader": "^0.6.4",
|
"exports-loader": "^0.6.4",
|
||||||
"extract-text-webpack-plugin": "^3.0.2",
|
"extract-text-webpack-plugin": "^3.0.2",
|
||||||
"file-loader": "^1.1.6",
|
"file-loader": "^1.1.6",
|
||||||
@@ -46,7 +47,7 @@
|
|||||||
"grunt-eslint": "^20.1.0",
|
"grunt-eslint": "^20.1.0",
|
||||||
"grunt-exec": "~3.0.0",
|
"grunt-exec": "~3.0.0",
|
||||||
"grunt-execute": "^0.2.2",
|
"grunt-execute": "^0.2.2",
|
||||||
"grunt-jsdoc": "^2.2.0",
|
"grunt-jsdoc": "^2.2.1",
|
||||||
"grunt-webpack": "^3.0.2",
|
"grunt-webpack": "^3.0.2",
|
||||||
"html-webpack-plugin": "^2.30.1",
|
"html-webpack-plugin": "^2.30.1",
|
||||||
"imports-loader": "^0.7.1",
|
"imports-loader": "^0.7.1",
|
||||||
@@ -56,19 +57,20 @@
|
|||||||
"less-loader": "^4.0.5",
|
"less-loader": "^4.0.5",
|
||||||
"postcss-css-variables": "^0.8.0",
|
"postcss-css-variables": "^0.8.0",
|
||||||
"postcss-import": "^11.0.0",
|
"postcss-import": "^11.0.0",
|
||||||
"postcss-loader": "^2.0.9",
|
"postcss-loader": "^2.0.10",
|
||||||
|
"sitemap": "^1.13.0",
|
||||||
"style-loader": "^0.19.1",
|
"style-loader": "^0.19.1",
|
||||||
"url-loader": "^0.6.2",
|
"url-loader": "^0.6.2",
|
||||||
"val-loader": "^1.1.0",
|
"val-loader": "^1.1.0",
|
||||||
"web-resource-inliner": "^4.2.0",
|
"web-resource-inliner": "^4.2.1",
|
||||||
"webpack": "^3.10.0",
|
"webpack": "^3.10.0",
|
||||||
"webpack-dev-server": "^2.9.7",
|
"webpack-dev-server": "^2.11.1",
|
||||||
"webpack-node-externals": "^1.6.0",
|
"webpack-node-externals": "^1.6.0",
|
||||||
"worker-loader": "^1.1.0"
|
"worker-loader": "^1.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-polyfill": "^6.26.0",
|
"babel-polyfill": "^6.26.0",
|
||||||
"bignumber.js": "^5.0.0",
|
"bignumber.js": "^6.0.0",
|
||||||
"bootstrap": "^3.3.7",
|
"bootstrap": "^3.3.7",
|
||||||
"bootstrap-colorpicker": "^2.5.2",
|
"bootstrap-colorpicker": "^2.5.2",
|
||||||
"bootstrap-switch": "^3.3.4",
|
"bootstrap-switch": "^3.3.4",
|
||||||
@@ -80,15 +82,15 @@
|
|||||||
"esprima": "^4.0.0",
|
"esprima": "^4.0.0",
|
||||||
"exif-parser": "^0.1.12",
|
"exif-parser": "^0.1.12",
|
||||||
"file-saver": "^1.3.3",
|
"file-saver": "^1.3.3",
|
||||||
"google-code-prettify": "^1.0.5",
|
"highlight.js": "^9.12.0",
|
||||||
"jquery": "^3.2.1",
|
"jquery": "^3.3.1",
|
||||||
"js-crc": "^0.2.0",
|
"js-crc": "^0.2.0",
|
||||||
"js-sha3": "^0.7.0",
|
"js-sha3": "^0.7.0",
|
||||||
"jsbn": "^1.1.0",
|
"jsbn": "^1.1.0",
|
||||||
"jsonpath": "^1.0.0",
|
"jsonpath": "^1.0.0",
|
||||||
"jsrsasign": "8.0.4",
|
"jsrsasign": "8.0.4",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"loglevel": "^1.6.0",
|
"loglevel": "^1.6.1",
|
||||||
"loglevel-message-prefix": "^3.0.0",
|
"loglevel-message-prefix": "^3.0.0",
|
||||||
"moment": "^2.20.1",
|
"moment": "^2.20.1",
|
||||||
"moment-timezone": "^0.5.14",
|
"moment-timezone": "^0.5.14",
|
||||||
|
|||||||
@@ -52,14 +52,25 @@ const FlowControl = {
|
|||||||
output = "",
|
output = "",
|
||||||
progress = 0;
|
progress = 0;
|
||||||
|
|
||||||
|
state.forkOffset += state.progress + 1;
|
||||||
|
|
||||||
recipe.addOperations(subOpList);
|
recipe.addOperations(subOpList);
|
||||||
|
|
||||||
|
// Take a deep(ish) copy of the ingredient values
|
||||||
|
const ingValues = subOpList.map(op => JSON.parse(JSON.stringify(op.getIngValues())));
|
||||||
|
|
||||||
// Run recipe over each tranche
|
// Run recipe over each tranche
|
||||||
for (i = 0; i < inputs.length; i++) {
|
for (i = 0; i < inputs.length; i++) {
|
||||||
log.debug(`Entering tranche ${i + 1} of ${inputs.length}`);
|
log.debug(`Entering tranche ${i + 1} of ${inputs.length}`);
|
||||||
|
|
||||||
|
// Baseline ing values for each tranche so that registers are reset
|
||||||
|
subOpList.forEach((op, i) => {
|
||||||
|
op.setIngValues(JSON.parse(JSON.stringify(ingValues[i])));
|
||||||
|
});
|
||||||
|
|
||||||
const dish = new Dish(inputs[i], inputType);
|
const dish = new Dish(inputs[i], inputType);
|
||||||
try {
|
try {
|
||||||
progress = await recipe.execute(dish, 0);
|
progress = await recipe.execute(dish, 0, state);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!ignoreErrors) {
|
if (!ignoreErrors) {
|
||||||
throw err;
|
throw err;
|
||||||
@@ -117,7 +128,7 @@ const FlowControl = {
|
|||||||
if (!registers) return state;
|
if (!registers) return state;
|
||||||
|
|
||||||
if (ENVIRONMENT_IS_WORKER()) {
|
if (ENVIRONMENT_IS_WORKER()) {
|
||||||
self.setRegisters(state.progress, state.numRegisters, registers.slice(1));
|
self.setRegisters(state.forkOffset + state.progress, state.numRegisters, registers.slice(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -141,11 +141,14 @@ Recipe.prototype.lastOpIndex = function(startIndex) {
|
|||||||
*
|
*
|
||||||
* @param {Dish} dish
|
* @param {Dish} dish
|
||||||
* @param {number} [startFrom=0] - The index of the Operation to start executing from
|
* @param {number} [startFrom=0] - The index of the Operation to start executing from
|
||||||
|
* @param {number} [forkState={}] - If this is a forked recipe, the state of the recipe up to this point
|
||||||
* @returns {number} - The final progress through the recipe
|
* @returns {number} - The final progress through the recipe
|
||||||
*/
|
*/
|
||||||
Recipe.prototype.execute = async function(dish, startFrom) {
|
Recipe.prototype.execute = async function(dish, startFrom = 0, forkState = {}) {
|
||||||
startFrom = startFrom || 0;
|
let op, input, output,
|
||||||
let op, input, output, numJumps = 0, numRegisters = 0;
|
numJumps = 0,
|
||||||
|
numRegisters = forkState.numRegisters || 0;
|
||||||
|
|
||||||
log.debug(`[*] Executing recipe of ${this.opList.length} operations, starting at ${startFrom}`);
|
log.debug(`[*] Executing recipe of ${this.opList.length} operations, starting at ${startFrom}`);
|
||||||
|
|
||||||
for (let i = startFrom; i < this.opList.length; i++) {
|
for (let i = startFrom; i < this.opList.length; i++) {
|
||||||
@@ -171,7 +174,8 @@ Recipe.prototype.execute = async function(dish, startFrom) {
|
|||||||
"dish": dish,
|
"dish": dish,
|
||||||
"opList": this.opList,
|
"opList": this.opList,
|
||||||
"numJumps": numJumps,
|
"numJumps": numJumps,
|
||||||
"numRegisters": numRegisters
|
"numRegisters": numRegisters,
|
||||||
|
"forkOffset": forkState.forkOffset || 0
|
||||||
};
|
};
|
||||||
|
|
||||||
state = await op.run(state);
|
state = await op.run(state);
|
||||||
@@ -256,4 +260,5 @@ Recipe.prototype.generateHighlightList = function() {
|
|||||||
return highlights;
|
return highlights;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default Recipe;
|
export default Recipe;
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ const Categories = [
|
|||||||
"Escape string",
|
"Escape string",
|
||||||
"Unescape string",
|
"Unescape string",
|
||||||
"Pseudo-Random Number Generator",
|
"Pseudo-Random Number Generator",
|
||||||
|
"Sleep",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -213,6 +214,7 @@ const Categories = [
|
|||||||
"Windows Filetime to UNIX Timestamp",
|
"Windows Filetime to UNIX Timestamp",
|
||||||
"UNIX Timestamp to Windows Filetime",
|
"UNIX Timestamp to Windows Filetime",
|
||||||
"Extract dates",
|
"Extract dates",
|
||||||
|
"Sleep",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -324,6 +326,7 @@ const Categories = [
|
|||||||
"Remove EXIF",
|
"Remove EXIF",
|
||||||
"Extract EXIF",
|
"Extract EXIF",
|
||||||
"Numberwang",
|
"Numberwang",
|
||||||
|
"XKCD Random Number",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1825,6 +1825,11 @@ const OperationConfig = {
|
|||||||
name: "Cisco style",
|
name: "Cisco style",
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
value: MAC.CISCO_STYLE
|
value: MAC.CISCO_STYLE
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "IPv6 interface ID",
|
||||||
|
type: "boolean",
|
||||||
|
value: MAC.IPV6_INTERFACE_ID
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -2154,7 +2159,7 @@ const OperationConfig = {
|
|||||||
{
|
{
|
||||||
name: "Invert condition",
|
name: "Invert condition",
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
value: SeqUtils.SORT_REVERSE
|
value: false
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -2441,8 +2446,21 @@ const OperationConfig = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"Sleep": {
|
||||||
|
module: "Default",
|
||||||
|
description: "Sleep causes the recipe to wait for a specified number of milliseconds before continuing execution.",
|
||||||
|
inputType: "ArrayBuffer",
|
||||||
|
outputType: "ArrayBuffer",
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
name: "Time (ms)",
|
||||||
|
type: "number",
|
||||||
|
value: 1000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"Windows Filetime to UNIX Timestamp": {
|
"Windows Filetime to UNIX Timestamp": {
|
||||||
module: "JSBN",
|
module: "Default",
|
||||||
description: "Converts a Windows Filetime value to a UNIX timestamp.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
|
description: "Converts a Windows Filetime value to a UNIX timestamp.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
|
||||||
inputType: "string",
|
inputType: "string",
|
||||||
outputType: "string",
|
outputType: "string",
|
||||||
@@ -2460,7 +2478,7 @@ const OperationConfig = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"UNIX Timestamp to Windows Filetime": {
|
"UNIX Timestamp to Windows Filetime": {
|
||||||
module: "JSBN",
|
module: "Default",
|
||||||
description: "Converts a UNIX timestamp to a Windows Filetime value.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
|
description: "Converts a UNIX timestamp to a Windows Filetime value.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
|
||||||
inputType: "string",
|
inputType: "string",
|
||||||
outputType: "string",
|
outputType: "string",
|
||||||
@@ -3449,15 +3467,10 @@ const OperationConfig = {
|
|||||||
outputType: "html",
|
outputType: "html",
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
name: "Language/File extension",
|
name: "Language",
|
||||||
type: "option",
|
type: "option",
|
||||||
value: Code.LANGUAGES
|
value: Code.LANGUAGES
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Display line numbers",
|
|
||||||
type: "boolean",
|
|
||||||
value: Code.LINE_NUMS
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"TCP/IP Checksum": {
|
"TCP/IP Checksum": {
|
||||||
@@ -3958,6 +3971,13 @@ const OperationConfig = {
|
|||||||
value: StrUtils.HAMMING_INPUT_TYPE
|
value: StrUtils.HAMMING_INPUT_TYPE
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"XKCD Random Number": {
|
||||||
|
module: "Default",
|
||||||
|
description: "RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.<br><br><a href='https://xkcd.com/221/'>XKCD #221</a>",
|
||||||
|
inputType: "string",
|
||||||
|
outputType: "number",
|
||||||
|
args: []
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Code from "../../operations/Code.js";
|
|||||||
* - xmldom
|
* - xmldom
|
||||||
* - xpath
|
* - xpath
|
||||||
* - jpath
|
* - jpath
|
||||||
* - googlecodeprettify
|
* - highlight.js
|
||||||
*
|
*
|
||||||
* @author n1474335 [n1474335@gmail.com]
|
* @author n1474335 [n1474335@gmail.com]
|
||||||
* @copyright Crown Copyright 2017
|
* @copyright Crown Copyright 2017
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import Convert from "../../operations/Convert.js";
|
|||||||
import DateTime from "../../operations/DateTime.js";
|
import DateTime from "../../operations/DateTime.js";
|
||||||
import Endian from "../../operations/Endian.js";
|
import Endian from "../../operations/Endian.js";
|
||||||
import Entropy from "../../operations/Entropy.js";
|
import Entropy from "../../operations/Entropy.js";
|
||||||
|
import Filetime from "../../operations/Filetime.js";
|
||||||
import FileType from "../../operations/FileType.js";
|
import FileType from "../../operations/FileType.js";
|
||||||
import Hexdump from "../../operations/Hexdump.js";
|
import Hexdump from "../../operations/Hexdump.js";
|
||||||
import HTML from "../../operations/HTML.js";
|
import HTML from "../../operations/HTML.js";
|
||||||
@@ -28,6 +29,8 @@ import StrUtils from "../../operations/StrUtils.js";
|
|||||||
import Tidy from "../../operations/Tidy.js";
|
import Tidy from "../../operations/Tidy.js";
|
||||||
import Unicode from "../../operations/Unicode.js";
|
import Unicode from "../../operations/Unicode.js";
|
||||||
import UUID from "../../operations/UUID.js";
|
import UUID from "../../operations/UUID.js";
|
||||||
|
import XKCD from "../../operations/XKCD.js";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default module.
|
* Default module.
|
||||||
@@ -39,6 +42,7 @@ import UUID from "../../operations/UUID.js";
|
|||||||
* - Utils.js
|
* - Utils.js
|
||||||
* - otp
|
* - otp
|
||||||
* - crypto
|
* - crypto
|
||||||
|
* - bignumber.js
|
||||||
*
|
*
|
||||||
* @author n1474335 [n1474335@gmail.com]
|
* @author n1474335 [n1474335@gmail.com]
|
||||||
* @copyright Crown Copyright 2017
|
* @copyright Crown Copyright 2017
|
||||||
@@ -88,7 +92,7 @@ OpModules.Default = {
|
|||||||
"Bit shift right": BitwiseOp.runBitShiftRight,
|
"Bit shift right": BitwiseOp.runBitShiftRight,
|
||||||
"XOR": BitwiseOp.runXor,
|
"XOR": BitwiseOp.runXor,
|
||||||
"XOR Brute Force": BitwiseOp.runXorBrute,
|
"XOR Brute Force": BitwiseOp.runXorBrute,
|
||||||
"OR": BitwiseOp.runXor,
|
"OR": BitwiseOp.runOr,
|
||||||
"NOT": BitwiseOp.runNot,
|
"NOT": BitwiseOp.runNot,
|
||||||
"AND": BitwiseOp.runAnd,
|
"AND": BitwiseOp.runAnd,
|
||||||
"ADD": BitwiseOp.runAdd,
|
"ADD": BitwiseOp.runAdd,
|
||||||
@@ -130,6 +134,7 @@ OpModules.Default = {
|
|||||||
"Translate DateTime Format": DateTime.runTranslateFormat,
|
"Translate DateTime Format": DateTime.runTranslateFormat,
|
||||||
"From UNIX Timestamp": DateTime.runFromUnixTimestamp,
|
"From UNIX Timestamp": DateTime.runFromUnixTimestamp,
|
||||||
"To UNIX Timestamp": DateTime.runToUnixTimestamp,
|
"To UNIX Timestamp": DateTime.runToUnixTimestamp,
|
||||||
|
"Sleep": DateTime.runSleep,
|
||||||
"Microsoft Script Decoder": MS.runDecodeScript,
|
"Microsoft Script Decoder": MS.runDecodeScript,
|
||||||
"Entropy": Entropy.runEntropy,
|
"Entropy": Entropy.runEntropy,
|
||||||
"Frequency distribution": Entropy.runFreqDistrib,
|
"Frequency distribution": Entropy.runFreqDistrib,
|
||||||
@@ -156,6 +161,9 @@ OpModules.Default = {
|
|||||||
"Mean": Arithmetic.runMean,
|
"Mean": Arithmetic.runMean,
|
||||||
"Median": Arithmetic.runMedian,
|
"Median": Arithmetic.runMedian,
|
||||||
"Standard Deviation": Arithmetic.runStdDev,
|
"Standard Deviation": Arithmetic.runStdDev,
|
||||||
|
"Windows Filetime to UNIX Timestamp": Filetime.runFromFiletimeToUnix,
|
||||||
|
"UNIX Timestamp to Windows Filetime": Filetime.runToFiletimeFromUnix,
|
||||||
|
"XKCD Random Number": XKCD.runRandomNumber,
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import IP from "../../operations/IP.js";
|
import IP from "../../operations/IP.js";
|
||||||
import Filetime from "../../operations/Filetime.js";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,8 +20,6 @@ OpModules.JSBN = {
|
|||||||
"Parse IPv4 header": IP.runParseIPv4Header,
|
"Parse IPv4 header": IP.runParseIPv4Header,
|
||||||
"Change IP format": IP.runChangeIpFormat,
|
"Change IP format": IP.runChangeIpFormat,
|
||||||
"Group IP addresses": IP.runGroupIps,
|
"Group IP addresses": IP.runGroupIps,
|
||||||
"Windows Filetime to UNIX Timestamp": Filetime.runFromFiletimeToUnix,
|
|
||||||
"UNIX Timestamp to Windows Filetime": Filetime.runToFiletimeFromUnix,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default OpModules;
|
export default OpModules;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const BCD = {
|
|||||||
runToBCD: function(input, args) {
|
runToBCD: function(input, args) {
|
||||||
if (input.isNaN())
|
if (input.isNaN())
|
||||||
return "Invalid input";
|
return "Invalid input";
|
||||||
if (!input.floor().equals(input))
|
if (!input.integerValue(BigNumber.ROUND_DOWN).isEqualTo(input))
|
||||||
return "Fractional values are not supported by BCD";
|
return "Fractional values are not supported by BCD";
|
||||||
|
|
||||||
const encoding = BCD.ENCODING_LOOKUP[args[0]],
|
const encoding = BCD.ENCODING_LOOKUP[args[0]],
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ DES uses a key length of 8 bytes (64 bits).`;
|
|||||||
return forge.util.bytesToHex(bytes);
|
return forge.util.bytesToHex(bytes);
|
||||||
case "Integer":
|
case "Integer":
|
||||||
for (i = bytes.length - 1; i >= 0; i--) {
|
for (i = bytes.length - 1; i >= 0; i--) {
|
||||||
value = value.mul(256).plus(bytes.charCodeAt(i));
|
value = value.times(256).plus(bytes.charCodeAt(i));
|
||||||
}
|
}
|
||||||
return value.toFixed();
|
return value.toFixed();
|
||||||
case "Byte array":
|
case "Byte array":
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import {camelCase, kebabCase, snakeCase} from "lodash";
|
import {camelCase, kebabCase, snakeCase} from "lodash";
|
||||||
|
|
||||||
import Utils from "../Utils.js";
|
|
||||||
import vkbeautify from "vkbeautify";
|
import vkbeautify from "vkbeautify";
|
||||||
import {DOMParser} from "xmldom";
|
import {DOMParser} from "xmldom";
|
||||||
import xpath from "xpath";
|
import xpath from "xpath";
|
||||||
import jpath from "jsonpath";
|
import jpath from "jsonpath";
|
||||||
import nwmatcher from "nwmatcher";
|
import nwmatcher from "nwmatcher";
|
||||||
import prettyPrintOne from "imports-loader?window=>global!exports-loader?prettyPrintOne!google-code-prettify/bin/prettify.min.js";
|
import hljs from "highlight.js";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,12 +22,7 @@ const Code = {
|
|||||||
* @constant
|
* @constant
|
||||||
* @default
|
* @default
|
||||||
*/
|
*/
|
||||||
LANGUAGES: ["default-code", "default-markup", "bash", "bsh", "c", "cc", "coffee", "cpp", "cs", "csh", "cv", "cxx", "cyc", "htm", "html", "in.tag", "java", "javascript", "js", "json", "m", "mxml", "perl", "pl", "pm", "py", "python", "rb", "rc", "rs", "ruby", "rust", "sh", "uq.val", "xhtml", "xml", "xsl"],
|
LANGUAGES: ["auto detect"].concat(hljs.listLanguages()),
|
||||||
/**
|
|
||||||
* @constant
|
|
||||||
* @default
|
|
||||||
*/
|
|
||||||
LINE_NUMS: false,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syntax highlighter operation.
|
* Syntax highlighter operation.
|
||||||
@@ -39,9 +32,13 @@ const Code = {
|
|||||||
* @returns {html}
|
* @returns {html}
|
||||||
*/
|
*/
|
||||||
runSyntaxHighlight: function(input, args) {
|
runSyntaxHighlight: function(input, args) {
|
||||||
let language = args[0],
|
const language = args[0];
|
||||||
lineNums = args[1];
|
|
||||||
return "<code class='prettyprint'>" + prettyPrintOne(Utils.escapeHtml(input), language, lineNums) + "</code>";
|
if (language === "auto detect") {
|
||||||
|
return hljs.highlightAuto(input).value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hljs.highlight(language, input, true).value;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const Convert = {
|
|||||||
let inputUnits = args[0],
|
let inputUnits = args[0],
|
||||||
outputUnits = args[1];
|
outputUnits = args[1];
|
||||||
|
|
||||||
input = input.mul(Convert.DISTANCE_FACTOR[inputUnits]);
|
input = input.times(Convert.DISTANCE_FACTOR[inputUnits]);
|
||||||
return input.div(Convert.DISTANCE_FACTOR[outputUnits]);
|
return input.div(Convert.DISTANCE_FACTOR[outputUnits]);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ const Convert = {
|
|||||||
let inputUnits = args[0],
|
let inputUnits = args[0],
|
||||||
outputUnits = args[1];
|
outputUnits = args[1];
|
||||||
|
|
||||||
input = input.mul(Convert.DATA_FACTOR[inputUnits]);
|
input = input.times(Convert.DATA_FACTOR[inputUnits]);
|
||||||
return input.div(Convert.DATA_FACTOR[outputUnits]);
|
return input.div(Convert.DATA_FACTOR[outputUnits]);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ const Convert = {
|
|||||||
let inputUnits = args[0],
|
let inputUnits = args[0],
|
||||||
outputUnits = args[1];
|
outputUnits = args[1];
|
||||||
|
|
||||||
input = input.mul(Convert.AREA_FACTOR[inputUnits]);
|
input = input.times(Convert.AREA_FACTOR[inputUnits]);
|
||||||
return input.div(Convert.AREA_FACTOR[outputUnits]);
|
return input.div(Convert.AREA_FACTOR[outputUnits]);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ const Convert = {
|
|||||||
let inputUnits = args[0],
|
let inputUnits = args[0],
|
||||||
outputUnits = args[1];
|
outputUnits = args[1];
|
||||||
|
|
||||||
input = input.mul(Convert.MASS_FACTOR[inputUnits]);
|
input = input.times(Convert.MASS_FACTOR[inputUnits]);
|
||||||
return input.div(Convert.MASS_FACTOR[outputUnits]);
|
return input.div(Convert.MASS_FACTOR[outputUnits]);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ const Convert = {
|
|||||||
let inputUnits = args[0],
|
let inputUnits = args[0],
|
||||||
outputUnits = args[1];
|
outputUnits = args[1];
|
||||||
|
|
||||||
input = input.mul(Convert.SPEED_FACTOR[inputUnits]);
|
input = input.times(Convert.SPEED_FACTOR[inputUnits]);
|
||||||
return input.div(Convert.SPEED_FACTOR[outputUnits]);
|
return input.div(Convert.SPEED_FACTOR[outputUnits]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,20 @@ const DateTime = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sleep operation.
|
||||||
|
*
|
||||||
|
* @param {ArrayBuffer} input
|
||||||
|
* @param {Object[]} args
|
||||||
|
* @returns {ArrayBuffer}
|
||||||
|
*/
|
||||||
|
runSleep: async function(input, args) {
|
||||||
|
const ms = args[0];
|
||||||
|
await new Promise(r => setTimeout(r, ms));
|
||||||
|
return input;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constant
|
* @constant
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ const Extract = {
|
|||||||
includeUnixPath = args[1],
|
includeUnixPath = args[1],
|
||||||
displayTotal = args[2],
|
displayTotal = args[2],
|
||||||
winDrive = "[A-Z]:\\\\",
|
winDrive = "[A-Z]:\\\\",
|
||||||
winName = "[A-Z\\d][A-Z\\d\\- '_\\(\\)]{0,61}",
|
winName = "[A-Z\\d][A-Z\\d\\- '_\\(\\)~]{0,61}",
|
||||||
winExt = "[A-Z\\d]{1,6}",
|
winExt = "[A-Z\\d]{1,6}",
|
||||||
winPath = winDrive + "(?:" + winName + "\\\\?)*" + winName +
|
winPath = winDrive + "(?:" + winName + "\\\\?)*" + winName +
|
||||||
"(?:\\." + winExt + ")?",
|
"(?:\\." + winExt + ")?",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {BigInteger} from "jsbn";
|
import BigNumber from "bignumber.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Windows Filetime operations.
|
* Windows Filetime operations.
|
||||||
@@ -35,27 +35,29 @@ const Filetime = {
|
|||||||
let units = args[0],
|
let units = args[0],
|
||||||
format = args[1];
|
format = args[1];
|
||||||
|
|
||||||
|
if (!input) return "";
|
||||||
|
|
||||||
if (format === "Hex") {
|
if (format === "Hex") {
|
||||||
input = new BigInteger(input, 16);
|
input = new BigNumber(input, 16);
|
||||||
} else {
|
} else {
|
||||||
input = new BigInteger(input);
|
input = new BigNumber(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
input = input.subtract(new BigInteger("116444736000000000"));
|
input = input.minus(new BigNumber("116444736000000000"));
|
||||||
|
|
||||||
if (units === "Seconds (s)"){
|
if (units === "Seconds (s)"){
|
||||||
input = input.divide(new BigInteger("10000000"));
|
input = input.dividedBy(new BigNumber("10000000"));
|
||||||
} else if (units === "Milliseconds (ms)") {
|
} else if (units === "Milliseconds (ms)") {
|
||||||
input = input.divide(new BigInteger("10000"));
|
input = input.dividedBy(new BigNumber("10000"));
|
||||||
} else if (units === "Microseconds (μs)") {
|
} else if (units === "Microseconds (μs)") {
|
||||||
input = input.divide(new BigInteger("10"));
|
input = input.dividedBy(new BigNumber("10"));
|
||||||
} else if (units === "Nanoseconds (ns)") {
|
} else if (units === "Nanoseconds (ns)") {
|
||||||
input = input.multiply(new BigInteger("100"));
|
input = input.multipliedBy(new BigNumber("100"));
|
||||||
} else {
|
} else {
|
||||||
throw "Unrecognised unit";
|
throw "Unrecognised unit";
|
||||||
}
|
}
|
||||||
|
|
||||||
return input.toString();
|
return input.toFixed();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@@ -71,26 +73,28 @@ const Filetime = {
|
|||||||
let units = args[0],
|
let units = args[0],
|
||||||
format = args[1];
|
format = args[1];
|
||||||
|
|
||||||
input = new BigInteger(input);
|
if (!input) return "";
|
||||||
|
|
||||||
|
input = new BigNumber(input);
|
||||||
|
|
||||||
if (units === "Seconds (s)"){
|
if (units === "Seconds (s)"){
|
||||||
input = input.multiply(new BigInteger("10000000"));
|
input = input.multipliedBy(new BigNumber("10000000"));
|
||||||
} else if (units === "Milliseconds (ms)") {
|
} else if (units === "Milliseconds (ms)") {
|
||||||
input = input.multiply(new BigInteger("10000"));
|
input = input.multipliedBy(new BigNumber("10000"));
|
||||||
} else if (units === "Microseconds (μs)") {
|
} else if (units === "Microseconds (μs)") {
|
||||||
input = input.multiply(new BigInteger("10"));
|
input = input.multiplyiedBy(new BigNumber("10"));
|
||||||
} else if (units === "Nanoseconds (ns)") {
|
} else if (units === "Nanoseconds (ns)") {
|
||||||
input = input.divide(new BigInteger("100"));
|
input = input.dividedBy(new BigNumber("100"));
|
||||||
} else {
|
} else {
|
||||||
throw "Unrecognised unit";
|
throw "Unrecognised unit";
|
||||||
}
|
}
|
||||||
|
|
||||||
input = input.add(new BigInteger("116444736000000000"));
|
input = input.plus(new BigNumber("116444736000000000"));
|
||||||
|
|
||||||
if (format === "Hex"){
|
if (format === "Hex"){
|
||||||
return input.toString(16);
|
return input.toString(16);
|
||||||
} else {
|
} else {
|
||||||
return input.toString();
|
return input.toFixed();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ const MAC = {
|
|||||||
* @default
|
* @default
|
||||||
*/
|
*/
|
||||||
CISCO_STYLE: false,
|
CISCO_STYLE: false,
|
||||||
|
/**
|
||||||
|
* @constant
|
||||||
|
* @default
|
||||||
|
*/
|
||||||
|
IPV6_INTERFACE_ID: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format MAC addresses operation.
|
* Format MAC addresses operation.
|
||||||
@@ -50,6 +55,7 @@ const MAC = {
|
|||||||
dashDelim = args[2],
|
dashDelim = args[2],
|
||||||
colonDelim = args[3],
|
colonDelim = args[3],
|
||||||
ciscoStyle = args[4],
|
ciscoStyle = args[4],
|
||||||
|
ipv6IntID = args[5],
|
||||||
outputList = [],
|
outputList = [],
|
||||||
macs = input.toLowerCase().split(/[,\s\r\n]+/);
|
macs = input.toLowerCase().split(/[,\s\r\n]+/);
|
||||||
|
|
||||||
@@ -57,23 +63,32 @@ const MAC = {
|
|||||||
let cleanMac = mac.replace(/[:.-]+/g, ""),
|
let cleanMac = mac.replace(/[:.-]+/g, ""),
|
||||||
macHyphen = cleanMac.replace(/(.{2}(?=.))/g, "$1-"),
|
macHyphen = cleanMac.replace(/(.{2}(?=.))/g, "$1-"),
|
||||||
macColon = cleanMac.replace(/(.{2}(?=.))/g, "$1:"),
|
macColon = cleanMac.replace(/(.{2}(?=.))/g, "$1:"),
|
||||||
macCisco = cleanMac.replace(/(.{4}(?=.))/g, "$1.");
|
macCisco = cleanMac.replace(/(.{4}(?=.))/g, "$1."),
|
||||||
|
macIPv6 = cleanMac.slice(0, 6) + "fffe" + cleanMac.slice(6);
|
||||||
|
|
||||||
|
macIPv6 = macIPv6.replace(/(.{4}(?=.))/g, "$1:");
|
||||||
|
let bite = parseInt(macIPv6.slice(0, 2), 16) ^ 2;
|
||||||
|
bite = bite.toString(16).padStart(2, "0");
|
||||||
|
macIPv6 = bite + macIPv6.slice(2);
|
||||||
|
|
||||||
if (outputCase === "Lower only") {
|
if (outputCase === "Lower only") {
|
||||||
if (noDelim) outputList.push(cleanMac);
|
if (noDelim) outputList.push(cleanMac);
|
||||||
if (dashDelim) outputList.push(macHyphen);
|
if (dashDelim) outputList.push(macHyphen);
|
||||||
if (colonDelim) outputList.push(macColon);
|
if (colonDelim) outputList.push(macColon);
|
||||||
if (ciscoStyle) outputList.push(macCisco);
|
if (ciscoStyle) outputList.push(macCisco);
|
||||||
|
if (ipv6IntID) outputList.push(macIPv6);
|
||||||
} else if (outputCase === "Upper only") {
|
} else if (outputCase === "Upper only") {
|
||||||
if (noDelim) outputList.push(cleanMac.toUpperCase());
|
if (noDelim) outputList.push(cleanMac.toUpperCase());
|
||||||
if (dashDelim) outputList.push(macHyphen.toUpperCase());
|
if (dashDelim) outputList.push(macHyphen.toUpperCase());
|
||||||
if (colonDelim) outputList.push(macColon.toUpperCase());
|
if (colonDelim) outputList.push(macColon.toUpperCase());
|
||||||
if (ciscoStyle) outputList.push(macCisco.toUpperCase());
|
if (ciscoStyle) outputList.push(macCisco.toUpperCase());
|
||||||
|
if (ipv6IntID) outputList.push(macIPv6.toUpperCase());
|
||||||
} else {
|
} else {
|
||||||
if (noDelim) outputList.push(cleanMac, cleanMac.toUpperCase());
|
if (noDelim) outputList.push(cleanMac, cleanMac.toUpperCase());
|
||||||
if (dashDelim) outputList.push(macHyphen, macHyphen.toUpperCase());
|
if (dashDelim) outputList.push(macHyphen, macHyphen.toUpperCase());
|
||||||
if (colonDelim) outputList.push(macColon, macColon.toUpperCase());
|
if (colonDelim) outputList.push(macColon, macColon.toUpperCase());
|
||||||
if (ciscoStyle) outputList.push(macCisco, macCisco.toUpperCase());
|
if (ciscoStyle) outputList.push(macCisco, macCisco.toUpperCase());
|
||||||
|
if (ipv6IntID) outputList.push(macIPv6, macIPv6.toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
outputList.push(
|
outputList.push(
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const Regex = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Windows file path",
|
name: "Windows file path",
|
||||||
value: "([A-Za-z]):\\\\((?:[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61}\\\\?)*[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61})(\\.[A-Za-z\\d]{1,6})?"
|
value: "([A-Za-z]):\\\\((?:[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)~]{0,61}\\\\?)*[A-Za-z\\d][A-Za-z\\d\\- \\x27_\\(\\)]{0,61})(\\.[A-Za-z\\d]{1,6})?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "UNIX file path",
|
name: "UNIX file path",
|
||||||
|
|||||||
@@ -104,6 +104,12 @@ const StrUtils = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constant
|
||||||
|
* @default
|
||||||
|
*/
|
||||||
|
DELIMITER_OPTIONS: ["Line feed", "CRLF", "Space", "Comma", "Semi-colon", "Colon", "Nothing (separate chars)"],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter operation.
|
* Filter operation.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const Unicode = {
|
|||||||
*/
|
*/
|
||||||
runUnescape: function(input, args) {
|
runUnescape: function(input, args) {
|
||||||
let prefix = Unicode._prefixToRegex[args[0]],
|
let prefix = Unicode._prefixToRegex[args[0]],
|
||||||
regex = new RegExp(prefix+"([a-f\\d]{4,6})", "ig"),
|
regex = new RegExp(prefix+"([a-f\\d]{4})", "ig"),
|
||||||
output = "",
|
output = "",
|
||||||
m,
|
m,
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|||||||
26
src/core/operations/XKCD.js
Executable file
26
src/core/operations/XKCD.js
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
/**
|
||||||
|
* XKCD operations.
|
||||||
|
*
|
||||||
|
* @author n1474335 [n1474335@gmail.com]
|
||||||
|
* @copyright Crown Copyright 2018
|
||||||
|
* @license Apache-2.0
|
||||||
|
*
|
||||||
|
* @namespace
|
||||||
|
*/
|
||||||
|
const XKCD = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* XKCD Random Number operation.
|
||||||
|
*
|
||||||
|
* @param {string} input
|
||||||
|
* @param {Object[]} args
|
||||||
|
* @returns {number}
|
||||||
|
*/
|
||||||
|
runRandomNumber: function(input, args) {
|
||||||
|
return 4; // chosen by fair dice roll.
|
||||||
|
// guaranteed to be random.
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
export default XKCD;
|
||||||
@@ -377,6 +377,7 @@ App.prototype.loadURIParams = function() {
|
|||||||
window.location.href.split("#")[1] ||
|
window.location.href.split("#")[1] ||
|
||||||
window.location.hash;
|
window.location.hash;
|
||||||
this.uriParams = Utils.parseURIParams(params);
|
this.uriParams = Utils.parseURIParams(params);
|
||||||
|
this.autoBakePause = true;
|
||||||
|
|
||||||
// Read in recipe from URI params
|
// Read in recipe from URI params
|
||||||
if (this.uriParams.recipe) {
|
if (this.uriParams.recipe) {
|
||||||
@@ -387,35 +388,29 @@ App.prototype.loadURIParams = function() {
|
|||||||
} else if (this.uriParams.op) {
|
} else if (this.uriParams.op) {
|
||||||
// If there's no recipe, look for single operations
|
// If there's no recipe, look for single operations
|
||||||
this.manager.recipe.clearRecipe();
|
this.manager.recipe.clearRecipe();
|
||||||
try {
|
|
||||||
this.manager.recipe.addOperation(this.uriParams.op);
|
|
||||||
} catch (err) {
|
|
||||||
// If no exact match, search for nearest match and add that
|
|
||||||
const matchedOps = this.manager.ops.filterOperations(this.uriParams.op, false);
|
|
||||||
if (matchedOps.length) {
|
|
||||||
this.manager.recipe.addOperation(matchedOps[0].name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Populate search with the string
|
// Search for nearest match and add it
|
||||||
const search = document.getElementById("search");
|
const matchedOps = this.manager.ops.filterOperations(this.uriParams.op, false);
|
||||||
|
if (matchedOps.length) {
|
||||||
search.value = this.uriParams.op;
|
this.manager.recipe.addOperation(matchedOps[0].name);
|
||||||
search.dispatchEvent(new Event("search"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Populate search with the string
|
||||||
|
const search = document.getElementById("search");
|
||||||
|
|
||||||
|
search.value = this.uriParams.op;
|
||||||
|
search.dispatchEvent(new Event("search"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read in input data from URI params
|
// Read in input data from URI params
|
||||||
if (this.uriParams.input) {
|
if (this.uriParams.input) {
|
||||||
this.autoBakePause = true;
|
|
||||||
try {
|
try {
|
||||||
const inputData = Utils.fromBase64(this.uriParams.input);
|
const inputData = Utils.fromBase64(this.uriParams.input);
|
||||||
this.setInput(inputData);
|
this.setInput(inputData);
|
||||||
} catch (err) {
|
} catch (err) {}
|
||||||
} finally {
|
|
||||||
this.autoBakePause = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.autoBakePause = false;
|
||||||
this.autoBake();
|
this.autoBake();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -488,7 +483,6 @@ App.prototype.setRecipeConfig = function(recipeConfig) {
|
|||||||
|
|
||||||
// Unpause auto bake
|
// Unpause auto bake
|
||||||
this.autoBakePause = false;
|
this.autoBakePause = false;
|
||||||
window.disptchEent(this.manager.statechange);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,15 @@ HTMLOperation.prototype.highlightSearchString = function(searchStr, namePos, des
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.description && descPos >= 0) {
|
if (this.description && descPos >= 0) {
|
||||||
|
// Find HTML tag offsets
|
||||||
|
const re = /<[^>]+>/g;
|
||||||
|
let match;
|
||||||
|
while ((match = re.exec(this.description))) {
|
||||||
|
// If the search string occurs within an HTML tag, return without highlighting it.
|
||||||
|
if (descPos >= match.index && descPos <= (match.index + match[0].length))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.description = this.description.slice(0, descPos) + "<b><u>" +
|
this.description = this.description.slice(0, descPos) + "<b><u>" +
|
||||||
this.description.slice(descPos, descPos + searchStr.length) + "</u></b>" +
|
this.description.slice(descPos, descPos + searchStr.length) + "</u></b>" +
|
||||||
this.description.slice(descPos + searchStr.length);
|
this.description.slice(descPos + searchStr.length);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import LoaderWorker from "worker-loader?inline&fallback=false!./LoaderWorker.js";
|
import LoaderWorker from "worker-loader?inline&fallback=false!./LoaderWorker.js";
|
||||||
|
import Utils from "../core/Utils.js";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,6 +65,7 @@ InputWaiter.prototype.set = function(input) {
|
|||||||
this.setInputInfo(input.size, null);
|
this.setInputInfo(input.size, null);
|
||||||
} else {
|
} else {
|
||||||
inputText.value = input;
|
inputText.value = input;
|
||||||
|
this.closeFile();
|
||||||
window.dispatchEvent(this.manager.statechange);
|
window.dispatchEvent(this.manager.statechange);
|
||||||
const lines = input.length < (this.app.options.ioDisplayThreshold * 1024) ?
|
const lines = input.length < (this.app.options.ioDisplayThreshold * 1024) ?
|
||||||
input.count("\n") + 1 : null;
|
input.count("\n") + 1 : null;
|
||||||
@@ -262,11 +264,28 @@ InputWaiter.prototype.handleLoaderMessage = function(e) {
|
|||||||
if (r.hasOwnProperty("fileBuffer")) {
|
if (r.hasOwnProperty("fileBuffer")) {
|
||||||
log.debug("Input file loaded");
|
log.debug("Input file loaded");
|
||||||
this.fileBuffer = r.fileBuffer;
|
this.fileBuffer = r.fileBuffer;
|
||||||
|
this.displayFilePreview();
|
||||||
window.dispatchEvent(this.manager.statechange);
|
window.dispatchEvent(this.manager.statechange);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows a chunk of the file in the input behind the file overlay.
|
||||||
|
*/
|
||||||
|
InputWaiter.prototype.displayFilePreview = function() {
|
||||||
|
const inputText = document.getElementById("input-text"),
|
||||||
|
fileSlice = this.fileBuffer.slice(0, 4096);
|
||||||
|
|
||||||
|
inputText.style.overflow = "hidden";
|
||||||
|
inputText.classList.add("blur");
|
||||||
|
inputText.value = Utils.printable(Utils.arrayBufferToStr(fileSlice));
|
||||||
|
if (this.fileBuffer.byteLength > 4096) {
|
||||||
|
inputText.value += "[truncated]...";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for file close events.
|
* Handler for file close events.
|
||||||
*/
|
*/
|
||||||
@@ -274,6 +293,9 @@ InputWaiter.prototype.closeFile = function() {
|
|||||||
if (this.loaderWorker) this.loaderWorker.terminate();
|
if (this.loaderWorker) this.loaderWorker.terminate();
|
||||||
this.fileBuffer = null;
|
this.fileBuffer = null;
|
||||||
document.getElementById("input-file").style.display = "none";
|
document.getElementById("input-file").style.display = "none";
|
||||||
|
const inputText = document.getElementById("input-text");
|
||||||
|
inputText.style.overflow = "auto";
|
||||||
|
inputText.classList.remove("blur");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ self.loadFile = function(file) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
reader.onerror = function(e) {
|
reader.onerror = function(e) {
|
||||||
self.postMessage({"error": file.error.message});
|
self.postMessage({"error": reader.error.message});
|
||||||
};
|
};
|
||||||
|
|
||||||
seek();
|
seek();
|
||||||
|
|||||||
@@ -167,7 +167,8 @@ OperationsWaiter.prototype.opListCreate = function(e) {
|
|||||||
OperationsWaiter.prototype.enableOpsListPopovers = function(el) {
|
OperationsWaiter.prototype.enableOpsListPopovers = function(el) {
|
||||||
$(el).find("[data-toggle=popover]").addBack("[data-toggle=popover]")
|
$(el).find("[data-toggle=popover]").addBack("[data-toggle=popover]")
|
||||||
.popover({trigger: "manual"})
|
.popover({trigger: "manual"})
|
||||||
.on("mouseenter", function() {
|
.on("mouseenter", function(e) {
|
||||||
|
if (e.buttons > 0) return; // Mouse button held down - likely dragging an opertion
|
||||||
const _this = this;
|
const _this = this;
|
||||||
$(this).popover("show");
|
$(this).popover("show");
|
||||||
$(".popover").on("mouseleave", function () {
|
$(".popover").on("mouseleave", function () {
|
||||||
@@ -178,7 +179,7 @@ OperationsWaiter.prototype.enableOpsListPopovers = function(el) {
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// Determine if the popover associated with this element is being hovered over
|
// Determine if the popover associated with this element is being hovered over
|
||||||
if ($(_this).data("bs.popover") &&
|
if ($(_this).data("bs.popover") &&
|
||||||
!$(_this).data("bs.popover").$tip.is(":hover")) {
|
($(_this).data("bs.popover").$tip && !$(_this).data("bs.popover").$tip.is(":hover"))) {
|
||||||
$(_this).popover("hide");
|
$(_this).popover("hide");
|
||||||
}
|
}
|
||||||
}, 50);
|
}, 50);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ OutputWaiter.prototype.set = function(data, type, duration, preserveBuffer) {
|
|||||||
|
|
||||||
outputText.value = "";
|
outputText.value = "";
|
||||||
outputHtml.innerHTML = data;
|
outputHtml.innerHTML = data;
|
||||||
this.dishStr = Utils.stripHtmlTags(data, true);
|
this.dishStr = Utils.unescapeHtml(Utils.stripHtmlTags(data, true));
|
||||||
length = data.length;
|
length = data.length;
|
||||||
lines = this.dishStr.count("\n") + 1;
|
lines = this.dishStr.count("\n") + 1;
|
||||||
|
|
||||||
@@ -128,6 +128,13 @@ OutputWaiter.prototype.setFile = function(buf) {
|
|||||||
|
|
||||||
fileOverlay.style.display = "block";
|
fileOverlay.style.display = "block";
|
||||||
fileSize.textContent = file.size.toLocaleString() + " bytes";
|
fileSize.textContent = file.size.toLocaleString() + " bytes";
|
||||||
|
|
||||||
|
// Display preview slice in the background
|
||||||
|
const outputText = document.getElementById("output-text"),
|
||||||
|
fileSlice = this.dishBuffer.slice(0, 4096);
|
||||||
|
|
||||||
|
outputText.classList.add("blur");
|
||||||
|
outputText.value = Utils.printable(Utils.arrayBufferToStr(fileSlice));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -137,6 +144,7 @@ OutputWaiter.prototype.setFile = function(buf) {
|
|||||||
OutputWaiter.prototype.closeFile = function() {
|
OutputWaiter.prototype.closeFile = function() {
|
||||||
this.dishBuffer = null;
|
this.dishBuffer = null;
|
||||||
document.getElementById("output-file").style.display = "none";
|
document.getElementById("output-file").style.display = "none";
|
||||||
|
document.getElementById("output-text").classList.remove("blur");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -163,6 +171,7 @@ OutputWaiter.prototype.displayFileSlice = function() {
|
|||||||
sliceTo = parseInt(sliceToEl.value, 10),
|
sliceTo = parseInt(sliceToEl.value, 10),
|
||||||
str = Utils.arrayBufferToStr(this.dishBuffer.slice(sliceFrom, sliceTo));
|
str = Utils.arrayBufferToStr(this.dishBuffer.slice(sliceFrom, sliceTo));
|
||||||
|
|
||||||
|
document.getElementById("output-text").classList.remove("blur");
|
||||||
showFileOverlay.style.display = "block";
|
showFileOverlay.style.display = "block";
|
||||||
this.set(str, "string", new Date().getTime() - startTime, true);
|
this.set(str, "string", new Date().getTime() - startTime, true);
|
||||||
};
|
};
|
||||||
@@ -177,6 +186,7 @@ OutputWaiter.prototype.showFileOverlayClick = function(e) {
|
|||||||
const outputFile = document.getElementById("output-file"),
|
const outputFile = document.getElementById("output-file"),
|
||||||
showFileOverlay = e.target;
|
showFileOverlay = e.target;
|
||||||
|
|
||||||
|
document.getElementById("output-text").classList.add("blur");
|
||||||
outputFile.style.display = "block";
|
outputFile.style.display = "block";
|
||||||
showFileOverlay.style.display = "none";
|
showFileOverlay.style.display = "none";
|
||||||
this.setOutputInfo(this.dishBuffer.byteLength, null, 0);
|
this.setOutputInfo(this.dishBuffer.byteLength, null, 0);
|
||||||
|
|||||||
@@ -88,6 +88,7 @@
|
|||||||
window.loadingMsgsInt = setInterval(changeLoadingMsg, (Math.random() * 2000) + 1500);
|
window.loadingMsgsInt = setInterval(changeLoadingMsg, (Math.random() * 2000) + 1500);
|
||||||
</script>
|
</script>
|
||||||
<% if (!htmlWebpackPlugin.options.inline) { %>
|
<% if (!htmlWebpackPlugin.options.inline) { %>
|
||||||
|
<meta name="robots" content="noindex" />
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
<% print(JSON.stringify(require("../static/structuredData.json"))); %>
|
<% print(JSON.stringify(require("../static/structuredData.json"))); %>
|
||||||
</script>
|
</script>
|
||||||
@@ -183,8 +184,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="textarea-wrapper no-select">
|
<div class="textarea-wrapper no-select">
|
||||||
<div id="input-highlighter" class="no-select"></div>
|
<div id="input-highlighter" class="no-select"></div>
|
||||||
<textarea id="input-text"></textarea>
|
<textarea id="input-text" spellcheck="false"></textarea>
|
||||||
<div id="input-file">
|
<div id="input-file">
|
||||||
|
<div class="file-overlay"></div>
|
||||||
<div style="position: relative; height: 100%;">
|
<div style="position: relative; height: 100%;">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img aria-hidden="true" src="<%- require('../static/images/file-128x128.png') %>" alt="File icon"/>
|
<img aria-hidden="true" src="<%- require('../static/images/file-128x128.png') %>" alt="File icon"/>
|
||||||
@@ -218,9 +220,10 @@
|
|||||||
<div class="textarea-wrapper">
|
<div class="textarea-wrapper">
|
||||||
<div id="output-highlighter" class="no-select"></div>
|
<div id="output-highlighter" class="no-select"></div>
|
||||||
<div id="output-html"></div>
|
<div id="output-html"></div>
|
||||||
<textarea id="output-text" readonly="readonly"></textarea>
|
<textarea id="output-text" readonly="readonly" spellcheck="false"></textarea>
|
||||||
<img id="show-file-overlay" aria-hidden="true" src="<%- require('../static/images/file-32x32.png') %>" alt="Show file overlay" title="Show file overlay"/>
|
<img id="show-file-overlay" aria-hidden="true" src="<%- require('../static/images/file-32x32.png') %>" alt="Show file overlay" title="Show file overlay"/>
|
||||||
<div id="output-file">
|
<div id="output-file">
|
||||||
|
<div class="file-overlay"></div>
|
||||||
<div style="position: relative; height: 100%;">
|
<div style="position: relative; height: 100%;">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img aria-hidden="true" src="<%- require('../static/images/file-128x128.png') %>" alt="File icon"/>
|
<img aria-hidden="true" src="<%- require('../static/images/file-128x128.png') %>" alt="File icon"/>
|
||||||
@@ -233,7 +236,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<input type="number" class="form-control" id="output-file-slice-from" placeholder="From" value="0" step="1024" min="0">
|
<input type="number" class="form-control" id="output-file-slice-from" placeholder="From" value="0" step="1024" min="0">
|
||||||
<div class="input-group-addon">to</div>
|
<div class="input-group-addon">to</div>
|
||||||
<input type="number" class="form-control" id="output-file-slice-to" placeholder="To" value="1024" step="1024" min="0">
|
<input type="number" class="form-control" id="output-file-slice-to" placeholder="To" value="2048" step="1024" min="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
33
src/web/static/sitemap.js
Normal file
33
src/web/static/sitemap.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import sm from "sitemap";
|
||||||
|
import OperationConfig from "../../core/config/MetaConfig.js";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates an XML sitemap for all CyberChef operations and a number of recipes.
|
||||||
|
*
|
||||||
|
* @author n1474335 [n1474335@gmail.com]
|
||||||
|
* @copyright Crown Copyright 2018
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
const sitemap = sm.createSitemap({
|
||||||
|
hostname: "https://gchq.github.io/CyberChef",
|
||||||
|
});
|
||||||
|
|
||||||
|
sitemap.add({
|
||||||
|
url: "/",
|
||||||
|
changefreq: "weekly",
|
||||||
|
priority: 1.0
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let op in OperationConfig) {
|
||||||
|
sitemap.add({
|
||||||
|
url: `/?op=${encodeURIComponent(op)}`,
|
||||||
|
changeFreq: "yearly",
|
||||||
|
priority: 0.5
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const xml = sitemap.toString();
|
||||||
|
|
||||||
|
console.log(xml); // eslint-disable-line no-console
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Libraries */
|
/* Libraries */
|
||||||
import "google-code-prettify/src/prettify.css";
|
import "highlight.js/styles/vs.css";
|
||||||
|
|
||||||
/* Frameworks */
|
/* Frameworks */
|
||||||
import "./vendors/bootstrap.less";
|
import "./vendors/bootstrap.less";
|
||||||
|
|||||||
@@ -84,10 +84,17 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: var(--title-background-colour);
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.file-overlay {
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0.8;
|
||||||
|
background-color: var(--title-background-colour);
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
#show-file-overlay {
|
#show-file-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 15px;
|
right: 15px;
|
||||||
|
|||||||
Reference in New Issue
Block a user