4/21/2025 at 7:38:36 AM
I've been using a shitty streaming website whose player interrupts the playback of a video in irregular intervals and presents a cryptic error message. I've started looking into the JavaScript code to see if I can't code up a work-around mechanism (basically debugging their garbage implementation), and of course (why actually?) their player code is also obfuscated.And I've gotta say, emplying an AI assistant has proven to be an invaluable help in trying to understand obfuscated code. It's actually really cool to take a function of gobbledegook JavaScript and ask the AI to rewrite it in a more canonical and easily understandable way, with inline comments. Of course, there are flaws every now and then, but the ability to do this has been such a game changer for reverse engineering, IMO.
I can even ask to take a guess at finding better variable/function names and the AI can infer from the code (maybe has seen the unobfuscated libraries during training?) what this code is actually doing on a high-level and turn something like e.g(e.g) into player.initialize(player.state) which is nothing short of amazing.
So for anyone doing similar work, I cannot recommend highly enough to have an AI agent as another tool in your tool belt.
by kleiba
4/21/2025 at 11:38:39 AM
I'm surprised by this. As a professional reverse engineering I've actually found LLMs to be terrible at deobfuscation of JS (especially in the context of JS malware). But maybe my requirements are higher and it's actually OK for occasional use against weak packers?by poincaredisk
4/21/2025 at 5:34:09 PM
Have you seen this?https://github.com/jehna/humanify
What they do is ground the LLM to the AST with Babel to ensure you still get the same shape of AST out of your deobfuscation pass. Probably this tool could be cleaned up, made to work with multiple llm and parser backends, have its prompts improved, &c.
by ctoth
4/24/2025 at 10:16:08 AM
This is great idea! But it's more about having LLMs to give function & variables names, instead of having LLM to deobfuscate. The (traditional) deobfuscations (e.g. unpack, de-flatten, de-virtualization etc) were done by 100% precise human made Babel plugins and is totally unrelated to a LLM.by rfoo
4/21/2025 at 1:10:51 PM
I've used it for small files and it did very well prettifying, naming the variables and adding comments for context. But I can imagine it doing a bad job with large files.by Bilal_io
4/21/2025 at 10:03:29 AM
Is it truly obfuscated, or just minified?by saagarjha
4/21/2025 at 12:32:23 PM
Well the example in the article was obfuscated with several specific examples.by johann8384
4/21/2025 at 6:31:02 PM
I mean the JavaScript the LLM reversed for themby saagarjha
4/22/2025 at 2:51:20 AM
I tried ChatGPT 4o to help me reverse engineer some game code with the symbols missing and the results were quite disappointing. To say it had a tendency to hallucinate is an understatement. It didn't have any clue what was going on.For me, those AI tools are much better at saving me time looking up documentation when doing simple things where it has examples of the exact code pattern I'm looking for in its training set. ChatGPT is great at writing one-off Blender scripts for me to give to artists, for instance.
by pcwalton
4/21/2025 at 7:46:20 AM
Which AI agents did you use?by lukan
4/21/2025 at 7:51:34 AM
I've tried different ones, they all seem to do a great job.by kleiba
4/21/2025 at 8:45:13 AM
Could you name a couple?by sureIy
4/21/2025 at 1:58:02 PM
next up is using AI to obfuscate it better in the first place, and then the terrible code gets scraped and used in further training, with an arms race ensuing, until all code on the internet is unintelligible but somehow works and can only be maintained by a specific AI that has a particularly encoded form of insanityby ImPostingOnHN
4/21/2025 at 10:57:00 PM
> they all seem to do a great jobYeah right.
by titaphraz
4/21/2025 at 8:15:32 AM
Out of curiosity (as someone disappointingly new to prompt engineering), what’s an example prompt you used with some success?by klabetron
4/21/2025 at 10:20:46 AM
Actually knowing the subject and presenting insights gives me much better results than simply asking it to do what I mean.by nurettin
4/21/2025 at 4:31:41 PM
For help with prompt engineering, take a graduate level grant writing course. It teaches you how to ask the right questions to get answers from humans and how to break down complicated processes into bite size pieces; really useable for llm's.by Loughla
4/21/2025 at 7:00:20 PM
Heh. Probably also useful should a djinn ever grant you three wishes.by specialist
4/21/2025 at 10:04:02 AM
Ask questions. Be disappointed in the outcomes.Ask more questions. Get some right answers. Repeat.
Make question asking muscle get swole.
by esseph