7 ms·
Yes, Claude Code can decompile itself. Here's the source code
- zeckalpha 2y agoThat's not the usual definition of clean room. If you had it generate tests then handed the tests off to a second agent to implement against...
- viraptor 2y agoI'm not sure why this is framed as an issue for security teams. Transpiling software has been a thing for ages. Especially in the JS world. Decompiling has been a bit harder without automation, but unless you have black box tests, this process will take ages to verify that the result has matching functionality. So why would the blue teams care beyond "oh fun, a new tool for speeding up malware decompilation"? Edit: To be clear, I get the new reverse engineering and reimplementation possibilities got much better and simpler. But the alarmist tone seems weird.
- Avicebron 2y agoIt seems like "red-teaming" and "security research" have become more socially prominent recently, so people naturally aligned with grift, e.g. making things seems alarmist and that they are the only ones in the know, are trying to seem part of the club?
- SebFender 2y agoOn point. We're not really interested in these things. Yeah we take a look at it and stay informed but the main focus remains bypass of controls and data itself. With decent backend controls - apps don't/shouldn't do much in the end. Once you show information on a screen consider it potentially gone.
- giancarlostoro 2y agoAgreed. Are we supposed to stop developing all software as a result? Ask for LLMs to censor reverse engineering? Someone else wont care and will build another LLM to bypass limitations.
- sbarre 2y agoI read the blog post (especially in combination with the end bit) at least in part, as an advertisement for the author's capabilities and services. That makes the tone make a bit more sense to me.
- iLoveOncall 2y agoThis is beyond clickbait, a node application that includes the map files is not even remotely "compiled".
- notpushkin 2y agoIt doesn't include a sourcemap for the main module, cli.mjs.
- jbellis 2y agoA better writeup on reverse engineering CC: https://github.com/Yuyz0112/claude-code-reverse https://github.com/Yuyz0112/claude-code-reverse
- deleted 2y ago[deleted]
- saagarjha 2y ago> You might be wondering why I've dumped a transpilation of the source code of Claude Code onto GitHub and the reason is simple. I'm not letting an autonomous closed source agent run hands free on my infrastructure and neither should you. Asking it for its source code (AI never lies, right?) and then buying it on your personal card so corporate security doesn’t know what you’re doing makes me feel a lot better about it.
- meindnoch 2y agoHorribly obnoxious writing style. Is there a name for this? It's like the written equivalent of TikTok trash or MrBeast videos.
- gabrieledarrigo 2y agoAgreed. The article on the performance reviews is disturbing.
- mkoubaa 2y agoReads like it was written by someone with the attention span of a gnat
- permanent 2y agoEngagement-optimized writing style (whether intentionally or subconsciously learnt to do so)
- a12k 2y agoMaybe, but I disengaged partway through (right after “I’m not going to bury the lede” and seeing there was a bunch more engagement filler immediately after, burying the lede). I will not read prose written like this.
- ghuntley 2y agothen you missed the gold at the bottom....
- a12k 2y agoIf the article was compellingly written I guess I would have gotten to it. But the author is a bad writer and uses tricks reminiscent of “read this list, item #9 will shock you!” No thanks. I opened another article someone posted by the same author and now that I know they write like this, u couldn’t make it through the first paragraph. Absolute trash.
- yodon 2y agoI found this article [0] by the same author and linked in the post more personally valuable - great insights into expert-level use of Cursor. [0]https://ghuntley.com/stdlib/ https://ghuntley.com/stdlib/
- gabrieledarrigo 2y agoA pretty boring article.
- causal 2y agoThe concept was interesting (build up your own stdlib of Cursor rules) but there's a kind of hyperbolic/click-baity flavor to both articles that undermine them a little, I think they would stand fine on their own if they just cooled the dramatics a bit.
- aeve890 2y agoPeople needs LLM to transpile JS now? Unless it can reliable extract semantics I don't see the novelty.
- gtirloni 2y agoTL;DR; developer asks Claude Code to revert TypeScript minification ("decompile"). Target is Claude Code's own CLI tool.
- ghuntley 2y agoTL;DR. Wine (the windows emulator) is about to get more contributors to it than ever before. How can people miss the gold at the bottom of the post. Heh.
- futasuki 2y agothe author apparently never checked the ouput. it has nothing to do with the original - its all hallucination. any professional can see this in 5 minutes.
- jazzyjackson 2y agoJust what open source projects need, contributers who don't bother to read the code they're contributing.
- amelius 2y ago> these LLMs are shockily good at transpilation and structure to structure conversions I wonder if it is possible to transpile all the C Python modules to an api version that has no GIL, this way.
- Retr0id 2y agoI'm confident you could get code output that compiles and runs, but not confident that you wouldn't end up with subtle race conditions. Aside from anything else, there's not much nogil C python code in training sets yet.
- viraptor 2y agoCython does the compilation already. You can optimise and disable gil from there.
- markisus 2y agoThe article contains a reference to a much more impressive task where a user automatically decompiled a binary exe game into Python. But I read their original post and here is what that user said. > Several critics seemed to assume I claimed Claude had "decompiled" the executable in the traditional sense. In reality, as I described in our conversation, it analyzed visible strings and inferred functionality - which is still impressive but different from true decompilation. So I’m not sure that the implications are as big as the article author is claiming. It seems Claude is good at de-minifying JavaScript but that is a long way away from decompiling highly optimized binary code.
- haolez 2y agoBut it should be easy to generate such data to train an AI to do that, if someone wants, no?
- kelsey98765431 2y agoReplace the word easy there with the phrase "technically may be possible with great effort and expense, probably"
- kees99 2y agoDecent optimizing compiler would necessarily loose a fair bit of source information - loop unrolling, function inlining, tail-call optimizations, etc... There is no good way to reconstruct that, AI/ML or not.
- brookst 2y agoFor loop unrolling at least, wouldn’t most human reverse engineers see the original loop? It’s far more likely that the source had a loop than that some high level language programmer did the unrolling in source.
- soulofmischief 2y agoSome transformations irrecoverably lose information. A recontextualization engine such as an LLM might be able to "recover" some information by comparing it to other code in its training set, but it's still a guess and not all code will have representation in the training set.
- mtrovo 2y agoI don't understand Anthropic's reluctance to release this project as an npm package but not open-source it. Claude Code is such a great example of how agents could work in the future that the whole community could benefit from studying it. Plus, the work on integrating MCPs alone could create a huge network effect opportunity for them, one that's much bigger than keeping the source code secret. All they've done so far is add an unnecessary step by putting a bounty on who will be the first to extract all the prompts and the agent orchestration layer.
- Etheryte 2y agoOne obvious reason to not make it open source is licensing, if you do that, all of your competitors can cookie cutter copy what you're doing.
- viraptor 2y agoI don't buy that explanation. Almost all the interesting bits can be found by observing the api requests and you don't need the source to get those.
- licnep 2y agointeresting, i never thought about this use case before, but LLMs may be exceedingly good at code deobfuscation and decompilation
- IshKebab 2y agoErm sure... so is the output actually any good? I don't think anyone doubted that the LLM could produce some output but I would like to know if it is actually good output. Does it compile? Does it make sense?
- causal 2y agoWhy does the post avoid this obvious question. Claude is impressive, but it still hallucinates a lot. You really need to be able to build + run + verify features + compare compiled outputs; then you can be somewhat confident it really did what the author is claiming.
- Snuggly73 2y agoThe other linked "oh fuck" article https://ghuntley.com/oh-fuck/ https://ghuntley.com/oh-fuck/ where it supposedly converts https://github.com/RustAudio/cpal https://github.com/RustAudio/cpal at least has a linked video. As far as I can see, based on that video's file tree/Haskell files - its not exactly doing what's described in the article. I'll extrapolate from there...
- futasuki 2y agoNo, the ouput is all hallucination. The minified version contains many prompts that can be easily found. None of them appear in the authors result. None of the code structures and identifiers of the minfied version are present. Its all BS.
- DrNosferatu 2y agoNow just integrate with Ghidra!
- ghuntley 2y agoYep. Now you are thinking! :)
- mpalmer 2y agoThree years ago, you wrote > Systemically, I'm concerned that there is a lack of professional liability, rigorous industry best practices, and validation in the software industry which contributes to why we see Boeings flying themselves into the ground, financial firms losing everyone's data day in and out, and stories floating around our industry publications about people being concerned about the possibility of a remotely exploitable lunar lander on Mars. > There's a heap of [comical?] tropes in the software industry that are illogical/counterproductive to the advancement of our profession and contribute to why other professions think software developers are a bunch of immature spoiled children that require constant supervision. 3 weeks ago you posted something titled "The future belongs to people who can just do things". Today you post this: > Because cli.mjs is close to 5mb - which is way bigger than any LLM context window out here. You're going to need baby sit it for a while and feed it reward tokens of kind words ("your doing good, please continue") and encourage it to keep on going on - even if it gives up. It will time out, lots... I don't think you are someone who can just "do things" if you think a good way to de-obfuscate 5MB of minified javascript is to pass it to a massive LLM. Do you think you are advancing your profession?
- rafram 2y agoWhy do you feel the need to be so rude about an interesting little blog post? Obviously you don’t need an LLM to prettify obfuscated JavaScript. But take a look at the repo. It didn’t just add the whitespace back — it restored the original file structure, inferred function and variable names, wrote TypeScript type definitions based on usage, and added (actually decent) comments throughout the source code. That simply isn’t possible without an LLM.
- ojr 2y agoI just inherited a Flutter project with no readme and no prior Flutter experience. AI helps but adding new features and deploying is still a tall task, having a conversation with the previous contributors is invaluable and somehow underrated these days
- deleted 2y ago[deleted]
- api 2y agoIt has always been possible to decompile and deobfuscate code. This makes it way, way easier, though it still requires effort. What this produces is not going to be perfect. The author thinks this invalidates the business models of companies with closed source or mixed open and closed components. This misunderstands why companies license software. They want to be compliant with the license, and they want support from the team that builds the software. Yes, hustlers can and will fork things just like they always have. There are hustlers that will fork open source software and turn it into proprietary stuff for app stores, for example. That's a thing right now. Or even raise investment money on it (IMHO this is borderline fraud if you aren't adding anything). Yet the majority of them will fail long term because they will not be good at supporting, maintaining, or enhancing the product. I don't see why this is so apocalyptic. It's also very useful for debugging and for security researchers. It makes it a lot easier to hunt for bugs or back doors in closed software. The stuff about Grok planning a hit on Elon is funny, but again not apocalyptic. The hard part about carrying out a hit is doing the thing, and someone who has no clue what they're doing is probably going to screw that up. Anyone with firearms and requisite tactical training probably doesn't need much help from an LLM. This is sensationalism. I've also seen stuff about Grok spitting out how to make meth. So what? You can find guides on making meth -- whole PDF books -- on the clear web, and even more on dark web sites. There are whole forums. There's even subreddits that do not not (wink wink nudge nudge) provide help for people cooking drugs. This too is AI doom sensationalism. You can find designs for atomic bombs too. The hard part about making an a-bomb is getting the materials. The rest could be done by anyone with grad level physics knowledge, a machine shop, and expertise in industrial and electrical engineering. If you don't have the proper facilities you might get some radiation exposure though. There is one area that does alarm me a little: LLMs spitting out detailed info on chemical and biological weapons manufacture. This is less obvious and less easy to find. Still: if you don't have the requisite practical expertise you will probably kill yourself trying to do it. So it's concerning but not apocalyptic.
- yellow_lead 2y ago> cli.mjs > This is the meat of the application itself. It is your typical commonjs application which has been compiled from typescript. Why is it .mjs then?
- panarky 2y ago.mjs typically designates newer ECMAScript modules, contrasted with .js for older CommonJS.
- nloomans 2y agoI think because Claude said so and the author just copied it without checking. You can see it in the first screenshot of Claude's output: > After examining the provided code, I've determined that this appears to be a CLI application for Claude code-related functionality, built as a CommonJS TypeScript application that has been compiled with webpack. Although, looking at the minified code, it seems to be using module.createRequire for CommonJS compatibility, so maybe it isn't completely wrong: https://nodejs.org/api/module.html#modulecreaterequirefilename https://nodejs.org/api/module.html#modulecreaterequirefilena...
- bavell 2y agoI appreciate the content and respect the hustle but I'm really not a fan of the author's writing style.
- zahlman 2y agoAt least it doesn't come across as AI-generated...
- Paracompact 2y agoThe content is insubstantial, the hustle is a pox on the industry, and the writing style is very effective at communicating this. > All you need is access to their source-code and they have given you the keys to the kingdom on a golden platter by going to market as... Definitely going on my wall of shame.
- vlovich123 2y ago> Please understand that restrictive software licenses no longer matter because these LLMs can be driven to behave like Bitcoin mixers that bypass licensing and copyright restrictions using the approach detailed in this blog post. I’m pretty sure translation of a text into another language would still count as copyright infringement. It may be hard to prove, but this isn’t a copyright bypass.
- 1970-01-01 2y agoOnly if the translation is then published
- Mathnerd314 2y agoThere is a question of originality. If the variable names, comments, etc. are preserved, then yes, it is probably a derivative work. But here, where you are starting from the obfuscated code, there is an argument that the code is solely functional, hence doesn't have copyright protection. It's like how if I take a news article and write a new article with the same facts, there's no copyright protection (witness: news gets re-reported all the time). There is a fine line between "this is just a prompt, not substantial enough to be copyrightable" and "this is a derivative work" which is still being worked out in the legal system.
- thegeomaster 2y agoThis is total bullshit. It's clear by spending 2 minutes with the output, located on https://github.com/ghuntley/claude-code-source-code-deobfuscation https://github.com/ghuntley/claude-code-source-code-deobfusc.... The AI has just made educated guesses about the functionality, wrote some sensible-looking code and hallucinated a whole lot. The provided code on GitHub does not compile, does not work in the slightest, does not include any of the prompts from the original source, does not contain any API URLs and endpoints from the original, and uses Claude 3 Opus! And this is just from a cursory 5-minute look.
- jasonjmcghee 2y agoThis needs to be the top comment. Many folks are arriving on the post and taking it at face value. I don't know if it's ignorance or an attempt at a publicity stunt on the author's part, but it isn't at all what they claim.
- thegeomaster 2y ago> I don't know if it's ignorance or an attempt at a publicity stunt on the author's part, but it isn't at all what they claim. I let the author know on Twitter too: https://x.com/thegeomaster/status/1895869781229912233 https://x.com/thegeomaster/status/1895869781229912233 If it's the former, I assume he will update or take down the blog post.
- jasonjmcghee 2y ago> but if it’s not a 1:1 then deobfuscate is the wrong word for sure "if it's not" is so troubling
- Sharlin 2y agoBased on the author's other blog posts, they certainly seem to have drunk the LLM Kool-Aid. Likely enough of it to make their conclusions perhaps slightly biased.
- jameshart 2y agoThis feels very much like the work of someone with ‘just enough knowledge to be dangerous’. At no point in this process does the author seem to stop and inspect the results to see if they actually amount to what he’s asking for. Claiming that this output represents a decompilation of the obfuscated target seems to require at least demonstrating that the resulting code produces an artifact that does the same thing. Further, the claim that “Using the above technique you can clean-room any software in existence in hours or less.” is horrifyingly naive. This would in no way be considered a ‘clean room’ implementation of the supplied artifact. It’s explicitly a derived work based on detailed study of the published, copyrighted artifact. Please step away from the LLM before you hurt someone.
- Snuggly73 2y ago“Using the above technique you can clean-room any software in existence in hours or less.” Having spent my misguided youth doing horrible things to Sentinel Rainbow and its cousins - I can only chuckle.
- dogma1138 2y agoFor those who don’t know Sentinel Rainbow is a DRM dongle these were popular in the 90’s through early 2000’s for enterprise/business software especially that could be useful on the smaller end of the businesses scale (CRM, ERP, CAD/CAM) where piracy concerns were much bigger due to the relative high cost of development combined with a relatively small market to begin with. SAAS pretty much made all of that obsolete, since with SAAS you get an unbeatable DRM for free.
- 29athrowaway 2y agoIf my understanding is correct, what's legally protected is reproducing a proprietary IP design rather than studying the design? If you create a new design that doesn't have the proprietary elements in it that's not grounds for copyright infringement?
- jazzyjackson 2y ago
- zahlman 2y ago> Please understand that restrictive software licenses no longer matter because these LLMs can be driven to behave like Bitcoin mixers that bypass licensing and copyright restrictions using the approach detailed in this blog post. This reads to me like "Please understand that legal protections no longer matter because computers can now break the law for you automatically".
- Morris156 2y ago[flagged]