Skip to content

Commit f0fcc2b

Browse files
author
Tony Wasserka
committed
Merge code lines into multiblock code
1 parent 05ad0f9 commit f0fcc2b

File tree

82 files changed

+2989
-2495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2989
-2495
lines changed

content/10.4.0-29.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ to launch the app without updating), prior to doing the actual
166166
application launch. When that returns 0, Home Menu will display a
167167
message using the following text from new message-strings:
168168

169-
`You need to update this `
170-
`software before you can`
171-
`launch it.`
169+
```
170+
You need to update this 
171+
software before you can
172+
launch it.
173+
```
172174

173175
### SpotPass sysmodule
174176

@@ -188,18 +190,20 @@ codebin("ratPEGI_U_02" and "detailPEGI_D_01").
188190

189191
The message files were updated:
190192

191-
`diff --git a/v19465/tiger.msbt.lz.decom.wstrs b/v20482/tiger.msbt.lz.decom.wstrs`
192-
`index 2a3a24e..55358d0 100644`
193-
`--- a/v19465/tiger.msbt.lz.decom.wstrs`
194-
`+++ b/v20482/tiger.msbt.lz.decom.wstrs`
195-
`@@ -258,6 +258,7 @@ Charts`
196-
` Search Results: `
197-
` Price: TBD`
198-
` Offers in-game purchases`
199-
`+Video `
200-
` This software is currently unavailable.`
201-
` Page `
202-
` Go to Page`
193+
```
194+
diff --git a/v19465/tiger.msbt.lz.decom.wstrs b/v20482/tiger.msbt.lz.decom.wstrs
195+
index 2a3a24e..55358d0 100644
196+
--- a/v19465/tiger.msbt.lz.decom.wstrs
197+
+++ b/v20482/tiger.msbt.lz.decom.wstrs
198+
@@ -258,6 +258,7 @@ Charts
199+
 Search Results: 
200+
 Price: TBD
201+
 Offers in-game purchases
202+
+Video 
203+
 This software is currently unavailable.
204+
 Page 
205+
 Go to Page
206+
```
203207

204208
### mint
205209

@@ -213,14 +217,16 @@ The USA 0004009B00012302 CFA(and the equivalent titleIDs for the other
213217
regions) was updated, the following message was added to
214218
20000_msbt_LZ.bin:
215219

216-
`An error has occurred.`
217-
`Please check if there is corrupted data`
218-
`in Data Management `
219-
` Nintendo 3DS`
220-
`in the System Settings.`
221-
`If the problem persists, please`
222-
`make a note of the error code`
223-
`and visit support.nintendo.com.`
220+
```
221+
An error has occurred.
222+
Please check if there is corrupted data
223+
in Data Management 
224+
 Nintendo 3DS
225+
in the System Settings.
226+
If the problem persists, please
227+
make a note of the error code
228+
and visit support.nintendo.com.
229+
```
224230

225231
## See Also
226232

content/10.7.0-32.md

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -49,61 +49,65 @@ to the updated message files mentioned below.
4949

5050
The following files in RomFS were updated(USA title diff):
5151

