JavaScript Deobfuscator Reloaded

phoneJust a few weeks in the past I launched JavaScript Deobfuscator 2.0 – lastly one thing that works with current Firefox versions again. Why did it take me a 12 months to repair this compatibility problem? Well, it really wasn’t that simple. After considering all the prospects I determined that rewriting it from scratch was the only chance, and that was laborious to accomplish in my spare time. Before I proceed with the technical particulars, enable me to introduce JavaScript Deobfuscator in its new reincarnation: it now provides a panel to Firefox Developer Tools. Instead of messing with filters your view is limited to the current tab routinely. Both compiled and executed scripts go into the same checklist, with some textual content indicating whether we’ve seen the script being compiled or executed or each. Starting with Firefox 39 even code running in Web Workers will probably be displayed. And JavaScript Deobfuscator will beautify the code instead of relying on the JavaScript engine to do so.

The downside is that only Firefox is supported now – other applications simply don’t have Developer Tools to integrate with. Also, debugging add-ons or the browser itself isn’t attainable– Developer Tools run in a separate course of for that, no add-ons installed there. Finally, the search functionality is completely rudimentary proper now, that’s one thing I hope to improve finally. Now to the technical particulars. The rationale for this overhaul is the new debugging interface which changed the one JavaScript Deobfuscator was using. The outdated debugging interface was conceptually completely different, it was designed as a single hook to gather all information. The brand new one however collects knowledge about individual compartments and it’s up to you to determine which ones you need. After just a few unsuccessful makes an attempt to proceed collecting all information in JavaScript Deobfuscator I realized that it made much more sense to have a look at individual tabs.

Using the brand new debugging API turned out to be tough to say the least. Did I link to MDN above? Sorry about that, I should have linked to the SpiderMonkey supply code. It’s very just like the MDN documentation however the later is outdated. And even in case you look on the SpiderMonkey source, much of the documentation is merely wishful pondering, itemizing options that have been never applied. A new UI concept had to be developed as nicely, and the only good choice for per-tab debugging can be integrating into the Firefox Developer Tools. That’s where the fun really began. Then I checked out what TargetType is and how present tools work with it – this was the purpose the place I realized that there are such a lot of implementation details concerned that an extension cannot probably do it. So I gave up. When i came again a few months later issues improved, slightly. Somebody wrote an Add-on SDK module to create new Developer Tools panels.

While I didn’t use that module directly, it showed nicely which components of the API are contractual and which ones are merely implementation particulars. It also confirmed that issues aren’t too dangerous for those who restrict yourself to a single goal type – a neighborhood tab. Handling remote connections to browser and add-ons is extra difficult, but as I discussed above extensions can’t do this anyway. Now that article stops at the point the place you “merely” want to use the distant debugging protocol to communicate with the constructed-in debugging actor. Well, possibly it is actually simple however I couldn’t work out how to do that – and whether that protocol is something I can depend on. See, the built-in instruments will definitely be adjusted when the debugging actor or/and the protocol change. My extension however will likely be broken, and I’ll want to speculate time into determining what modified and the way my code needs to be adjusted whereas staying suitable with older Firefox variations.

So JavaScript Deobfuscator makes use of the debugging interface instantly, without counting on the debugging actor of the Developer Tools. And it beautifies JavaScript code using its personal copy of a library fairly than counting on code used by Developer Tools – JavaScript beautification in Developer Tools is at the moment an implementation detail that extensions can’t depend on. JavaScript Deobfuscator additionally duplicates the kinds of the two Developer Tools themes to make sure it seems much like the existing panels – simply utilizing the styles from Developer Tools would have possible triggered a disaster after just a few Firefox releases. Not that the built-in styles are really outlined in a generic approach, there is de facto lots of inconsistencies there and each panel is styled considerably in a different way. These are only some examples, there’s more code duplication. Developer Tools aren’t presently constructed to allow extensions to reuse their code. Still, I’m fairly proud of the outcome, and discuss i hope that the most important chunk (JavaScript beautification) will go away finally. From the usability point of view the brand new version is a big leap ahead, getting there could have been easier however.

Leave a Reply

Your email address will not be published. Required fields are marked *