-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: block-level calculator/dispatcher #100
Comments
Yes that could added to
|
I am not too familiar with the entire codebase, so you should do the call where best to implement this. Just a few more notes:
e.ZaiCw(hh, d, function (f) {
// does
hh(d, function(f) { Maybe specialized dispatchers make more sense? // dispatcher only for hh
function dispatcher_hh(arg1, arg2) {
return hh(arg1, arg2)
}
// dispatcher with an array
// problem: might leak all functions used in the scope, so extra fake values required
function dispatcher(idx, arg1, arg2) {
var fn = [hh][idx];
return fn(arg1, arg2);
}
function test() {
var a = 10;
return a;
}
// out
function test(a) {
a = 10;
return a;
}
var example = {
abc: "def"
}
// after
var example = {};
example["abc"] = "def"; // most often with string concealment here Which can get really annoying with >50 assignments.
// example, after undoing string concealment
// only one string (ignoring "log") and a lot more confusing imo than an extra random string
var e = {
"hello world": function(a, b) {
return a(b)
}
}
e["hello world"](console.log, "hello world") |
I think going about this would be to buff up dispatcher. It will probably not be exactly like |
Closing for now. 1- Dispatchers are recursively applied |
Is your feature request related to a problem? Please describe.
In addition to the global calculator function, local/block-level calculator functions are very annoying to deal with.
This is an example from a script obfuscated by Cloudflare's proprietary solution:
As you can see, the
e
object contains a block-level dispatcher and variable, but it can also include calculators and even the same one multiple times:Sometimes in deeply nested functions, a block-level dispatcher/calculator also calls another higher-up one:
The text was updated successfully, but these errors were encountered: