nca

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PFS0HeaderOffset = 0x280
	PFS0HashSize     = 0x20
	PFS0EntryOffset  = 0x240
	PFS0EntrySize    = 0x10
)
View Source
const (
	// Sections
	NCASectionCode = 0
	NCASectionData = 1
	// Content types
	NCAContentProgram    = 0
	NCAContentMeta       = 1
	NCAContentControl    = 2
	NCAContentManual     = 3
	NCAContentData       = 4
	NCAContentPublicData = 5
	// Format consts
	HeaderLength  = 0xC00
	NCASectorSize = 0x200
)

Variables

This section is empty.

Functions

func DecryptMetaNCADataSection

func DecryptMetaNCADataSection(keystore *keystore.Keystore, reader io.ReaderAt, header *Header, ncaOffset uint64) ([]byte, error)

Types

type FSEntry

type FSEntry struct {
	StartOffset uint32
	EndOffset   uint32
	Size        uint32
}

func GetFSEntry

func GetFSEntry(ncaHeader *Header, index int) FSEntry

type FSHeader

type FSHeader struct {
	EncType       byte //(0 = Auto, 1 = None, 2 = AesCtrOld, 3 = AesCtr, 4 = AesCtrEx)
	FSType        byte //(0 = RomFs, 1 = PartitionFs)
	HashType      byte // (0 = Auto, 2 = HierarchicalSha256, 3 = HierarchicalIntegrity (Ivfc))
	FSHeaderBytes []byte
	Generation    uint32
}

func GetFSHeader

func GetFSHeader(ncaHeader *Header, index int) (*FSHeader, error)

type HashInfo

type HashInfo struct {
	PFS0HeaderOffset uint64
	PFS0size         uint64
}
type Header struct {
	HeaderBytes    []byte // Raw Decrypted header
	RightsID       []byte // rights id [ 0x10]
	ProgramID      uint64 // programID of the file
	Distribution   byte
	ContentType    byte
	KeyGeneration2 byte
	KeyGeneration1 byte
	EncryptedKeys  []byte // 4 * 0x10
	CryptoType     byte
}

func ParseNCAEncryptedHeader

func ParseNCAEncryptedHeader(keystore *keystore.Keystore, reader io.ReaderAt, ncaOffset uint64) (*Header, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL