Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a8b362dfd | ||
|
|
82b94fad5d | ||
|
|
42cfed5fa8 | ||
|
|
e4452b906e | ||
|
|
36abaeb6fb | ||
|
|
507c951f28 | ||
|
|
8a67103808 | ||
|
|
b3a10d4f9e | ||
|
|
d4c4e2599d | ||
|
|
67ead1c250 |
No files matched your search
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cyberchef",
|
||||
"version": "9.0.1",
|
||||
"version": "9.0.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cyberchef",
|
||||
"version": "9.0.1",
|
||||
"version": "9.0.3",
|
||||
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
||||
"author": "n1474335 <n1474335@gmail.com>",
|
||||
"homepage": "https://gchq.github.io/CyberChef",
|
||||
|
||||
+19
-1
@@ -235,6 +235,10 @@ class Dish {
|
||||
case Dish.JSON:
|
||||
title = "application/json";
|
||||
break;
|
||||
case Dish.NUMBER:
|
||||
case Dish.BIG_NUMBER:
|
||||
title = this.value.toString();
|
||||
break;
|
||||
case Dish.ARRAY_BUFFER:
|
||||
case Dish.BYTE_ARRAY:
|
||||
title = this.detectDishType();
|
||||
@@ -283,7 +287,21 @@ class Dish {
|
||||
case Dish.ARRAY_BUFFER:
|
||||
return this.value instanceof ArrayBuffer;
|
||||
case Dish.BIG_NUMBER:
|
||||
return BigNumber.isBigNumber(this.value);
|
||||
if (BigNumber.isBigNumber(this.value)) return true;
|
||||
/*
|
||||
If a BigNumber is passed between WebWorkers it is serialised as a JSON
|
||||
object with a coefficient (c), exponent (e) and sign (s). We detect this
|
||||
and reinitialise it as a BigNumber object.
|
||||
*/
|
||||
if (Object.keys(this.value).sort().equals(["c", "e", "s"])) {
|
||||
const temp = new BigNumber();
|
||||
temp.c = this.value.c;
|
||||
temp.e = this.value.e;
|
||||
temp.s = this.value.s;
|
||||
this.value = temp;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case Dish.JSON:
|
||||
// All values can be serialised in some manner, so we return true in all cases
|
||||
return true;
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
|
||||
/* Misc. */
|
||||
--drop-file-border-colour: #3a87ad;
|
||||
--table-border-colour: #ccc;
|
||||
--popover-background: #fff;
|
||||
--popover-border-colour: #ccc;
|
||||
--code-background: #f9f2f4;
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
|
||||
/* Misc. */
|
||||
--drop-file-border-colour: #0e639c;
|
||||
--table-border-colour: #555;
|
||||
--popover-background: #444;
|
||||
--popover-border-colour: #555;
|
||||
--code-background: #0e639c;
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
|
||||
/* Misc. */
|
||||
--drop-file-border-colour: purple;
|
||||
--table-border-colour: var(--hl3);
|
||||
--popover-background: turquoise;
|
||||
--popover-border-colour: violet;
|
||||
--code-background: black;
|
||||
|
||||
@@ -138,6 +138,7 @@
|
||||
|
||||
/* Misc. */
|
||||
--drop-file-border-colour: var(--base01);
|
||||
--table-border-colour: var(--base01);
|
||||
--popover-background: var(--base02);
|
||||
--popover-border-colour: var(--base01);
|
||||
--code-background: var(--base03);
|
||||
|
||||
@@ -140,6 +140,7 @@
|
||||
|
||||
/* Misc. */
|
||||
--drop-file-border-colour: var(--base1);
|
||||
--table-border-colour: var(--base1);
|
||||
--popover-background: var(--base2);
|
||||
--popover-border-colour: var(--base1);
|
||||
--code-background: var(--base3);
|
||||
|
||||
@@ -148,6 +148,15 @@ optgroup {
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
.table,
|
||||
.table-hover tbody tr:hover {
|
||||
color: var(--primary-font-colour);
|
||||
}
|
||||
|
||||
.table-bordered th, .table-bordered td {
|
||||
border: 1px solid var(--table-border-colour);
|
||||
}
|
||||
|
||||
.popover {
|
||||
background-color: var(--popover-background);
|
||||
border-color: var(--popover-border-colour);
|
||||
|
||||
@@ -515,8 +515,9 @@ class InputWaiter {
|
||||
*
|
||||
* @param {number} inputNum
|
||||
* @param {string | ArrayBuffer} value
|
||||
* @param {boolean} [force=false] - If true, forces the value to be updated even if the type is different to the currently stored type
|
||||
*/
|
||||
updateInputValue(inputNum, value) {
|
||||
updateInputValue(inputNum, value, force=false) {
|
||||
let includeInput = false;
|
||||
const recipeStr = toBase64(value, "A-Za-z0-9+/"); // B64 alphabet with no padding
|
||||
if (recipeStr.length > 0 && recipeStr.length <= 68267) {
|
||||
@@ -534,7 +535,8 @@ class InputWaiter {
|
||||
action: "updateInputValue",
|
||||
data: {
|
||||
inputNum: inputNum,
|
||||
value: value
|
||||
value: value,
|
||||
force: force
|
||||
}
|
||||
}, transferable);
|
||||
}
|
||||
@@ -988,9 +990,13 @@ class InputWaiter {
|
||||
this.manager.highlighter.removeHighlights();
|
||||
getSelection().removeAllRanges();
|
||||
|
||||
const tabsList = document.getElementById("input-tabs").children;
|
||||
for (let i = tabsList.length - 1; i >= 0; i--) {
|
||||
tabsList.item(i).remove();
|
||||
const tabsList = document.getElementById("input-tabs");
|
||||
const tabsListChildren = tabsList.children;
|
||||
|
||||
tabsList.classList.remove("tabs-left");
|
||||
tabsList.classList.remove("tabs-right");
|
||||
for (let i = tabsListChildren.length - 1; i >= 0; i--) {
|
||||
tabsListChildren.item(i).remove();
|
||||
}
|
||||
|
||||
this.showLoadingInfo({
|
||||
@@ -1021,7 +1027,7 @@ class InputWaiter {
|
||||
this.manager.highlighter.removeHighlights();
|
||||
getSelection().removeAllRanges();
|
||||
|
||||
this.updateInputValue(inputNum, "");
|
||||
this.updateInputValue(inputNum, "", true);
|
||||
|
||||
this.set({
|
||||
inputNum: inputNum,
|
||||
|
||||
@@ -217,9 +217,13 @@ class OutputWaiter {
|
||||
*/
|
||||
removeAllOutputs() {
|
||||
this.outputs = {};
|
||||
const tabs = document.getElementById("output-tabs").children;
|
||||
for (let i = tabs.length - 1; i >= 0; i--) {
|
||||
tabs.item(i).remove();
|
||||
const tabsList = document.getElementById("output-tabs");
|
||||
const tabsListChildren = tabsList.children;
|
||||
|
||||
tabsList.classList.remove("tabs-left");
|
||||
tabsList.classList.remove("tabs-right");
|
||||
for (let i = tabsListChildren.length - 1; i >= 0; i--) {
|
||||
tabsListChildren.item(i).remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,8 +939,8 @@ class OutputWaiter {
|
||||
*/
|
||||
refreshTabs(activeTab, direction) {
|
||||
const newNums = this.getNearbyNums(activeTab, direction),
|
||||
tabsLeft = (newNums[0] !== this.getSmallestInputNum()),
|
||||
tabsRight = (newNums[newNums.length - 1] !== this.getLargestInputNum());
|
||||
tabsLeft = (newNums[0] !== this.getSmallestInputNum() && newNums.length > 0),
|
||||
tabsRight = (newNums[newNums.length - 1] !== this.getLargestInputNum() && newNums.length > 0);
|
||||
|
||||
this.manager.tabs.refreshOutputTabs(newNums, activeTab, tabsLeft, tabsRight);
|
||||
|
||||
@@ -1149,14 +1153,14 @@ class OutputWaiter {
|
||||
* Handler for copy click events.
|
||||
* Copies the output to the clipboard
|
||||
*/
|
||||
copyClick() {
|
||||
async copyClick() {
|
||||
const dish = this.getOutputDish(this.manager.tabs.getActiveOutputTab());
|
||||
if (dish === null) {
|
||||
this.app.alert("Could not find data to copy. Has this output been baked yet?", 3000);
|
||||
return;
|
||||
}
|
||||
|
||||
const output = dish.get(Dish.STRING);
|
||||
const output = await dish.get(Dish.STRING);
|
||||
|
||||
// Create invisible textarea to populate with the raw dish string (not the printable version that
|
||||
// contains dots instead of the actual bytes)
|
||||
@@ -1331,7 +1335,7 @@ class OutputWaiter {
|
||||
if (Object.prototype.hasOwnProperty.call(output, "data") &&
|
||||
output.data &&
|
||||
Object.prototype.hasOwnProperty.call(output.data, "dish")) {
|
||||
const data = output.data.dish.get(Dish.STRING);
|
||||
const data = await output.data.dish.get(Dish.STRING);
|
||||
if (contentFilterExp.test(data)) {
|
||||
results.push({
|
||||
inputNum: iNum,
|
||||
|
||||
@@ -493,8 +493,8 @@ self.setInput = function(inputData) {
|
||||
self.refreshTabs = function(inputNum, direction) {
|
||||
const nums = self.getNearbyNums(inputNum, direction),
|
||||
inputNums = Object.keys(self.inputs),
|
||||
tabsLeft = (self.getSmallestInputNum(inputNums) !== nums[0]),
|
||||
tabsRight = (self.getLargestInputNum(inputNums) !== nums[nums.length - 1]);
|
||||
tabsLeft = (self.getSmallestInputNum(inputNums) !== nums[0] && nums.length > 0),
|
||||
tabsRight = (self.getLargestInputNum(inputNums) !== nums[nums.length - 1] && nums.length > 0);
|
||||
|
||||
self.postMessage({
|
||||
action: "refreshTabs",
|
||||
@@ -546,10 +546,13 @@ self.updateInputProgress = function(inputData) {
|
||||
* @param {object} inputData
|
||||
* @param {number} inputData.inputNum - The input that's having its value updated
|
||||
* @param {string | ArrayBuffer} inputData.value - The new value of the input
|
||||
* @param {boolean} inputData.force - If true, still updates the input value if the input type is different to the stored value
|
||||
*/
|
||||
self.updateInputValue = function(inputData) {
|
||||
const inputNum = inputData.inputNum;
|
||||
if (inputNum < 1) return;
|
||||
if (Object.prototype.hasOwnProperty.call(self.inputs[inputNum].data, "fileBuffer") &&
|
||||
typeof inputData.value === "string" && !inputData.force) return;
|
||||
const value = inputData.value;
|
||||
if (self.inputs[inputNum] !== undefined) {
|
||||
if (typeof value === "string") {
|
||||
|
||||
Reference in new issue
Block a user