Skip to content

Commit

Permalink
mode3
Browse files Browse the repository at this point in the history
  • Loading branch information
44670 committed Jul 25, 2015
1 parent 5677e95 commit 0d87fb5
Show file tree
Hide file tree
Showing 14 changed files with 526 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Please send us the result.txt along with your console's firmware version (both e

# Latest Build

https://github.com/44670/BootNTR/raw/master/output/BootNTR.cia
https://github.com/44670/BootNTR/raw/master/release/BootNTR.cia
4 changes: 4 additions & 0 deletions build-all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
call build-mode3.bat

call build-mode0.bat

10 changes: 10 additions & 0 deletions build-mode0.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
copy template-cia-0.rsf template-cia.rsf
cd resources
copy AppInfo-0 AppInfo
cd ..
make clean

make

copy output\*.cia release\
pause
10 changes: 10 additions & 0 deletions build-mode3.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
copy template-cia-3.rsf template-cia.rsf
cd resources
copy AppInfo-3 AppInfo
cd ..
make clean

make

copy output\*.cia release\
pause
Binary file modified output/BootNTR.cia
Binary file not shown.
Binary file modified output/BootNTR.elf
Binary file not shown.
Binary file added release/BootNTR-Mode3.cia
Binary file not shown.
Binary file added release/BootNTR.cia
Binary file not shown.
5 changes: 5 additions & 0 deletions resources/AppInfo-0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP_TITLE = BootNTR
APP_DESCRIPTION = NTR CFW Loader.
APP_AUTHOR = BootNTR
APP_PRODUCT_CODE = CTR-P-BNTR
APP_UNIQUE_ID = 0xb000
5 changes: 5 additions & 0 deletions resources/AppInfo-3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP_TITLE = BootNTR-Mode3
APP_DESCRIPTION = NTR CFW Loader.
APP_AUTHOR = BootNTR
APP_PRODUCT_CODE = CTR-P-BNTU
APP_UNIQUE_ID = 0xb003
14 changes: 5 additions & 9 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Result bnInitParamsByHomeMenu() {
}
svc_closeHandle(hProcess);
t = *(u32*)(tmpBuffer);
printf("0x0020000 in HomeMenu: %08x\n", t);
printf("0x00200000 in HomeMenu: %08x\n", t);
if (t == 0xe59f80f4) {
// new3ds 9.2.0
ntrConfig->HomeMenuVersion = SYSTEM_VERSION(9, 2, 0);;
Expand Down Expand Up @@ -697,25 +697,21 @@ int main() {
bnConfig = &g_bnConfig;
ret = bnBootNTR();
if (ret == 0) {
printf("NTR CFW loaded successfully\nExiting...\n(Hold SELECT to prevent auto-exit) \n");
printf("NTR CFW loaded successfully\n");
svcSleepThread(1000000000);
isSuccess = 1;
} else {
printf("bnBootNTR failed, press START to exit.\n");
printf("bnBootNTR failed\n");
}
printf("Press Home button to return to the menu.\n");

// Main loop
while (aptMainLoop())
{
hidScanInput();

u32 kDown = hidKeysDown();
if (kDown & KEY_SELECT) {
isSuccess = 0;
}
if (isSuccess) {
break;
}

if (kDown & KEY_START) {
break; // break in order to return to hbmenu
}
Expand Down
242 changes: 242 additions & 0 deletions template-cia-0.rsf
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
BasicInfo:
Title : "$(APP_TITLE)"
CompanyCode : "00"
ProductCode : "$(APP_PRODUCT_CODE)"
ContentType : Application
Logo : Nintendo # Nintendo / Licensed / Distributed / iQue / iQueForSystem

TitleInfo:
UniqueId : $(APP_UNIQUE_ID)
Category : Application

CardInfo:
MediaSize : 128MB # 128MB / 256MB / 512MB / 1GB / 2GB / 4GB / 8GB / 16GB / 32GB
MediaType : Card1 # Card1 / Card2
CardDevice : None # NorFlash(Pick this if you use savedata) / None

Option:
UseOnSD : true # true if App is to be installed to SD
FreeProductCode : true # Removes limitations on ProductCode
MediaFootPadding : false # If true CCI files are created with padding
EnableCrypt : false # Enables encryption for NCCH and CIA
EnableCompress : true # Compresses exefs code

ExeFs: # these are the program segments from the ELF, check your elf for the appropriate segment names
ReadOnly:
- .rodata
- RO
ReadWrite:
- .data
- RO
Text:
- .init
- .text
- STUP_ENTRY

PlainRegion: # only used with SDK ELFs
#- .module_id

#Rom:
# Specifies the root path of the file system to include in the ROM.
# HostRoot : "romfs"

AccessControlInfo:
# UseOtherVariationSaveData : true
# UseExtSaveData : true
# ExtSaveDataId: 0xffffffff
# SystemSaveDataId1: 0x220
# SystemSaveDataId2: 0x00040010
# OtherUserSaveDataId1: 0x220
# OtherUserSaveDataId2: 0x330
# OtherUserSaveDataId3: 0x440
# UseExtendedSaveDataAccessControl: true
# AccessibleSaveDataIds: [0x101, 0x202, 0x303, 0x404, 0x505, 0x606]
FileSystemAccess:
# - CategorySystemApplication
# - CategoryHardwareCheck
- CategoryFileSystemTool
- Debug
# - TwlCardBackup
# - TwlNandData
# - Boss
- DirectSdmc
# - Core
# - CtrNandRo
# - CtrNandRw
# - CtrNandRoWrite
# - CategorySystemSettings
# - CardBoard
# - ExportImportIvs
- DirectSdmcWrite
# - SwitchCleanup
# - SaveDataMove
# - Shop
# - Shell
# - CategoryHomeMenu
IoAccessControl:
# - FsMountNand
# - FsMountNandRoWrite
# - FsMountTwln
# - FsMountWnand
# - FsMountCardSpi
# - UseSdif3
# - CreateSeed
# - UseCardSpi

IdealProcessor : 0
AffinityMask : 1

Priority : 16

MaxCpu : 0x9E # Default

DisableDebug : true
EnableForceDebug : false
CanWriteSharedPage : true
CanUsePrivilegedPriority : false
CanUseNonAlphabetAndNumber : true
PermitMainFunctionArgument : true
CanShareDeviceMemory : true
RunnableOnSleep : false
SpecialMemoryArrange : true

CoreVersion : 2
DescVersion : 2

ReleaseKernelMajor : "02"
ReleaseKernelMinor : "33"
MemoryType : Application # Application / System / Base
HandleTableSize: 512
IORegisterMapping:
- 1ff50000-1ff57fff
- 1ff70000-1ff77fff
MemoryMapping:
- 1f000000-1f5fffff:r
SystemCallAccess:
ArbitrateAddress: 34
Break: 60
CancelTimer: 28
ClearEvent: 25
ClearTimer: 29
CloseHandle: 35
ConnectToPort: 45
ControlMemory: 1
CreateAddressArbiter: 33
CreateEvent: 23
CreateMemoryBlock: 30
CreateMutex: 19
CreateSemaphore: 21
CreateThread: 8
CreateTimer: 26
DuplicateHandle: 39
ExitProcess: 3
ExitThread: 9
GetCurrentProcessorNumber: 17
GetHandleInfo: 41
GetProcessId: 53
GetProcessIdOfThread: 54
GetProcessIdealProcessor: 6
GetProcessInfo: 43
GetResourceLimit: 56
GetResourceLimitCurrentValues: 58
GetResourceLimitLimitValues: 57
GetSystemInfo: 42
GetSystemTick: 40
GetThreadContext: 59
GetThreadId: 55
GetThreadIdealProcessor: 15
GetThreadInfo: 44
GetThreadPriority: 11
MapMemoryBlock: 31
OutputDebugString: 61
QueryMemory: 2
ReleaseMutex: 20
ReleaseSemaphore: 22
SendSyncRequest1: 46
SendSyncRequest2: 47
SendSyncRequest3: 48
SendSyncRequest4: 49
SendSyncRequest: 50
SetThreadPriority: 12
SetTimer: 27
SignalEvent: 24
SleepThread: 10
UnmapMemoryBlock: 32
WaitSynchronization1: 36
WaitSynchronizationN: 37
Backdoor: 123
controlProcessMemory: 112
StartInterProcessDma: 85
FlushProcessDataCache: 84
InvalidateProcessDataCache: 82
GetDmaState: 87
OpenProcess: 51
InterruptNumbers:
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
- ir:u
- mic:u
- ndm:u
- news:u
- nwm::UDS
- ptm:u
- pxi:dev
- soc:U
- ssl:C
- y2r:u
- am:u
- cfg:nor
- csnd:SND

SystemControlInfo:
SaveDataSize: 0KB # It doesn't use any save data.
RemasterVersion: 2
StackSize: 0x40000
# JumpId: 0
Dependency:
ac: 0x0004013000002402L
am: 0x0004013000001502L
boss: 0x0004013000003402L
camera: 0x0004013000001602L
cecd: 0x0004013000002602L
cfg: 0x0004013000001702L
codec: 0x0004013000001802L
csnd: 0x0004013000002702L
dlp: 0x0004013000002802L
dsp: 0x0004013000001a02L
friends: 0x0004013000003202L
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
Loading

0 comments on commit 0d87fb5

Please sign in to comment.