mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-11 00:31:31 -04:00
Finally working
This commit is contained in:
parent
49a05c5d73
commit
ee3e6751be
3 changed files with 23 additions and 25 deletions
|
@ -280,7 +280,7 @@ class Magic {
|
||||||
if (_buffersEqual(output, new ArrayBuffer())) {
|
if (_buffersEqual(output, new ArrayBuffer())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const outputRegexes = OperationConfig[op.op].outputRegexes;
|
const outputRegexes = OperationConfig[op.op].outputRegexes;
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case "Input":
|
case "Input":
|
||||||
|
|
|
@ -85,17 +85,16 @@ class potentialOps {
|
||||||
generateInputOpPatterns() {
|
generateInputOpPatterns() {
|
||||||
const opPatterns = [];
|
const opPatterns = [];
|
||||||
for (const op in OperationConfig) {
|
for (const op in OperationConfig) {
|
||||||
if (!("inputRegexes" in OperationConfig[op])) continue;
|
if (("inputRegexes" in OperationConfig[op]) && !!(OperationConfig[op].inputRegexes))
|
||||||
|
OperationConfig[op].inputRegexes.forEach(pattern => {
|
||||||
OperationConfig[op].inputRegexes.forEach(pattern => {
|
opPatterns.push({
|
||||||
opPatterns.push({
|
op: op,
|
||||||
op: op,
|
match: pattern.match,
|
||||||
match: pattern.match,
|
flags: pattern.flags,
|
||||||
flags: pattern.flags,
|
args: pattern.args,
|
||||||
args: pattern.args,
|
useful: pattern.useful || false
|
||||||
useful: pattern.useful || false
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return opPatterns;
|
return opPatterns;
|
||||||
|
@ -109,20 +108,19 @@ class potentialOps {
|
||||||
generateOutputOpPatterns() {
|
generateOutputOpPatterns() {
|
||||||
const opPatterns = [];
|
const opPatterns = [];
|
||||||
for (const op in OperationConfig) {
|
for (const op in OperationConfig) {
|
||||||
if (!(OperationConfig[op].outputRegexes) && (OperationConfig[op].inputRegexes)) continue;
|
if ((OperationConfig[op].outputRegexes) && !(OperationConfig[op].inputRegexes))
|
||||||
|
OperationConfig[op].outputRegexes.forEach(pattern => {
|
||||||
OperationConfig[op].outputRegexes.forEach(pattern => {
|
opPatterns.push({
|
||||||
opPatterns.push({
|
op: op,
|
||||||
op: op,
|
match: pattern.match,
|
||||||
match: pattern.match,
|
flags: pattern.flags,
|
||||||
flags: pattern.flags,
|
shouldMatch: pattern.shouldMatch,
|
||||||
shouldMatch: pattern.shouldMatch,
|
args: pattern.args,
|
||||||
args: pattern.args,
|
useful: pattern.useful || false
|
||||||
useful: pattern.useful || false
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
console.log(opPatterns);
|
||||||
return opPatterns;
|
return opPatterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,13 @@ class DefangIPAddresses extends Operation {
|
||||||
this.inputType = "string";
|
this.inputType = "string";
|
||||||
this.outputType = "string";
|
this.outputType = "string";
|
||||||
this.args = [];
|
this.args = [];
|
||||||
this.checks = new magicObject([
|
this.checks = new magicObject(/*[
|
||||||
{
|
{
|
||||||
match: "^\\s*(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-f]{4}:){7}[0-9a-f]{4})\\s*$",
|
match: "^\\s*(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-f]{4}:){7}[0-9a-f]{4})\\s*$",
|
||||||
flags: "i",
|
flags: "i",
|
||||||
args: [],
|
args: [],
|
||||||
}
|
}
|
||||||
],
|
],*/null,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
match: "^\\s*(([0-9]{1,3}\\[\\.\\]){3}[0-9]{1,3}|([0-9a-f]{4}\\[\\:\\]){7}[0-9a-f]{4})\\s*$",
|
match: "^\\s*(([0-9]{1,3}\\[\\.\\]){3}[0-9]{1,3}|([0-9a-f]{4}\\[\\:\\]){7}[0-9a-f]{4})\\s*$",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue