Inline functions do often affect codegen, though. There are exceptions, of course, but many things simply do not matter at all for matching.
#BREATH OF THE WILD ROM PC CODE#
In general, two equivalent constructs that should clearly produce the same code actually produce the exact same code. No "same line" memes (codegen being different if two statements are put on the same line).If you see something that looks like a regalloc problem, it usually means your code is not semantically equivalent. Pure register allocation (regalloc) issues are almost non-existent.Even when the stack is used, things Just Work™ in the vast majority of cases. Stack reordering issues are extremely rare, given that AArch64 uses its registers a lot more efficiently.Clang is an extremely reasonable compiler with much fewer memes than older compilers such as IDO or older versions of GCC: How easy is it to match functions?Ĭompared to other decomp projects for older compilers: extremely easy. Unlike some other first-party games such as Super Mario Odyssey, all known public versions of U-King are completely stripped, so most names are just more or less educated guesses that try to fill in the blanks.Īs more parts of the game get decompiled, it becomes easier to figure out what the rest of the game is doing and equally easier to name functions. How do you name things?įile names, class or function names, and the file organization come from leftover strings. Since C++ code makes heavy use of inline functions and zero-cost abstractions that disappear in compiled code, contributors have a lot more leeway when it comes to organizing files and adding abstractions.
#BREATH OF THE WILD ROM PC SOFTWARE#
The result is that the codebase looks a lot more like a regular software project than a decompilation codebase. Libraries are not treated as being part of the game code, but as external dependencies. Instead of trying to match the entire executable, each function is matched individually and source code is organized in whichever way makes the most sense. Given the impossibility of automatically splitting the assembly and generating a matching binary (as is done in many other decomp projects), the sheer size of the main executable and the usage of many software libraries, this project takes a somewhat experimental approach to matching decompilation.īecause meaningfully splitting the code is not feasible, the built executable currently only contains functions that have been decompiled and no effort is being made to put functions and data at the correct addresses. Thanks to Clang, this is easier than one would expect. This process makes functional correctness extremely easy to verify since the assembly can simply be compared against the original executable. Matching decompilation goes one step further and produces original source code that compiles to the exact same assembly. Frequently Asked Questions What is (matching) decompilation?ĭecompiling is the process of turning the game's compiled code back into equivalent, readable C++ source code. Any other statically linked library, except:Įxcluded libraries will not be fully decompiled but may be partly re-implemented or decompiled, and (reverse-engineered) headers will still be provided so that the rest of the codebase can still use those libraries.Framework/engine code ( KingSystem / ksys:: namespace).Actual game code ( Game / uking:: namespace).
The RomFS and the SDK libraries are out of the scope of this project. This project only concerns the main executable which contains all the game code and statically linked libraries. It will help with understanding and reverse engineering the game even in its incomplete state, but it will not help with playing BotW or porting the game to other platforms, which is explicitly a non-goal. The goal of this project is to better understand game internals, aid with glitch hunting and document existing knowledge in a permanent, unambiguous form which helps further reverse engineer the game.Ĭonsidering the large size of the executable (~40MB), it is not expected to reach 100% progress within a reasonable timeframe.Īs a result, the project is unlikely to produce a working executable in the near future. This repository does not contain game assets or RomFS content and cannot be used to play Breath of the Wild. This is an experimental, WIP decompilation of The Legend of Zelda: Breath of the Wild v1.5.0 (Switch).