Skip to content

Update nacp parsing #714

@Dimensional

Description

@Dimensional

Recently a game was updated to version 1.9.0 on the Switch, and this update added a 17th language to what it supports. This of course breaks the current structure for reading control.nacp, however what was found out is that now the supported languages are compressed into a small zlib binary blob at the start of the file, while retaining the remainder of the standard data structure, ie everything after 0x3000 is still pretty much the same.

By reading offset 0x3215, the reserved byte is now 1, which may be a compression flag. Reading 2 bytes at 0x0 gives a possible compressed size, and if you read from 0x2+size, running it through zlib decompress with a wbits of -15, you'll decompress into memory 0x6000 bytes worth of data that has the same structure as classic nacp, allowing for 32 language slots instead of the original 16.

Certain tools rely on libnx for reading the nacp file, so this is an issue/enhancement to have this patched, now that there are 2 apparent versions of title lists.

Another formerly reserved flag was at offset 0x3404, which now has 4 non-zero bytes. I thought those were language flags, but I'm unable to determine as it's not matching up with what is in the new structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions