| Probably a good place to ask a specific question about debugging here. A few years ago, I was hacking a web bookreader. It has a function that is used to decode images (they're encrypted in some way) into canvas, and I want to find it so I can call it directly in my user script to batch download decoded images. So I monkey patched `CanvasRenderingContext2D` function, added breakpoint, and found where the the function is defined in the 100k lines of obfuscated JS source code, easily. The problem is.. once the page is rendered, the function would be nested in some objects, something like `window.abd.fdsfsd.r2323.fsdfs.fasf.xyy.myfunc`. I don't know how exactly I can find the full "path" of the function so I can call it, despite I'm literally pausing inside of it. I eventually got it done, but it was manual and painful. So I'm wandering: is there a better way to do it? The browser obviously knows it, it just lacks of a way to tell. |
If you're sure the function is reachable from window you can search for it recursively: