Resident Evil 4 (GameCube) – complete byte-identical decompilation to C/C++
Recorded: Sept. 20, 2026, 6:09 p.m.
| Original | Summarized |
GitHub - adonis-singh/re4: Resident Evil 4 (GameCube, G4BE08 debug build) — complete byte-identical decompilation to C/C++ · GitHub Skip to content Navigation MenuSign inAppearance settingsPlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesCode QualityEnforce quality at mergeAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricingSearch/Sign inSign upAppearance settings You signed in with another tab or window. Reload to refresh your session. Dismiss alert adonis-singh re4 Public
Notifications
Fork
Star Code Issues Pull requests Actions Projects Security and quality Insights
Additional navigation options
Code Issues Pull requests Actions Projects Security and quality Insights
masterBranchesTagsGo to fileCodeOpen more actions menuLatest commit History771 Commits771 CommitsFolders and filesNameNameLast commit messageLast commit date.github/ISSUE_TEMPLATE.github/ISSUE_TEMPLATE config/G4BE08config/G4BE08 docsdocs includeinclude orig/G4BE08orig/G4BE08 srcsrc toolstools .clang-format.clang-format .editorconfig.editorconfig .gitattributes.gitattributes .gitignore.gitignore CONTRIBUTING.mdCONTRIBUTING.md LICENSELICENSE README.mdREADME.md configure.pyconfigure.py View all filesRepository files navigationREADMEContributingCC0-1.0 licenseMore itemsResident Evil 4 (GameCube) — decompilation Objects Source Game code CRI middleware (src/lib/adx_*, sfd_*, mpv_*, …) Nintendo SDK (src/lib/OS*, GX*, …) The repository contains no game assets and no code or data copied from the discs. You need your # 2. your disc images (disc 1: main.dol + 110 RELs; disc 2: the four island-stage RELs st3_0..st3_3) # 3. build and verify src/game/ — the game (C++; a few newlib C units). src/em*/ enemies, src/wep*/ weapons, What "matching" means here GCC 2.95 game code: paired-single kernels (SINF/COSF/RSQRT/LIMIT_ANGLE in math_sub, the Naming Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
This repository documents a complete, byte-identical decompilation of the Resident Evil 4 debug build for the Nintendo GameCube (G4BE08), encompassing both game discs. The project aims to reproduce the main.dol file and all one hundred fourteen REL overlays exactly, relying on a rigorous process of reverse engineering and source reconstruction based on the original compiled artifacts. The resulting codebase is composed of approximately five hundred fifty-five thousand lines of C and C++ code, along with thirty-three thousand lines of header files, and notably contains no assembly files. The construction of this decompilation involves integrating source materials from various components, including the SN Systems ProDG, Metrowerks CodeWarrior, and Nintendo SDKs, which were used when the original software was compiled. The methodology centers on a "matching" process, which mandates that every unit in the decompiled result must compile to the original bytes using the original compilers. This verification step is detailed through extensive documentation, demonstrating how compiler provenance, the catalogue of compiler mechanisms, and source shapes are used to reconstruct the original execution environment. Specific attention is paid to accounting for compiler differences, such as register choices and padding statements, which are documented through commentary within the source code to track deviations from natural spelling. The repository structure organizes the project logically, separating game logic, SDK and runtime libraries, configuration data, and specialized tools necessary for the build and verification process. The source code is logically divided into game components such as enemies, weapons, player characters, and room definitions, alongside specific files for the SDK, CRI middleware, and runtime environments. The configuration directory contains essential unit lists, symbols, and linker scripts required for the compilation process. The process of building the project necessitates the use of specific disc images as input, and the system automatically downloads necessary compilers and tools upon the initial configuration. The build process utilizes standardized commands and tools, such as python3, ninja, and specialized comparison utilities to ensure byte-level accuracy against the original files. The system employs detailed tools for comparison, allowing for word-by-word checks between the reconstructed objects and the original word by word, as well as function identification tools. The analysis also details the fate of assembly code within the reconstructed structure. While most assembly that was present was either eliminated or documented through compiler mechanisms applied during the reconstruction, specific assembly code remains because it represents instructions the original authors wrote directly, as their compilers offered no other method of expression. The project meticulously tracks assembly-bodied units and registers derived from the environment, noting where register allocation mechanisms were handled and where instructions were preserved. Furthermore, the project addresses naming conventions, noting that function names originate from the debug build's symbol files, and struct and field names are tracked based on vendor information, usage, and the identification of unknown offsets. The project emphasizes that the reconstructed game and SDK source, along with the associated build scripts and documentation, are intellectual property belonging to Capcom, Nintendo, and CRI Middleware, and are published strictly for research and preservation purposes. The project is released under a Creative Commons Zero license. |