Javascript:跟踪函数父对象层次结构,以便从窗口上下文中调用它

时间:2022-11-07 16:56:40

I have a 3rd-party page with a complex, semi-obfuscated script generated by WebPack. It eventually calls a function, buried deep inside some object within an object within an array, etc. When debugging it I can see the line where the function is called at, but I want to trace the entire object hierarchy so I can call this function from the window context.

我有一个第三方页面,其中包含由WebPack生成的复杂,半混淆的脚本。它最终调用一个函数,深埋在数组中对象内的某个对象内部等。调试它时,我可以看到调用函数的行,但我想跟踪整个对象层次结构,这样我就可以调用这个函数从窗口上下文。

When debugging and breakpointing the relevant line, I get the call stack, but this doesn't help me reverse-engineer the way I can call this function, since it's buried within objects and arrays.

在调试和断开相关的行时,我得到了调用堆栈,但这并没有帮助我对我调用这个函数的方式进行反向工程,因为它隐藏在对象和数组中。

Is there any way to trace this backwards? For example, maybe have the Function object print its parents?

有没有办法追溯这个?例如,可能有Function对象打印其父对象?

Thanks in advance.

提前致谢。

1 个解决方案

#1


0  

check this "Get the stack trace for a function" in the following article Javascript Tips & Tricks you didn't know

在下面的文章中查看“获取函数的堆栈跟踪”,这是您不知道的Javascript提示和技巧

Hope this helps

希望这可以帮助

#1


0  

check this "Get the stack trace for a function" in the following article Javascript Tips & Tricks you didn't know

在下面的文章中查看“获取函数的堆栈跟踪”,这是您不知道的Javascript提示和技巧

Hope this helps

希望这可以帮助