Files
Project_CTR/makerom/src/cia_build.h
T
Jack cc707c160f Modernize MakeROM build system + bug fixes (#120)
* Move files around to new directory structure

* Rework libyaml into a stand-alone dep for makerom.

* Rework libpolarssl to be standalone dependency for makerom.

* Update includes.

* Delete makefile

* Add new makefile for makerom.

* Update MakeROM github actions script.

* Fix again.

* Update MakeROM's makefile

* Tweak makerom build script

* Tweak MakeROM build script.

* Fix typo

* Update MakeROM makefiles.

* Tweak CTRTool build script.

* Tweak build script

* Tweak CTRTool build script.

* Tweak CTRTool build script

* Add libmbedtls to makerom deps

* Partially migrate makerom to libmbedtls

* Break out libblz as an external dependency for makerom.

* Tweak makerom build script.

* Move dependencies to the top level.

* Put everything back.

* misc

* Update makerom documentation.

* Link to ctrtool/makerom readmes from the root readme.

* Update root readme again.

* Migrate makerom to modern mbedtls

* Bump makerom version to 0.18.1

* Change signing errors to be warnings when they fail.

* Add error verbosity to errors when generating CIA files.

* Fix bug in RSA code.

* misc.

* Remove polarssl now migration to mbedtls complete.

* Surface more makerom errors.

* [makerom] Tolerate CCI signing errors as a warning.

* Add missing return.

* Import initial data key_x (prod/dev included)

* [makerom] Fix initial data generation.
2022-04-17 10:49:05 +08:00

108 lines
1.5 KiB
C

#pragma once
#include "cia.h"
// Enums
typedef enum
{
CIA_NO_NCCH0 = -1,
CIA_INVALID_NCCH0 = -2,
CIA_CONFILCTING_CONTENT_IDS = -3,
} cia_errors;
typedef struct
{
u8 *inFile;
u64 inFileSize;
FILE *out;
rsf_settings *rsf;
keys_struct *keys;
bool verbose;
struct{
bool useCxiRemasterVersion;
u64 titleId;
u16 titleVersion[3];
u8 titleKey[16];
} common;
struct{
u8 caCrlVersion;
u8 signerCrlVersion;
} cert;
struct{
u8 issuer[0x40];
u8 formatVersion;
u16 version;
u64 ticketId;
u32 deviceId;
u8 licenceType;
u8 audit;
u32 eshopAccId;
} tik;
struct{
u8 issuer[0x40];
u8 formatVersion;
u16 version;
u32 accessRights;
u32 titleType;
u32 savedataSize;
u32 privSavedataSize;
u8 twlFlag;
} tmd;
struct{
bool IsCfa;
bool IsDlc;
bool encryptCia;
bool includeUpdateNcch; // for cci -> cia conversions
bool keyFound;
FILE **filePtrs;
u64 fileSize[CIA_MAX_CONTENT];
/* Misc Records */
u16 count;
u64 offset[CIA_MAX_CONTENT];
u64 totalSize;
/* Content Chunk Records */
u64 size[CIA_MAX_CONTENT];
u16 index[CIA_MAX_CONTENT];
u16 flags[CIA_MAX_CONTENT];
u32 id[CIA_MAX_CONTENT];
u8 hash[CIA_MAX_CONTENT][0x20];
} content;
struct{
buffer_struct ciaHdr;
u32 certChainOffset;
buffer_struct certChain;
u32 tikOffset;
buffer_struct tik;
u32 tmdOffset;
buffer_struct tmd;
u32 metaOffset;
buffer_struct meta;
u64 contentOffset;
buffer_struct content;
} ciaSections;
} cia_settings;
// Public Prototypes
int build_CIA(user_settings *usrset);