mirror of
https://github.com/gchq/CyberChef
synced 2026-01-06 02:23:20 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5f6cedd30 | ||
|
|
c879af6860 | ||
|
|
22fe5a6ae7 | ||
|
|
57714c86a6 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cyberchef",
|
"name": "cyberchef",
|
||||||
"version": "9.27.0",
|
"version": "9.27.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cyberchef",
|
"name": "cyberchef",
|
||||||
"version": "9.27.0",
|
"version": "9.27.2",
|
||||||
"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",
|
||||||
|
|||||||
@@ -895,8 +895,8 @@ class Utils {
|
|||||||
|
|
||||||
while ((m = recipeRegex.exec(recipe))) {
|
while ((m = recipeRegex.exec(recipe))) {
|
||||||
// Translate strings in args back to double-quotes
|
// Translate strings in args back to double-quotes
|
||||||
args = m[2]
|
args = m[2] // lgtm [js/incomplete-sanitization]
|
||||||
.replace(/"/g, '\\"') // Escape double quotes // lgtm [js/incomplete-sanitization]
|
.replace(/"/g, '\\"') // Escape double quotes
|
||||||
.replace(/(^|,|{|:)'/g, '$1"') // Replace opening ' with "
|
.replace(/(^|,|{|:)'/g, '$1"') // Replace opening ' with "
|
||||||
.replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
.replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
||||||
.replace(/\\'/g, "'"); // Unescape single quotes
|
.replace(/\\'/g, "'"); // Unescape single quotes
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import {fuzzyMatch, calcMatchRanges, DEFAULT_WEIGHTS} from "../lib/FuzzyMatch.mjs";
|
import {fuzzyMatch, calcMatchRanges, DEFAULT_WEIGHTS} from "../lib/FuzzyMatch.mjs";
|
||||||
|
import Utils from "../Utils.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fuzzy Match operation
|
* Fuzzy Match operation
|
||||||
@@ -101,16 +102,16 @@ class FuzzyMatch extends Operation {
|
|||||||
const matchRanges = calcMatchRanges(idxs);
|
const matchRanges = calcMatchRanges(idxs);
|
||||||
|
|
||||||
matchRanges.forEach(([start, length], i) => {
|
matchRanges.forEach(([start, length], i) => {
|
||||||
result += input.slice(pos, start);
|
result += Utils.escapeHtml(input.slice(pos, start));
|
||||||
if (i === 0) result += `<span class="${hlClass}">`;
|
if (i === 0) result += `<span class="${hlClass}">`;
|
||||||
pos = start + length;
|
pos = start + length;
|
||||||
result += `<b>${input.slice(start, pos)}</b>`;
|
result += `<b>${Utils.escapeHtml(input.slice(start, pos))}</b>`;
|
||||||
});
|
});
|
||||||
result += "</span>";
|
result += "</span>";
|
||||||
hlClass = hlClass === "hl1" ? "hl2" : "hl1";
|
hlClass = hlClass === "hl1" ? "hl2" : "hl1";
|
||||||
});
|
});
|
||||||
|
|
||||||
result += input.slice(pos, input.length);
|
result += Utils.escapeHtml(input.slice(pos, input.length));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -725,7 +725,7 @@ class App {
|
|||||||
this.progress = 0;
|
this.progress = 0;
|
||||||
this.autoBake();
|
this.autoBake();
|
||||||
|
|
||||||
this.updateTitle(false, null, true);
|
this.updateTitle(true, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class ControlsWaiter {
|
|||||||
const includeRecipe = document.getElementById("save-link-recipe-checkbox").checked;
|
const includeRecipe = document.getElementById("save-link-recipe-checkbox").checked;
|
||||||
const includeInput = document.getElementById("save-link-input-checkbox").checked;
|
const includeInput = document.getElementById("save-link-input-checkbox").checked;
|
||||||
const saveLinkEl = document.getElementById("save-link");
|
const saveLinkEl = document.getElementById("save-link");
|
||||||
const saveLink = this.generateStateUrl(includeRecipe, includeInput, recipeConfig);
|
const saveLink = this.generateStateUrl(includeRecipe, includeInput, null, recipeConfig);
|
||||||
|
|
||||||
saveLinkEl.innerHTML = Utils.escapeHtml(Utils.truncate(saveLink, 120));
|
saveLinkEl.innerHTML = Utils.escapeHtml(Utils.truncate(saveLink, 120));
|
||||||
saveLinkEl.setAttribute("href", saveLink);
|
saveLinkEl.setAttribute("href", saveLink);
|
||||||
@@ -128,11 +128,13 @@ class ControlsWaiter {
|
|||||||
includeRecipe = includeRecipe && (recipeConfig.length > 0);
|
includeRecipe = includeRecipe && (recipeConfig.length > 0);
|
||||||
|
|
||||||
// If we don't get passed an input, get it from the current URI
|
// If we don't get passed an input, get it from the current URI
|
||||||
if (input === null) {
|
if (input === null && includeInput) {
|
||||||
const params = this.app.getURIParams();
|
const params = this.app.getURIParams();
|
||||||
if (params.input) {
|
if (params.input) {
|
||||||
includeInput = true;
|
includeInput = true;
|
||||||
input = params.input;
|
input = params.input;
|
||||||
|
} else {
|
||||||
|
includeInput = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user