7 ms·
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 sta
by kleiba 2y ago
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.
- lukan 2y agoWhich AI agents did you use?
- kleiba 2y agoI've tried different ones, they all seem to do a great job.
- klabetron 2y agoOut of curiosity (as someone disappointingly new to prompt engineering), what’s an example prompt you used with some success?
- esseph 2y agoAsk questions. Be disappointed in the outcomes. Ask more questions. Get some right answers. Repeat. Make question asking muscle get swole.
- nurettin 2y agoActually knowing the subject and presenting insights gives me much better results than simply asking it to do what I mean.
- Loughla 2y agoFor 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.
- specialist 2y agoHeh. Probably also useful should a djinn ever grant you three wishes.
- sureIy 2y agoCould you name a couple?
- ImPostingOnHN 2y agonext 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 insanity
- titaphraz 2y ago> they all seem to do a great job Yeah right.
- saagarjha 2y agoIs it truly obfuscated, or just minified?
- johann8384 2y agoWell the example in the article was obfuscated with several specific examples.
- saagarjha 2y agoI mean the JavaScript the LLM reversed for them
- poincaredisk 2y agoI'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?
- Bilal_io 2y agoI'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.
- ctoth 2y agoHave you seen this? https://github.com/jehna/humanify 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.
- rfoo 2y agoThis 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.
- pcwalton 2y agoI 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.