20 comments

  • simonw5 hours ago
    For anyone else who was initially confused by this, useful context is that Snowboard Kids 2 is an N64 game.<p>I also wasn&#x27;t familiar with this terminology:<p>&gt; You hand it a function; it tries to match it, and you move on.<p>In decompilation &quot;matching&quot; means you found a function block in the machine code, wrote some C, then confirmed that the C produces the exact same binary machine code once it is compiled.<p>The author&#x27;s previous post explains this all in a bunch more detail: <a href="https:&#x2F;&#x2F;blog.chrislewis.au&#x2F;using-coding-agents-to-decompile-nintendo-64-games&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.chrislewis.au&#x2F;using-coding-agents-to-decompile-...</a>
  • reactordev8 minutes ago
    I’ve been having fun sending Claude down the old school MUD route, giving it access to a SMAUG derivative and once it’s mastered the play, give it admin powers to create new play experiences.<p>I stayed away from decompilation and reverse engineering, for legal reasons.<p>Claude is amazing. It can sometimes get stuck in a reason loop but will break away, reassess, and continue on until it finds its way.<p>Claude was murdered in a dark instance dungeon when it managed to defeat the dragon but ran out of lamp oil and torches to find its way out. Because of the light system it kept getting “You can’t seem to see anything in the darkness” and randomly walked into a skeleton lair.<p>Super fun to watch from an observer. Super terrifying that this will replace us at the office.
  • Nevermark28 minutes ago
    There are quite a few comments here on code obfuscation.<p>The hardest form of code obfuscation is called homomorphic computing, which is code transformed to act on encrypted data isomorphically to regular code on regular data. The homomorphic code is hard obfuscated by this transformation.<p>Now create a homomorphic virtual machine, that operates on encrypted code over encrypted data. Very hard to understand.<p>Now add data encryption&#x2F;decryption algorithms, both homomorphically encrypted to be run by the virtual machine, to prepare and recover inputs, outputs or effects of any data or event information, for the homomorphic application code. Now that all data within the system is encrypted by means which are hard obfuscated, running on code which is hard obfuscated, the entire system becomes hard^2 (not a formal measure) opaque.<p>This isn&#x27;t realistic in practice. Homomorphic implementations of even simple functions are extremely inefficient for the time being. But it is possible, and improvements in efficiency have not been exhausted.<p>Equivalent but different implementations of homomorphic code can obviously be made. However, given the only credible explanations for design decisions of the new code are, to exactly match the original code, this precludes any &quot;clean room&quot; defenses.<p>--<p>Implementing software with neural network models wouldn&#x27;t stop replication, but would decompile as source that was clearly not developed independent from the original implementation.<p>Even distilling (training a new model on the &quot;decompiled&quot; model) would be dead giveaway that it was derived directly from the source, not a clean room implementation.<p>--<p>I have wondered, if quantum computing wouldn&#x27;t enable an efficient version of homomorphic computing over classical data.<p>Just some wild thoughts.
  • saagarjha6 hours ago
    It&#x27;s worth noting here that the author came up with a handful of good heuristics to guide Claude and a very specific goal, and the LLM did a good job given those constraints. Most seasoned reverse engineers I know have found similar wins with those in place.<p>What LLMs are (still?) <i>not</i> good at is one-shot reverse engineering for understanding by a non-expert. If that&#x27;s your goal, don&#x27;t blindly use an LLM. People already know that you getting an LLM to write prose or code is bad, but it&#x27;s worth remembering that doing this for decompilation is even harder :)
    • zdware4 hours ago
      Agree with this. I&#x27;m a software engineer that has mostly not had to manage memory for most of my career.<p>I asked Opus how hard it would be to port the script extender for Baldurs Gate 3 from Windows to the native Linux Build. It outlined that it would be very difficult for someone without reverse engineering experience, and correctly pointed out they are using different compilers, so it&#x27;s not a simple mapping exercise. It&#x27;s recommendation was not to try unless I was a Ghrida master and had lots of time in my hands.
      • dimitri-vs4 hours ago
        FWIW most LLMs are pretty terrible at estimating complexity. If you&#x27;ve used Claude Code for any length of time you might be familiar with it&#x27;s plan &quot;timelines&quot; which always span many days but for medium size projects get implemented in about an hour.<p>I&#x27;ve had CC build semi-complex Tauri, PyQT6, Rust and SvelteKit apps for me without me having ever touched that language. Is the code quality good? Probably not. But all those apps were local-only tools or had less than 10 users so it doesn&#x27;t matter.
        • zdware4 hours ago
          That&#x27;s fair, I&#x27;ve had similar experiences working in other stacks with it. And with some niche stacks, it seems to struggle more. Definitely agree the more narrow the context&#x2F;problem statement, higher chance of success.<p>For this project, it described its reasoning well, and knowing my own skillset, and surface level info on how one would start this, it had many good points that made the project not realistic for me.
        • hobs1 hour ago
          Disagree - the timelines are completely reasonable for an actual software project, and that&#x27;s what the training data is based on, not projects written with LLMs.
          • theturtle3238 minutes ago
            Yes, this is my experience as well.
    • ph4evers6 hours ago
      Are they not performing well because they are trained to be more generic, or is the task too complex? It seems like a cheap problem to fine-tune.
      • motoboi11 minutes ago
        The knowledge probably is o the pre-training data (the internet documenta the LLM is trained at to get a good grasp), but probably very poorly represented in the reinforcement learning phase.<p>Which is to say that probably antropic don’t have good training documents and evals to teach the model how to do that.<p>Well they didn’t. But now they have some.<p>If the author want to improve his efficiency even more, I’d suggest he starts creating tools that allow a human to create a text trace of a good run on decompilating this project.<p>Those traces can be hosted in a place Antropic can see and then after the next model pre-training there will be a good chance the model become even better at this task.
      • pixl975 hours ago
        Sounds like a more agentic pipeline task. Decompile, assess, explain.
  • rlili7 hours ago
    Makes me wonder if decompilation could eventually become so trivial that everything would become de-facto open source.
    • anabis2 minutes ago
      Would some sparks fly when easy decompile of MSOffice and Photoshop are available, I wonder.
    • jasonjmcghee5 hours ago
      It would be &quot;source available&quot;, if anything, not &quot;open source&quot;.<p>&gt; An open-source license is a type of license for computer software and other products that allows the source code, blueprint or design to be used, modified or shared (with or without modification) under defined terms and conditions.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Open_source" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Open_source</a><p>Companies have been really abusing what open source means- claiming something is &quot;open source&quot; cause they share the code and then having a license that says you can&#x27;t use any part of it in any way.<p>Similarly if you ever use that software or depending on where you downloaded it from, you might have agreed not to decompile or read the source code. Using that code is a gamble.
      • mkatx2 hours ago
        So instead of reverse engineering.. an llm&#x2F;agent&#x2F;whatever could simply produce custom apps for everyone, simply implementing the features an individual might want. A more viable path?
      • DrNosferatu3 hours ago
        But, for example, isn&#x27;t Cannonball (SEGA Outrun source port) open source?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;djyt&#x2F;cannonball" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;djyt&#x2F;cannonball</a>
        • jasonjmcghee3 hours ago
          No it is not. There is no license in that repository.<p>Relevant: <a href="https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;community&#x2F;discussions&#x2F;82431" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;community&#x2F;discussions&#x2F;82431</a><p>&gt; When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation. Once the work has other contributors (each a copyright holder), “nobody” starts including you.<p><a href="https:&#x2F;&#x2F;choosealicense.com&#x2F;no-permission&#x2F;" rel="nofollow">https:&#x2F;&#x2F;choosealicense.com&#x2F;no-permission&#x2F;</a>
      • sa15 hours ago
        But clean room reverse engineered code can have its own license, no?
        • vunderba2 hours ago
          In fact, the story of how Atari tried to circumvent the lockout chip on the original NES is a good example of this.<p>They had gotten surprisingly close to a complete decompilation, but then they tried to request a copy of the source code from the copyright office citing that they needed it as a result of ongoing unrelated litigation with Nintendo.<p>Later on this killed them in court.
        • simonw5 hours ago
          Yeah, I think it can. I&#x27;m reminded of the thing in the 80s when Compaq reverse engineered and reimplemented the IBM BIOS by having one team decompile it and write a spec which they handed to a separate team who built a new implementation based on the spec.<p>I expect that for games the more important piece will be the art assets - like how the Quake game engine was open source but you still needed to buy a copy of the game in order to use the textures.
      • yieldcrv3 hours ago
        Open source never meant free to begin with and was never software specific, that’s a colloquialism and I’d love to say “language evolves” in favor of the software community’s use but open source is used in other still similar contexts, specifically legal and public policy ones<p>FOSS specifically means&#x2F;meant free and open source software, the free and software words are there for a reason<p>so we don’t need another distinction like “source available” that people need to understand to convey an already shared concept<p>yes, companies abuse their community’s interest in something by blending open source legal term as a marketing term
        • viraptor1 hour ago
          This is not a space for &quot;language evolves&quot;. Open source has very specific definitions and the distinctions there matter for legal purposes <a href="https:&#x2F;&#x2F;opensource.org&#x2F;licenses" rel="nofollow">https:&#x2F;&#x2F;opensource.org&#x2F;licenses</a>
          • yieldcrv1 hour ago
            the software community is the one trying to evolve the language in favor of this software license specific use case
        • jasonjmcghee3 hours ago
          Whether or not something is &quot;free&quot; is a separate matter and subject to how the software is licensed. If there is no license it is, by definition &quot;source available&quot;, not open source. &quot;source available&quot; is not some new distinction I&#x27;m making up.<p>See my other comment: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46175760">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46175760</a>
    • VikingCoder5 hours ago
      I wonder when you&#x27;re never going to run expensive software on your own CPU.<p>It&#x27;ll either all be in the cloud, so you never run the code...<p>Or it&#x27;ll be on a chip, in a hermetically sealed usb drive, that you plug in to your computer.
    • johnfn2 hours ago
      Surely then people start using LLMs to obfuscate compiled source to the point that another LLM can’t deobfuscate it. I imagine it’s always easier to make something messy than clean. Something like a rule of thermodynamics or something :)<p>Though, that’s only for actively developer software. I can imagine a great future where all retro games are now source available.
      • tuhgdetzhh1 hour ago
        But on the other hand, at the current speed of LLM progression, a game that might have been obfuscated with the help of Opus 4.5 might in two years be decompiled within hours by Opus 6.5.
    • tcdent5 hours ago
      That&#x27;s definitely a possible future abstraction and one are about the future of technology I&#x27;m excited about.<p>First we get to tackle all of the small ideas and side projects we haven&#x27;t had time to prioritize.<p>Then, we start taking ownership of all of the software systems that we interact with on a daily basis; hacking in modifications and reverse engineering protocols to suit our needs.<p>Finally our own interaction with software becomes entirely boutique: operating systems, firmware, user interfaces that we have directed ourselves to suit our individual tastes.
    • DrNosferatu5 hours ago
      This day <i>will</i> arrive.<p>And it will be great for retro game preservation.<p>Having more integrated tools and tutorials on this would be awesome.
    • js85 hours ago
      Yes, I believe it will. What I predict will happen is that most commercial software will be hosted and provided through &quot;trusted&quot; platforms with limited access, making reverse engineering impossible.
    • Aeolun5 hours ago
      When the decompilation like that is trivial, so is recreation without decompilation. It implies the LLM know exactly how thins work.
    • Xmd5a7 hours ago
      This deserves a discussion
      • ronsor6 hours ago
        I&#x27;ve used LLMs to help with decompilation since the original release of GPT-4. They&#x27;re excellent at recognizing the purpose of functions and refactoring IDA or Ghidra pseudo-C into readable code.
        • galangalalgol6 hours ago
          How does it do on things that were originally written in assembly?
          • saagarjha6 hours ago
            This is typically easier because the code was written for humans already.
        • euroderf6 hours ago
          Someone please try this on an original (early 1980s) IBM-PC BIOS.
          • tadfisher18 minutes ago
            I don&#x27;t believe that was written in a compiled language, so any old 8086 disassembler should suffice. I would love to see what comments an LLM adds to the assembly code, though.
          • mh-2 hours ago
            Got a bin?
      • stevemk14ebr5 hours ago
        We&#x27;re very far away from this.
  • t_mann4 hours ago
    &gt; The ‘give up after ten attempts’ threshold aims to prevent Claude from wasting tokens when further progress is unlikely. It was only partially successful, as Claude would still sometimes make dozens of attempts.<p>Not what I would have expected from a &#x27;one-shot&#x27;. Maybe self-supervised would be a more suitable term?
    • voiper116 minutes ago
      I definitely didn&#x27;t expect one-shot to mean &quot;let it run itself in an indefinite loop&quot;
    • johnfn2 hours ago
      One shot just means one prompt. What Claude decides to do during that prompt is up to it.
    • wavemode3 hours ago
      &quot;one-shot&quot; usually just means, one example and its correct answer was provided in the prompt.<p>See also, &quot;zero-shot&quot; &#x2F; &quot;few-shot&quot; etc.
      • simonw2 hours ago
        I&#x27;ve seen one-shot used to mean two different things in LLMs:<p>1. Getting an LLM to do something based on a single example<p>2. Getting an LLM to achieve a goal from a single prompt with no follow-ups<p>I think both are equally valid.
        • baq1 hour ago
          One-shot as in ‘given one example’ is the ML term. One-shot as in ‘in a single prompt’ is the colloquial meaning. Both are useful, but it can be confusing when discussing LLMs in ML topics.
    • hombre_fatal3 hours ago
      Meh, the main idea of one-shot is that you prompted it once and got a good impl when it decided it was done. As opposed to having to workshop yourself with additional prompts to fix things.<p>It doesn&#x27;t do it in one-shot on the GPU either. It feeds outputs back into inputs over and over. By the time you see tokens as an end-user, the clanker has already made a bunch of iterations.
  • ACCount378 hours ago
    If you aren&#x27;t using LLMs for your reverse engineering tasks, you&#x27;re missing out, big time. Claude kicks ass.<p>It&#x27;s good at cleaning up decompiled code, at figuring out what functions do, at uncovering weird assembly tricks and more.
    • keepamovin6 hours ago
      The article is a useful resource for setting up automated flows, and Claude is great at assembly. Codex less so, Gemini is also good at assembly. Gemini will happily hand roll x86_64 bytecode. Codex appears optimized for more &quot;mainstream&quot; dev tasks, and excels at that. If only Gemini had a great agent...
      • xnx1 hour ago
        Is Gemini CLI not a good agent?
    • skerit6 hours ago
      I&#x27;ve been using Claude for months with Ghidra. It is simply amazing.
    • amelius7 hours ago
      Makes sense because LLMs are quite good at translating between natural languages.<p>Anyway, we&#x27;re reaching the point where documentation can be generated by LLMs and this is great news for developers.
      • saagarjha6 hours ago
        Documentation is one place where humans should have input. If an LLM can generate documentation, why would I want you to generate it when I can do so myself (probably with a better, newer model)?
        • simonw5 hours ago
          I definitely want documentation that a project expert has reviewed. I&#x27;ve found LLMs are fantastic at writing documentation about how something works, but they have a nasty tendency to take guesses at WHY - you&#x27;ll get occasional sentences like &quot;This improves the efficiency of the system&quot;.<p>I don&#x27;t want invented rationales for changes, I want to know the actual reason a developer decided that the code should work that way.
        • ACCount375 hours ago
          That&#x27;s great if those humans are around to have that input.<p>Not so much when you have a lot of code from 6 years ago, built around an obscure SDK, and you have to figure out how it works, and the documentation is both incredibly sparse and in Chinese.
        • amelius4 hours ago
          Because it takes time and effort to write documentation.<p>If people __can__ actually read undocumented code with the help of LLMs, why do you need human-written documentation really?
          • baq1 hour ago
            Docs are a form of error correcting coding for code. Docs+code allows you to spot discrepancies and ask which one is the intended behavior.
      • james_marks6 hours ago
        I stumbled across a fun trick this week. After making some API changes, I had CC “write a note to the FE team with the changes”.<p>I then pasted this to another CC instance running the FE app, and it made the counter part.<p>Yes, I could have CC running against both repos and sometimes do, but I often run separate instances when tasks are complex.
      • monsieurbanana7 hours ago
        Maybe documentation meant for other llms to ingest. Their documentation is like their code, it might work, but I don&#x27;t want to have to be the one to read it.<p>Although of course if you don&#x27;t vibe document but instead just use them as a tool, with significant human input, then yes go ahead.
        • dunham5 hours ago
          Although with code it&#x27;s implementing functions that don&#x27;t exist yet and with documentation, it&#x27;s describing functions that don&#x27;t exist yet.
  • knackers8 days ago
    I&#x27;ve been experimenting with running Claude in headless mode + a continuous loop to decompile N64 functions and the results have been pretty incredible. (This is despite already using Claude in my decompilation workflow).<p>I hope that others find this similarly useful.
    • viraptor2 hours ago
      One thing I don&#x27;t annoying in really old sources is that sometimes you can&#x27;t go function by function, because the code will occasionally just use a random register to pass results. Passing the whole file works better at that point.
    • plastic-enjoyer7 hours ago
      This sounds interesting! Do you have some good introduction to N64 decompiliation? Would you recommend using Claude right from the start or rather try to get to know the ins and outs of N64 decomp?
    • garrettjoecox8 hours ago
      What game are you working on?
      • wk_end7 hours ago
        Last sentence of the first paragraph says it’s Snowboard Kids 2.
        • rat99887 hours ago
          For his defense, it is missing a &quot;Tell HN&quot;
          • dpkirchner7 hours ago
            And it isn&#x27;t always obvious when the commenter is the submitter (no [S] tag like you see on other sites).
            • garrettjoecox6 hours ago
              whoops, I did indeed miss that this was OP
    • turnsout6 hours ago
      This is super cool! I would be curious to see how Gemini 3 fares… I&#x27;ve found it to be even more effective than Opus 4.5 at technical analysis (in another domain).
  • grim_io43 minutes ago
    I need to try using a frontier LLM for deobfuscation. That&#x27;s a huge pain in the ass for a noob like me.
  • wiz21c51 minutes ago
    Last day I asked Claude to estimate a loop of a dozen 6502 instructions. It failed but his estimate was not bad at all. Amazing!
  • viraptor2 hours ago
    Yeah, it works great for porting as well. I tried it on the assembler sources of Prince of Persia for Apple ii and went from nothing to basics being playable (with a few bugs but still) on modern Mac with SDL graphics within a day.
  • benmccann4 hours ago
    I used Gemini to compare the minimized output of the Rollup vs Rolldown JavaScript bundlers to find locations where the latter was not yet at the same degree of optimization. It was astoundingly good and I&#x27;m not sure how I would have been able to accomplish the task without an LLM as an available tool.
  • heavyset_go2 hours ago
    Am I just wrong in thinking doing decompilation of copyrighted code via the cloud is a bad idea?<p>Like, if it ever leaks, or you were planning on releasing it, literally every step you took in your crime is uploaded to the cloud ready to send you to prison.<p>It&#x27;s what&#x27;s stopped me from using hosted LLMs for DMCA-legal RE. All it takes is for a prosecutor&#x2F;attorney to spin a narrative based on uploaded evidence and your ass is in court.
    • Juliate2 hours ago
      It wouldn&#x27;t fit most of the current LLM cloud providers narrative about privacy and copyright either, so, not sure they would be as cooperative with a prosecutor as they are today with lawmakers and right holders.
  • xnx1 hour ago
    Great use case. Curious to see how Gemini fares when tested.
  • sehugg3 hours ago
    I ran Node with --print-opt-code and had Opus look at Turbofan&#x27;s output. It was able to add comments to the JIT&#x27;ed code and give suggestions on how to improve the JavaScript for better optimization.
  • butz6 hours ago
    Are there any similar specialized decompilation LLM models available to be used locally?
  • DrNosferatu5 hours ago
    More than an overview, a step by step tutorial on this would be awesome!
  • VikingCoder5 hours ago
    I&#x27;ve been waiting for decompilation to show up in this space.
  • jamesbelchamber7 hours ago
    This is a refreshingly practical demonstration of an LLM adding value. More of this please.