mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +00:00
makerom v0.3-alternate
This commit is contained in:
+123
-108
@@ -1,51 +1,85 @@
|
|||||||
# Default value for application
|
ARM11LocalSysCapabilities:
|
||||||
BasicInfo:
|
MaxCpu: 0x0 # 0x9E
|
||||||
Title : "Pyramids"
|
|
||||||
CompanyCode : "00"
|
|
||||||
ProductCode : "CTR-T-JA9P"
|
|
||||||
ContentType : Application # Application / SystemUpdate / Manual / Child / Trial
|
|
||||||
Logo : Licensed # Nintendo / Licensed / Distributed / iQue / iQueForSystem
|
|
||||||
BackupMemoryType: None # None / 128KB / 512KB
|
|
||||||
|
|
||||||
TitleInfo:
|
|
||||||
Category: Application
|
|
||||||
UniqueId: 0x60f
|
|
||||||
|
|
||||||
Option:
|
|
||||||
UseOnSD: true # true if App is to be installed to SD
|
|
||||||
EnableCompress: true
|
|
||||||
FreeProductCode: true
|
|
||||||
EnableCrypt : true
|
|
||||||
|
|
||||||
Rom:
|
|
||||||
SaveDataSize: 128KB
|
|
||||||
|
|
||||||
ExeFs:
|
|
||||||
ReadOnly:
|
|
||||||
- .rodata
|
|
||||||
#- RO
|
|
||||||
ReadWrite:
|
|
||||||
- .data
|
|
||||||
#- RW
|
|
||||||
Text:
|
|
||||||
- .text
|
|
||||||
#- STUP_ENTRY
|
|
||||||
|
|
||||||
# Don't Modify Below here
|
|
||||||
AccessControlInfo:
|
|
||||||
MaxCpu: 0x9E
|
|
||||||
AffinityMask: 1
|
|
||||||
CoreVersion: 2
|
CoreVersion: 2
|
||||||
DescVersion: 2
|
IdealProcessor: 0
|
||||||
|
Priority: 16
|
||||||
|
AppType: Application
|
||||||
|
AffinityMask: 1
|
||||||
|
ServiceAccessControl:
|
||||||
|
- APT:U
|
||||||
|
- $hioFIO
|
||||||
|
- $hostio0
|
||||||
|
- $hostio1
|
||||||
|
- ac:u
|
||||||
|
- boss:U
|
||||||
|
- cam:u
|
||||||
|
- cecd:u
|
||||||
|
- cfg:u
|
||||||
|
- dlp:FKCL
|
||||||
|
- dlp:SRVR
|
||||||
|
- dsp::DSP
|
||||||
|
- frd:u
|
||||||
|
- fs:USER
|
||||||
|
- gsp::Gpu
|
||||||
|
- hid:USER
|
||||||
|
- http:C
|
||||||
|
- mic:u
|
||||||
|
- ndm:u
|
||||||
|
- news:u
|
||||||
|
- nwm::UDS
|
||||||
|
- ptm:u
|
||||||
|
- pxi:dev
|
||||||
|
- soc:U
|
||||||
|
- ssl:C
|
||||||
|
- y2r:u
|
||||||
|
- ldr:ro
|
||||||
|
- ir:USER
|
||||||
|
|
||||||
|
ARM11KernelCapabilities:
|
||||||
|
DisableDebug : true
|
||||||
|
EnableForceDebug : true
|
||||||
|
CanWriteSharedPage : true
|
||||||
|
CanUsePrivilegedPriority : true
|
||||||
|
CanUseNonAlphabetAndNumber : true
|
||||||
|
PermitMainFunctionArgument : true
|
||||||
|
CanShareDeviceMemory : true
|
||||||
|
RunnableOnSleep : true
|
||||||
|
SpecialMemoryArrange : true
|
||||||
|
|
||||||
HandleTableSize: 512
|
HandleTableSize: 512
|
||||||
|
|
||||||
|
MemoryType: Application
|
||||||
|
|
||||||
|
ReleaseKernelMajor: "02"
|
||||||
|
ReleaseKernelMinor: "33"
|
||||||
|
|
||||||
IORegisterMapping:
|
IORegisterMapping:
|
||||||
- 1ff50000-1ff57fff
|
- 1ff50000-1ff57fff
|
||||||
- 1ff70000-1ff77fff
|
- 1ff70000-1ff77fff
|
||||||
IdealProcessor: 0
|
|
||||||
MemoryMapping:
|
MemoryMapping:
|
||||||
- 1f000000-1f5fffff:r
|
- 1f000000-1f5fffff:r
|
||||||
Priority: 16
|
|
||||||
|
FileSystemAccess:
|
||||||
|
- CategorySystemApplication #0x1
|
||||||
|
- CategoryHardwareCheck #0x2
|
||||||
|
- CategoryFileSystemTool #0x4
|
||||||
|
- Debug #0x8
|
||||||
|
- TwlCardBackup #0x10
|
||||||
|
- TwlNandData #0x20
|
||||||
|
- Boss #0x40
|
||||||
|
- DirectSdmc #0x80
|
||||||
|
- Core #0x100
|
||||||
|
- CtrNandRo #0x200
|
||||||
|
- CtrNandRw #0x400
|
||||||
|
- CtrNandRoWrite #0x800
|
||||||
|
- CategorySystemSettings #0x1000
|
||||||
|
- CardBoard #0x2000
|
||||||
|
- ExportImportIvs #0x4000
|
||||||
|
- DirectSdmcWrite #0x8000
|
||||||
|
|
||||||
InterruptNumbers:
|
InterruptNumbers:
|
||||||
|
- 0x1
|
||||||
|
|
||||||
SystemCallAccess:
|
SystemCallAccess:
|
||||||
ArbitrateAddress: 34
|
ArbitrateAddress: 34
|
||||||
Break: 60
|
Break: 60
|
||||||
@@ -98,74 +132,52 @@ AccessControlInfo:
|
|||||||
UnmapMemoryBlock: 32
|
UnmapMemoryBlock: 32
|
||||||
WaitSynchronization1: 36
|
WaitSynchronization1: 36
|
||||||
WaitSynchronizationN: 37
|
WaitSynchronizationN: 37
|
||||||
MemoryType: Application
|
|
||||||
ReleaseKernelMajor: "02"
|
ARM9AccessControlInfo:
|
||||||
ReleaseKernelMinor: "33"
|
DescVersion: 2
|
||||||
ServiceAccessControl:
|
IoAccessControl:
|
||||||
- APT:U
|
- FsMountNand # 0x1
|
||||||
- $hioFIO
|
- FsMountNandRoWrite #0x2
|
||||||
- $hostio0
|
- FsMountTwln #0x4
|
||||||
- $hostio1
|
- FsMountWnand # 0x8
|
||||||
- ac:u
|
- FsMountCardSpi #0x10
|
||||||
- boss:U
|
- UseSdif3 # 0x20
|
||||||
- cam:u
|
- CreateSeed # 0x40
|
||||||
- cecd:u
|
- UseCardSpi # 0x80
|
||||||
- cfg:u
|
|
||||||
- dlp:FKCL
|
Dependency:
|
||||||
- dlp:SRVR
|
ac: 0x0004013000002402L
|
||||||
- dsp::DSP
|
am: 0x0004013000001502L
|
||||||
- frd:u
|
boss: 0x0004013000003402L
|
||||||
- fs:USER
|
camera: 0x0004013000001602L
|
||||||
- gsp::Gpu
|
cecd: 0x0004013000002602L
|
||||||
- hid:USER
|
cfg: 0x0004013000001702L
|
||||||
- http:C
|
codec: 0x0004013000001802L
|
||||||
- mic:u
|
csnd: 0x0004013000002702L
|
||||||
- ndm:u
|
dlp: 0x0004013000002802L
|
||||||
- news:u
|
dsp: 0x0004013000001a02L
|
||||||
- nwm::UDS
|
friends: 0x0004013000003202L
|
||||||
- ptm:u
|
gpio: 0x0004013000001b02L
|
||||||
- pxi:dev
|
gsp: 0x0004013000001c02L
|
||||||
- soc:U
|
hid: 0x0004013000001d02L
|
||||||
- ssl:C
|
http: 0x0004013000002902L
|
||||||
- y2r:u
|
i2c: 0x0004013000001e02L
|
||||||
- ldr:ro
|
ir: 0x0004013000003302L
|
||||||
- ir:USER
|
mcu: 0x0004013000001f02L
|
||||||
|
mic: 0x0004013000002002L
|
||||||
SystemControlInfo:
|
ndm: 0x0004013000002b02L
|
||||||
Dependency:
|
news: 0x0004013000003502L
|
||||||
ac: 0x0004013000002402L
|
nim: 0x0004013000002c02L
|
||||||
am: 0x0004013000001502L
|
nwm: 0x0004013000002d02L
|
||||||
boss: 0x0004013000003402L
|
pdn: 0x0004013000002102L
|
||||||
camera: 0x0004013000001602L
|
ps: 0x0004013000003102L
|
||||||
cecd: 0x0004013000002602L
|
ptm: 0x0004013000002202L
|
||||||
cfg: 0x0004013000001702L
|
ro: 0x0004013000003702L
|
||||||
codec: 0x0004013000001802L
|
socket: 0x0004013000002e02L
|
||||||
csnd: 0x0004013000002702L
|
spi: 0x0004013000002302L
|
||||||
dlp: 0x0004013000002802L
|
ssl: 0x0004013000002f02L
|
||||||
dsp: 0x0004013000001a02L
|
|
||||||
friends: 0x0004013000003202L
|
CommonHeaderKey:
|
||||||
gpio: 0x0004013000001b02L
|
|
||||||
gsp: 0x0004013000001c02L
|
|
||||||
hid: 0x0004013000001d02L
|
|
||||||
http: 0x0004013000002902L
|
|
||||||
i2c: 0x0004013000001e02L
|
|
||||||
ir: 0x0004013000003302L
|
|
||||||
mcu: 0x0004013000001f02L
|
|
||||||
mic: 0x0004013000002002L
|
|
||||||
ndm: 0x0004013000002b02L
|
|
||||||
news: 0x0004013000003502L
|
|
||||||
nim: 0x0004013000002c02L
|
|
||||||
nwm: 0x0004013000002d02L
|
|
||||||
pdn: 0x0004013000002102L
|
|
||||||
ps: 0x0004013000003102L
|
|
||||||
ptm: 0x0004013000002202L
|
|
||||||
ro: 0x0004013000003702L
|
|
||||||
socket: 0x0004013000002e02L
|
|
||||||
spi: 0x0004013000002302L
|
|
||||||
ssl: 0x0004013000002f02L
|
|
||||||
StackSize: 0x40000
|
|
||||||
|
|
||||||
CommonHeaderKey:
|
|
||||||
D: |
|
D: |
|
||||||
jL2yO86eUQnYbXIrzgFVMm7FVze0LglZ2f5g+c42hWoEdnb5BOotaMQPBfqt
|
jL2yO86eUQnYbXIrzgFVMm7FVze0LglZ2f5g+c42hWoEdnb5BOotaMQPBfqt
|
||||||
aUyAEmzQPaoi/4l4V+hTJRXQfthVRqIEx27B84l8LA6Tl5Fy9PaQaQ+4yRfP
|
aUyAEmzQPaoi/4l4V+hTJRXQfthVRqIEx27B84l8LA6Tl5Fy9PaQaQ+4yRfP
|
||||||
@@ -173,6 +185,8 @@ CommonHeaderKey:
|
|||||||
0RCb66lYcr2h/p2G7SnpKUliS9h9KnpmG+UEgVYQUK+4SCfByUa9PxYGpT0E
|
0RCb66lYcr2h/p2G7SnpKUliS9h9KnpmG+UEgVYQUK+4SCfByUa9PxYGpT0E
|
||||||
nw1UcRz0gsBmdOqcgzwnAd9vVqgb42hVn6uQZyAl+j1RKiMWywZarazIR/k5
|
nw1UcRz0gsBmdOqcgzwnAd9vVqgb42hVn6uQZyAl+j1RKiMWywZarazIR/k5
|
||||||
Lmr4+groimSEa+3ajyoIho9WaWTDmFU3mkhA2tUDIQ==
|
Lmr4+groimSEa+3ajyoIho9WaWTDmFU3mkhA2tUDIQ==
|
||||||
|
Exponent: |
|
||||||
|
AQAB
|
||||||
Modulus: |
|
Modulus: |
|
||||||
z+yySANtuAnjXGxiLKlJ4fT0DGzD5S+dUKArWgDGcgALowRdlEbnABtIhbVh
|
z+yySANtuAnjXGxiLKlJ4fT0DGzD5S+dUKArWgDGcgALowRdlEbnABtIhbVh
|
||||||
LMl0yitDE8F4l1wzLwfHhfDa22CWUA98S3rXF53k5cOrb12leDKtBN2Wbtx1
|
LMl0yitDE8F4l1wzLwfHhfDa22CWUA98S3rXF53k5cOrb12leDKtBN2Wbtx1
|
||||||
@@ -180,6 +194,7 @@ CommonHeaderKey:
|
|||||||
BEou29fQZEOc0HgRQYgz3TFikC0X8sapK5xwq9zTq13a7j1sDoH/9mdaRPms
|
BEou29fQZEOc0HgRQYgz3TFikC0X8sapK5xwq9zTq13a7j1sDoH/9mdaRPms
|
||||||
Bz0jlHVlkyAMxXYdD2UGPSGi8JaAtwpJUzijXcB0PKTZQDaFH4zRLRX57ySp
|
Bz0jlHVlkyAMxXYdD2UGPSGi8JaAtwpJUzijXcB0PKTZQDaFH4zRLRX57ySp
|
||||||
fp2yHvigcoEXd3OxVn+tBaLSMFr1068PEEpS2AlHlw==
|
fp2yHvigcoEXd3OxVn+tBaLSMFr1068PEEpS2AlHlw==
|
||||||
|
# The following are associated for signature integrity (dev units only obviously)
|
||||||
Signature: |
|
Signature: |
|
||||||
3xyLmORvojVswxgXmPPOVH4ULn8e2G3PvClO/jIuwRGtRprGcOruKFUi4TYF
|
3xyLmORvojVswxgXmPPOVH4ULn8e2G3PvClO/jIuwRGtRprGcOruKFUi4TYF
|
||||||
HASKzg8Mg4/I1t4RjurPrZvPgQ3rcROz066DAkwOEFBZPO5gBvuMf8IgJAFi
|
HASKzg8Mg4/I1t4RjurPrZvPgQ3rcROz066DAkwOEFBZPO5gBvuMf8IgJAFi
|
||||||
+76
@@ -0,0 +1,76 @@
|
|||||||
|
BasicInfo:
|
||||||
|
Title:
|
||||||
|
CompanyCode:
|
||||||
|
ProductCode:
|
||||||
|
ContentType:
|
||||||
|
Logo:
|
||||||
|
RemasterVersion:
|
||||||
|
|
||||||
|
TitleInfo:
|
||||||
|
UniqueId:
|
||||||
|
Category:
|
||||||
|
CategoryFlags:
|
||||||
|
TargetCategory:
|
||||||
|
#Variation
|
||||||
|
Version:
|
||||||
|
ContentsIndex:
|
||||||
|
DataTitleIndex:
|
||||||
|
ChildIndex:
|
||||||
|
DemoIndex:
|
||||||
|
|
||||||
|
CardInfo:
|
||||||
|
MediaSize:
|
||||||
|
MediaFootPadding:
|
||||||
|
|
||||||
|
WritableAddress:
|
||||||
|
CardType:
|
||||||
|
CryptoType:
|
||||||
|
CardDevice:
|
||||||
|
MediaType:
|
||||||
|
|
||||||
|
BackupWriteWaitTime:
|
||||||
|
|
||||||
|
SystemInfo:
|
||||||
|
SaveDataSize:
|
||||||
|
JumpID:
|
||||||
|
|
||||||
|
StorageInfo:
|
||||||
|
#Extdata Related
|
||||||
|
UseExtSaveData: #Boolean
|
||||||
|
ExtSaveDataId:
|
||||||
|
|
||||||
|
#SystemSaveIds
|
||||||
|
SystemSaveDataId1:
|
||||||
|
SystemSaveDataId2:
|
||||||
|
|
||||||
|
#Other Accessible SaveIds:
|
||||||
|
UseOtherVariationSaveData: #Boolean
|
||||||
|
OtherUserSaveDataId1:
|
||||||
|
OtherUserSaveDataId2:
|
||||||
|
OtherUserSaveDataId3:
|
||||||
|
|
||||||
|
#SDK 6+ Accessible SaveIds alternate method
|
||||||
|
# Renders Extdata/OtherUserSaveData values empty
|
||||||
|
UseExtendedSaveDataAccessControl: #Boolean
|
||||||
|
AccessibleSaveDataIds: # List of (max 6) SaveIds
|
||||||
|
|
||||||
|
Option:
|
||||||
|
PageSize:
|
||||||
|
|
||||||
|
EnableCrypt: #Boolean
|
||||||
|
EnableCompress: #Boolean
|
||||||
|
FreeProductCode: #Boolean
|
||||||
|
UseOnSD: #Boolean
|
||||||
|
|
||||||
|
ExeFs:
|
||||||
|
Text:
|
||||||
|
ReadOnly:
|
||||||
|
ReadWrite:
|
||||||
|
StackSize:
|
||||||
|
|
||||||
|
RomFs:
|
||||||
|
HostRoot:
|
||||||
|
DefaultReject:
|
||||||
|
Reject:
|
||||||
|
Include:
|
||||||
|
File:
|
||||||
@@ -19,9 +19,9 @@ CFLAGS = --std=c99 -Wall -I. -DMAKEROM_VER_MAJOR=$(VER_MAJOR) -DMAKEROM_VER_MINO
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
# MAKEROM Build Settings
|
# MAKEROM Build Settings
|
||||||
MAKEROM_BUILD_FLAGS = -DPRIVATE_BUILD #-DRETAIL_FSIGN #-DELF_DEBUG
|
MAKEROM_BUILD_FLAGS = -DPRIVATE_BUILD #-DELF_DEBUG -DRETAIL_FSIGN -DDEBUG
|
||||||
VER_MAJOR = 0
|
VER_MAJOR = 0
|
||||||
VER_MINOR = 2
|
VER_MINOR = 3
|
||||||
OUTPUT = makerom
|
OUTPUT = makerom
|
||||||
|
|
||||||
main: build
|
main: build
|
||||||
|
|||||||
@@ -70,11 +70,17 @@ int BuildExeFsCode(ncch_settings *ncchset)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Import ELF\n");
|
||||||
|
#endif
|
||||||
/* Import ELF */
|
/* Import ELF */
|
||||||
u8 *ElfFile = malloc(ncchset->ComponentFilePtrs.elf_size);
|
u8 *ElfFile = malloc(ncchset->ComponentFilePtrs.elf_size);
|
||||||
if(!ElfFile) {fprintf(stderr,"[ELF ERROR] MEM ERROR\n"); return MEM_ERROR;}
|
if(!ElfFile) {fprintf(stderr,"[ELF ERROR] MEM ERROR\n"); return MEM_ERROR;}
|
||||||
ReadFile_64(ElfFile,ncchset->ComponentFilePtrs.elf_size,0,ncchset->ComponentFilePtrs.elf);
|
ReadFile_64(ElfFile,ncchset->ComponentFilePtrs.elf_size,0,ncchset->ComponentFilePtrs.elf);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Create ELF Context\n");
|
||||||
|
#endif
|
||||||
/* Create ELF Context */
|
/* Create ELF Context */
|
||||||
ElfContext *elf = malloc(sizeof(ElfContext));
|
ElfContext *elf = malloc(sizeof(ElfContext));
|
||||||
if(!elf) {fprintf(stderr,"[ELF ERROR] MEM ERROR\n"); free(ElfFile); return MEM_ERROR;}
|
if(!elf) {fprintf(stderr,"[ELF ERROR] MEM ERROR\n"); free(ElfFile); return MEM_ERROR;}
|
||||||
@@ -95,9 +101,18 @@ int BuildExeFsCode(ncch_settings *ncchset)
|
|||||||
PrintElfContext(elf,ElfFile);
|
PrintElfContext(elf,ElfFile);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
PrintElfContext(elf,ElfFile);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Create ExeFs Code\n");
|
||||||
|
#endif
|
||||||
result = CreateExeFsCode(elf,ElfFile,ncchset);
|
result = CreateExeFsCode(elf,ElfFile,ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Get BSS Size\n");
|
||||||
|
#endif
|
||||||
result = GetBSS_SizeFromElf(elf,ElfFile,ncchset);
|
result = GetBSS_SizeFromElf(elf,ElfFile,ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
|
||||||
@@ -110,10 +125,14 @@ finish:
|
|||||||
else if(result == NOT_FIND_CODE_SECTIONS) fprintf(stderr,"[ELF ERROR] Failed to retrieve code sections from ELF\n");
|
else if(result == NOT_FIND_CODE_SECTIONS) fprintf(stderr,"[ELF ERROR] Failed to retrieve code sections from ELF\n");
|
||||||
else fprintf(stderr,"[ELF ERROR] Failed to process ELF file (%d)\n",result);
|
else fprintf(stderr,"[ELF ERROR] Failed to process ELF file (%d)\n",result);
|
||||||
}
|
}
|
||||||
for(int i = 0; i < elf->ActiveSegments; i++){
|
#ifdef DEBUG
|
||||||
free(elf->Segments[i].Header);
|
printf("[DEBUG] Free Segment Header/Sections\n");
|
||||||
|
#endif
|
||||||
|
for(int i = 0; i < elf->ActiveSegments; i++)
|
||||||
free(elf->Segments[i].Sections);
|
free(elf->Segments[i].Sections);
|
||||||
}
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Free others\n");
|
||||||
|
#endif
|
||||||
free(ElfFile);
|
free(ElfFile);
|
||||||
free(elf->Sections);
|
free(elf->Sections);
|
||||||
free(elf->ProgramHeaders);
|
free(elf->ProgramHeaders);
|
||||||
|
|||||||
+45
-42
@@ -90,6 +90,9 @@ int BuildExHeader(ncch_settings *ncchset)
|
|||||||
|
|
||||||
result = set_AccessDesc(exhdrset,ncchset);
|
result = set_AccessDesc(exhdrset,ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
|
||||||
|
exhdrset->ExHdr->AccessDescriptor.ARM11SystemLocalCapabilities.Flags[6] = 5;
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
if(result) fprintf(stderr,"[EXHEADER ERROR] Failed to create ExHeader\n");
|
if(result) fprintf(stderr,"[EXHEADER ERROR] Failed to create ExHeader\n");
|
||||||
free_ExHeaderSettings(exhdrset);
|
free_ExHeaderSettings(exhdrset);
|
||||||
@@ -152,7 +155,7 @@ int get_ExHeaderSettingsFromNcchset(exheader_settings *exhdrset, ncch_settings *
|
|||||||
if(ncchset->Options.UseOnSD)
|
if(ncchset->Options.UseOnSD)
|
||||||
exhdrset->ExHdr->CodeSetInfo.Flags.flag |= RetailSDAppFlag;
|
exhdrset->ExHdr->CodeSetInfo.Flags.flag |= RetailSDAppFlag;
|
||||||
if(!ncchset->Options.UseRomFS) // Move this later
|
if(!ncchset->Options.UseRomFS) // Move this later
|
||||||
exhdrset->ExHdr->ARM11SystemLocalCapabilities.StorageInfo.OtherAttributes |= 1 << NOT_USE_ROMFS;
|
exhdrset->ExHdr->ARM11SystemLocalCapabilities.StorageInfo.OtherAttributes |= 1 << attribute_NOT_USE_ROMFS;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -443,47 +446,47 @@ int SetARM11StorageInfo(exhdr_ARM11SystemLocalCapabilities *arm11, rsf_settings
|
|||||||
u32 AccessInfo = 0;
|
u32 AccessInfo = 0;
|
||||||
for(int i = 0; i < yaml->AccessControlInfo.FileSystemAccessNum; i++){
|
for(int i = 0; i < yaml->AccessControlInfo.FileSystemAccessNum; i++){
|
||||||
if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategorySystemApplication") == 0)
|
if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategorySystemApplication") == 0)
|
||||||
AccessInfo |= 1 << CATEGORY_SYSTEM_APPLICATION;
|
AccessInfo |= 1 << fsaccess_CATEGORY_SYSTEM_APPLICATION;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategoryHardwareCheck") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategoryHardwareCheck") == 0)
|
||||||
AccessInfo |= 1 << CATEGORY_HARDWARE_CHECK;
|
AccessInfo |= 1 << fsaccess_CATEGORY_HARDWARE_CHECK;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategoryFileSystemTool") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategoryFileSystemTool") == 0)
|
||||||
AccessInfo |= 1 << CATEGORY_FILE_SYSTEM_TOOL;
|
AccessInfo |= 1 << fsaccess_CATEGORY_FILE_SYSTEM_TOOL;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Debug") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Debug") == 0)
|
||||||
AccessInfo |= 1 << DEBUG;
|
AccessInfo |= 1 << fsaccess_DEBUG;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"TwlCardBackup") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"TwlCardBackup") == 0)
|
||||||
AccessInfo |= 1 << TWL_CARD_BACKUP;
|
AccessInfo |= 1 << fsaccess_TWL_CARD_BACKUP;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"TwlNandData") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"TwlNandData") == 0)
|
||||||
AccessInfo |= 1 << TWL_NAND_DATA;
|
AccessInfo |= 1 << fsaccess_TWL_NAND_DATA;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Boss") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Boss") == 0)
|
||||||
AccessInfo |= 1 << BOSS;
|
AccessInfo |= 1 << fsaccess_BOSS;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"DirectSdmc") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"DirectSdmc") == 0)
|
||||||
AccessInfo |= 1 << DIRECT_SDMC;
|
AccessInfo |= 1 << fsaccess_DIRECT_SDMC;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Core") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Core") == 0)
|
||||||
AccessInfo |= 1 << CORE;
|
AccessInfo |= 1 << fsaccess_CORE;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CtrNandRo") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CtrNandRo") == 0)
|
||||||
AccessInfo |= 1 << CTR_NAND_RO;
|
AccessInfo |= 1 << fsaccess_CTR_NAND_RO;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CtrNandRw") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CtrNandRw") == 0)
|
||||||
AccessInfo |= 1 << CTR_NAND_RW;
|
AccessInfo |= 1 << fsaccess_CTR_NAND_RW;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CtrNandRoWrite") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CtrNandRoWrite") == 0)
|
||||||
AccessInfo |= 1 << CTR_NAND_RO_WRITE;
|
AccessInfo |= 1 << fsaccess_CTR_NAND_RO_WRITE;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategorySystemSettings") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategorySystemSettings") == 0)
|
||||||
AccessInfo |= 1 << CATEGORY_SYSTEM_SETTINGS;
|
AccessInfo |= 1 << fsaccess_CATEGORY_SYSTEM_SETTINGS;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CardBoard") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CardBoard") == 0)
|
||||||
AccessInfo |= 1 << CARD_BOARD;
|
AccessInfo |= 1 << fsaccess_CARD_BOARD;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"ExportImportIvs") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"ExportImportIvs") == 0)
|
||||||
AccessInfo |= 1 << EXPORT_IMPORT_IVS;
|
AccessInfo |= 1 << fsaccess_EXPORT_IMPORT_IVS;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"DirectSdmcWrite") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"DirectSdmcWrite") == 0)
|
||||||
AccessInfo |= 1 << DIRECT_SDMC_WRITE;
|
AccessInfo |= 1 << fsaccess_DIRECT_SDMC_WRITE;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"SwitchCleanup") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"SwitchCleanup") == 0)
|
||||||
AccessInfo |= 1 << SWITCH_CLEANUP;
|
AccessInfo |= 1 << fsaccess_SWITCH_CLEANUP;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"SaveDataMove") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"SaveDataMove") == 0)
|
||||||
AccessInfo |= 1 << SAVE_DATA_MOVE;
|
AccessInfo |= 1 << fsaccess_SAVE_DATA_MOVE;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Shop") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Shop") == 0)
|
||||||
AccessInfo |= 1 << SHOP;
|
AccessInfo |= 1 << fsaccess_SHOP;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Shell") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"Shell") == 0)
|
||||||
AccessInfo |= 1 << SHELL;
|
AccessInfo |= 1 << fsaccess_SHELL;
|
||||||
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategoryHomeMenu") == 0)
|
else if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"CategoryHomeMenu") == 0)
|
||||||
AccessInfo |= 1 << CATEGORY_HOME_MENU;
|
AccessInfo |= 1 << fsaccess_CATEGORY_HOME_MENU;
|
||||||
else{
|
else{
|
||||||
fprintf(stderr,"[EXHEADER ERROR] Invalid FileSystemAccess Name: '%s'\n",yaml->AccessControlInfo.FileSystemAccess[i]);
|
fprintf(stderr,"[EXHEADER ERROR] Invalid FileSystemAccess Name: '%s'\n",yaml->AccessControlInfo.FileSystemAccess[i]);
|
||||||
return EXHDR_BAD_YAML_OPT;
|
return EXHDR_BAD_YAML_OPT;
|
||||||
@@ -602,7 +605,7 @@ int SetARM11StorageInfoAccessibleSaveDataIds(exhdr_ARM11SystemLocalCapabilities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
arm11->StorageInfo.OtherAttributes |= 1 << USE_EXTENDED_SAVEDATA_ACCESS_CONTROL;
|
arm11->StorageInfo.OtherAttributes |= 1 << attribute_USE_EXTENDED_SAVEDATA_ACCESS_CONTROL;
|
||||||
|
|
||||||
/* UseOtherVariationSaveData Flag */
|
/* UseOtherVariationSaveData Flag */
|
||||||
if(yaml->AccessControlInfo.UseOtherVariationSaveData){
|
if(yaml->AccessControlInfo.UseOtherVariationSaveData){
|
||||||
@@ -1012,23 +1015,23 @@ int SetARM11KernelDescOtherCapabilities(ARM11KernelCapabilityDescriptor *desc, r
|
|||||||
u32 OtherCapabilities = 0;
|
u32 OtherCapabilities = 0;
|
||||||
|
|
||||||
if(!yaml->AccessControlInfo.DisableDebug)
|
if(!yaml->AccessControlInfo.DisableDebug)
|
||||||
OtherCapabilities |= 1 << PERMIT_DEBUG;
|
OtherCapabilities |= 1 << othcap_PERMIT_DEBUG;
|
||||||
if(yaml->AccessControlInfo.EnableForceDebug)
|
if(yaml->AccessControlInfo.EnableForceDebug)
|
||||||
OtherCapabilities |= 1 << FORCE_DEBUG;
|
OtherCapabilities |= 1 << othcap_FORCE_DEBUG;
|
||||||
if(yaml->AccessControlInfo.CanUseNonAlphabetAndNumber)
|
if(yaml->AccessControlInfo.CanUseNonAlphabetAndNumber)
|
||||||
OtherCapabilities |= 1 << CAN_USE_NON_ALPHABET_AND_NUMBER;
|
OtherCapabilities |= 1 << othcap_CAN_USE_NON_ALPHABET_AND_NUMBER;
|
||||||
if(yaml->AccessControlInfo.CanWriteSharedPage)
|
if(yaml->AccessControlInfo.CanWriteSharedPage)
|
||||||
OtherCapabilities |= 1 << CAN_WRITE_SHARED_PAGE;
|
OtherCapabilities |= 1 << othcap_CAN_WRITE_SHARED_PAGE;
|
||||||
if(yaml->AccessControlInfo.CanUsePrivilegedPriority)
|
if(yaml->AccessControlInfo.CanUsePrivilegedPriority)
|
||||||
OtherCapabilities |= 1 << CAN_USE_PRIVILEGE_PRIORITY;
|
OtherCapabilities |= 1 << othcap_CAN_USE_PRIVILEGE_PRIORITY;
|
||||||
if(yaml->AccessControlInfo.PermitMainFunctionArgument)
|
if(yaml->AccessControlInfo.PermitMainFunctionArgument)
|
||||||
OtherCapabilities |= 1 << PERMIT_MAIN_FUNCTION_ARGUMENT;
|
OtherCapabilities |= 1 << othcap_PERMIT_MAIN_FUNCTION_ARGUMENT;
|
||||||
if(yaml->AccessControlInfo.CanShareDeviceMemory)
|
if(yaml->AccessControlInfo.CanShareDeviceMemory)
|
||||||
OtherCapabilities |= 1 << CAN_SHARE_DEVICE_MEMORY;
|
OtherCapabilities |= 1 << othcap_CAN_SHARE_DEVICE_MEMORY;
|
||||||
if(yaml->AccessControlInfo.RunnableOnSleep)
|
if(yaml->AccessControlInfo.RunnableOnSleep)
|
||||||
OtherCapabilities |= 1 << RUNNABLE_ON_SLEEP;
|
OtherCapabilities |= 1 << othcap_RUNNABLE_ON_SLEEP;
|
||||||
if(yaml->AccessControlInfo.SpecialMemoryArrange)
|
if(yaml->AccessControlInfo.SpecialMemoryArrange)
|
||||||
OtherCapabilities |= 1 << SPECIAL_MEMORY_ARRANGE;
|
OtherCapabilities |= 1 << othcap_SPECIAL_MEMORY_ARRANGE;
|
||||||
|
|
||||||
if(yaml->AccessControlInfo.MemoryType){
|
if(yaml->AccessControlInfo.MemoryType){
|
||||||
u32 MemType = 0;
|
u32 MemType = 0;
|
||||||
@@ -1123,21 +1126,21 @@ int get_ExHeaderARM9AccessControlInfo(exhdr_ARM9AccessControlInfo *arm9, rsf_set
|
|||||||
u32 Arm9AccessControl = 0;
|
u32 Arm9AccessControl = 0;
|
||||||
for(int i = 0; i < yaml->AccessControlInfo.IoAccessControlNum; i++){
|
for(int i = 0; i < yaml->AccessControlInfo.IoAccessControlNum; i++){
|
||||||
if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountNand") == 0)
|
if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountNand") == 0)
|
||||||
Arm9AccessControl |= 1 << FS_MOUNT_NAND;
|
Arm9AccessControl |= 1 << arm9cap_FS_MOUNT_NAND;
|
||||||
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountNandRoWrite") == 0)
|
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountNandRoWrite") == 0)
|
||||||
Arm9AccessControl |= 1 << FS_MOUNT_NAND_RO_WRITE;
|
Arm9AccessControl |= 1 << arm9cap_FS_MOUNT_NAND_RO_WRITE;
|
||||||
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountTwln") == 0)
|
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountTwln") == 0)
|
||||||
Arm9AccessControl |= 1 << FS_MOUNT_TWLN;
|
Arm9AccessControl |= 1 << arm9cap_FS_MOUNT_TWLN;
|
||||||
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountWnand") == 0)
|
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountWnand") == 0)
|
||||||
Arm9AccessControl |= 1 << FS_MOUNT_WNAND;
|
Arm9AccessControl |= 1 << arm9cap_FS_MOUNT_WNAND;
|
||||||
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountCardSpi") == 0)
|
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"FsMountCardSpi") == 0)
|
||||||
Arm9AccessControl |= 1 << FS_MOUNT_CARD_SPI;
|
Arm9AccessControl |= 1 << arm9cap_FS_MOUNT_CARD_SPI;
|
||||||
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"UseSdif3") == 0)
|
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"UseSdif3") == 0)
|
||||||
Arm9AccessControl |= 1 << USE_SDIF3;
|
Arm9AccessControl |= 1 << arm9cap_USE_SDIF3;
|
||||||
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"CreateSeed") == 0)
|
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"CreateSeed") == 0)
|
||||||
Arm9AccessControl |= 1 << CREATE_SEED;
|
Arm9AccessControl |= 1 << arm9cap_CREATE_SEED;
|
||||||
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"UseCardSpi") == 0)
|
else if(strcmp(yaml->AccessControlInfo.IoAccessControl[i],"UseCardSpi") == 0)
|
||||||
Arm9AccessControl |= 1 << USE_CARD_SPI;
|
Arm9AccessControl |= 1 << arm9cap_USE_CARD_SPI;
|
||||||
else{
|
else{
|
||||||
fprintf(stderr,"[EXHEADER ERROR] Invalid IoAccessControl Name: '%s'\n",yaml->AccessControlInfo.IoAccessControl[i]);
|
fprintf(stderr,"[EXHEADER ERROR] Invalid IoAccessControl Name: '%s'\n",yaml->AccessControlInfo.IoAccessControl[i]);
|
||||||
return EXHDR_BAD_YAML_OPT;
|
return EXHDR_BAD_YAML_OPT;
|
||||||
@@ -1146,11 +1149,11 @@ int get_ExHeaderARM9AccessControlInfo(exhdr_ARM9AccessControlInfo *arm9, rsf_set
|
|||||||
|
|
||||||
for(int i = 0; i < yaml->AccessControlInfo.FileSystemAccessNum; i++){
|
for(int i = 0; i < yaml->AccessControlInfo.FileSystemAccessNum; i++){
|
||||||
if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"DirectSdmc") == 0)
|
if(strcmp(yaml->AccessControlInfo.FileSystemAccess[i],"DirectSdmc") == 0)
|
||||||
Arm9AccessControl |= 1 << USE_DIRECT_SDMC;
|
Arm9AccessControl |= 1 << arm9cap_USE_DIRECT_SDMC;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(yaml->Option.UseOnSD)
|
if(yaml->Option.UseOnSD)
|
||||||
Arm9AccessControl |= 1 << SD_APPLICATION;
|
Arm9AccessControl |= 1 << arm9cap_SD_APPLICATION;
|
||||||
|
|
||||||
u32_to_u8(arm9->descriptors,Arm9AccessControl,LE);
|
u32_to_u8(arm9->descriptors,Arm9AccessControl,LE);
|
||||||
|
|
||||||
|
|||||||
+42
-44
@@ -37,60 +37,60 @@ typedef enum
|
|||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
PERMIT_DEBUG,
|
othcap_PERMIT_DEBUG,
|
||||||
FORCE_DEBUG,
|
othcap_FORCE_DEBUG,
|
||||||
CAN_USE_NON_ALPHABET_AND_NUMBER,
|
othcap_CAN_USE_NON_ALPHABET_AND_NUMBER,
|
||||||
CAN_WRITE_SHARED_PAGE,
|
othcap_CAN_WRITE_SHARED_PAGE,
|
||||||
CAN_USE_PRIVILEGE_PRIORITY,
|
othcap_CAN_USE_PRIVILEGE_PRIORITY,
|
||||||
PERMIT_MAIN_FUNCTION_ARGUMENT,
|
othcap_PERMIT_MAIN_FUNCTION_ARGUMENT,
|
||||||
CAN_SHARE_DEVICE_MEMORY,
|
othcap_CAN_SHARE_DEVICE_MEMORY,
|
||||||
RUNNABLE_ON_SLEEP,
|
othcap_RUNNABLE_ON_SLEEP,
|
||||||
SPECIAL_MEMORY_ARRANGE = 12,
|
othcap_SPECIAL_MEMORY_ARRANGE = 12,
|
||||||
} OtherCapabilities_Flagbitmask;
|
} OtherCapabilities_Flagbitmask;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CATEGORY_SYSTEM_APPLICATION,
|
fsaccess_CATEGORY_SYSTEM_APPLICATION,
|
||||||
CATEGORY_HARDWARE_CHECK,
|
fsaccess_CATEGORY_HARDWARE_CHECK,
|
||||||
CATEGORY_FILE_SYSTEM_TOOL,
|
fsaccess_CATEGORY_FILE_SYSTEM_TOOL,
|
||||||
DEBUG,
|
fsaccess_DEBUG,
|
||||||
TWL_CARD_BACKUP,
|
fsaccess_TWL_CARD_BACKUP,
|
||||||
TWL_NAND_DATA,
|
fsaccess_TWL_NAND_DATA,
|
||||||
BOSS,
|
fsaccess_BOSS,
|
||||||
DIRECT_SDMC,
|
fsaccess_DIRECT_SDMC,
|
||||||
CORE,
|
fsaccess_CORE,
|
||||||
CTR_NAND_RO,
|
fsaccess_CTR_NAND_RO,
|
||||||
CTR_NAND_RW,
|
fsaccess_CTR_NAND_RW,
|
||||||
CTR_NAND_RO_WRITE,
|
fsaccess_CTR_NAND_RO_WRITE,
|
||||||
CATEGORY_SYSTEM_SETTINGS,
|
fsaccess_CATEGORY_SYSTEM_SETTINGS,
|
||||||
CARD_BOARD,
|
fsaccess_CARD_BOARD,
|
||||||
EXPORT_IMPORT_IVS,
|
fsaccess_EXPORT_IMPORT_IVS,
|
||||||
DIRECT_SDMC_WRITE,
|
fsaccess_DIRECT_SDMC_WRITE,
|
||||||
SWITCH_CLEANUP,
|
fsaccess_SWITCH_CLEANUP,
|
||||||
SAVE_DATA_MOVE,
|
fsaccess_SAVE_DATA_MOVE,
|
||||||
SHOP,
|
fsaccess_SHOP,
|
||||||
SHELL,
|
fsaccess_SHELL,
|
||||||
CATEGORY_HOME_MENU
|
fsaccess_CATEGORY_HOME_MENU
|
||||||
} FileSystemAccess;
|
} FileSystemAccess;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
NOT_USE_ROMFS,
|
attribute_NOT_USE_ROMFS,
|
||||||
USE_EXTENDED_SAVEDATA_ACCESS_CONTROL
|
attribute_USE_EXTENDED_SAVEDATA_ACCESS_CONTROL
|
||||||
} AttributeName;
|
} AttributeName;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
FS_MOUNT_NAND,
|
arm9cap_FS_MOUNT_NAND,
|
||||||
FS_MOUNT_NAND_RO_WRITE,
|
arm9cap_FS_MOUNT_NAND_RO_WRITE,
|
||||||
FS_MOUNT_TWLN,
|
arm9cap_FS_MOUNT_TWLN,
|
||||||
FS_MOUNT_WNAND,
|
arm9cap_FS_MOUNT_WNAND,
|
||||||
FS_MOUNT_CARD_SPI,
|
arm9cap_FS_MOUNT_CARD_SPI,
|
||||||
USE_SDIF3,
|
arm9cap_USE_SDIF3,
|
||||||
CREATE_SEED,
|
arm9cap_CREATE_SEED,
|
||||||
USE_CARD_SPI,
|
arm9cap_USE_CARD_SPI,
|
||||||
SD_APPLICATION,
|
arm9cap_SD_APPLICATION,
|
||||||
USE_DIRECT_SDMC
|
arm9cap_USE_DIRECT_SDMC
|
||||||
} Arm9Capability;
|
} Arm9Capability;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -131,8 +131,6 @@ typedef struct
|
|||||||
u8 ExtSaveDataId[8];
|
u8 ExtSaveDataId[8];
|
||||||
u8 SystemSaveDataId[8];
|
u8 SystemSaveDataId[8];
|
||||||
u8 StorageAccessableUniqueIds[8];
|
u8 StorageAccessableUniqueIds[8];
|
||||||
//u8 reserved[7];
|
|
||||||
//u8 flag;
|
|
||||||
u8 AccessInfo[7];
|
u8 AccessInfo[7];
|
||||||
u8 OtherAttributes;
|
u8 OtherAttributes;
|
||||||
} exhdr_StorageInfo;
|
} exhdr_StorageInfo;
|
||||||
|
|||||||
@@ -30,8 +30,9 @@
|
|||||||
#include "keys_retail.h"
|
#include "keys_retail.h"
|
||||||
#else
|
#else
|
||||||
#include "keys_debug.h"
|
#include "keys_debug.h"
|
||||||
#include "accessdesc_sig.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
#include "accessdesc_sig.h"
|
||||||
|
|
||||||
#include "keyset.h"
|
#include "keyset.h"
|
||||||
#include "usersettings.h"
|
#include "usersettings.h"
|
||||||
#include "libyaml/yaml.h"
|
#include "libyaml/yaml.h"
|
||||||
|
|||||||
@@ -12,19 +12,30 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Parseing Args\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
// Parsing command args
|
// Parsing command args
|
||||||
result = ParseArgs(argc,argv,usrset);
|
result = ParseArgs(argc,argv,usrset);
|
||||||
if(result < 0) goto fail_finalise;
|
if(result < 0) goto finish;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Importing Yaml Settings\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
// Import RSF Settings if present
|
// Import RSF Settings if present
|
||||||
result = GetYamlSettings(usrset);
|
result = GetYamlSettings(usrset);
|
||||||
if(result < 0) goto fail_finalise;
|
if(result < 0) goto finish;
|
||||||
|
|
||||||
// Setup Content 0
|
// Setup Content 0
|
||||||
if(!usrset->IsBuildingNCCH0){ // Import Content 0
|
if(!usrset->IsBuildingNCCH0){ // Import Content 0
|
||||||
if(usrset->Content0IsNcch){
|
if(usrset->Content0IsNcch){
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Import NCCH0\n");
|
||||||
|
#endif
|
||||||
FILE *ncch0 = fopen(usrset->ContentPath[0],"rb");
|
FILE *ncch0 = fopen(usrset->ContentPath[0],"rb");
|
||||||
if(!ncch0) {fprintf(stderr,"[MAKEROM ERROR] Failed to open Content 0: %s\n",usrset->ContentPath[0]); goto fail_finalise;}
|
if(!ncch0) {fprintf(stderr,"[MAKEROM ERROR] Failed to open Content 0: %s\n",usrset->ContentPath[0]); goto finish;}
|
||||||
fclose(ncch0);
|
fclose(ncch0);
|
||||||
usrset->Content0.size = GetFileSize_u64(usrset->ContentPath[0]);
|
usrset->Content0.size = GetFileSize_u64(usrset->ContentPath[0]);
|
||||||
usrset->Content0.buffer = malloc(usrset->Content0.size);
|
usrset->Content0.buffer = malloc(usrset->Content0.size);
|
||||||
@@ -33,8 +44,11 @@ int main(int argc, char *argv[])
|
|||||||
fclose(ncch0);
|
fclose(ncch0);
|
||||||
}
|
}
|
||||||
else if(usrset->Content0IsSrl){
|
else if(usrset->Content0IsSrl){
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Import SRL\n");
|
||||||
|
#endif
|
||||||
FILE *srl = fopen(usrset->SrlPath,"rb");
|
FILE *srl = fopen(usrset->SrlPath,"rb");
|
||||||
if(!srl) {fprintf(stderr,"[MAKEROM ERROR] Failed to open SRL: %s\n",usrset->SrlPath); goto fail_finalise;}
|
if(!srl) {fprintf(stderr,"[MAKEROM ERROR] Failed to open SRL: %s\n",usrset->SrlPath); goto finish;}
|
||||||
fclose(srl);
|
fclose(srl);
|
||||||
u64 size = GetFileSize_u64(usrset->SrlPath);
|
u64 size = GetFileSize_u64(usrset->SrlPath);
|
||||||
usrset->Content0.size = align_value(size,0x10);
|
usrset->Content0.size = align_value(size,0x10);
|
||||||
@@ -44,8 +58,11 @@ int main(int argc, char *argv[])
|
|||||||
fclose(srl);
|
fclose(srl);
|
||||||
}
|
}
|
||||||
else if(usrset->ConvertCci){
|
else if(usrset->ConvertCci){
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Import CCI\n");
|
||||||
|
#endif
|
||||||
FILE *cci = fopen(usrset->CciPath,"rb");
|
FILE *cci = fopen(usrset->CciPath,"rb");
|
||||||
if(!cci) {fprintf(stderr,"[MAKEROM ERROR] Failed to open CCI: %s\n",usrset->CciPath); goto fail_finalise;}
|
if(!cci) {fprintf(stderr,"[MAKEROM ERROR] Failed to open CCI: %s\n",usrset->CciPath); goto finish;}
|
||||||
fclose(cci);
|
fclose(cci);
|
||||||
usrset->Content0.size = GetFileSize_u64(usrset->CciPath);
|
usrset->Content0.size = GetFileSize_u64(usrset->CciPath);
|
||||||
usrset->Content0.buffer = malloc(usrset->Content0.size);
|
usrset->Content0.buffer = malloc(usrset->Content0.size);
|
||||||
@@ -55,39 +72,55 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{// Build Content 0
|
else{// Build Content 0
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Build NCCH0\n");
|
||||||
|
#endif
|
||||||
result = build_NCCH(usrset);
|
result = build_NCCH(usrset);
|
||||||
if(result < 0) {
|
if(result < 0) {
|
||||||
//fprintf(stderr,"[ERROR] %s generation failed\n",usrset->build_ncch_type == CXI? "CXI" : "CFA");
|
//fprintf(stderr,"[ERROR] %s generation failed\n",usrset->build_ncch_type == CXI? "CXI" : "CFA");
|
||||||
fprintf(stderr,"[RESULT] Failed to build outfile\n");
|
fprintf(stderr,"[RESULT] Failed to build outfile\n");
|
||||||
goto fail_finalise;
|
goto finish;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Make CCI
|
// Make CCI
|
||||||
if(usrset->out_format == CCI){
|
if(usrset->out_format == CCI){
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Building CCI\n");
|
||||||
|
#endif
|
||||||
result = build_CCI(usrset);
|
result = build_CCI(usrset);
|
||||||
if(result < 0) { fprintf(stderr,"[RESULT] Failed to build CCI\n"); goto fail_finalise; }
|
if(result < 0) { fprintf(stderr,"[RESULT] Failed to build CCI\n"); goto finish; }
|
||||||
}
|
}
|
||||||
// Make CIA
|
// Make CIA
|
||||||
else if(usrset->out_format == CIA){
|
else if(usrset->out_format == CIA){
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Building CIA\n");
|
||||||
|
#endif
|
||||||
result = build_CIA(usrset);
|
result = build_CIA(usrset);
|
||||||
if(result < 0) { fprintf(stderr,"[RESULT] Failed to build CIA\n"); goto fail_finalise; }
|
if(result < 0) { fprintf(stderr,"[RESULT] Failed to build CIA\n"); goto finish; }
|
||||||
}
|
}
|
||||||
// No Container Raw CXI/CFA
|
// No Container Raw CXI/CFA
|
||||||
else if(usrset->out_format == CXI || usrset->out_format == CFA){
|
else if(usrset->out_format == CXI || usrset->out_format == CFA){
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Outputting NCCH, because No Container\n");
|
||||||
|
#endif
|
||||||
FILE *ncch_out = fopen(usrset->outfile,"wb");
|
FILE *ncch_out = fopen(usrset->outfile,"wb");
|
||||||
if(!ncch_out) {
|
if(!ncch_out) {
|
||||||
fprintf(stderr,"[ERROR] Failed to create '%s'\n",usrset->outfile);
|
fprintf(stderr,"[ERROR] Failed to create '%s'\n",usrset->outfile);
|
||||||
fprintf(stderr,"[RESULT] Failed to build '%s'\n",usrset->out_format == CXI? "CXI" : "CFA");
|
fprintf(stderr,"[RESULT] Failed to build '%s'\n",usrset->out_format == CXI? "CXI" : "CFA");
|
||||||
result = FAILED_TO_CREATE_OUTFILE;
|
result = FAILED_TO_CREATE_OUTFILE;
|
||||||
goto fail_finalise;
|
goto finish;
|
||||||
}
|
}
|
||||||
WriteBuffer(usrset->Content0.buffer,usrset->Content0.size,0,ncch_out);
|
WriteBuffer(usrset->Content0.buffer,usrset->Content0.size,0,ncch_out);
|
||||||
fclose(ncch_out);
|
fclose(ncch_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish:
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Free Context\n");
|
||||||
|
#endif
|
||||||
free_UserSettings(usrset);
|
free_UserSettings(usrset);
|
||||||
return 0;
|
#ifdef DEBUG
|
||||||
fail_finalise:
|
printf("[DEBUG] Finished returning (result=%d)\n",result);
|
||||||
free_UserSettings(usrset);
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -57,16 +57,24 @@ int CheckCXISignature(u8 *Signature, u8 *CXI_HDR, u8 *PubK)
|
|||||||
int build_NCCH(user_settings *usrset)
|
int build_NCCH(user_settings *usrset)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Init Settings\n");
|
||||||
|
#endif
|
||||||
// Init Settings
|
// Init Settings
|
||||||
ncch_settings *ncchset = malloc(sizeof(ncch_settings));
|
ncch_settings *ncchset = malloc(sizeof(ncch_settings));
|
||||||
if(!ncchset) {fprintf(stderr,"[NCCH ERROR] MEM ERROR\n"); return MEM_ERROR;}
|
if(!ncchset) {fprintf(stderr,"[NCCH ERROR] MEM ERROR\n"); return MEM_ERROR;}
|
||||||
init_NCCHSettings(ncchset);
|
init_NCCHSettings(ncchset);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Get Settings\n");
|
||||||
|
#endif
|
||||||
// Get Settings
|
// Get Settings
|
||||||
result = get_NCCHSettings(ncchset,usrset);
|
result = get_NCCHSettings(ncchset,usrset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Build ExeFS Code/PlainRegion\n");
|
||||||
|
#endif
|
||||||
// Build ExeFs Code Section
|
// Build ExeFs Code Section
|
||||||
result = BuildExeFsCode(ncchset);
|
result = BuildExeFsCode(ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
@@ -82,25 +90,46 @@ int build_NCCH(user_settings *usrset)
|
|||||||
memdump(stdout,"Code Hash: ",hash,0x20);
|
memdump(stdout,"Code Hash: ",hash,0x20);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Build Exheader\n");
|
||||||
|
#endif
|
||||||
// Build ExHeader
|
// Build ExHeader
|
||||||
result = BuildExHeader(ncchset);
|
result = BuildExHeader(ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Exefs\n");
|
||||||
|
#endif
|
||||||
// Build ExeFs/RomFs
|
// Build ExeFs/RomFs
|
||||||
result = BuildExeFs(ncchset);
|
result = BuildExeFs(ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Build Romfs\n");
|
||||||
|
#endif
|
||||||
result = BuildRomFs(ncchset);
|
result = BuildRomFs(ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
|
||||||
// Final Steps
|
// Final Steps
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Build common header\n");
|
||||||
|
#endif
|
||||||
result = BuildCommonHeader(ncchset);
|
result = BuildCommonHeader(ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Encrypt Sections\n");
|
||||||
|
#endif
|
||||||
result = EncryptNCCHSections(ncchset);
|
result = EncryptNCCHSections(ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Write Sections\n");
|
||||||
|
#endif
|
||||||
result = WriteNCCHSectionsToBuffer(ncchset);
|
result = WriteNCCHSectionsToBuffer(ncchset);
|
||||||
if(result) goto finish;
|
if(result) goto finish;
|
||||||
finish:
|
finish:
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[DEBUG] Finish Building\n");
|
||||||
|
#endif
|
||||||
if(result) fprintf(stderr,"[NCCH ERROR] NCCH Build Process Failed\n");
|
if(result) fprintf(stderr,"[NCCH ERROR] NCCH Build Process Failed\n");
|
||||||
free_NCCHSettings(ncchset);
|
free_NCCHSettings(ncchset);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
+106
@@ -555,6 +555,111 @@ void init_UserSettings(user_settings *usr_settings)
|
|||||||
memset(usr_settings,0,sizeof(user_settings));
|
memset(usr_settings,0,sizeof(user_settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void free_YamlSettings(yaml_settings *set)
|
||||||
|
{
|
||||||
|
// Option
|
||||||
|
free(set->Option.PageSize);
|
||||||
|
|
||||||
|
// RomFs
|
||||||
|
free(set->RomFs.HostRoot);
|
||||||
|
free_StringCollection(set->RomFs.DefaultReject,set->RomFs.DefaultRejectNum);
|
||||||
|
free_StringCollection(set->RomFs.Reject,set->RomFs.RejectNum);
|
||||||
|
free_StringCollection(set->RomFs.Include,set->RomFs.IncludeNum);
|
||||||
|
free_StringCollection(set->RomFs.File,set->RomFs.FileNum);
|
||||||
|
|
||||||
|
// ExeFs
|
||||||
|
free(set->ExeFs.StackSize);
|
||||||
|
free_StringCollection(set->ExeFs.Text,set->ExeFs.TextNum);
|
||||||
|
free_StringCollection(set->ExeFs.ReadOnly,set->ExeFs.ReadOnlyNum);
|
||||||
|
free_StringCollection(set->ExeFs.ReadWrite,set->ExeFs.ReadWriteNum);
|
||||||
|
|
||||||
|
// Plain Region
|
||||||
|
free_StringCollection(set->PlainRegion,set->PlainRegionNum);
|
||||||
|
|
||||||
|
// BasicInfo
|
||||||
|
free(set->BasicInfo.Title);
|
||||||
|
free(set->BasicInfo.CompanyCode);
|
||||||
|
free(set->BasicInfo.ProductCode);
|
||||||
|
free(set->BasicInfo.ContentType);
|
||||||
|
free(set->BasicInfo.Logo);
|
||||||
|
free(set->BasicInfo.RemasterVersion);
|
||||||
|
|
||||||
|
// TitleInfo
|
||||||
|
free(set->TitleInfo.Category);
|
||||||
|
free(set->TitleInfo.ChildIndex);
|
||||||
|
free(set->TitleInfo.ContentsIndex);
|
||||||
|
free(set->TitleInfo.DataTitleIndex);
|
||||||
|
free(set->TitleInfo.DemoIndex);
|
||||||
|
free(set->TitleInfo.Version);
|
||||||
|
free(set->TitleInfo.TargetCategory);
|
||||||
|
free(set->TitleInfo.UniqueId);
|
||||||
|
free_StringCollection(set->TitleInfo.CategoryFlags,set->TitleInfo.CategoryFlagsNum);
|
||||||
|
|
||||||
|
// CardInfo
|
||||||
|
free(set->CardInfo.BackupWriteWaitTime);
|
||||||
|
free(set->CardInfo.CardDevice);
|
||||||
|
free(set->CardInfo.CardType);
|
||||||
|
free(set->CardInfo.CryptoType);
|
||||||
|
free(set->CardInfo.MediaSize);
|
||||||
|
free(set->CardInfo.MediaType);
|
||||||
|
free(set->CardInfo.WritableAddress);
|
||||||
|
|
||||||
|
// SystemInfo
|
||||||
|
free(set->SystemInfo.JumpId);
|
||||||
|
free(set->SystemInfo.SaveDataSize);
|
||||||
|
|
||||||
|
// Dependency
|
||||||
|
free_StringCollection(set->Dependency,set->DependencyNum);
|
||||||
|
|
||||||
|
// ARM11SystemLocalCapabilities
|
||||||
|
free(set->ARM11SystemLocalCapabilities.AppType);
|
||||||
|
free(set->ARM11SystemLocalCapabilities.MaxCpu);
|
||||||
|
free(set->ARM11SystemLocalCapabilities.CoreVersion);
|
||||||
|
free(set->ARM11SystemLocalCapabilities.IdealProcessor);
|
||||||
|
free(set->ARM11SystemLocalCapabilities.Priority);
|
||||||
|
free(set->ARM11SystemLocalCapabilities.AffinityMask);
|
||||||
|
free(set->ARM11SystemLocalCapabilities.SystemMode);
|
||||||
|
free(set->ARM11SystemLocalCapabilities.ResourceLimitCategory);
|
||||||
|
|
||||||
|
free_StringCollection(set->ARM11SystemLocalCapabilities.ServiceAccessControl,set->ARM11SystemLocalCapabilities.ServiceAccessControlNum);
|
||||||
|
|
||||||
|
// ARM11KernelCapabilities
|
||||||
|
free(set->ARM11KernelCapabilities.MemoryType);
|
||||||
|
free(set->ARM11KernelCapabilities.HandleTableSize);
|
||||||
|
free(set->ARM11KernelCapabilities.ReleaseKernelMajor);
|
||||||
|
free(set->ARM11KernelCapabilities.ReleaseKernelMinor);
|
||||||
|
free(set->ARM11KernelCapabilities.StorageInfo.SystemSaveDataId1);
|
||||||
|
free(set->ARM11KernelCapabilities.StorageInfo.SystemSaveDataId2);
|
||||||
|
free(set->ARM11KernelCapabilities.StorageInfo.OtherUserSaveDataId1);
|
||||||
|
free(set->ARM11KernelCapabilities.StorageInfo.OtherUserSaveDataId2);
|
||||||
|
free(set->ARM11KernelCapabilities.StorageInfo.OtherUserSaveDataId3);
|
||||||
|
free(set->ARM11KernelCapabilities.StorageInfo.ExtSaveDataId);
|
||||||
|
|
||||||
|
free_StringCollection(set->ARM11KernelCapabilities.MemoryMapping,set->ARM11KernelCapabilities.MemoryMappingNum);
|
||||||
|
free_StringCollection(set->ARM11KernelCapabilities.IORegisterMapping,set->ARM11KernelCapabilities.IORegisterMappingNum);
|
||||||
|
free_StringCollection(set->ARM11KernelCapabilities.FileSystemAccess,set->ARM11KernelCapabilities.FileSystemAccessNum);
|
||||||
|
free_StringCollection(set->ARM11KernelCapabilities.InterruptNumbers,set->ARM11KernelCapabilities.InterruptNumbersNum);
|
||||||
|
free_StringCollection(set->ARM11KernelCapabilities.SystemCallAccess,set->ARM11KernelCapabilities.SystemCallAccessNum);
|
||||||
|
free_StringCollection(set->ARM11KernelCapabilities.StorageInfo.AccessibleSaveDataIds,set->ARM11KernelCapabilities.StorageInfo.AccessibleSaveDataIdsNum);
|
||||||
|
|
||||||
|
// ARM9AccessControlInfo
|
||||||
|
free(set->ARM9AccessControlInfo.DescVersion);
|
||||||
|
free_StringCollection(set->ARM9AccessControlInfo.IoAccessControl,set->ARM9AccessControlInfo.IoAccessControlNum);
|
||||||
|
|
||||||
|
// CommonHeaderKey
|
||||||
|
free(set->CommonHeaderKey.D);
|
||||||
|
free(set->CommonHeaderKey.Modulus);
|
||||||
|
free(set->CommonHeaderKey.Exponent);
|
||||||
|
free(set->CommonHeaderKey.AccCtlDescSign);
|
||||||
|
free(set->CommonHeaderKey.AccCtlDescBin);
|
||||||
|
}
|
||||||
|
|
||||||
|
void free_StringCollection(char **Collection, u32 StringNum)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < StringNum; i++)
|
||||||
|
free(Collection[i]);
|
||||||
|
free(Collection);
|
||||||
|
}
|
||||||
|
|
||||||
void free_RsfSettings(rsf_settings *set)
|
void free_RsfSettings(rsf_settings *set)
|
||||||
{
|
{
|
||||||
@@ -805,6 +910,7 @@ void DisplayHelp(char *app_name)
|
|||||||
//printf(" -DNAME=VALUE Substitute values in Spec files\n");
|
//printf(" -DNAME=VALUE Substitute values in Spec files\n");
|
||||||
printf("NCCH Options:\n");
|
printf("NCCH Options:\n");
|
||||||
printf(" -ncch0 <ncch format> NCCH Format (cxi|cfa)\n");
|
printf(" -ncch0 <ncch format> NCCH Format (cxi|cfa)\n");
|
||||||
|
printf(" -desc <desc path> DESC File\n");
|
||||||
printf(" -elf <elf path> ELF File\n");
|
printf(" -elf <elf path> ELF File\n");
|
||||||
printf(" -icon <icon path> Icon File\n");
|
printf(" -icon <icon path> Icon File\n");
|
||||||
printf(" -banner <banner path> Banner File\n");
|
printf(" -banner <banner path> Banner File\n");
|
||||||
|
|||||||
+184
-3
@@ -39,7 +39,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
struct{
|
struct{
|
||||||
// Booleans
|
// Booleans
|
||||||
int NoPadding;
|
int NoPadding; // DELETE
|
||||||
int AllowUnalignedSection;
|
int AllowUnalignedSection;
|
||||||
int EnableCrypt;
|
int EnableCrypt;
|
||||||
int EnableCompress;
|
int EnableCompress;
|
||||||
@@ -136,8 +136,8 @@ typedef struct
|
|||||||
char *MediaSize;
|
char *MediaSize;
|
||||||
char *ContentType;
|
char *ContentType;
|
||||||
char *Logo;
|
char *Logo;
|
||||||
char *BackupMemoryType;
|
char *BackupMemoryType;// Delete
|
||||||
char *InitialCode;
|
char *InitialCode;// Delete
|
||||||
} BasicInfo;
|
} BasicInfo;
|
||||||
|
|
||||||
struct{
|
struct{
|
||||||
@@ -213,6 +213,183 @@ typedef struct
|
|||||||
} CommonHeaderKey;
|
} CommonHeaderKey;
|
||||||
} rsf_settings;
|
} rsf_settings;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
struct{
|
||||||
|
// Booleans
|
||||||
|
int EnableCrypt;
|
||||||
|
int EnableCompress;
|
||||||
|
int FreeProductCode;
|
||||||
|
int UseOnSD;
|
||||||
|
|
||||||
|
// Strings
|
||||||
|
char *PageSize;
|
||||||
|
} Option;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
// Strings
|
||||||
|
char *HostRoot;
|
||||||
|
|
||||||
|
// String Collections
|
||||||
|
u32 DefaultRejectNum;
|
||||||
|
char **DefaultReject;
|
||||||
|
u32 RejectNum;
|
||||||
|
char **Reject;
|
||||||
|
u32 IncludeNum;
|
||||||
|
char **Include;
|
||||||
|
u32 FileNum;
|
||||||
|
char **File;
|
||||||
|
} RomFs;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
char *StackSize;
|
||||||
|
|
||||||
|
u32 TextNum;
|
||||||
|
char **Text;
|
||||||
|
u32 ReadOnlyNum;
|
||||||
|
char **ReadOnly;
|
||||||
|
u32 ReadWriteNum;
|
||||||
|
char **ReadWrite;
|
||||||
|
} ExeFs;
|
||||||
|
|
||||||
|
u32 PlainRegionNum;
|
||||||
|
char **PlainRegion;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
// Strings
|
||||||
|
char *Title;
|
||||||
|
char *CompanyCode;
|
||||||
|
char *ProductCode;
|
||||||
|
char *ContentType;
|
||||||
|
char *Logo;
|
||||||
|
char *RemasterVersion;
|
||||||
|
} BasicInfo;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
// Strings
|
||||||
|
char *Category;
|
||||||
|
char *UniqueId;
|
||||||
|
char *Version;
|
||||||
|
char *ContentsIndex;
|
||||||
|
char *DataTitleIndex;
|
||||||
|
char *ChildIndex;
|
||||||
|
char *DemoIndex;
|
||||||
|
char *TargetCategory;
|
||||||
|
|
||||||
|
// String Collections
|
||||||
|
u32 CategoryFlagsNum;
|
||||||
|
char **CategoryFlags;
|
||||||
|
} TitleInfo;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
// Booleans
|
||||||
|
int MediaFootPadding;
|
||||||
|
|
||||||
|
// Strings
|
||||||
|
char *WritableAddress;
|
||||||
|
char *CardType;
|
||||||
|
char *CryptoType;
|
||||||
|
char *CardDevice;
|
||||||
|
char *MediaType;
|
||||||
|
char *BackupWriteWaitTime;
|
||||||
|
char *MediaSize;
|
||||||
|
} CardInfo;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
char *SaveDataSize;
|
||||||
|
char *JumpId;
|
||||||
|
} SystemInfo;
|
||||||
|
|
||||||
|
u32 DependencyNum;
|
||||||
|
char **Dependency;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
// Strings
|
||||||
|
char *AppType;
|
||||||
|
char *MaxCpu;
|
||||||
|
char *CoreVersion;
|
||||||
|
char *IdealProcessor;
|
||||||
|
char *Priority;
|
||||||
|
char *AffinityMask;
|
||||||
|
char *SystemMode;
|
||||||
|
char *ResourceLimitCategory;
|
||||||
|
|
||||||
|
// String Collections
|
||||||
|
u32 ServiceAccessControlNum;
|
||||||
|
char **ServiceAccessControl;
|
||||||
|
} ARM11SystemLocalCapabilities;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
struct{ // Set from RSF
|
||||||
|
// Booleans
|
||||||
|
bool UseOtherVariationSaveData;
|
||||||
|
bool UseExtSaveData;
|
||||||
|
bool UseExtendedSaveDataAccessControl;
|
||||||
|
|
||||||
|
// Strings
|
||||||
|
char *SystemSaveDataId1;
|
||||||
|
char *SystemSaveDataId2;
|
||||||
|
char *OtherUserSaveDataId1;
|
||||||
|
char *OtherUserSaveDataId2;
|
||||||
|
char *OtherUserSaveDataId3;
|
||||||
|
char *ExtSaveDataId;
|
||||||
|
|
||||||
|
// String Collections
|
||||||
|
u32 AccessibleSaveDataIdsNum;
|
||||||
|
char **AccessibleSaveDataIds;
|
||||||
|
} StorageInfo;
|
||||||
|
|
||||||
|
// Booleans
|
||||||
|
int DisableDebug;
|
||||||
|
int EnableForceDebug;
|
||||||
|
int CanWriteSharedPage;
|
||||||
|
int CanUsePrivilegedPriority;
|
||||||
|
int CanUseNonAlphabetAndNumber;
|
||||||
|
int PermitMainFunctionArgument;
|
||||||
|
int CanShareDeviceMemory;
|
||||||
|
int RunnableOnSleep;
|
||||||
|
int SpecialMemoryArrange;
|
||||||
|
|
||||||
|
// Strings
|
||||||
|
char *MemoryType;
|
||||||
|
char *HandleTableSize;
|
||||||
|
char *ReleaseKernelMajor;
|
||||||
|
char *ReleaseKernelMinor;
|
||||||
|
|
||||||
|
// String Collections
|
||||||
|
u32 MemoryMappingNum;
|
||||||
|
char **MemoryMapping;
|
||||||
|
u32 IORegisterMappingNum;
|
||||||
|
char **IORegisterMapping;
|
||||||
|
u32 FileSystemAccessNum;
|
||||||
|
char **FileSystemAccess;
|
||||||
|
u32 InterruptNumbersNum;
|
||||||
|
char **InterruptNumbers;
|
||||||
|
u32 SystemCallAccessNum;
|
||||||
|
char **SystemCallAccess;
|
||||||
|
} ARM11KernelCapabilities;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
// Strings
|
||||||
|
char *DescVersion;
|
||||||
|
|
||||||
|
// String Collections
|
||||||
|
u32 IoAccessControlNum;
|
||||||
|
char **IoAccessControl;
|
||||||
|
} ARM9AccessControlInfo;
|
||||||
|
|
||||||
|
struct{
|
||||||
|
bool Found;
|
||||||
|
|
||||||
|
char *D;
|
||||||
|
char *Modulus;
|
||||||
|
char *Exponent;
|
||||||
|
|
||||||
|
char *AccCtlDescSign;
|
||||||
|
char *AccCtlDescBin;
|
||||||
|
} CommonHeaderKey;
|
||||||
|
} yaml_settings;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
// General Settings
|
// General Settings
|
||||||
@@ -274,3 +451,7 @@ void ReadYAMLtest(char *filepath);
|
|||||||
|
|
||||||
void InvalidateRSFBooleans(rsf_settings *rsf_set);
|
void InvalidateRSFBooleans(rsf_settings *rsf_set);
|
||||||
void free_RsfSettings(rsf_settings *set);
|
void free_RsfSettings(rsf_settings *set);
|
||||||
|
|
||||||
|
void SetYAMLBooleanDefaults(yaml_settings *yaml);
|
||||||
|
void free_YamlSettings(yaml_settings *set);
|
||||||
|
void free_StringCollection(char **Collection, u32 StringNum);
|
||||||
|
|||||||
Reference in New Issue
Block a user