Im trying to deobfuscate a js in order for me to understand it better. To do so im trying to replace variable declarations/operations etc with the correct values (values are stored in objects & arrays). I have been trying to use esprima and uglifyjs in order to parse and interpret the operations but the parsing is way too detailed to be parsed for my use case. Chrome/Firefox have a similar feature in their debugger where they show the value of the variable at the time the debugger stopped. Is there some way to step through the js line by line and see what variable changes/gets declared. Or is there a really simple js parsing library that doesnt parse as detailed as esprima in order to automatically execute the js line by line to get the info needed
ex:
function a(arg){
var b = arg << 8;
b++;
b += b*4;
if(b > 5){console.log("b is greater 5");}
}
a(5);
could be simplified to
function a(5){
var b = 1280;
b++;
b += 1281*4;
if(6405 > 5){console.log("b is greater 5");}
}