maierfelix / Iroh

Dynamic code analysis tool - Exploit, record and analyze running JavaScript
https://maierfelix.github.io/Iroh/
MIT License
923 stars 54 forks source link

Error when accessing a variable from inside an eval() #14

Closed cpx0rpc closed 4 years ago

cpx0rpc commented 4 years ago

I get an error when trying to access a variable from inside an eval(). An example is below:

var cmd = "var inEval = 1000; console.log(inEval); console.log(outEval);"; var outEval = 9999; eval(cmd); console.log(inEval); console.log(outEval);

In this example, if I run it without the Iroh being applied, the output is correct. However, when I apply Iroh on this example I get an error indicating that outEval is not defined from inside the eval(). The variable inside an eval(), on the other hand, works as expect outside an eval(). Anyone know the reason why this happens or how to fix it?