Live data from Hacker News

Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

decomp-academy.dev

21–30 of 83 posts

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#21

I recently heard that Super Mario 64 (N64) modding community reverse engineered the game enough to recreate more-or-less accurate C code that can be compiled in binaries to execute on many popular target architectures. Have you managed to get beloved games into modifiable C code? Or is it more common to invest a lot of work to document assembly language functions? I know some old assembly but no idea what is involved…

Most games will have been written in a higher level language first (like C or C++) and then compiled into assembly. With matching decomp, we write C, compile it to assembly, and see how much it matches the retail assembly. Using this we can write C that we theorise is almost identical to how it would have been written originally. There are things lost during the compilation process (like comments, function names, etc) these we have to name manually and it's a long process to do! But yes, the goal is to have C at the end and once you have C you can recompile using a different compiler and target any architecture you like

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#22

I recently heard that Super Mario 64 (N64) modding community reverse engineered the game enough to recreate more-or-less accurate C code that can be compiled in binaries to execute on many popular target architectures. Have you managed to get beloved games into modifiable C code? Or is it more common to invest a lot of work to document assembly language functions? I know some old assembly but no idea what is involved…

Most games will have been written in a higher level language first (like C or C++) and then compiled into assembly. With matching decomp, we write C, compile it to assembly, and see how much it matches the retail assembly. Using this we can write C that we theorise is almost identical to how it would have been written originally. There are things lost during the compilation process (like comments, function names, etc…

I suspect LLMs would do a good first pass with function naming.

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#23

Earlier quoted context omitted.

Most games will have been written in a higher level language first (like C or C++) and then compiled into assembly. With matching decomp, we write C, compile it to assembly, and see how much it matches the retail assembly. Using this we can write C that we theorise is almost identical to how it would have been written originally. There are things lost during the compilation process (like comments, function names, etc…

I suspect LLMs would do a good first pass with function naming.

They do an alright job, but they deffo need human-in-the-loop for the best results. I wrote on my blog about how I wrote an MCP to communicate with the Dolphin emulator. Allows Claude Code to set breakpoints, read the memory, write the memory, etc. It was a super fun way to work with Claude and has made naming functions/structs/fields/etc much easier! https://jpb.dev/blog/dolphin-debugger-mcp/

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#24

Earlier quoted context omitted.

AI is being used in many retro game decomp projects! One of the reasons I went down the path of learning decomp myself was because AI had hit a wall. Matching decomp is quite a bit harder than just normal decomp as even simple things like using an if/else instead of a terney actually change the assembly. AI did an amazing job of getting to 95% matches on nearly all functions, but once it got to that tail end, it star…

I say this every time it comes up, but polluting a decomp project with AI generated code is risky, imho. What makes decomp legal (in the US) is that it’s a creative transformation performed by a human and the resulting copyright of the code that just happens to compile to the same binary is owned by the person doing the decompiling. USPTO and court precedent is leaning heavily toward LLM output not being transformati…

Does it being a creative transformation rob the derivative work status? Personally, I'd liken the process of decompilation to that of translating a book from one language to another - the copyright on the original work does not become void merely because the process of translation requires extensive creativity.

Nicalis and Take-Two have both gone after decompilation projects, also. In particular, Nicalis has gone after a decompilation of Cave Story, but not a black box reimplementation of the same, while Take-Two ended up suing a decompilation developer (albeit settled out of court). However, in some jurisdictions, even clean reimplementations have failed - see Tetris v. Xio.

(I am not a lawyer either, etc etc, but that's my understanding)

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#26

I like decomp, but it makes me nervous. Like how safe is it to decompile a game and publish it to like github with all the symbols, addresses, etc..

The risk is low assuming you respect a potential take down notice that comes in.

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#28

Dumb question about reverse engineering binaries: is there a way to only do it piecemeal? I'm eventually waiting for LLMs and harnesses to get good enough to reverse engineer BFME (old Lord of the Rings game that still has an active modding community), but it's a multi GB sized game that would have to be done in bite-sized pieces. Basically; can you reverse engineer in bite sized pieces, and recompile/customize their…

Have you tried? I've haven't tried anything huge but I've had LLMs decompile SNES ROMs for me.

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#29

Seems like a cool idea, but I can't even complete the first task. The compiler service seems to be broken, since in both lessons and the playground I just get "Could not write source: No space left on device (os error 28)".

Just deploying a fix for this right now! Didn't expect this to be so popular haha

Re: Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

#30

Earlier quoted context omitted.

I say this every time it comes up, but polluting a decomp project with AI generated code is risky, imho. What makes decomp legal (in the US) is that it’s a creative transformation performed by a human and the resulting copyright of the code that just happens to compile to the same binary is owned by the person doing the decompiling. USPTO and court precedent is leaning heavily toward LLM output not being transformati…

Does it being a creative transformation rob the derivative work status? Personally, I'd liken the process of decompilation to that of translating a book from one language to another - the copyright on the original work does not become void merely because the process of translation requires extensive creativity. Nicalis and Take-Two have both gone after decompilation projects, also. In particular, Nicalis has gone aft…

The RE3 devs were distributing binaries. This is known to be an issue. The source code is theirs, binaries mixed with other copyrighted content is not. They also allegedly violated a EULA, but I haven’t looked closely into that.

CSE2 was distributing binaries as well.

So was SM64 decomp and Nintendo told them to stop, they did and continued to share their source code.

Tetris v. Xio is unrelated to reverse engineering or decompilation.

Post reply on HN