mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +00:00
[makerom] Relaxed RSF requirements.
This commit is contained in:
+5
-11
@@ -4,6 +4,7 @@
|
|||||||
#include "accessdesc.h"
|
#include "accessdesc.h"
|
||||||
#include "titleid.h"
|
#include "titleid.h"
|
||||||
|
|
||||||
|
const char *DEFAULT_EXHEADER_NAME = "CtrApp";
|
||||||
|
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
void free_ExHeaderSettings(exheader_settings *exhdrset);
|
void free_ExHeaderSettings(exheader_settings *exhdrset);
|
||||||
@@ -189,17 +190,10 @@ finish:
|
|||||||
int get_ExHeaderCodeSetInfo(exhdr_CodeSetInfo *CodeSetInfo, rsf_settings *rsf)
|
int get_ExHeaderCodeSetInfo(exhdr_CodeSetInfo *CodeSetInfo, rsf_settings *rsf)
|
||||||
{
|
{
|
||||||
/* Name */
|
/* Name */
|
||||||
if(rsf->BasicInfo.Title){
|
if (rsf->BasicInfo.Title)
|
||||||
//if(strlen(rsf->BasicInfo.Title) > 8){
|
strncpy((char*)CodeSetInfo->name, rsf->BasicInfo.Title, 8);
|
||||||
// fprintf(stderr,"[EXHEADER ERROR] Parameter Too Long \"BasicInfo/Title\"\n");
|
else
|
||||||
// return EXHDR_BAD_RSF_OPT;
|
strncpy((char*)CodeSetInfo->name, DEFAULT_EXHEADER_NAME, 8);
|
||||||
//}
|
|
||||||
strncpy((char*)CodeSetInfo->name,rsf->BasicInfo.Title,8);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
ErrorParamNotFound("BasicInfo/Title");
|
|
||||||
return EXHDR_BAD_RSF_OPT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Stack Size */
|
/* Stack Size */
|
||||||
if(rsf->SystemControlInfo.StackSize)
|
if(rsf->SystemControlInfo.StackSize)
|
||||||
|
|||||||
+8
-4
@@ -12,6 +12,8 @@
|
|||||||
#include "ncch_logo.h" // Contains Logos
|
#include "ncch_logo.h" // Contains Logos
|
||||||
|
|
||||||
const u32 NCCH_BLOCK_SIZE = 0x200;
|
const u32 NCCH_BLOCK_SIZE = 0x200;
|
||||||
|
const char *DEFAULT_PRODUCT_CODE = "CTR-P-CTAP";
|
||||||
|
const char *DEFAULT_MAKER_CODE = "00";
|
||||||
|
|
||||||
// Private Prototypes
|
// Private Prototypes
|
||||||
int SignCFA(ncch_hdr *hdr, keys_struct *keys);
|
int SignCFA(ncch_hdr *hdr, keys_struct *keys);
|
||||||
@@ -591,18 +593,20 @@ int SetCommonHeaderBasicData(ncch_settings *set, ncch_hdr *hdr)
|
|||||||
fprintf(stderr,"[NCCH ERROR] Invalid Product Code\n");
|
fprintf(stderr,"[NCCH ERROR] Invalid Product Code\n");
|
||||||
return NCCH_BAD_RSF_SET;
|
return NCCH_BAD_RSF_SET;
|
||||||
}
|
}
|
||||||
memcpy(hdr->productCode,set->rsfSet->BasicInfo.ProductCode,strlen((char*)set->rsfSet->BasicInfo.ProductCode));
|
strncpy((char*)hdr->productCode,set->rsfSet->BasicInfo.ProductCode, 16);
|
||||||
}
|
}
|
||||||
else memcpy(hdr->productCode,"CTR-P-CTAP",10);
|
else
|
||||||
|
strncpy((char*)hdr->productCode, DEFAULT_PRODUCT_CODE, 16);
|
||||||
|
|
||||||
if(set->rsfSet->BasicInfo.CompanyCode){
|
if(set->rsfSet->BasicInfo.CompanyCode){
|
||||||
if(strlen((char*)set->rsfSet->BasicInfo.CompanyCode) != 2){
|
if(strlen((char*)set->rsfSet->BasicInfo.CompanyCode) != 2){
|
||||||
fprintf(stderr,"[NCCH ERROR] CompanyCode length must be 2\n");
|
fprintf(stderr,"[NCCH ERROR] CompanyCode length must be 2\n");
|
||||||
return NCCH_BAD_RSF_SET;
|
return NCCH_BAD_RSF_SET;
|
||||||
}
|
}
|
||||||
memcpy(hdr->makerCode,set->rsfSet->BasicInfo.CompanyCode,2);
|
strncpy((char*)hdr->makerCode, set->rsfSet->BasicInfo.CompanyCode, 2);
|
||||||
}
|
}
|
||||||
else memcpy(hdr->makerCode,"00",2);
|
else
|
||||||
|
strncpy((char*)hdr->makerCode, DEFAULT_MAKER_CODE, 2);
|
||||||
|
|
||||||
// Setting Encryption Settings
|
// Setting Encryption Settings
|
||||||
if(!set->options.Encrypt)
|
if(!set->options.Encrypt)
|
||||||
|
|||||||
+4
-4
@@ -2,6 +2,8 @@
|
|||||||
#include "ncch_read.h"
|
#include "ncch_read.h"
|
||||||
#include "titleid.h"
|
#include "titleid.h"
|
||||||
|
|
||||||
|
const u32 DEFAULT_UNIQUE_ID = 0xff3ff;
|
||||||
|
|
||||||
void SetPIDType(u16 *type);
|
void SetPIDType(u16 *type);
|
||||||
int SetPIDCategoryFromName(u16 *cat, char *CategoryStr);
|
int SetPIDCategoryFromName(u16 *cat, char *CategoryStr);
|
||||||
int SetPIDCategoryFromFlags(u16 *cat, char **CategoryFlags, u32 FlagNum);
|
int SetPIDCategoryFromFlags(u16 *cat, char **CategoryFlags, u32 FlagNum);
|
||||||
@@ -52,10 +54,8 @@ int GetProgramID(u64 *dest, rsf_settings *rsf, bool IsForExheader)
|
|||||||
// Getting UniqueId
|
// Getting UniqueId
|
||||||
if(rsf->TitleInfo.UniqueId)
|
if(rsf->TitleInfo.UniqueId)
|
||||||
GetUniqueID(&uniqueId,rsf);
|
GetUniqueID(&uniqueId,rsf);
|
||||||
else{
|
else
|
||||||
fprintf(stderr,"[ID ERROR] ParameterNotFound: \"TitleInfo/UniqueId\"\n");
|
uniqueId = DEFAULT_UNIQUE_ID;
|
||||||
return PID_BAD_RSF_SET;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Getting Variation
|
// Getting Variation
|
||||||
if(SetTitleVariation(&variation,category,rsf) == PID_INVALID_VARIATION)
|
if(SetTitleVariation(&variation,category,rsf) == PID_INVALID_VARIATION)
|
||||||
|
|||||||
Reference in New Issue
Block a user