I'd like to reverse engineer a JavaScript program by manually renaming minimified variable, parameter and function names. However, updating my reverse-engineered code to a newer version would be very difficult, because:
- The minimized variable names are randomized every time, which makes it hard to see what changed between two versions
- Even if the variable names were static, I'd have to keep track of which variable means what, which is very difficult because variable names are not globally unique, but rather per-scope
Is there any tool that could:
- Automatically rename variables to unique names keeping track of their scope
- Be able to find difference between two versions by looking at the code structure but ignoring changes in the variable names, and assign names to new variables without conflicting the old ones
- Automatically rename these variables based on an mapping file, such as
var584 -> readPacket, var585 -> writePacket, ...
- Automatically convert minimified statements such as
condition && statement;
toif (!condition) { statement; }
, and!0
totrue