Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6318f78e29 | ||
|
|
5e6f3cc5b4 | ||
|
|
04f1fa06ad | ||
|
|
8d660e53b2 | ||
|
|
f3864b00fe | ||
|
|
51cc94bf2a | ||
|
|
f63d1354ba | ||
|
|
80362cfa84 | ||
|
|
447a6d7524 | ||
|
|
f022440b4a | ||
|
|
4f5e0c007d | ||
|
|
b83f6591bb | ||
|
|
77a9481cf9 |
No files matched your search
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cyberchef",
|
||||
"version": "9.11.0",
|
||||
"version": "9.11.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cyberchef",
|
||||
"version": "9.11.0",
|
||||
"version": "9.11.1",
|
||||
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
||||
"author": "n1474335 <n1474335@gmail.com>",
|
||||
"homepage": "https://gchq.github.io/CyberChef",
|
||||
|
||||
@@ -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",
|
||||
@@ -1444,7 +1444,7 @@ export const FILE_SIGNATURES = {
|
||||
1: 0x5a,
|
||||
2: 0x68
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractBZIP2
|
||||
},
|
||||
{
|
||||
name: "7zip",
|
||||
@@ -1485,7 +1485,7 @@ export const FILE_SIGNATURES = {
|
||||
4: 0x5a,
|
||||
5: 0x0
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractXZ
|
||||
},
|
||||
{
|
||||
name: "Tarball",
|
||||
@@ -2440,6 +2440,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.
|
||||
@@ -2777,6 +2820,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 +2888,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.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user