1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added experimental options to change the Windows agent resource executable information.

This commit is contained in:
Ylian Saint-Hilaire 2022-06-20 12:03:23 -07:00
parent 0b9d0eb60a
commit 44994a5a9b
3 changed files with 39 additions and 7 deletions

View file

@ -1639,7 +1639,6 @@ function createAuthenticodeHandler(path) {
// Re-encode the executable signature block
const p7signature = Buffer.from(forge.asn1.toDer(pkcs7der).data, 'binary');
console.log('r3');
// Write the file with the signature block
writeExecutableEx(output, p7signature, written, func);
@ -1830,16 +1829,14 @@ function start() {
if (err == null) { console.log("Done."); } else { console.log(err); }
if (exe != null) { exe.close(); }
});
return;
} else {
console.log("Changing resources and signing to " + args.out);
exe.writeExecutable(args, cert, function (err) { // Signing with resources decoded and re-encoded.
if (err == null) { console.log("Done."); } else { console.log(err); }
if (exe != null) { exe.close(); }
});
return;
}
console.log("Done.");
return;
}
if (command == 'unsign') { // Unsign an executable
if (typeof args.exe != 'string') { console.log("Missing --exe [filename]"); return; }