Struct layouts

The structs a handler reads in guest memory are declared beside the hooks, each version's layout apart:

struct nn::os::MutexType @version(< 9.0.0) {
    u8 state @0x0
    u32 owner @0x4
} size 0x10
struct nn::os::MutexType @version(>= 9.0.0) { u8 state @0x0; u32 owner @0x8 } size 0x20

tests/hook_versions.c checks the entries hookgen makes of tests/hook/versions.hook, the labels, the entry and layout picked for a module's version (none, below and between ranges, the bounds of each comparison), and the accessors.


Made from docs/platforms/nx/hooks.md at 69237645142c. GPL-3.0-or-later.