Minor fixes

This commit is contained in:
Spotlight 2021-12-31 02:07:38 -06:00
parent b15a4059bf
commit e4c4758290
No known key found for this signature in database
GPG Key ID: 874AA355B3209BDC
4 changed files with 8 additions and 9 deletions

View File

@ -5,3 +5,4 @@ Contents:
- [`opcacrt6.yml`](opcacrt6.yml): A [Kaitai](https://kaitai.io) structure describing a very basic `opcacrt6.dat`. - [`opcacrt6.yml`](opcacrt6.yml): A [Kaitai](https://kaitai.io) structure describing a very basic `opcacrt6.dat`.
It does not attempt to handle things such as client certificates or user passwords. It does not attempt to handle things such as client certificates or user passwords.
- [`patch_overwrite_ios.md`](patch_overwrite_ios.md): An explanation over why and how IOS is patched for operation of the Wii Shop Channel. - [`patch_overwrite_ios.md`](patch_overwrite_ios.md): An explanation over why and how IOS is patched for operation of the Wii Shop Channel.
- [`patch_custom_ca_ios.md`](patch_custom_ca_ios.md): The logistics of inserting our custom CA into IOS as well for EC usage.

View File

@ -1,7 +1,7 @@
# Patch: Overwrite IOS Syscall for ES # Patch: Overwrite IOS Syscall for ES
## Motivation ## Motivation
When installing a custom title via the Wii Shop Channel, the signature expects a valid signature. When installing a custom title via the Wii Shop Channel, ES expects valid signatures and certificates.
Most homebrew-based WAD installers apply IOS patches or manually insert contents to their proper place. Most homebrew-based WAD installers apply IOS patches or manually insert contents to their proper place.
However, as we use Nintendo's official code, we lack this luxury. However, as we use Nintendo's official code, we lack this luxury.

View File

@ -108,8 +108,6 @@ func main() {
fmt.Println(aurora.Green("Applying DOL patches...")) fmt.Println(aurora.Green("Applying DOL patches..."))
applyDefaultPatches() applyDefaultPatches()
ioutil.WriteFile("/Users/spot/Desktop/patched.app", mainDol, 0755)
// Load main ARC // Load main ARC
arcData, err := originalWad.GetContent(2) arcData, err := originalWad.GetContent(2)
check(err) check(err)

View File

@ -4,14 +4,14 @@ package main
// into the IOS trust store for EC usage. // into the IOS trust store for EC usage.
// It is assumed that rootCertificate has been loaded upon invoking this patchset. // It is assumed that rootCertificate has been loaded upon invoking this patchset.
// See docs/patch_custom_ca_ios.md for more information. // See docs/patch_custom_ca_ios.md for more information.
func LoadCustomCA(rootCert []byte) PatchSet { func LoadCustomCA() PatchSet {
return PatchSet{ return PatchSet{
Patch{ Patch{
Name: "Insert custom CA into free space", Name: "Insert custom CA into free space",
AtOffset: 3037368, AtOffset: 3037368,
Before: emptyBytes(len(rootCert)), Before: emptyBytes(len(rootCertificate)),
After: rootCert, After: rootCertificate,
}, },
Patch{ Patch{
Name: "Modify NHTTPi_SocSSLConnect to load cert", Name: "Modify NHTTPi_SocSSLConnect to load cert",
@ -77,7 +77,7 @@ func LoadCustomCA(rootCert []byte) PatchSet {
// r5 is the third parameter of SSLSetRootCA, the cert_length field. // r5 is the third parameter of SSLSetRootCA, the cert_length field.
// xor r5, r5, r5 // xor r5, r5, r5
Instruction{0x7c, 0xa5, 0x2a, 0x78}, Instruction{0x7c, 0xa5, 0x2a, 0x78},
ADDI(R5, R5, uint16(len(rootCert))), ADDI(R5, R5, uint16(len(rootCertificate))),
// r3 is the first parameter of SSLSetRootCA, the ssl_fd. // r3 is the first parameter of SSLSetRootCA, the ssl_fd.
// We load it exactly as Nintendo does. // We load it exactly as Nintendo does.