Game mods: LayeredFS is built into kaiHEN.
- HEN installs LayeredFS into the FS process when it starts. A game's mods go in sdmc:/kaihen/contents//, where the folder ID is the program ID the game runs with on Switch 2, with its last three digits set to 000; it starts with 04 for every game. After a game's first launch, sdmc:/kaihen/layeredfs/status.txt names its folder.
- A mod can replace and add RomFS files (romfs/, or a whole romfs.bin under them), replace code files (exefs/, with .stub to remove one, or a whole exefs.nsp). The game's own main.npdm is always kept, because the system checks its signature.
- IPS and IPS32 patches named by build ID apply to games' code files from sdmc:/kaihen/exefs_patches//, and to NROs from sdmc:/kaihen/nro_patches//.
- The layout follows Atmosphère's, but kaiHEN reads only the kaihen/ folders, never atmosphere/. A mod made for Atmosphère's 01… folder goes in the game's 04… folder.
- Mods are read at each launch, so a change applies the next time the game starts. The file sdmc:/kaihen/layeredfs/disabled turns mods off from HEN's next start.
- LayeredFS supports Switch 2's FS with and without the exFAT driver. The build without the exFAT driver has not been tested on a console yet; if status.txt does not say "LayeredFS: on" on such a console, please report what it says.
- The zip has sdcard/kaihen/system.json, which lists the libraries in sdcard/kaihen/lib with their devkit package versions and SHA-256.
- HEN's homebrew interface is protocol 13: GetLayeredFsStatus, GetApplicationLaunchStatus and GetCurrentGameProcessHandle are new in kaihen.h.
See layeredfs/README.md for the full guide.
LayeredFS installs once per boot. If a test build of kaiHEN with LayeredFS has run since the last restart, restart the console before starting this release; otherwise status.txt reports that installing LayeredFS failed.
Warning: this is still a work in progress, and might have bugs. kaiHEN allows full access to the system, including the system NAND. A malicious homebrew might write to your Switch 2 and brick it forever.
Known issue: files whose names have non-ASCII characters (accents, Japanese, emoji) do not show in folder listings, in OunceShell or over FTP. They can still be opened, downloaded and deleted by name.
If a program does not start, the menu shows a number for the reason:
2346-0200: the program needs shared libraries and this kaiHEN is older than they are. Update kaiHEN.2346-0201: a shared library that the program needs is not on the SD card. Copysdcard/of this zip to the SD card's root.2346-0202,2346-0203,2346-0204: a shared library on the SD card does not fit the program: it is older or newer than the one the program was built with. Copysdcard/of this zip again, or update the program.2346-0205: a library insdmc:/kaihen/preloadcould not be loaded. Remove it.
kaiHEN-20261128.zip layout:
sdcard/: copy its contents to the SD card's root. The acquisition tool copies this folder for you.hbmenu.nrokaihen/bin/ro/main(RO, which the acquisition tool also reads itself),kaihen/bin/hen/main(kaiHEN) andkaihen/bin/game/main(nx-hbloader)kaihen/lib/: the shared libraries of dynamically linked programs:libounce.so.1,libstdc++.so.6, Vulkan (libouncevk.so.1), OpenGL (libouncevk-gl.so.1), andlibvulkan.so.1,libEGL.so.1,libGLESv2.so.2andlibGL.so.1for programs that load those names. nx-hbloader looks for a program's libraries in the program's folder and then insdmc:/kaihen/lib.kaihen/system.json: the libraries ofkaihen/libwith their versions and SHA-256switch/ounceshell/ounceshell.nro: OunceShell, in the folder that holds its settings. Releases up to 20261127 had it atswitch/ounceshell.nro; the acquisition tool deletes that file.
bootstrap.bin: the acquisition tool reads it itself; it does not go on the SD card.licenses/: the licenses of everything above
Built with docker build --build-arg RELEASE=1 --output out . at this tag, in ounce-devkit's image with libounce 20261127-1, OunceVK 20261123.1-1 and libkaihen 20261127.1-1 from the [ounce] repository.
libkaihen-20261128-1-any.pkg.tar.zst: libkaihen (kaihen.h, -lkaihen, -lkaihen_plugin) for devkitPro's pacman, built with packaging/Dockerfile. It is also in the [ounce] repository at https://pkg.ouncebrew.org.
Source
- kaiHEN: this repository at this tag.
- nx-hbloader: ouncebrew/ounce-hbloader at
e34f4afae44fb308dd781a7bd619c3c0787a7a99. - nx-hbmenu: ouncebrew/ounce-hbmenu at
cb0696389bb10c668c37eabdfd455dde1d63ddaf. - OunceShell (GPL-3.0-or-later): kurumuz/ounceshell at
b2655caf6f8e48084bde84f18c28f834358f8286, built with itsswitch2/Makefile. Its FTP server is mtheall/ftpd v2.3.1 (public domain), modified. libstdc++.so.6(GPL-3.0-or-later with the GCC Runtime Library Exception): GCC's C++ library as devkitA64 builds it, linked as a shared library by libounce's package. Its source is devkitPro's buildscripts for the devkitA64 release of the build image.- libounce 20261127-1, OunceVK 20261123.1-1 and libkaihen 20261127.1-1: the packages of ouncebrew/libounce, ouncebrew/ouncevk and this repository's releases of those versions.
- The devkitPro portlibs linked into hbmenu and OunceShell, from devkitPro's packages: libconfig 1.7.2, freetype 2.13.3, harfbuzz 10.0.1, libjpeg-turbo 2.1.2, libpng 1.6.48, bzip2 1.0.8, zlib 1.3.1, physfs 3.2.0, SDL2 2.28.5, SDL2_ttf 2.22.0, SDL2_image 2.0.4, libwebp 1.0.2, libarchive 3.7.2, expat 2.2.5, lz4 1.9.3, zstd 1.5.7, liblzma 5.8.2, libvorbis 1.3.7, libogg 1.3.4, Oniguruma 6.9.2.
SHA-256: 1ae8d61a0b8b5f0f611ca847381af233292c787b4906dd2044113623a4649466