Network & download
How CyberFoil moves bytes from a source to the installer. NSP/XCI parsing: Install pipeline. Shop HTTP API: Shop.
Connection modes
| UI source | Transport | Reader | Source |
|---|---|---|---|
| LAN install | TCP :2000 then HTTP range | HTTPNSP / HTTPXCI | netInstall.cpp |
| URL / Google Drive | HTTP(S) range | HTTPNSP / HTTPXCI | netInstPage.cpp |
| eShop | HTTP(S) + shop auth | HTTPNSP / shop XCI stream | shopInstall.cpp |
| SD card | Local file | SDMCNSP / SDMCXCI | sdInstall.cpp |
| USB HDD | USB volume file | SDMCNSP / SDMCXCI | hddInstall.cpp |
| NS-USBloader | USB bulk TUC0/TUL0 | USBNSP / USBXCI | usbInstall.cpp |
| MTP | Push to install/ | MtpNspStream | mtp_install.cpp |
Target storage: 0 = SD (NcmStorageId_SdCard), else internal (NcmStorageId_BuiltInUser).
URL & path types
| Kind | Example | Handling |
|---|---|---|
| HTTP(S) direct | https://host/a.nsp | curl Range, expect 206 |
| Name fragment | url#Display%20Name | Fragment = label only |
| Google Drive | File ID (keyboard) | drive/v3/files/{id}?key=…&alt=media |
| Shop relative | /files/x.nsp | Joined to shop base URL |
| JBOD | jbod:{chunk}/{url}/… | Virtual multi-URL file |
| Local path | SD / USB filesystem | No HTTP |
| LAN list | URLs over TCP :2000 | Newline-separated |
network_util.cpp, util/util.cpp, shopInstall.cpp
HTTP streaming download
Remote installs stream into NCM placeholders - the full file is not saved to SD first.
Range: offset-(offset+size-1)→ HTTP 206Accept-Encoding: identity- 3 retries / segment, 2 s delay; user retry dialog after exhaustion
- NSP vs XCI: bytes 0x100-0x103 ==
HEAD→ XCI, else NSP
Install requests may add Tinfoil headers (Theme, UID, HAUTH, UAUTH, …) plus HTTP Basic when configured.
network_util.cpp, curl.cpp, netInstall.cpp
LAN protocol - port 2000
- Client →
<switch-ip>:2000 - Receive
u32size, then payload (newline-separated URLs, max ~262 KB) - Each URL installed via HTTP range
- Done: 1-byte
0x00ack + HTTP DROP to host
Y on net screen: manual URL or Google Drive ID.
netInstall.cpp - REMOTE_INSTALL_PORT = 2000
USB protocol
TUL0 - title list (magic 0x304C5554). TUC0 - file range commands, 8 MB bulk reads.
XCI if title name ends with xc.
usb_util.cpp, usbInstall.cpp
Local & MTP
Extensions .nsp .nsz .xci .xcz. SD/HDD: 4 MB sequential reads. MTP: incremental parse on upload to install/.
sdInstall.cpp, mtp_install.cpp