js-confuser
js-confuser copied to clipboard
Question about Excluding Functions from Obfuscation
Hi there,
I am using js-confuser for obfuscating my JavaScript code, and I have a question regarding excluding certain functions from the obfuscation process.
Is there an option or feature available that allows me to exclude specific functions (e.g., upload) from being obfuscated? If so, could you please provide guidance on how to implement this?
Thank you for your help!
You can use custom implementations to exclude the function transforms applying. This depends on what obfuscations you want for the upload function.
// Options.js
module.exports = {
target: 'browser',
// Versions 1.7.3 and below
stack: (fnName) => fnName != 'upload',
// Versions 2.0.0-alpha.2 and up ('stack' was renamed to 'variableMasking')
variableMasking: (fnName) => fnName != 'upload',
// Other function transforms
flatten: (fnName) => fnName != 'upload',
dispatcher: (fnName) => fnName != 'upload',
renameVariables: (fnName) => fnName != 'upload',
};
Nested functions within upload could be obfuscated and strings/variables inside the function could still be obfuscated.
Do you want the function to be completely unobfuscated? Because you could simply not run that through JS-Confuser and re-include that back in.
Closing for now