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

@ -4,4 +4,5 @@ This directory contains documentation about given patches applied.
Contents:
- [`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.
- [`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
## 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.
However, as we use Nintendo's official code, we lack this luxury.

View File

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

View File

@ -4,14 +4,14 @@ package main
// into the IOS trust store for EC usage.
// It is assumed that rootCertificate has been loaded upon invoking this patchset.
// See docs/patch_custom_ca_ios.md for more information.
func LoadCustomCA(rootCert []byte) PatchSet {
func LoadCustomCA() PatchSet {
return PatchSet{
Patch{
Name: "Insert custom CA into free space",
AtOffset: 3037368,
Before: emptyBytes(len(rootCert)),
After: rootCert,
Before: emptyBytes(len(rootCertificate)),
After: rootCertificate,
},
Patch{
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.
// xor r5, r5, r5
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.
// We load it exactly as Nintendo does.