github ouncebrew/kaihen 20261201
kaiHEN 20261201

25 minutes ago

Settings, more for mods, and RO extensions for plugins.

  • kaiHEN has a settings file, sdmc:/kaihen/config/kaihen.ini, in the INI format of Atmosphère's settings. HEN reads it when it starts. See hen/README.md.
    • [layeredfs] enabled = 0 turns mods off. It replaces the file sdmc:/kaihen/layeredfs/disabled, which kaiHEN no longer reads: if you used that file, put this setting in kaihen.ini instead.
    • [hbloader] override_key sets the button that opens hbmenu when held at a game's start: R by default, or another button by Atmosphère's names (ZR, L, PLUS, …).
  • Holding R at a Switch 1 game's start also opens hbmenu.
  • A RomFS image can be split for FAT32 cards: a folder named romfs.bin with the parts 00, 01, … (up to 64). Thanks to Hinoaaaaaf212.
  • An empty file romfs.replace makes romfs.bin replace the game's RomFS instead of adding to it, so that a mod can remove files. The image must be a complete RomFS. An image whose header does not fit its size is not used. Thanks to Hinoaaaaaf212.
  • A main.npdm in exefs/ replaces the game's when its ACID and ACI0 are the same as the game's, so that a mod can change fields such as the main thread's stack size. Thanks to Hinoaaaaaf212.
  • A mod's own code module can be named subsdk0 to subsdk9, such as subsdk9 as on Switch 1. Switch 2 loads subsdk modules only up to the first missing number, so LayeredFS gives a mod's modules the next free numbers after the game's own.
  • For plugins such as cheat engines: RO's ro:dmnt service reads and writes a running game's code and data (kaihenGetApplicationProcess and kaihenQuery/Read/WriteApplicationMemory in kaihen.h). It finds every Switch 2 game while [modules] attach = 1 is set in kaihen.ini, which is off by default. See libkaihen/PLUGINS.md and attach/README.md.
  • RO's ldr:ro has WriteCode, which patches the calling program's own code, and AttachProcess. Homebrew's JIT gets MapJitImage, for code that keeps its data at a fixed offset, and can keep up to 4096 JIT mappings.
  • hbmenu's netloader can start an NRO that is already on the SD card.

If another kaiHEN build has run since the console's last restart, restart the console before starting this release: LayeredFS installs once per boot.

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. Copy sdcard/ 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. Copy sdcard/ of this zip again, or update the program.
  • 2346-0205: a library in sdmc:/kaihen/preload could not be loaded. Remove it.

kaiHEN-20261201.zip layout:

  • sdcard/: copy its contents to the SD card's root. The acquisition tool copies this folder for you.
    • hbmenu.nro
    • kaihen/bin/ro/main (RO, which the acquisition tool also reads itself), kaihen/bin/hen/main (kaiHEN) and kaihen/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), and libvulkan.so.1, libEGL.so.1, libGLESv2.so.2 and libGL.so.1 for programs that load those names. nx-hbloader looks for a program's libraries in the program's folder and then in sdmc:/kaihen/lib.
    • kaihen/system.json: the libraries of kaihen/lib with their versions and SHA-256
    • switch/ounceshell/ounceshell.nro: OunceShell, in the folder that holds its settings. Releases up to 20261127 had it at switch/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 20261128.1-1 from the [ounce] repository.

libkaihen-20261201-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 b28851eac351bc5f41424a384de0c1daca33c3b7.
  • OunceShell (GPL-3.0-or-later): kurumuz/ounceshell at b2655caf6f8e48084bde84f18c28f834358f8286, built with its switch2/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 20261128.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: c8d6b891948c9b26c66cdefbe8d4134cce6581b6bca7fe2f770ac54951f56502

Don't miss a new kaihen release

NewReleases is sending notifications on new releases.