cyberchef 9.47.2 → 9.47.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyberchef",
|
|
3
|
-
"version": "9.47.
|
|
3
|
+
"version": "9.47.3",
|
|
4
4
|
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
|
5
5
|
"author": "n1474335 <n1474335@gmail.com>",
|
|
6
6
|
"homepage": "https://gchq.github.io/CyberChef",
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import Operation from "../Operation.mjs";
|
|
8
8
|
import {INFLATE_BUFFER_TYPE} from "../lib/Zlib.mjs";
|
|
9
9
|
import rawinflate from "zlibjs/bin/rawinflate.min.js";
|
|
10
|
-
import OperationError from "../errors/OperationError.mjs";
|
|
11
10
|
|
|
12
11
|
const Zlib = rawinflate.Zlib;
|
|
13
12
|
|
|
@@ -83,25 +82,6 @@ class RawInflate extends Operation {
|
|
|
83
82
|
}),
|
|
84
83
|
result = new Uint8Array(inflate.decompress());
|
|
85
84
|
|
|
86
|
-
// Raw Inflate sometimes messes up and returns nonsense like this:
|
|
87
|
-
// ]....]....]....]....]....]....]....]....]....]....]....]....]....]...
|
|
88
|
-
// e.g. Input data of [8b, 1d, dc, 44]
|
|
89
|
-
// Look for the first two square brackets:
|
|
90
|
-
if (result.length > 158 && result[0] === 93 && result[5] === 93) {
|
|
91
|
-
// If the first two square brackets are there, check that the others
|
|
92
|
-
// are also there. If they are, throw an error. If not, continue.
|
|
93
|
-
let valid = false;
|
|
94
|
-
for (let i = 0; i < 155; i += 5) {
|
|
95
|
-
if (result[i] !== 93) {
|
|
96
|
-
valid = true;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (!valid) {
|
|
101
|
-
throw new OperationError("Error: Unable to inflate data");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
// This seems to be the easiest way...
|
|
105
85
|
return result.buffer;
|
|
106
86
|
}
|
|
107
87
|
|