# grimdoomer/xbox360badupdate architecture

> Architecture diagram of the GitHub repository grimdoomer/xbox360badupdate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/grimdoomer/xbox360badupdate
- Repository: https://github.com/grimdoomer/xbox360badupdate

## Overview

##### Project Type and Purpose
- The project is a non-persistent “softmod” or hypervisor exploit toolkit for the Xbox 360. Its purpose is to gain temporary control over the console (to run unsigned code) by exploiting vulnerabilities via game save files for titles like Tony Hawk’s American Wasteland and Rock Band Blitz.
- The README makes clear that this is not a full homebrew operating system but a proof-of-concept race condition exploit that involves a series of staged payloads.

##### Analyzing the File Structure
- The top-level directories and files indicate multiple “stages” (Stage1, Stage2, Stage3, Stage4) and a “Common” folder:
- The Common directory holds shared assembly modules (e.g., various *.asm files including configuration and utility code) used by multiple stages.
- Stage1 contains exploit files arranged by target game (“RockBandBlitz” and “TonyHawksAmericanWasteland”) along with deeply nested folders representing retail data or the structure required by the targeted exploit vector.
- Stage2 includes a second stage assembly file.
- Stage3 houses both an assembly file for the third stage and a sub-project (“ObjLink”) that is a C# solution. This ObjLink project (with several Endian I/O utilities and a symbol table file) appears to link object code or manage payload assembly.
- Stage4 contains the fourth stage payload and a clean hypervisor data file for the specific 17559 dashboard.
- Other files like build_exploit.bat, update_data.bin, and xke_update.bin support the build and update processes.

##### Key Components
a. Exploit Stages:
- Stage1: Initial trigger exploited through target games (Tony Hawk’s American Wasteland / Rock Band Blitz) – represents the starting point when a modified save file is loaded.
- Stage2: The second-stage payload, which furthers the exploitation process.
- Stage3: Contains the third-stage exploit and the ObjLink tool; this component is responsible for linking/building final payload binaries using both assembly and C# code.
- Stage4: The final stage that finalizes the hypervisor patch process (includes the cleaned HV data).
- Common Module: Shared assembly utilities and configuration modules that provide core functionality for each stage.

b. Supporting Artifacts and Build Process:
- Build Scripts: e.g., build_exploit.bat – handles the automated assembly/compilation sequence.
- Binary Update Files: update_data.bin and xke_update.bin are part of the payloads deployed to the console.

c. External Dependencies and Execution Environment:
- The Xbox 360 Console: The target hardware where the exploit is executed.
- USB Stick Payload Deployment: The instructions from the README detail a USB stick-based delivery mechanism for game exploits.

##### Relationships and Data Flow
- User Interaction: The user loads a USB stick (populated with the appropriate exploit folder based on the chosen game) into the Xbox 360.
- Exploit Triggering: Game-specific save files (Stage1) trigger the exploit when the game is run.
- Sequential Payload Execution: Once Stage1 successfully exploits the vulnerability, control passes to Stage2, then Stage3 (which is assisted by ObjLink to ensure the correct binary linking and symbol handling), and finally Stage4 patches the hypervisor.
- Shared Code Integration: The Common assembly modules are loaded/included at various stages to manage payload behavior and configuration.
- Build Process: The provided build_exploit.bat ties together the assembly stages and ObjLink (C# project) to produce the final binary payloads.

- “User/USB Payload” that contains game-specific exploit files.
- “Stage1 (Game Exploit Trigger)” block, with subdivisions for Tony Hawk’s American Wasteland and Rock Band Blitz.
- “Stage2 – Second Stage Exploit” block.
- “Stage3 – ObjLink and Symbol Linking” block (annotate with details that explain the use of C# components such as EndianReader/Writer, etc.).
- “Stage4 – Final Hypervisor Patch” block.
- “Common Module” block that sits adjacent/underpins all stages.
- “Build Script & Deploy Files” block (linking to update_data.bin, xke_update.bin, build_exploit.bat).
- “Target Environment: Xbox 360 Console” block emphasizing that the cascade of stages ultimately patches the console’s hypervisor.
- Use another for build/tool components (ObjLink solution in Stage3).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Entities
    USB["USB Payload (Modified Save Files)"]:::external
    Xbox["Xbox 360 Console (Exploited)"]:::external

    %% Common Module
    CommonModule["Common Module (Shared Assembly Utilities)"]:::assembly

    %% Build Tools & Deploy Files
    subgraph "Build Tools & Deploy Files"
        Build_Script["Build Script (build_exploit.bat)"]:::build
        Build_Update["Update Data (update_data.bin)"]:::build
        Build_XKE["XKE Update (xke_update.bin)"]:::build
    end

    %% Stage1 - Game Exploit Trigger
    subgraph "Stage1 - Game Exploit Trigger"
        ST1_Tony["Tony Hawk’s American Wasteland Exploit"]:::assembly
        ST1_RB["Rock Band Blitz Exploit"]:::assembly
        ST1_Consolidated["Stage1 Trigger Consolidation"]
    end

    %% Stage2 - Second Stage Exploit
    ST2["Stage2 - Second Stage Exploit"]:::assembly

    %% Stage3 - Third Stage Exploit & ObjLink
    subgraph "Stage3 - Third Stage Exploit & ObjLink"
        ST3_Exploit["Third Stage Exploit (Stage3/BadUpdateExploit-3rdStage.asm & symbol_table.asm)"]:::assembly
        ST3_ObjLink["ObjLink Tool (C# Linking)"]:::csharp
    end

    %% Stage4 - Final Hypervisor Patch
    subgraph "Stage4 - Final Hypervisor Patch"
        ST4_Exploit["Final Hypervisor Patch (BadUpdateExploit-4thStage.asm)"]:::assembly
        ST4_Clean["Clean HV Data (Retail 17559)"]:::assembly
        ST4_Consolidated["Stage4 Final Payload"]
    end

    %% Flow of Execution
    USB --> ST1_Tony
    USB --> ST1_RB
    ST1_Tony --> ST1_Consolidated
    ST1_RB --> ST1_Consolidated
    ST1_Consolidated --> ST2
    ST2 --> ST3_Exploit
    ST3_Exploit --> ST3_ObjLink
    ST3_ObjLink --> ST4_Exploit
    ST4_Exploit --> ST4_Consolidated
    ST4_Clean --> ST4_Consolidated
    ST4_Consolidated --> Xbox

    %% Common Module Dependencies
    CommonModule --- ST1_Tony
    CommonModule --- ST1_RB
    CommonModule --- ST2
    CommonModule --- ST3_Exploit
    CommonModule --- ST4_Exploit

    %% Build Tools Dependencies
    Build_Script --> ST3_ObjLink
    Build_Update --> ST3_ObjLink
    Build_XKE --> ST3_ObjLink

    %% Styles
    classDef external fill:#E3F2FD,stroke:#1565C0,stroke-width:2px;
    classDef assembly fill:#FFEBEE,stroke:#C62828,stroke-width:2px;
    classDef build fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px;
    classDef csharp fill:#FFF9C4,stroke:#F9A825,stroke-width:2px;

    %% Click Events
    click CommonModule "https://github.com/grimdoomer/xbox360badupdate/tree/master/Common/"
    click ST1_RB "https://github.com/grimdoomer/xbox360badupdate/tree/master/Stage1/RockBandBlitz/"
    click ST1_Tony "https://github.com/grimdoomer/xbox360badupdate/tree/master/Stage1/TonyHawksAmericanWasteland/"
    click ST2 "https://github.com/grimdoomer/xbox360badupdate/blob/master/Stage2/BadUpdateExploit-2ndStage.asm"
    click ST3_Exploit "https://github.com/grimdoomer/xbox360badupdate/blob/master/Stage3/BadUpdateExploit-3rdStage.asm"
    click ST3_ObjLink "https://github.com/grimdoomer/xbox360badupdate/tree/master/Stage3/ObjLink/"
    click ST4_Exploit "https://github.com/grimdoomer/xbox360badupdate/blob/master/Stage4/BadUpdateExploit-4thStage.asm"
    click ST4_Clean "https://github.com/grimdoomer/xbox360badupdate/blob/master/Stage4/Stage4_CleanHvData_Retail_17559.bin"
    click Build_Script "https://github.com/grimdoomer/xbox360badupdate/blob/master/build_exploit.bat"
    click Build_Update "https://github.com/grimdoomer/xbox360badupdate/blob/master/update_data.bin"
    click Build_XKE "https://github.com/grimdoomer/xbox360badupdate/blob/master/xke_update.bin"
```
