Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:libnx

From ReverseEngineering.wiki
Library
On this wiki Facts · Code · Notes · Topics

The ISC-licensed standard library for Nintendo Switch homebrew (switchbrew): svc wrappers, IPC service clients, crt0 with the NRO/NSO MOD0 and homebrew ABI loader environment. Its headers document services and public structures.

Overview

libnx (nx/include/switch/): nro.h (NRO header, segments, asset header), nacp.h (NacpStruct), runtime/env.h (the homebrew loader environment passed in x0: config entries such as main thread handle, argv, heap override, applet type), services/*.h, kernel/svc.h. nx/source/runtime/switch_crt0.s shows the NRO entry (x0=env ptr, x1=0xFFFFFFFFFFFFFFFF) vs NSO entry (x0=0) and user-mode exception entry convention; dynamic.c defines the MOD0 header.

See Platform:Nintendo Switch, Format:NRO, Format:NACP.

Code & repositories

  • https://github.com/switchbrew/libnx @ 20cbcfd90567f7bf84df7725f27e345e2164fa6b · license: ISC
    libnx: nx/include/switch/nro.h (NRO), nacp.h (NACP), nx/source/runtime/dynamic.c (MOD0), switch_crt0.s (entry convention).
    Tested on: source read, not run: source read · checked 2026-10-18; last activity 2026-10-14