mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 07:45:00 -04:00
got file output working. Adding Mime walking
This commit is contained in:
parent
1e0bb72dfa
commit
d8667a67be
1 changed files with 25 additions and 3 deletions
|
@ -90,19 +90,41 @@ class ParseIMF extends Operation {
|
||||||
let headerBody = ParseIMF.splitHeaderFromBody(input);
|
let headerBody = ParseIMF.splitHeaderFromBody(input);
|
||||||
let header = headerBody[0];
|
let header = headerBody[0];
|
||||||
let headerArray = ParseIMF.parseHeader(header);
|
let headerArray = ParseIMF.parseHeader(header);
|
||||||
if (args[0]) {
|
if (args[0] && headerBody.length > 0) {
|
||||||
header = ParseIMF.replaceDecodeWord(header);
|
headerBody[0] = ParseIMF.replaceDecodeWord(headerBody[0]);
|
||||||
}
|
}
|
||||||
let retval = [];
|
let retval = [];
|
||||||
let i = 0;
|
let i = 0;
|
||||||
headerBody.forEach(function(file){
|
headerBody.forEach(function(file){
|
||||||
file = new File(Array.from(file), "test"+String(i), {type: "text/plain"})
|
file = new File([file], "test"+String(i), {type: "text/plain"});
|
||||||
retval.push(file);
|
retval.push(file);
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays the files in HTML for web apps.
|
||||||
|
*
|
||||||
|
* @param {File[]} files
|
||||||
|
* @returns {html}
|
||||||
|
*/
|
||||||
|
async present(files) {
|
||||||
|
return await Utils.displayFilesAsHTML(files);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Walks a MIME document and returns an array of Mime data and header objects.
|
||||||
|
*
|
||||||
|
* @param {string} input
|
||||||
|
* @param {object} header
|
||||||
|
* @returns {object[]}
|
||||||
|
*/
|
||||||
|
static walkMime(input, header) {
|
||||||
|
let output = [];
|
||||||
|
if header[""]
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Breaks the header from the body and returns [header, body]
|
* Breaks the header from the body and returns [header, body]
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue