PerimeterX/restringer

rename identifiers

Closed this issue · 1 comments

using this input:

const c=n.a.get("API.lemonade.url"),d=n.a.get("API.lemonade.urlLinear"),u=n.a.get("API.lemonade.urlVod"),p=n.a.get("API.lemonade.platform"),m=n.a.get("API.lemonade.timeout");

I get this output:

const c = n.a.get('API.lemonade.url');
const d = n.a.get('API.lemonade.urlLinear');
const u = n.a.get('API.lemonade.urlVod');
const p = n.a.get('API.lemonade.platform');
const m = n.a.get('API.lemonade.timeout');

using another tool, I get:

const const1_ = n.a.get("API.lemonade.url"),
  const2_ = n.a.get("API.lemonade.urlLinear"),
  const3_ = n.a.get("API.lemonade.urlVod"),
  const4_ = n.a.get("API.lemonade.platform"),
  const5_ = /* global */ n.a.get("API.lemonade.timeout");

https://richsnapp.com/tools/code-unmangler

is is possible for restringer to also rename/unminify/unmangle identifiers?

It's possible, but I don't think this should be part of the deobfuscation process, as often times some of the variable names keep their meaning, and this will cause us to lose the little context that they give.
Personally I don't see the benefit of renaming variables like this, as const4_ doesn't give me any context.

There's a really nice project called JS Nice that does more meaningful renaming.

It's easy to create that with REstringer though, so if anyone's interested in creating a module that renames variable you can easily create it and open a PR