added GootLoader decoder

This commit is contained in:
Rodel Mendrez 2023-05-02 14:58:56 +12:00
parent 1bc88728f0
commit ef3e8eb3b0
5 changed files with 2341 additions and 10661 deletions

View file

@ -0,0 +1,44 @@
/**
* @author drole [rodelm@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import Operation from "../Operation.mjs";
/**
* Gootloader decode operation
*/
class GootLoaderDecode extends Operation {
/**
* GootLoader constructor
*/
constructor() {
super();
this.name = "GootLoader Decode";
this.module = "Code";
this.description = "Decodes GootLoader JScript code block obfuscation";
this.inputType = "string";
this.outputType = "string";
this.args = [];
}
/**
* @param {string} input
* @param {Object[]} args
* @returns {string}
*/
run(input, args) {
if (!input) return "";
let decoded = "";
let decodedReversed = "";
for (let i = 0; i < input.length; i++) {
if (i%2) {
decoded += input.charAt(i);
} else {
decodedReversed += input.charAt(i);
}
}
return decodedReversed.split("").reverse().join("") + decoded;
}
}
export default GootLoaderDecode;