Metal Gear Solid 2's source code has been leaked on 4chan

(thegamer.com)

101 points | by rishabhd 2 hours ago

4 comments

  • tombert 1 hour ago
    Maybe with the source code, I'd be able to figure out what the hell happened in the last ~2 hours of the game.
  • AnotherGoodName 2 hours ago
    I wonder if it’s a real leak or just an agent recreation of the source from machine code.

    I’ve been having fun lately with agents and decompilation. You can literally point them at any game and ask them to decompile the game and structure and format as if it was the original source code. Asking them to ensure it compiles works fine.

    Some proof: i made online save game editors for jagged alliance 3; grandcheaten.com and news tower; thedailycheat.com (.com domains are only $10 so i figured why not).

    You can do this with any game i’ve found. Older games work best due to the forced simplicity of the source code though.

    • jamesu 50 minutes ago
      There is no way you could recreate a convincing enough 90s era codebase of a japanese videogame + its associated tools + scripts and commented out codepaths with current ai tools.
      • sigmoid10 39 minutes ago
        I wouldn't be too sure about that. The original decompilations of Mario 64 and Ocarina of Time were done mostly by hand because LLMs weren't really around yet, but these kinds of projects seem perfectly suited for handing the gritty work off to AI: There is a clear output (exact binary recreation) and a straightforward path to get there (look at this assembly code and produce some C code from it). The decompilation of Twilight Princess jumped from very little to basically 100% of core code in the past year alone: https://github.com/zeldaret/tp

        I have no doubt that this would be possible for MGS2 as well.

        • SpecialistK 25 minutes ago
          Keep your eyes open for Sonic R too. Sadly a lot of the online Sonic community has been toxic to the dev for being transparent about using Claude for the majority of the disassembly. Even though he's a very talented developer with lots of credit to his name, and only took a few weeks compared to a year+ if fully manual.
        • jamesu 13 minutes ago
          My take was more along the lines of: it wouldn't be convincing enough, if anything it would be too clean and perfect.
      • diath 11 minutes ago
        Absolutely. This is just some delusions of a vibe coder at best. Not with just current generation of AI tools but essentially never. The conversion from C, C++, Rust or whatever, through post-processing (macros etc), through IR generation, through compile time optimizations, through link time optimizations, to the generated machine code is a one way street for low level languages. You can get a pretty close higher level approximation that matches the flow/logic/structure - but the code will never be anywhere near close to the original source code. I could write the same C++ program in 5 different ways and get identical assembly, how do you go back to the exact source? The answer is that you don't.
      • CamperBob2 36 minutes ago
        That's pre-2026 thinking. At this point, with the ability to lash IDA or similar tools to an agentic harness, there is no longer any such thing as a closed-source binary.
        • wuschel 25 minutes ago
          What is the state of the art of compilers here? What size of project are we speaking here?

          What is the experience faulty decompilation, and the existence of bugs in the binary?

          Could one decompile a binary to a more modern language than C?

    • whywhywhywhy 1 hour ago
      It’s the real code there is code for known removed content (tanker escape scene and the 9/11 removed cutscene). Also AI can’t do what you’re theorizing yet.

      >and ask them to decompile the game and structure and format as if it was the original source code. Asking them to ensure it compiles works fine

      lot of people claiming this the end result is the AI downloading an emulator and rom

      • AnotherGoodName 1 hour ago
        >Also AI can’t do what you’re theorizing yet.

        Did you try the above links? I haven’t shared the full source but all game mechanics listed in the ja3 guide including code snippets where helpful.

      • echelon 1 hour ago
        > It’s the real code there is code for known removed content (tanker escape scene and the 9/11 removed cutscene). Also AI can’t do what you’re theorizing yet.

        There are lots of decompilation community efforts for N64 games, etc.

        Someone should train a model on this. Giving the decompiled symbols good names, etc.

        De-minification and de-obfuscation while we're at it.

        It should be easy to generate a ton of "synthetic" (actually real) training data for this by simply compiling sources and using that as (input, output) pairs.

    • defen 55 minutes ago
      Whoa, since when is there a Jagged Alliance 3? Is it any good? JA2 is one of my favorite games of all time
      • AnotherGoodName 39 minutes ago
        It’s playable but nowhere near as good and a lot of criticism is warranted. A true ‘70%’ game.

        Gunplay is weak. Accuracy drops off waaaay too fast based on maximum range of the gun and burst fire has arbitrary damage reduction per bullet. So short range guns almost always missed (mechanics documented from source in the above guide) and if they hit they did little damage. It means the only viable weapons are long range weapons. Rifles and assault rifles. A submachine gun is worse than a sniper rifle even at close range.

        The plot has a key gameplay changing moment that triggers waaay to early meaning you have to work to see much of the game content. Everyone tries to avoid the trigger on the second playthrough which is a silly thing to do game design wise. A desire to teleport across the map was the original motivation to the above from my point of view.

        Enemies are bullet sponges in the late game too. A lame way o balance weak ai and gunplay.

        It could have been as good as ja2 but they just didn’t refine the above enough.

    • tuna74 57 minutes ago
      How do you verify that everything is correct?
      • AnotherGoodName 48 minutes ago
        I’m sure the builds from doing what i’ve been doing won’t generate identical bytecode but it’s fun for the sake of messing with the game or understanding it (eg. The checksum logic for newstowers save game logic was cooy pastable as was the whole save game structure formatting itself and clearly matches the game - it works!). Likewise with all the JA3 mechanics documented in that linked guide.
    • bigyabai 1 hour ago
      It's (probably) a real leak. There are original comments in Japanese describing cut content and game logic that was scrapped in the final release.
      • jayd16 1 hour ago
        Raw assets are probably the better tell
  • charcircuit 1 hour ago
    >this remains a tremendous milestone for games preservation

    Clearly if it was able to be leaked it already was being preserved. It is shameful that such a publication tries and celebrate copyright infringement like this.

    • gwern 57 minutes ago
      > Clearly if it was able to be leaked it already was being preserved

      Preserved by whom? Many leaks are done by old or ex-employees who quietly kept a shall we say 'backup' of their work. More than one 'official' re-release has been rumored to be an embarrassed company quietly filing the serial numbers off a rogue leak because they realized way too late that their archival practices were inadequate.

    • tfigueroa 1 hour ago
      It’s, what, 25 years old? There have been many sequels, prequels, remastering. The economic benefits of this IP are largely exhausted; that it is now leaked to the commons isn’t an alarming thing.
      • charcircuit 59 minutes ago
        The game just had an update to support the Switch 2 only 2 months ago. It is still being used commercially.
    • unleaded 1 hour ago
      copyright infringement is awesome
    • pdntspa 1 hour ago
      because intellectual property laws are inherently worthy of respect and they are never used against consumers ever