Gezine/CivSwitch
GamesA Switch userland exploit chain that uses a Civilization 7 cartridge chat XSS to load and persist JavaScript payloads.
What it does
CivSwitch is an exploit toolchain for the Switch 1 edition of Civilization 7. It abuses the in-game multiplayer chat to inject a JavaScript payload and reach userland code execution on the console, and can then persist that payload so it runs from savedata at every boot. It targets people who already own the physical 1.0.0 cartridge and want to run their own JS payloads on a Switch.
The chain has two parts. PicoSwitch is RP2040/RP2350 firmware that acts as a USB HID keyboard and types the chat-XSS payload into the game's chat box; its default payload is a Remote JS Loader that exposes a TCP loader on port 9026. installer-creator takes any JavaScript payload and builds a boot-persistent installer by writing an XSTRIG.Civ7Save trigger into savedata. Both components build from the shared core.js, and send_js.py ships payloads to a running loader. The JS exploit core derives from the Netflix-N-Hack inject.js and its ufm42 fork; the firmware is based on Pico-Switch-Controller.
Requirements
- A physical Civilization 7 cartridge for Switch 1, version 1.0.0 only — no other version is supported.
- The console tested on Switch 1 firmware 22.5.0 and Switch 2 firmware 20.4.0 and 23.0.1, using a Pico 2 (RP2350). Pico 1 (RP2040) is untested.
- The console system language must be set to English (US) while the exploit is typed; it can be reverted after the installer runs.
- A Linux/Ubuntu 24.04 host for building the firmware (or a prebuilt UF2), plus a PC on the same network as the console for the installer and
send_js.pysteps.
Quick start
- Build and flash the loader UF2 as described in
PicoSwitch/README.md. On Ubuntu 24.04 this means installing the ARM toolchain, CMake, Ninja and Node, cloning thepico-sdkat tag 2.3.1, exportingPICO_SDK_PATH, runningnpm installandnode compress.jsinPicoSwitch/, then building a preset:
cmake --preset pico2 && cmake --build --preset pico2 # RP2350 -> build-pico2/src/civ7-pico2.uf2
cmake --preset pico1 && cmake --build --preset pico1 # RP2040 -> build-pico1/src/civ7-pico1.uf2
- On the Switch set the language to English (US), launch the game, then go to MULTIPLAYER → WIRELESS → CREATE GAME → HOST LOBBY → CHAT. Plug the Pico in; the Pico types roughly 87 lines over about 15 minutes, after which the Remote JS Loader is up on
:9026for that session. - From the PC, install the persistent trigger:
python installer-creator/install.py <console-ip>
This uploads the save template, splices the compressed payload on-console, wipes save:/saves/Single/, and writes the trigger. After it finishes you can revert the system language.
4. On later boots, go to main menu → Load Game and the payload runs from savedata; if it is the loader, port 9026 is up at boot and survives sleep/wake.
To send a payload to a running loader:
python send_js.py <console-ip> [port] file.js
It defaults to port 9026, sends the file as-is, and prints the console's streamed log until close or timeout.
Constraints
- Only the 1.0.0 physical cartridge is supported, so later game versions or digital copies are out of scope.
- The first-stage exploit typing takes about 15 minutes and requires the chat box to have focus; in docked mode you must focus it before plugging in the Pico.
- The persistent trigger writes into savedata and wipes
save:/saves/Single/, so existing single-player saves in that path should be treated as lost. - The build assumes Ubuntu 24.04 and the Pico SDK 2.3.1; different toolchains or SDK versions are not covered by the documented steps.
- The repository is MIT-licensed, but the code's behavior on your console and account is in your hands; it is an exploit, not an officially supported game mod.
HotRepo's take
The project appeared on HotRepo's new-project board for 2026-11-01, reporting 136 stars and 30 forks within a roughly five-hour window on its first day. That is a fast opening for a niche cartridge-specific exploit, and no longer-term ranking data is available yet, so the record supports only a first-day interest statement, not a sustained trend. The narrow hardware target — one game version, a physical cart and a Pico 2 — means the audience is likely experienced console tinkerers rather than general Civilization 7 players.
Written by AI from the project's README, updated . The project's own docs are the source of truth.