mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Added WAV extractor.
This commit is contained in:
parent
f3864b00fe
commit
a4772941a7
1 changed files with 17 additions and 1 deletions
|
@ -736,7 +736,7 @@ export const FILE_SIGNATURES = {
|
||||||
10: 0x56,
|
10: 0x56,
|
||||||
11: 0x45
|
11: 0x45
|
||||||
},
|
},
|
||||||
extractor: null
|
extractor: extractWAV
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "OGG audio",
|
name: "OGG audio",
|
||||||
|
@ -2642,6 +2642,22 @@ export function extractBMP(bytes, offset) {
|
||||||
return stream.carve();
|
return stream.carve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WAV extractor.
|
||||||
|
*
|
||||||
|
* @param {Uint8Array} bytes
|
||||||
|
* @param {Number} offset
|
||||||
|
* @returns {Uint8Array}
|
||||||
|
*/
|
||||||
|
export function extractWAV(bytes, offset) {
|
||||||
|
const stream = new Stream(bytes.slice(offset));
|
||||||
|
stream.moveTo(4);
|
||||||
|
|
||||||
|
// Move to file size.
|
||||||
|
stream.moveTo(stream.readInt(4, "le")-4);
|
||||||
|
return stream.carve();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FLV extractor.
|
* FLV extractor.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue