diff --git a/.github/release-notes/v2.4.0.md b/.github/release-notes/v2.4.0.md new file mode 100644 index 0000000..dfd084e --- /dev/null +++ b/.github/release-notes/v2.4.0.md @@ -0,0 +1,32 @@ +# BadBuilderLinux v2.4.0 + +Prepare a **Peer Pressure installer USB**, package Aurora and other homebrew for installation to the HDD, and choose Aurora as the default dashboard from BadBuilder. + +## What's new + +- **Exploit → Peer Pressure** downloads the official v1.0.477 `SoftmodInstaller.zip`, pinned to its exact release and upstream SHA-256, plus the Rock Band Blitz demo. The upstream installer, license, and bundled XeLL are preserved. +- **Homebrew** packages Aurora, XeXMenu, utilities, and custom apps through Peer Pressure's `SoftmodExtras.ini`. Existing catalog entries are retained, and homebrew does not replace the installer payload. +- **Set default dashboard → Aurora** adds the supported `DashXex` setting after verifying the executable exists. On the console, enable **Install Extras** and select **Aurora** to apply it. Use **Extras Only** for an existing Peer Pressure setup. +- Peer Pressure supplies its own payload and dashboard configuration. BadUpdate and ABadAvatar continue using their existing bootstrap and USB homebrew workflows. +- The README now covers downloads, workflow selection, Aurora setup after installation, recovery, and testing. A root changelog collects release history. + +## Compatibility and backup + +Peer Pressure supports Xenon, Zephyr, Falcon, Jasper, and Trinity consoles; **Corona and Winchester are unsupported**. It requires an HDD, with a mechanical SATA drive recommended. DashLaunch and its plugins are unsupported. Choose a dashboard such as Aurora for default startup; the picker also accepts executable maintenance utilities. + +BadBuilder erases the selected USB. Peer Pressure installation on the console modifies NAND and HDD security sectors and can cause data loss or prevent booting. Create and keep the official installer's system backup outside the USB before reusing it. Follow the [official installation guide](https://github.com/grimdoomer/Xbox360PeerPressure/wiki/Installation). + +## Validation + +- 68 tests pass locally, covering the existing safety checks and Peer Pressure installer, extras, default-dashboard paths, and INI injection handling. +- The real upstream installer and built-in homebrew archives pass extraction, complete-plan installation into a temporary directory, copied-file hash comparison, and Aurora configuration checks. +- Linux and Windows self-contained builds have been checked; the release workflow builds and tests both platforms before publishing. +- Aurora default-dashboard startup has been confirmed on one physical setup. Broader console/HDD compatibility testing remains outstanding. + +## Downloads + +- `BadBuilder-linux-x64` — self-contained Linux x64 binary +- `BadBuilder-win-x64.exe` — self-contained Windows x64 binary +- `SHA256SUMS` — checksums for both binaries + +On Linux, make the binary executable and run it without sudo. The previous v2.3.1 binaries remain available for earlier USB preparation workflows. diff --git a/BadBuilder.Tests/PeerPressureHomebrewTests.cs b/BadBuilder.Tests/PeerPressureHomebrewTests.cs new file mode 100644 index 0000000..0bc734d --- /dev/null +++ b/BadBuilder.Tests/PeerPressureHomebrewTests.cs @@ -0,0 +1,155 @@ +using BadBuilder.Configuration; +using BadBuilder.Services; + +namespace BadBuilder.Tests; + +public sealed class PeerPressureHomebrewTests +{ + [Fact] + public async Task Extras_InstallAppsAndContentWithOneDefaultDashboardAndPreserveXell() + { + using TemporaryDirectory temporary = new(); + BuilderConfig config = new(ArtifactCatalog.Homebrew) { SelectedExploit = ExploitOption.PeerPressure }; + config.LaunchHomebrew = config.Homebrew[0]; + var staged = CreateStagedArtifacts(temporary.Path, config); + + var prepared = PeerPressureHomebrewService.PrepareArtifacts(config, staged); + InstallPlan plan = InstallService.BuildPlan(prepared, [], 128L * 1024 * 1024); + string target = Path.Combine(temporary.Path, "target"); + Directory.CreateDirectory(target); + await InstallService.ExecuteAsync(plan, target, CancellationToken.None); + + string extras = Path.Combine(target, "BadUpdatePayload", "SoftmodExtras"); + Assert.Equal("aurora", await File.ReadAllTextAsync(Path.Combine(extras, "homebrew-aurora", "Aurora.xex"))); + Assert.True(File.Exists(Path.Combine(extras, "homebrew-xexmenu", "Content", "menu"))); + Assert.True(File.Exists(Path.Combine(extras, "homebrew-simple360nandflasher", "Default.xex"))); + Assert.True(File.Exists(Path.Combine(extras, "Xell", "xell-2f.bin"))); + Assert.Equal("installer", await File.ReadAllTextAsync(Path.Combine(target, "BadUpdatePayload", "default.xex"))); + string ini = await File.ReadAllTextAsync(Path.Combine(extras, "SoftmodExtras.ini")); + Assert.StartsWith("; upstream comments\r\n[Xell]\r\nSource = \"Xell\"\r\n", ini, StringComparison.Ordinal); + Assert.Contains("Source = \"homebrew-aurora\"\r\nDestination = \"Hdd1:\\Apps\\Aurora\"", ini, StringComparison.Ordinal); + Assert.Contains("Source = \"homebrew-xexmenu\"\r\nDestination = \"Hdd1:\\\"", ini, StringComparison.Ordinal); + Assert.Single(ini.Split('\n'), line => line.StartsWith("DashXex", StringComparison.Ordinal)); + Assert.Contains("DashXex = \"Aurora.xex\"", ini, StringComparison.Ordinal); + Assert.False(Directory.Exists(Path.Combine(target, "Apps"))); + Assert.False(File.Exists(Path.Combine(target, "launch.ini"))); + Assert.All(config.Homebrew, entry => Assert.DoesNotContain("SoftmodExtras", entry.Artifact.Operations![0].DestinationPath, StringComparison.Ordinal)); + } + + [Fact] + public void Extras_WithoutADefaultDoNotSetDashXex() + { + using TemporaryDirectory temporary = new(); + BuilderConfig config = new(ArtifactCatalog.Homebrew) { SelectedExploit = ExploitOption.PeerPressure }; + var prepared = PeerPressureHomebrewService.PrepareArtifacts(config, CreateStagedArtifacts(temporary.Path, config)); + InstallPlan plan = InstallService.BuildPlan(prepared, [], 128L * 1024 * 1024); + var ini = Assert.Single(plan.Actions, action => action.Kind == PlannedActionKind.WriteFile); + Assert.DoesNotContain("DashXex", System.Text.Encoding.UTF8.GetString(ini.Contents!), StringComparison.Ordinal); + } + + [Theory] + [InlineData("missing.xex", typeof(FileNotFoundException))] + [InlineData("../outside.xex", typeof(InvalidDataException))] + public void Extras_RejectInvalidDefaultEntryPointBeforeFormatting(string entryPoint, Type expectedError) + { + using TemporaryDirectory temporary = new(); + HomebrewEntry aurora = ArtifactCatalog.Homebrew[0] with { EntryPointRelativePath = entryPoint }; + BuilderConfig config = new([aurora]) { SelectedExploit = ExploitOption.PeerPressure, LaunchHomebrew = aurora }; + var staged = CreateStagedArtifacts(temporary.Path, config); + Assert.Throws(expectedError, () => PeerPressureHomebrewService.PrepareArtifacts(config, staged)); + } + + [Fact] + public void Extras_RejectIniInjectionInAnAppName() + { + using TemporaryDirectory temporary = new(); + HomebrewEntry aurora = ArtifactCatalog.Homebrew[0] with + { + Artifact = ArtifactCatalog.Homebrew[0].Artifact with { DisplayName = "Aurora\"\r\nDestination = HddSys:" } + }; + BuilderConfig config = new([aurora]) { SelectedExploit = ExploitOption.PeerPressure }; + Assert.Throws(() => PeerPressureHomebrewService.PrepareArtifacts(config, + CreateStagedArtifacts(temporary.Path, config))); + } + + [Fact] + public async Task Extras_SupportNestedCustomEntryPointsAndArchiveSubdirectories() + { + using TemporaryDirectory temporary = new(); + HomebrewEntry app = ArtifactCatalog.Homebrew[0] with + { + EntryPointRelativePath = "bin/start.xex", + Artifact = ArtifactCatalog.Homebrew[0].Artifact with + { + DisplayName = "My App", + Operations = [new InstallOperation(InstallOperationKind.CopyDirectory, "Apps/My App", "package")] + } + }; + BuilderConfig config = new([app]) { SelectedExploit = ExploitOption.PeerPressure, LaunchHomebrew = app }; + var staged = CreateStagedArtifacts(temporary.Path, config); + WriteFile(Path.Combine(temporary.Path, app.Artifact.ID), "package/bin/start.xex", "custom"); + + var prepared = PeerPressureHomebrewService.PrepareArtifacts(config, staged); + InstallPlan plan = InstallService.BuildPlan(prepared, [], 128L * 1024 * 1024); + string target = Path.Combine(temporary.Path, "target"); + Directory.CreateDirectory(target); + await InstallService.ExecuteAsync(plan, target, CancellationToken.None); + + string extras = Path.Combine(target, "BadUpdatePayload", "SoftmodExtras"); + Assert.Equal("custom", await File.ReadAllTextAsync(Path.Combine(extras, app.Artifact.ID, "bin", "start.xex"))); + string ini = await File.ReadAllTextAsync(Path.Combine(extras, "SoftmodExtras.ini")); + Assert.Contains("Destination = \"Hdd1:\\Apps\\My App\"", ini, StringComparison.Ordinal); + Assert.Contains("DashXex = \"bin\\start.xex\"", ini, StringComparison.Ordinal); + } + + [Fact] + public void Extras_WithNoAppsPreserveOriginalInstallerOperations() + { + using TemporaryDirectory temporary = new(); + BuilderConfig config = new([]) { SelectedExploit = ExploitOption.PeerPressure }; + var staged = CreateStagedArtifacts(temporary.Path, config); + var prepared = PeerPressureHomebrewService.PrepareArtifacts(config, staged); + Assert.Equal(staged, prepared); + } + + [Fact] + public void Extras_RejectAStaleDefaultSelection() + { + BuilderConfig config = new([]) + { + SelectedExploit = ExploitOption.PeerPressure, + LaunchHomebrew = ArtifactCatalog.Homebrew[0] + }; + Assert.Throws(() => PeerPressureHomebrewService.PrepareArtifacts(config, [])); + } + + private static List<(ArtifactDefinition Artifact, string StagingPath)> CreateStagedArtifacts(string root, BuilderConfig config) + { + ArtifactDefinition installer = ArtifactCatalog.Exploits[ExploitOption.PeerPressure]; + string installerRoot = Path.Combine(root, installer.ID); + foreach (string path in installer.Layout!.RequiredPaths!) + WriteFile(installerRoot, path, "installer"); + WriteFile(installerRoot, "BadUpdatePayload/SoftmodExtras/SoftmodExtras.ini", "; upstream comments\r\n[Xell]\r\nSource = \"Xell\"\r\n"); + List<(ArtifactDefinition, string)> staged = [(installer, installerRoot)]; + foreach (HomebrewEntry entry in config.Homebrew) + { + string appRoot = Path.Combine(root, entry.Artifact.ID); + string file = entry.Artifact.ID switch + { + "homebrew-aurora" => "Aurora.xex", + "homebrew-xexmenu" => "Content/menu", + _ => "Simple 360 NAND Flasher/Default.xex" + }; + WriteFile(appRoot, file, "aurora"); + staged.Add((entry.Artifact, appRoot)); + } + return staged; + } + + private static void WriteFile(string root, string relative, string text) + { + string path = Path.Combine(root, relative); + Directory.CreateDirectory(Path.GetDirectoryName(path)!); + File.WriteAllText(path, text); + } +} diff --git a/BadBuilder.Tests/PeerPressureTests.cs b/BadBuilder.Tests/PeerPressureTests.cs new file mode 100644 index 0000000..b24fba1 --- /dev/null +++ b/BadBuilder.Tests/PeerPressureTests.cs @@ -0,0 +1,163 @@ +using System.Security.Cryptography; +using BadBuilder.Configuration; +using BadBuilder.Services; + +namespace BadBuilder.Tests; + +public sealed class PeerPressureTests +{ + [Fact] + public void Catalog_PinsOfficialInstallerReleaseAndChecksum() + { + GitHubReleaseSource source = Assert.IsType( + ArtifactCatalog.Exploits[ExploitOption.PeerPressure].Source); + + Assert.Equal("grimdoomer", source.Owner); + Assert.Equal("Xbox360PeerPressure", source.Repo); + Assert.Equal("SoftmodInstaller.zip", source.AssetPattern); + Assert.Equal(ReleaseSelectionPolicy.ExactTag, source.ReleasePolicy); + Assert.Equal("v1.0.477", source.ReleaseTag); + Assert.Equal("7C7D42C301E72145B9D1F0A0E23FF164FDEFBBE780C2019A3CE7465E963B1827", source.PinnedSHA256); + } + + [Theory] + [InlineData("XeUnshackle")] + [InlineData("XeUnshackleMax")] + [InlineData("FreeMyXe")] + public void Selection_IncludesHomebrewWithoutASeparateBootstrap(string bootstrap) + { + BuilderConfig config = new(ArtifactCatalog.Homebrew) + { + SelectedExploit = ExploitOption.PeerPressure, + SelectedBootstrap = Enum.Parse(bootstrap), + LaunchHomebrew = ArtifactCatalog.Homebrew[0], + }; + + IReadOnlyList selected = ArtifactCatalog.GetSelectedArtifacts(config); + + Assert.True(config.IsPeerPressureInstall); + Assert.Equal(["badupdate-gamedata", "exploit-peerpressure", "homebrew-aurora", "homebrew-xexmenu", "homebrew-simple360nandflasher"], + selected.Select(artifact => artifact.ID)); + Assert.DoesNotContain("XeUnshackle", config.ToString(), StringComparison.Ordinal); + Assert.Contains("Aurora", config.ToString(), StringComparison.Ordinal); + } + + [Fact] + public void DashboardUpdate_StillTakesPrecedenceOverPeerPressure() + { + BuilderConfig config = new(ArtifactCatalog.Homebrew) + { + SelectedExploit = ExploitOption.PeerPressure, + FirmwareUpdateEnabled = true, + }; + + Assert.Equal("dashboard-update", Assert.Single(ArtifactCatalog.GetSelectedArtifacts(config)).ID); + Assert.False(config.IsPeerPressureInstall); + } + + [Fact] + public async Task Install_MergesGameAndInstallerContentWithoutReplacingInstallerPayload() + { + using TemporaryDirectory temporary = new(); + BuilderConfig config = new([]) { SelectedExploit = ExploitOption.PeerPressure }; + List<(ArtifactDefinition Artifact, string StagingPath)> staged = []; + foreach (ArtifactDefinition artifact in ArtifactCatalog.GetSelectedArtifacts(config)) + { + string root = Path.Combine(temporary.Path, artifact.ID); + Directory.CreateDirectory(root); + foreach (string required in artifact.Layout!.RequiredPaths!) + { + string path = Path.Combine(root, required); + Directory.CreateDirectory(Path.GetDirectoryName(path)!); + if (required == ".") + continue; + await File.WriteAllTextAsync(path, required); + } + + string content = Path.Combine(root, "Content", "0000000000000000", "5841122D", + artifact.ID == "badupdate-gamedata" ? "000D0000/demo" : "00000001/DaTArrest_Xbox360BadUpdate"); + Directory.CreateDirectory(Path.GetDirectoryName(content)!); + await File.WriteAllTextAsync(content, artifact.ID); + staged.Add((artifact, root)); + } + + InstallPlan plan = InstallService.BuildPlan(staged, [], 128L * 1024 * 1024); + string target = Path.Combine(temporary.Path, "target"); + Directory.CreateDirectory(target); + await InstallService.ExecuteAsync(plan, target, CancellationToken.None); + + Assert.Equal("BadUpdatePayload/default.xex", + await File.ReadAllTextAsync(Path.Combine(target, "BadUpdatePayload", "default.xex"))); + Assert.True(File.Exists(Path.Combine(target, "BadUpdatePayload", "SoftmodData.zip"))); + Assert.Equal("badupdate-gamedata", await File.ReadAllTextAsync(Path.Combine(target, + "Content", "0000000000000000", "5841122D", "000D0000", "demo"))); + Assert.Equal("exploit-peerpressure", await File.ReadAllTextAsync(Path.Combine(target, + "Content", "0000000000000000", "5841122D", "00000001", "DaTArrest_Xbox360BadUpdate"))); + Assert.False(File.Exists(Path.Combine(target, "launch.ini"))); + } + + [Theory] + [InlineData("BadUpdatePayload/default.xex")] + [InlineData("BadUpdatePayload/SoftmodData.zip")] + [InlineData("Content/0000000000000000/5841122D/00000001/DaTArrest_Xbox360BadUpdate")] + public void Install_RejectsAnIncompleteInstaller(string missingPath) + { + using TemporaryDirectory temporary = new(); + ArtifactDefinition artifact = ArtifactCatalog.Exploits[ExploitOption.PeerPressure]; + foreach (string required in artifact.Layout!.RequiredPaths!.Where(path => path != missingPath)) + { + string path = Path.Combine(temporary.Path, required); + Directory.CreateDirectory(Path.GetDirectoryName(path)!); + File.WriteAllText(path, "fixture"); + } + + Assert.Throws(() => InstallService.BuildPlan( + [(artifact, temporary.Path)], [], 128L * 1024 * 1024)); + } + + [Fact] + public async Task OptIn_RealArchivesPrepareInstallerUsbInTemporaryDirectory() + { + string? archives = Environment.GetEnvironmentVariable("BADBUILDER_PEER_PRESSURE_ARCHIVES"); + if (string.IsNullOrWhiteSpace(archives)) + return; + + using TemporaryDirectory temporary = new(); + BuilderConfig config = new(ArtifactCatalog.Homebrew) { SelectedExploit = ExploitOption.PeerPressure }; + config.LaunchHomebrew = config.Homebrew[0]; + List<(ArtifactDefinition Artifact, string StagingPath)> staged = []; + foreach (ArtifactDefinition artifact in ArtifactCatalog.GetSelectedArtifacts(config)) + { + GitHubReleaseSource source = Assert.IsType(artifact.Source); + string archive = Path.Combine(archives, source.AssetPattern); + await using (FileStream stream = File.OpenRead(archive)) + { + string hash = Convert.ToHexString(await SHA256.HashDataAsync(stream)); + DownloadService.EnsureHashMatches(artifact.DisplayName, hash, source.PinnedSHA256); + } + string root = await ArchiveService.ExtractAsync(artifact.ID, archive, temporary.Path, + ArchiveExtractionLimits.CreateDefault(temporary.Path, 1024L * 1024 * 1024), CancellationToken.None); + staged.Add((artifact, root)); + } + + var prepared = PeerPressureHomebrewService.PrepareArtifacts(config, staged); + InstallPlan plan = InstallService.BuildPlan(prepared, [], 1024L * 1024 * 1024); + string target = Path.Combine(temporary.Path, "target"); + Directory.CreateDirectory(target); + await InstallService.ExecuteAsync(plan, target, CancellationToken.None); + + foreach (PlannedInstallAction action in plan.Actions.Where(action => action.Kind == PlannedActionKind.CopyFile && + action.DestinationRelativePath != "BadUpdatePayload/SoftmodExtras/SoftmodExtras.ini")) + { + await using FileStream source = File.OpenRead(action.SourcePath!); + await using FileStream installed = File.OpenRead(Path.Combine(target, action.DestinationRelativePath)); + Assert.Equal(await SHA256.HashDataAsync(source), await SHA256.HashDataAsync(installed)); + } + string ini = await File.ReadAllTextAsync(Path.Combine(target, "BadUpdatePayload", "SoftmodExtras", "SoftmodExtras.ini")); + Assert.Contains("[Xell]", ini, StringComparison.Ordinal); + Assert.Contains("DashXex = \"Aurora.xex\"", ini, StringComparison.Ordinal); + Assert.True(File.Exists(Path.Combine(target, "BadUpdatePayload", "SoftmodExtras", "homebrew-aurora", "Aurora.xex"))); + Assert.False(Directory.Exists(Path.Combine(target, "Apps"))); + Assert.False(File.Exists(Path.Combine(target, "launch.ini"))); + } +} diff --git a/BadBuilder/Application/BuilderApp.Homebrew.cs b/BadBuilder/Application/BuilderApp.Homebrew.cs index 9dbdc40..fed8005 100644 --- a/BadBuilder/Application/BuilderApp.Homebrew.cs +++ b/BadBuilder/Application/BuilderApp.Homebrew.cs @@ -14,14 +14,17 @@ private static void ConfigureHomebrew() Controls.ShowConfigurationSummary(Config); string action = Controls.PromptSelection( - "Homebrew configuration", + Config.IsPeerPressureInstall ? "Peer Pressure installer extras" : "Homebrew configuration", [ new MenuOption("add", "Add homebrew", "Add from archive"), new MenuOption("remove", "Remove homebrew", Config.Homebrew.Count == 0 ? "None" : $"{Config.Homebrew.Count} configured"), - new MenuOption("launch", "Set default launch", GetLaunchDisplayName()), - new MenuOption("clear-launch", "Clear default launch", "Do not auto-launch a homebrew app"), + new MenuOption("launch", Config.IsPeerPressureInstall ? "Set default dashboard" : "Set default launch", GetLaunchDisplayName()), + new MenuOption("clear-launch", Config.IsPeerPressureInstall ? "Clear default dashboard" : "Clear default launch", "Do not auto-launch a homebrew app"), new MenuOption("back", "Back") - ] + ], + Config.IsPeerPressureInstall + ? "Packages apps for installation to the HDD. Select Install Extras on the console to install them; DashLaunch plugins are unsupported." + : null ); switch (action) @@ -167,7 +170,7 @@ private static void RemoveCustomHomebrew() private static void ConfigureLaunchHomebrew() { - if (!BootstrapCapabilities.SupportsDefaultHomebrewLaunch(Config.SelectedBootstrap)) + if (!Config.IsPeerPressureInstall && !BootstrapCapabilities.SupportsDefaultHomebrewLaunch(Config.SelectedBootstrap)) { Controls.WriteWarning("Automatic homebrew launch requires XeUnshackle or XeUnshackle Max."); Controls.Pause(); @@ -190,7 +193,7 @@ private static void ConfigureLaunchHomebrew() new MenuOption(null, "Back") ]; - string? selectedLaunch = Controls.PromptSelection("Choose default launch program", options); + string? selectedLaunch = Controls.PromptSelection(Config.IsPeerPressureInstall ? "Choose default dashboard" : "Choose default launch program", options); if (selectedLaunch is null) return; diff --git a/BadBuilder/Application/BuilderApp.cs b/BadBuilder/Application/BuilderApp.cs index b996e32..569ef00 100644 --- a/BadBuilder/Application/BuilderApp.cs +++ b/BadBuilder/Application/BuilderApp.cs @@ -33,6 +33,10 @@ internal static async Task RunAsync(CancellationToken cancellationToken) options.RemoveAll(item => item.Value is not (RootAction.ConfigureDrive or RootAction.UpdateXbox or RootAction.Install or RootAction.Exit)); } + else if (Config.IsPeerPressureInstall) + { + options.RemoveAll(item => item.Value == RootAction.ConfigureBootstrap); + } try { @@ -89,6 +93,12 @@ private static async Task InstallAsync(CancellationToken cancellationToken) try { ValidateConfiguration(); + if (Config.IsPeerPressureInstall) + { + Controls.WriteWarning("Peer Pressure requires a supported Xbox 360 and an HDD (mechanical recommended). Corona and Winchester are unsupported."); + Controls.WriteWarning("The console installer modifies NAND and HDD security sectors. Create and keep a system backup before installing; failure may require a hardware NAND flasher."); + Controls.WriteInfo("This prepares the official installer USB. Follow https://github.com/grimdoomer/Xbox360PeerPressure/wiki/Installation"); + } DiskInfo selected = Config.TargetDisk!; IReadOnlyList artifacts = ArtifactCatalog.GetSelectedArtifacts(Config); if (artifacts.Count == 0) @@ -122,6 +132,9 @@ private static async Task InstallAsync(CancellationToken cancellationToken) staged.Add((artifact, path)); } + if (Config.IsPeerPressureInstall) + staged = PeerPressureHomebrewService.PrepareArtifacts(Config, staged); + string configText = $"Configuration:{Environment.NewLine}{Config}"; List extraOperations = [ @@ -162,7 +175,7 @@ private static async Task InstallAsync(CancellationToken cancellationToken) Controls.WriteInfo("Copying the fully validated installation plan."); await InstallService.ExecuteAsync(installPlan, preparedTarget.MountRoot, CancellationToken.None); - if (Config.LaunchHomebrew is not null) + if (!Config.FirmwareUpdateEnabled && !Config.IsPeerPressureInstall && Config.LaunchHomebrew is not null) { string iniPath = Path.Combine(preparedTarget.MountRoot, "launch.ini"); string appName = FileServices.SanitizeFatName(Config.LaunchHomebrew.Artifact.DisplayName); @@ -244,6 +257,8 @@ private static async Task InstallAsync(CancellationToken cancellationToken) ? "Your USB drive is ready for use and was safely unmounted." : "Your USB drive is ready for use. Eject it normally from Windows." : "All files were copied, but review the cleanup warning before removing the USB."); + if (Config.IsPeerPressureInstall) + Controls.WriteInfo("On the Xbox 360, launch the Rock Band Blitz demo and press A at the title screen. Create and keep a system backup. Select Install Extras and choose the packaged homebrew, including your selected default dashboard."); Controls.Pause(); } else if (failureNeedsPause) @@ -257,7 +272,7 @@ private static void ValidateConfiguration() if (Config.TargetDisk is null) throw new InvalidOperationException("Select a target drive."); - if (Config.FirmwareUpdateEnabled) + if (Config.FirmwareUpdateEnabled || Config.IsPeerPressureInstall) return; if (Config.LaunchHomebrew is null) diff --git a/BadBuilder/BadBuilder.csproj b/BadBuilder/BadBuilder.csproj index b86d6d0..931dcdc 100644 --- a/BadBuilder/BadBuilder.csproj +++ b/BadBuilder/BadBuilder.csproj @@ -12,7 +12,7 @@ all low latest-recommended - 2.3.1 + 2.4.0 win-x64;linux-x64 true true diff --git a/BadBuilder/Configuration/ArtifactCatalog.cs b/BadBuilder/Configuration/ArtifactCatalog.cs index 3ae7309..031ea90 100644 --- a/BadBuilder/Configuration/ArtifactCatalog.cs +++ b/BadBuilder/Configuration/ArtifactCatalog.cs @@ -4,6 +4,37 @@ internal static class ArtifactCatalog { private static readonly Dictionary ExploitMap = new() { + [ExploitOption.PeerPressure] = new + ( + "exploit-peerpressure", + "Peer Pressure", + "Persistent softmod installer; requires an HDD and a supported console (not Corona/Winchester)", + "exploit", + new GitHubReleaseSource( + "grimdoomer", + "Xbox360PeerPressure", + "SoftmodInstaller.zip", + ReleaseSelectionPolicy.ExactTag, + "v1.0.477", + "7C7D42C301E72145B9D1F0A0E23FF164FDEFBBE780C2019A3CE7465E963B1827"), + [new InstallOperation(InstallOperationKind.CopyDirectory, ".", ".")], + ArtifactPriority.Exploit, + Layout: new ArchiveLayout([ + "BadUpdatePayload/default.xex", + "BadUpdatePayload/BadUpdateExploit-2ndStage.bin", + "BadUpdatePayload/BadUpdateExploit-3rdStage.bin", + "BadUpdatePayload/BadUpdateExploit-4thStage.bin", + "BadUpdatePayload/BadUpdateExploit-Data.bin", + "BadUpdatePayload/SoftmodData.zip", + "BadUpdatePayload/bootanim.xex", + "BadUpdatePayload/update_data.bin", + "BadUpdatePayload/xke_update.bin", + "BadUpdatePayload/SoftmodExtras/SoftmodExtras.ini", + "BadUpdatePayload/SoftmodExtras/Xell/boot.ini", + "BadUpdatePayload/SoftmodExtras/Xell/xell-2f.bin", + "Content/0000000000000000/5841122D/00000001/DaTArrest_Xbox360BadUpdate" + ]) + ), [ExploitOption.ABadAvatar] = new ( "exploit-abadavatar", @@ -210,6 +241,12 @@ internal static IReadOnlyList GetSelectedArtifacts(BuilderCo if (config.FirmwareUpdateEnabled) selected.Add(DashboardUpdate); + else if (config.IsPeerPressureInstall) + { + selected.Add(BadUpdateGameData); + selected.Add(ExploitMap[ExploitOption.PeerPressure]); + selected.AddRange(config.Homebrew.Select(entry => entry.Artifact)); + } else { selected.Add(ExploitMap[config.SelectedExploit]); diff --git a/BadBuilder/Configuration/BuilderConfig.cs b/BadBuilder/Configuration/BuilderConfig.cs index a0e3eb3..88bc084 100644 --- a/BadBuilder/Configuration/BuilderConfig.cs +++ b/BadBuilder/Configuration/BuilderConfig.cs @@ -16,8 +16,20 @@ internal sealed class BuilderConfig internal bool FirmwareUpdateEnabled { get; set; } + internal bool IsPeerPressureInstall => !FirmwareUpdateEnabled && SelectedExploit == ExploitOption.PeerPressure; + public override string ToString() { + if (IsPeerPressureInstall) + return $""" + Target drive: {TargetDisk} + + Selected exploit: Peer Pressure + USB contents: Official softmod installer and Rock Band Blitz demo (includes XeLL). + Installer extras: {string.Join(", ", Homebrew.Select(item => item.Artifact.DisplayName))} + Default dashboard: {LaunchHomebrew?.Artifact.DisplayName ?? "N/A"} + """; + return $""" Target drive: {TargetDisk} diff --git a/BadBuilder/Configuration/Models.cs b/BadBuilder/Configuration/Models.cs index 2338851..79eb0e0 100644 --- a/BadBuilder/Configuration/Models.cs +++ b/BadBuilder/Configuration/Models.cs @@ -5,6 +5,7 @@ internal enum ExploitOption ABadAvatar, ABadAvatar13Beta, BadUpdate, + PeerPressure, } internal enum BootstrapOption diff --git a/BadBuilder/Services/PeerPressureHomebrewService.cs b/BadBuilder/Services/PeerPressureHomebrewService.cs new file mode 100644 index 0000000..5877ff1 --- /dev/null +++ b/BadBuilder/Services/PeerPressureHomebrewService.cs @@ -0,0 +1,71 @@ +using System.Globalization; +using System.Text; +using BadBuilder.Configuration; + +namespace BadBuilder.Services; + +internal static class PeerPressureHomebrewService +{ + private const string ExtrasRoot = "BadUpdatePayload/SoftmodExtras"; + private const string ExtrasIni = ExtrasRoot + "/SoftmodExtras.ini"; + + internal static List<(ArtifactDefinition Artifact, string StagingPath)> PrepareArtifacts( + BuilderConfig config, + IReadOnlyList<(ArtifactDefinition Artifact, string StagingPath)> staged) + { + if (config.LaunchHomebrew is not null && !config.Homebrew.Any(entry => entry.Artifact.ID == config.LaunchHomebrew.Artifact.ID)) + throw new InvalidOperationException("The default dashboard must be included in the homebrew selection."); + + List<(ArtifactDefinition Artifact, string StagingPath)> prepared = [..staged]; + if (config.Homebrew.Count == 0) + return prepared; + + string installerId = ArtifactCatalog.Exploits[ExploitOption.PeerPressure].ID; + int installerIndex = prepared.FindIndex(item => item.Artifact.ID == installerId); + if (installerIndex < 0) + throw new InvalidDataException("The Peer Pressure installer archive was not staged."); + (ArtifactDefinition installer, string installerRoot) = prepared[installerIndex]; + StringBuilder ini = new(File.ReadAllText(PathSafety.ResolveInside(installerRoot, ExtrasIni))); + + foreach (HomebrewEntry entry in config.Homebrew) + { + string id = FileServices.ValidateIdentifier(entry.Artifact.ID); + string name = entry.Artifact.DisplayName; + if (string.IsNullOrWhiteSpace(name) || name.Any(character => char.IsControl(character) || character == '"')) + throw new InvalidDataException("A Peer Pressure homebrew name cannot contain quotes or control characters."); + + int index = prepared.FindIndex(item => item.Artifact.ID == id); + if (index < 0) + throw new InvalidDataException($"The homebrew archive for {name} was not staged."); + (ArtifactDefinition artifact, string root) = prepared[index]; + // shortcut: extras use one directory copy per app; extend if the homebrew catalog adds other layouts. + if (artifact.Operations is not [InstallOperation { Kind: InstallOperationKind.CopyDirectory } operation]) + throw new InvalidDataException($"{name} must install from one directory to be packaged as a Peer Pressure extra."); + + string destination = XboxPath.Combine("Hdd1", operation.DestinationPath); + ini.Append(CultureInfo.InvariantCulture, $"\r\n[BadBuilder-{id}]\r\nCategory = \"Homebrew\"\r\nName = \"{name}\"\r\nDescription = \"Installs {name}.\"\r\nSource = \"{id}\"\r\nDestination = \"{destination}\"\r\n"); + if (config.LaunchHomebrew?.Artifact.ID == id) + { + if (string.IsNullOrWhiteSpace(entry.EntryPointRelativePath)) + throw new InvalidOperationException("The selected default dashboard has no entry point."); + string entryPoint = PathSafety.NormalizeRelativePath(entry.EntryPointRelativePath); + FileServices.ValidateFatRelativePath(entryPoint); + string source = PathSafety.ResolveInside(root, operation.SourcePath ?? "."); + FileServices.EnsureFile(PathSafety.ResolveInside(source, entryPoint)); + ini.Append(CultureInfo.InvariantCulture, $"DashXex = \"{entryPoint.Replace('/', '\\')}\"\r\n"); + } + + prepared[index] = (artifact with + { + Operations = [operation with { DestinationPath = ExtrasRoot + "/" + id }] + }, root); + } + + prepared[installerIndex] = (installer with + { + Operations = [..installer.Operations!, new InstallOperation( + InstallOperationKind.WriteFile, ExtrasIni, Contents: ini.ToString(), AllowedOverwritePaths: [ExtrasIni])] + }, installerRoot); + return prepared; + } +} diff --git a/BadBuilder/UI/Controls.cs b/BadBuilder/UI/Controls.cs index be573ef..3a05520 100644 --- a/BadBuilder/UI/Controls.cs +++ b/BadBuilder/UI/Controls.cs @@ -159,6 +159,13 @@ internal static void ShowConfigurationSummary(BuilderConfig config) { table.AddRow("Update", "[gray]Update to 2.0.17559.0[/]"); } + else if (config.IsPeerPressureInstall) + { + table.AddRow("Exploit", "[gray]Peer Pressure[/]"); + table.AddRow("USB contents", "[gray]Official softmod installer + Rock Band Blitz demo (includes XeLL)[/]"); + table.AddRow("Installer extras", Escape(string.Join(", ", config.Homebrew.Select(entry => entry.Artifact.DisplayName).DefaultIfEmpty("None")))); + table.AddRow("Default dashboard", Escape(config.LaunchHomebrew?.Artifact.DisplayName ?? "None")); + } else { table.AddRow("Exploit", $"[gray]{Escape(config.SelectedExploit.ToString())}[/]"); diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e10e551 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,41 @@ +# Changelog + +## [2.4.0](https://github.com/mitch030504/BadBuilderLinux/releases/tag/v2.4.0) — 2026-11-07 + +### Added + +- Peer Pressure as a separate exploit choice, with the official v1.0.477 installer pinned to its release and SHA-256. The USB includes Rock Band Blitz, the upstream license, and bundled XeLL. +- A separate Peer Pressure homebrew path for Aurora, XeXMenu, built-in utilities, and custom archives. Apps are packaged as HDD installation extras while the upstream extras catalog is preserved. +- **Set default dashboard** through Peer Pressure's `DashXex` setting, including preflight validation of the selected executable. Select the dashboard under **Install Extras** on the console to apply it. +- Regression coverage for installer selection and layout, app staging, dashboard paths, catalog preservation, and INI injection. An optional real-archive test checks the complete USB plan without formatting a disk. + +### Changed + +- Peer Pressure hides the separate bootstrap menu and uses its own dashboard configuration. BadUpdate and ABadAvatar retain their existing bootstrap and USB homebrew paths. +- Reworked the README around downloads, workflow selection, Peer Pressure installation, Aurora setup, recovery, and development checks. + +### Validation and limits + +- The 68-test suite and real-archive integration check pass locally; Linux and Windows self-contained builds have been checked. +- Aurora default-dashboard startup was confirmed on one physical setup. Other console and HDD combinations still require testing. +- Peer Pressure requires a compatible console and HDD; Corona and Winchester are unsupported. DashLaunch plugins are unsupported. The dashboard picker accepts executable utilities too, so choose a dashboard rather than a maintenance tool. +- USB preparation erases the selected disk. Console softmod installation modifies NAND/HDD data; keep the official installer's system backup somewhere safe. + +## [2.3.1](.github/release-notes/v2.3.1.md) — 2026-10-22 + +- Fixed preflight failures when XeUnshackle or XeUnshackle Max adds `BadUpdatePayload/default.xex` to an exploit archive that does not already contain it. +- Preserved strict collision checks and added regression tests for optional overlays. + +## [2.3.0](.github/release-notes/v2.3.0.md) — 2026-10-22 + +- Added the pinned XeUnshackle Max v1.0.0 bootstrap and default USB homebrew launching. +- Omitted bundled JRPC2/Xbdm remote-access binaries from automatic installation. + +## [2.2.1](.github/release-notes/v2.2.1.md) — 2026-10-22 + +- Integrated upstream changes through September 14, 2026, including Windows administrator elevation, while retaining Linux's scoped sudo helper and disk safeguards. + +## [2.2.0](https://github.com/mitch030504/BadBuilderLinux/releases/tag/v2.2.0) — 2026-09-28 + +- Added the pinned ABadAvatar 1.3 Beta option alongside the original Public Beta. +- Included submenu Back navigation, dependency updates, and archive-layout validation. diff --git a/README.md b/README.md index 57c6a24..7367ca7 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,130 @@ # BadBuilderLinux -BadBuilderLinux is a Linux-first, safety-hardened fork of [Pdawg-bytes/BadBuilder](https://github.com/Pdawg-bytes/BadBuilder). It prepares a FAT32 USB drive for the Xbox 360 BadUpdate or ABadAvatar exploit. It downloads and verifies the selected exploit, bootstrap, dashboard update, and homebrew archives; validates and stages everything; then formats and installs the complete plan. +Prepare an Xbox 360 USB with BadUpdate, ABadAvatar, or the Peer Pressure softmod installer. BadBuilderLinux downloads the required files, verifies and stages them, then formats and installs the complete USB layout. -The executable and .NET project retain the `BadBuilder` name for compatibility. This fork supports self-contained `win-x64` and `linux-x64` builds, preserves Windows behavior, and adds a native Linux disk backend. Linux is tested primarily on CachyOS/Arch and targets mainstream systemd desktops. macOS is not supported. +This is a Linux-first fork of [Pdawg-bytes/BadBuilder](https://github.com/Pdawg-bytes/BadBuilder), with self-contained Linux and Windows x64 builds. The executable and .NET project retain the `BadBuilder` name. Linux is tested primarily on CachyOS/Arch and targets mainstream systemd desktops; macOS is unsupported. + +**New in v2.4.0:** Peer Pressure installer support, homebrew installation through its extras catalog, and Aurora default-dashboard setup. See the [changelog](CHANGELOG.md) for release history. > [!CAUTION] -> BadBuilder erases the selected USB disk. It deliberately offers only writable USB/removable/hot-plug whole disks and excludes devices backing the operating system, boot, home, swap, the current workspace, or its cache. Always verify the model, size, serial, and exact device path before typing the final confirmation. +> Preparing a USB erases the entire selected disk. Check its device path, model, size, and serial before confirming. Save any console backups elsewhere before reusing an installer USB. -## Safety model +## Download and run -All downloads, archive extraction, and installation planning finish before BadBuilder asks for destructive confirmation. The preflight phase enforces trusted SHA-256 metadata where available, requires explicit approval for checksum-less bytes, rejects unsafe archive paths and FAT-incompatible names, validates expected archive layouts, detects case-insensitive destination collisions, and checks staging and target capacity. +Get the binaries and `SHA256SUMS` from the [latest release](https://github.com/mitch030504/BadBuilderLinux/releases/latest). The published binaries include the .NET runtime. -On Linux, run the interactive application as your normal desktop user. BadBuilder invokes its own hidden disk helper through `sudo` only for preparation and cleanup. The helper independently re-enumerates the selected disk, verifies its fingerprint, takes a per-device lease, normally unmounts child volumes, creates an MBR with one `BADUPDATE` FAT32 partition, and mounts it below `/run/badbuilder//` with `nodev,nosuid,noexec` and caller ownership. It flushes and normally unmounts the USB when installation ends. It never uses force or lazy unmounting. +| Platform | Download | Launch | +| --- | --- | --- | +| Linux x64 | `BadBuilder-linux-x64` | Make executable and run as your desktop user | +| Windows x64 | `BadBuilder-win-x64.exe` | Launch and accept the administrator prompt | -On Windows, the published `win-x64` executable includes an administrator manifest and may show a UAC elevation prompt when launched normally; launching from an Administrator terminal also works. BadBuilder additionally checks its administrator privileges at runtime. It excludes the Windows system disk, accepts USB/removable media only, requires every volume lock and dismount to succeed, revalidates identity immediately before formatting, and waits for drive-letter reassignment after refreshing the partition table. The Linux executable has no elevation manifest. +On Linux, download the Linux binary and `SHA256SUMS` into the same directory, then run: -Ctrl+C cancels downloads, extraction, and other preflight work. Once the exact device-path confirmation has been accepted and formatting starts, cancellation is deferred until disk cleanup finishes. +```bash +sha256sum --ignore-missing -c SHA256SUMS +chmod +x BadBuilder-linux-x64 +./BadBuilder-linux-x64 +``` -## Linux prerequisites +Linux requires `sudo` and the standard util-linux/coreutils commands: `lsblk`, `findmnt`, `wipefs`, `blockdev`, `mount`, `umount`, and `sync`. `udevadm` is optional; DiscUtils creates FAT32, so `dosfstools` is unnecessary. On CachyOS/Arch these commands normally come from `sudo`, `util-linux`, `util-linux-libs`, `coreutils`, and `systemd`. -Install `sudo` and the standard util-linux/coreutils commands: `lsblk`, `findmnt`, `wipefs`, `blockdev`, `mount`, `umount`, and `sync`. `udevadm` is optional; BadBuilder polls for the new partition when it is unavailable. DiscUtils creates FAT32 itself, so `dosfstools` is not required. +Run without sudo. BadBuilder requests sudo only for USB preparation and cleanup. On Windows, an Administrator terminal also works. -On CachyOS or Arch, these tools are normally supplied by the `sudo`, `util-linux`, `util-linux-libs`, `coreutils`, and `systemd` packages. +## Choose a workflow -Launch the Linux binary without sudo: +| Workflow | Select | Payload and homebrew | +| --- | --- | --- | +| BadUpdate | **Exploit → BadUpdate** | Rock Band Blitz demo, your chosen bootstrap, and USB homebrew | +| ABadAvatar | **Exploit → ABadAvatar** or **ABadAvatar 1.3 Beta** | Your chosen bootstrap and USB homebrew | +| Peer Pressure | **Exploit → Peer Pressure** | Official installer, Rock Band Blitz demo, bundled XeLL, and homebrew extras for the HDD | +| Official dashboard update | **Update Xbox Dashboard** | Official `2.0.17559.0` update files | -```bash -./BadBuilder -``` +1. Open **Target drive** and choose the USB. Fixed, protected, and read-only disks are excluded. +2. Choose the workflow above. For BadUpdate or ABadAvatar, select XeUnshackle, XeUnshackle Max, or FreeMyXe under **Post-exploit bootstrap**. Open **Homebrew** to add or remove apps. +3. Choose **Install**. Downloads, checksums, extraction, layout validation, capacity checks, and the complete copy plan finish first. +4. Review the device identity and type its exact path to authorize erasing it. +5. Wait for completion. Linux flushes and unmounts the USB; Windows leaves it ready for normal eject. Resolve any cleanup warning before removing the drive. -Do not run `sudo ./BadBuilder`. Interactive root launches are refused. +Expected disk, network, cache, and archive failures return to the menu with an error message. Stack traces go to the per-user diagnostic log. Ctrl+C cancels preflight work; after formatting starts, cancellation is deferred until cleanup finishes. -## Using BadBuilder +> [!WARNING] +> ABadAvatar 1.3 Beta is a prerelease. Its upstream notes advise disconnecting Ethernet and Wi-Fi before triggering it and warn that a connected Kinect can reduce success rates. -1. Open **Target drive** and choose the USB device. Fixed and protected disks are not shown. -2. Select BadUpdate, ABadAvatar Public Beta, or the pinned ABadAvatar 1.3 Beta build, then choose XeUnshackle, XeUnshackle Max, or FreeMyXe as a post-exploit bootstrap and any desired homebrew. Dashboard Update is a separate install mode for official `2.0.17559.0` update files. -3. Choose **Install**. BadBuilder resolves releases, verifies or explicitly approves hashes, extracts into a unique temporary run directory, validates layouts, and builds the complete copy plan. -4. Review the displayed path, model, byte size, and serial/WWN. Type the exact device path to authorize formatting. -5. Wait for the success message. Linux automatically flushes and unmounts the USB. Windows leaves its assigned drive letter in place for normal eject. +## Peer Pressure and Aurora -Expected disk, network, cache, and archive errors are shown as actionable messages and return to the menu. Detailed stack traces are written only to the per-user diagnostic log. +Peer Pressure mode uses the [official v1.0.477 `SoftmodInstaller.zip`](https://github.com/grimdoomer/Xbox360PeerPressure/releases/tag/v1.0.477), pinned to its exact tag and upstream-published SHA-256. It includes its own exploit payload, so the bootstrap menu is hidden. The upstream license, extras catalog, and bundled XeLL are preserved. -> [!WARNING] -> ABadAvatar 1.3 Beta is still a prerelease. Disconnect the Xbox 360 from both Ethernet and Wi-Fi before triggering it. Its release notes also warn that a connected Kinect can significantly reduce the exploit success rate. +### Prepare the USB -## XeUnshackle Max +1. Select **Exploit → Peer Pressure**. +2. Open **Homebrew** to choose the packaged apps. Aurora, XeXMenu, and Simple 360 NAND Flasher are included by default; custom archives can be added. +3. For automatic Aurora startup, choose **Set default dashboard → Aurora**. Choose a dashboard here; maintenance tools such as NAND Flasher are also selectable and should not be used as dashboards. +4. Select the target USB and choose **Install**. -**Fixed in v2.3.1:** A missing exploit-side `BadUpdatePayload/default.xex` no longer makes the XeUnshackle or XeUnshackle Max install plan fail. That file may be created or overwritten as needed; all other undeclared collisions are still rejected. +BadBuilder stages each app under `BadUpdatePayload/SoftmodExtras` and appends its installation entry to `SoftmodExtras.ini`. The selected dashboard gets a `DashXex` setting after its executable has been checked. Apps install to `Hdd1:\Apps\...`; XeXMenu retains its `Hdd1:\Content\...` layout. Peer Pressure uses its own dashboard setting. DashLaunch and its plugins are unsupported. -XeUnshackle Max is an additional post-exploit bootstrap choice alongside the original XeUnshackle and FreeMyXe. Its pinned source is [klofi/XeUnshackle-Max v1.0.0](https://github.com/klofi/XeUnshackle-Max/releases/tag/v1.0.0), an independent **beta** fork of Byrom90's XeUnshackle. +### Apply it on the Xbox -The fork adds optional automatic startup, CPU/DVD-key masking, boot-video skipping and volume control, and custom boot-video playback. On the Xbox 360, pressing Start can create a XeUnshackleConfig.txt next to BadUpdatePayload/default.xex. See the [upstream configuration documentation](https://github.com/klofi/XeUnshackle-Max#features). Both XeUnshackle variants support default homebrew launching through launch.ini. +Follow the [official installation guide](https://github.com/grimdoomer/Xbox360PeerPressure/wiki/Installation). Launch the Rock Band Blitz demo and press A at the title screen. Create and keep a system backup, then enable **Install Extras** and select the apps you want, including **Aurora** to apply its default-dashboard setting. Use the appropriate installation option for your console; **Extras Only** installs the selected extras onto an existing Peer Pressure setup. -BadBuilderLinux pins the exact v1.0.0 ZIP and its upstream-published SHA-256. It copies the BadUpdatePayload directory and launch.ini, intentionally **not** installing the bundled JRPC2/Xbdm remote-access binaries automatically. You can add those plugins manually after reviewing the security implications. The upstream launch.ini may reference plugins that are not present on the freshly formatted USB. +If Aurora is already installed and you forgot to set the default, use **Guide → Settings → Softmod Settings → Dashboard** to choose `Hdd1:\Apps\Aurora\Aurora.xex`. See the [upstream settings guide](https://github.com/grimdoomer/Xbox360PeerPressure/wiki/Softmod-Settings). A dashboard startup problem can be bypassed with [Peer Pressure safe mode](https://github.com/grimdoomer/Xbox360PeerPressure/wiki/Booting-Your-Console): with the console off, hold Sync, power on with Eject, and keep holding Sync until the MS dashboard loads. -The existing preflight and disk-identity checks remain mandatory. XeUnshackle Max is not a permanent softmod. Do not flash modified NAND images or overwrite files in the console's flash. Read the upstream warnings before use. +> [!WARNING] +> Peer Pressure supports Xenon, Zephyr, Falcon, Jasper, and Trinity; Corona and Winchester are unsupported. An HDD is required, with a mechanical SATA HDD recommended. Installation modifies NAND and HDD security sectors; failure can cause data loss or prevent booting and may require a hardware NAND flasher. Back up the NAND, CPU fuses/key, and HDD security sectors with the official installer, and keep those files somewhere safe outside the USB. + +Aurora default-dashboard startup has been confirmed on one physical setup. That report does not establish compatibility across all console and HDD combinations. + +## Other bootstraps + +XeUnshackle and XeUnshackle Max support default USB homebrew launching through `launch.ini`; FreeMyXe supplies a lightweight payload without that automatic-launch integration. -## Storage locations +XeUnshackle Max is an independent **beta** fork pinned to [klofi/XeUnshackle-Max v1.0.0](https://github.com/klofi/XeUnshackle-Max/releases/tag/v1.0.0) and its upstream SHA-256. It adds configurable auto-start, CPU/DVD-key masking, and boot-video options; see the [upstream documentation](https://github.com/klofi/XeUnshackle-Max#features). BadBuilder copies its `BadUpdatePayload` and `launch.ini`. Bundled JRPC2/Xbdm remote-access binaries are omitted; the supplied `launch.ini` may reference plugins that are absent. -Persistent downloads and their manifests live in the user cache: +Both XeUnshackle variants can create or replace `BadUpdatePayload/default.xex` during preflight; other undeclared collisions are rejected. These bootstraps are not persistent softmods. Do not flash modified NAND images or overwrite console flash files when using them. -- Linux: `$XDG_CACHE_HOME/badbuilder`, or `~/.cache/badbuilder` -- Windows: `%LOCALAPPDATA%\BadBuilder\Cache` +## Disk and download safeguards -Transient extraction uses a unique directory below the operating-system temporary directory and is removed after each run. Existing legacy `Work` directories are intentionally left untouched. +BadBuilder offers only eligible writable USB/removable/hot-plug whole disks. It validates the complete installation plan before destructive confirmation, rejects unsafe archive paths, FAT-incompatible names, and unintended file collisions, and rechecks the disk identity before formatting. -## Download integrity +On Linux, disks backing the OS, boot, home, swap, workspace, or cache are excluded. The scoped sudo helper independently checks the disk fingerprint, takes a per-device lease, unmounts child volumes, creates an MBR with one `BADUPDATE` FAT32 partition, and mounts it below `/run/badbuilder//` with `nodev,nosuid,noexec` and caller ownership. Cleanup flushes and normally unmounts it; force and lazy unmounting are not used. -GitHub release sources use an exact asset glob and an explicit release policy. Drafts are never selected; the original ABadAvatar entry may use its newest prerelease, while ABadAvatar 1.3 Beta is pinned to the exact `avatar-v1.3-beta` release and SHA-256. Other moving sources use the newest stable release. Zero or multiple matching assets are errors. GitHub's per-asset `digest` metadata and catalog-pinned SHA-256 values are treated as trusted and enforced strictly. +On Windows, system disks are excluded and USB/removable media is required. Every volume lock and dismount must succeed, disk identity is revalidated, and drive-letter reassignment is checked after formatting. The published Windows executable requests administrator privileges; the Linux executable has no elevation manifest. -When a trusted checksum is unavailable, BadBuilder displays the source, release, asset, and computed SHA-256 and asks for explicit approval. The approved bytes are recorded in the cache manifest; changed bytes trigger a new warning. Downloads stream into a partial file, verify their length and hash, and replace a cache entry only after success. A failed download cannot overwrite a valid cached archive. +GitHub sources require exactly one matching asset and an explicit release policy. Drafts are excluded. Peer Pressure, ABadAvatar 1.3 Beta, and XeUnshackle Max use pinned releases and SHA-256 values. Other sources follow their configured stable/prerelease policies. GitHub asset digests and catalog pins are enforced; when no trusted checksum exists, BadBuilder asks you to approve the displayed source and computed hash. Changed bytes require fresh approval, and failed downloads cannot replace valid cached archives. -## Building and testing +Downloads and manifests are cached at `$XDG_CACHE_HOME/badbuilder` (otherwise `~/.cache/badbuilder`) on Linux and `%LOCALAPPDATA%\BadBuilder\Cache` on Windows. Transient extraction directories are removed after each run; legacy `Work` directories are left alone. If online metadata and valid cache entries are unavailable, local archives go through the same verification, approval, extraction, and planning checks. Configured built-in apps are never silently skipped. -The project requires the .NET 10 SDK. +## Build and test + +The source requires the .NET 10 SDK. ```bash dotnet restore BadBuilder.Tests/BadBuilder.Tests.csproj -dotnet build BadBuilder/BadBuilder.csproj -c Release --no-restore -dotnet test BadBuilder.Tests/BadBuilder.Tests.csproj -c Release --no-restore +dotnet build BadBuilder.Tests/BadBuilder.Tests.csproj -c Release --no-restore +dotnet test BadBuilder.Tests/BadBuilder.Tests.csproj -c Release --no-build --no-restore dotnet publish BadBuilder/BadBuilder.csproj -c Release -r linux-x64 --self-contained true --no-restore dotnet publish BadBuilder/BadBuilder.csproj -c Release -r win-x64 --self-contained true --no-restore ``` -Nullable, platform, and analyzer warnings fail the build. The unit suite covers Linux inventory parsing and system ancestry, identity changes, shell-free command construction, release and asset policies, checksum/cache behavior, unsafe archives and extraction limits, Xbox path handling, `launch.ini` preservation, preflight copy planning, and FAT32 formatting against disposable raw images. - -Two destructive tests are opt-in and never run in normal CI: - -- Set `BADBUILDER_LOOP_TEST=1` and run the loop integration test as root. It creates its own sparse image below the test temporary directory and proves the `/dev/loop*` backing file is that exact image before formatting, mounting, copying, flushing, unmounting, and detaching it. -- A physical USB end-to-end test must be performed manually. Re-enumerate the sacrificial device and obtain a fresh confirmation of its path, model, size, and serial immediately before every run. +Nullable, platform, and analyzer warnings fail the build. The suite covers disk inventory and identity, downloads and cache integrity, archive limits and paths, install planning, FAT32 formatting against disposable images, and Peer Pressure extras, default-dashboard paths, and catalog injection checks. -Set `BADBUILDER_LIVE_SMOKE=1` to resolve all upstream catalog sources without downloading an asset or touching a disk. +Optional checks: -## Publishing a release +- `BADBUILDER_LIVE_SMOKE=1` resolves upstream sources without downloading assets or touching a disk. +- `BADBUILDER_PEER_PRESSURE_ARCHIVES=/path/to/archives` enables the real-archive integration test. Supply `SoftmodInstaller.zip`, `GameData.zip`, `Aurora.rar`, `MenuData.7z`, and `Flasher.7z`. The test verifies the installer checksum, extracts and installs into a temporary directory, compares copied-file hashes, and checks Aurora's generated dashboard setting. +- `BADBUILDER_LOOP_TEST=1` enables the root-only loop-device test. It creates and verifies its own disposable backing image before formatting, mounting, copying, and cleaning up. Normal CI never runs it. +- Physical USB tests are manual. Recheck the sacrificial device's path, model, size, and serial immediately before each destructive run. -Releases are published by GitHub Actions after the VersionPrefix in BadBuilder/BadBuilder.csproj is increased on main. Add the corresponding release notes at .github/release-notes/vX.Y.Z.md before merging. The release.yml workflow builds and tests both supported x64 platforms, verifies the version strings and native binary formats, generates SHA-256 checksums, then creates the matching version tag and GitHub release. An already-published version is skipped. To retry a failed release, rerun the workflow from GitHub Actions. +## Releases -## Offline archives +See [CHANGELOG.md](CHANGELOG.md) and the [release notes](.github/release-notes). To publish, increase `VersionPrefix` in `BadBuilder/BadBuilder.csproj`, add matching `.github/release-notes/vX.Y.Z.md`, update the changelog, and merge to `main`. GitHub Actions builds and tests Linux and Windows, validates versions and binary formats, generates checksums, and publishes the tag and release. An existing release is skipped; rerun the workflow to retry a failed publication. -If release metadata is unavailable and no valid cache exists, BadBuilder asks for a local archive for every configured artifact. No configured built-in homebrew is silently skipped. Local files go through the same checksum, approval, extraction, layout, and preflight checks as downloads. +Previous binaries remain available on the releases page. Returning to an older builder affects future USB preparation; use Peer Pressure's official recovery/uninstall procedures for an already modified console. ## Credits -- Pdawg11239 / [Pdawg-bytes](https://github.com/Pdawg-bytes/BadBuilder) — original BadBuilder project -- Grimdoomer — [BadUpdate](https://github.com/grimdoomer/Xbox360BadUpdate) +- Pdawg11239 / [Pdawg-bytes](https://github.com/Pdawg-bytes/BadBuilder) — original BadBuilder +- Grimdoomer — [BadUpdate](https://github.com/grimdoomer/Xbox360BadUpdate) and [Peer Pressure](https://github.com/grimdoomer/Xbox360PeerPressure) - Shutterbug2000 — [ABadAvatar](https://github.com/shutterbug2000/ABadAvatar) - Bibarub — [ABadAvatar 1.3 Beta](https://github.com/bibarub/Xbox360BadUpdate/releases/tag/avatar-v1.3-beta) - FreeMyXe Team / InvoxiPlayGames — [FreeMyXe](https://github.com/FreeMyXe/FreeMyXe)