52-
`/cad/Common.arc.lz`
53-
`/cad/CommonWin.arc.lz`
54-
`/cad/Entrance.arc.lz`
55-
`/cad/Register.arc.lz`
56-
`/cad/TitleInfo.arc.lz`
57-
`/message/america/US_English/RI.mstl.lz`
58-
`/message/america/US_English/tiger.msbt.lz`
59-
`/message/america/US_French/RI.mstl.lz`
60-
`/message/america/US_French/tiger.msbt.lz`
61-
`/message/america/US_Portuguese/RI.mstl.lz`
62-
`/message/america/US_Portuguese/tiger.msbt.lz`
63-
`/message/america/US_Spanish/RI.mstl.lz`
64-
`/message/america/US_Spanish/tiger.msbt.lz`
65-
66-
`git diff v20482/tiger.msbt.lz.decom.wstrs v21506/US_English_tiger.msbt.lz.decom_wstrs`
67-
`diff --git a/v20482/tiger.msbt.lz.decom.wstrs b/v21506/US_English_tiger.msbt.lz.decom_wstrs`
68-
`index 55358d0..3c3938f 100644`
69-
`--- a/v20482/tiger.msbt.lz.decom.wstrs`
70-
`+++ b/v21506/US_English_tiger.msbt.lz.decom_wstrs`
71-
`@@ -357,10 +357,10 @@ Please read before purchasing`
72-
` this software license.`
73-
` Next`
74-
` Back`
75-
`-Please check the ESRB rating`
76-
`-information on the upper screen.`
77-
`+Please check the rating information`
78-
`+on the upper screen.`
79-
` Title Information`
80-
`-ESRB Rating`
81-
`+Rating Information`
82-
` Change of Address`
83-
` Your address information is out of date.`
84-
` You must enter your current address in`
85-
`@@ -421,6 +421,12 @@ Please enter the coupon code`
86-
` correctly. Do not use any special`
87-
` characters or symbols.`
88-
` K(incl. tax)`
89-
`+A Just for You offer is available.`
90-
`+Would you like to redeem it?`
91-
`+Redeem offer`
92-
`+Purchase without redeeming offer`
93-
`+K(incl. tax) `
94-
`+K(incl. tax) `
95-
` Downloadable-Content Information`
96-
` In order to view information about`
97-
` downloadable content, Nintendo`
98-
`@@ -461,7 +467,7 @@ Genre`
99-
` Languages`
100-
` Important Information`
101-
` Compatible Features/Accessories`
102-
`-ESRB Rating`
103-
`+Rating Information`
104-
` Related Keywords`
105-
` Repair`
106-
` Repair Software`
52+
```
53+
/cad/Common.arc.lz
54+
/cad/CommonWin.arc.lz
55+
/cad/Entrance.arc.lz
56+
/cad/Register.arc.lz
57+
/cad/TitleInfo.arc.lz
58+
/message/america/US_English/RI.mstl.lz
59+
/message/america/US_English/tiger.msbt.lz
60+
/message/america/US_French/RI.mstl.lz
61+
/message/america/US_French/tiger.msbt.lz
62+
/message/america/US_Portuguese/RI.mstl.lz
63+
/message/america/US_Portuguese/tiger.msbt.lz
64+
/message/america/US_Spanish/RI.mstl.lz
65+
/message/america/US_Spanish/tiger.msbt.lz
66+
```
67+
68+
```
69+
git diff v20482/tiger.msbt.lz.decom.wstrs v21506/US_English_tiger.msbt.lz.decom_wstrs
70+
diff --git a/v20482/tiger.msbt.lz.decom.wstrs b/v21506/US_English_tiger.msbt.lz.decom_wstrs
71+
index 55358d0..3c3938f 100644
72+
--- a/v20482/tiger.msbt.lz.decom.wstrs
73+
+++ b/v21506/US_English_tiger.msbt.lz.decom_wstrs
74+
@@ -357,10 +357,10 @@ Please read before purchasing
75+
 this software license.
76+
 Next
77+
 Back
78+
-Please check the ESRB rating
79+
-information on the upper screen.
80+
+Please check the rating information
81+
+on the upper screen.
82+
 Title Information
83+
-ESRB Rating
84+
+Rating Information
85+
 Change of Address
86+
 Your address information is out of date.
87+
 You must enter your current address in
88+
@@ -421,6 +421,12 @@ Please enter the coupon code
89+
 correctly. Do not use any special
90+
 characters or symbols.
91+
 K(incl. tax)
92+
+A Just for You offer is available.
93+
+Would you like to redeem it?
94+
+Redeem offer
95+
+Purchase without redeeming offer
96+
+K(incl. tax) 
97+
+K(incl. tax) 
98+
 Downloadable-Content Information
99+
 In order to view information about
100+
 downloadable content, Nintendo
101+
@@ -461,7 +467,7 @@ Genre
102+
 Languages
103+
 Important Information
104+
 Compatible Features/Accessories
105+
-ESRB Rating
106+
+Rating Information
107+
 Related Keywords
108+
 Repair
109+
 Repair Software
110+
```
107111

108112
### Internet Browser
109113

content/11.0.0-33.md

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ memory region. This was implemented with the following checks which are
7070
done for each memchunk separately - right before clearing and mapping
7171
each one to the requested vaddr.
7272

73-
`if((region_base > memchunk_addr) || ((region_base + region_size) < (memchunk_addr + memchunk_size<<12))) { kernel_panic(); }`
73+
```
74+
if((region_base > memchunk_addr) || ((region_base + region_size) < (memchunk_addr + memchunk_size<<12))) { kernel_panic(); }
75+
```
7476

7577
The actual ToCToU race has not been fixed (see
7678
[memchunkhax2.1](3DS_System_Flaws "wikilink")).
@@ -85,45 +87,57 @@ detect when it is modified by an outside DMA device
8587
The MAC itself is custom based on xor-rot-sub-mul, and is calculated as
8688
follows (pseudo-code):
8789

88-
`u32* crypto_state = (u32*) r4; // Safe kernel memory. This is actually the `[`RegionDescriptor`](Memory_Management#RegionDescriptor "wikilink")`.`
89-
`u32* data_ptr = (u32*) lr; // Unsafe FCRAM pointer.`
90-
91-
`r0 = crypto_state[16/4] // Load "key".`
92-
`r1 = crypto_state[20/4]`
93-
`r2 = crypto_state[28/4]`
94-
`r3 = crypto_state[24/4]`
95-
96-
`for(size_t i=0; i<2; i++) {`
97-
`    for(size_t j=0; j<5; j++) {`
98-
`        r0 -= (r1 >>> 3) - data_ptr[j]`
99-
`        r1 -= (r3 >>> ((r2 & 0xf) + 3)) ^ (r2 >>> ((r0 & 0xf) + 13))`
100-
`        r3 -= (r2 >>> r0) * r1`
101-
`        r2 -= (r0 >>> r1) * r3`
102-
`    }`
103-
`}`
104-
`    `
105-
`// Verify MAC.`
106-
`if(data_ptr[5] != (r0 ^ r1)) {`
107-
`    kernel_panic()`
108-
`}`
90+
```
91+
u32* crypto_state = (u32*) r4; // Safe kernel memory. This is actually the `[`RegionDescriptor`](Memory_Management#RegionDescriptor "wikilink")`.
92+
u32* data_ptr = (u32*) lr; // Unsafe FCRAM pointer.
93+
```
94+
95+
```
96+
r0 = crypto_state[16/4] // Load "key".
97+
r1 = crypto_state[20/4]
98+
r2 = crypto_state[28/4]
99+
r3 = crypto_state[24/4]
100+
```
101+
102+
```
103+
for(size_t i=0; i<2; i++) {
104+
    for(size_t j=0; j<5; j++) {
105+
        r0 -= (r1 >>> 3) - data_ptr[j]
106+
        r1 -= (r3 >>> ((r2 & 0xf) + 3)) ^ (r2 >>> ((r0 & 0xf) + 13))
107+
        r3 -= (r2 >>> r0) * r1
108+
        r2 -= (r0 >>> r1) * r3
109+
    }
110+
}
111+
    
112+
// Verify MAC.
113+
if(data_ptr[5] != (r0 ^ r1)) {
114+
    kernel_panic()
115+
}
116+
```
109117

110118
The function which initializes a memalloc heap had a major update (used
111119
for FCRAM memregions and the SlabHeap container). It generates a random
112120
MAC key based on svcGetSystemTick, like this:
113121

114-
`crypto_state[16/4] = 0 //This is actually the `[`RegionDescriptor`](Memory_Management#RegionDescriptor "wikilink")`.`
115-
`crypto_state[20/4] = 0`
116-
`crypto_state[24/4] = 0`
117-
`crypto_state[28/4] = 0`
118-
119-
`u32* key = &crypto_state[16/4];`
120-
121-
`for(size_t i=0; i<0x40; i++) {`
122-
`    for(size_t j=0; j<4; j++) { `
123-
`        r0 = key[j] - GetSystemTick()`
124-
`        key[j] = r0 ^ ((r0 >>> 7) - (key[(i+j) % 4] >>> 17))`
125-
`    }`
126-
`}`
122+
```
123+
crypto_state[16/4] = 0 //This is actually the `[`RegionDescriptor`](Memory_Management#RegionDescriptor "wikilink")`.
124+
crypto_state[20/4] = 0
125+
crypto_state[24/4] = 0
126+
crypto_state[28/4] = 0
127+
```
128+
129+
```
130+
u32* key = &crypto_state[16/4];
131+
```
132+
133+
```
134+
for(size_t i=0; i<0x40; i++) {
135+
    for(size_t j=0; j<4; j++) { 
136+
        r0 = key[j] - GetSystemTick()
137+
        key[j] = r0 ^ ((r0 >>> 7) - (key[(i+j) % 4] >>> 17))
138+
    }
139+
}
140+
```
127141

128142
However, it's unknown how much the svcGetSystemTick() output really
129143
varies if anything(?) for each hard-boot during initialization of the

content/11.1.0-34.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ to exploit the memory-management code.
5353

5454
The first function ("validateChunk") now makes sure that:
5555

56-
`chunk + currentChunkSize >= currentChunk`
56+
```
57+
chunk + currentChunkSize >= currentChunk
58+
```
5759

5860
when checking that the current chunk doesn't overlap with either the
5961
previous or next one.
@@ -62,13 +64,17 @@ The second function ("Kern::ControlMemory"), aside from other small
6264
changes, now makes additional checks on the previously allocated memory
6365
chunk; the code for that is now:
6466

65-
`if(chunkSizeInPages >= regionSize >> 12 || chunk < regionBase || chunk + chunkSize < chunk || chunk + chunkSize > regionBase + regionSize) panic;`
67+
```
68+
if(chunkSizeInPages >= regionSize >> 12 || chunk < regionBase || chunk + chunkSize < chunk || chunk + chunkSize > regionBase + regionSize) panic;
69+
```
6670

6771
The third function ("insertChunk") now makes the following checks:
6872

69-
`if(chunkSizeInPages >= regionSize >> 12 || regionBase + regionSize < chunk + chunkSize) panic;`
70-
`// ...`
71-
`if(leftChunk && leftChunk + leftChunkSize <= leftChunk) panic; // this check was already done on 'right'`
73+
```
74+
if(chunkSizeInPages >= regionSize >> 12 || regionBase + regionSize < chunk + chunkSize) panic;
75+
// ...
76+
if(leftChunk && leftChunk + leftChunkSize <= leftChunk) panic; // this check was already done on 'right'
77+
```
7278

7379
#### FIRM-modules
7480

0 commit comments

Comments
 (0)