From e4c47582900eb351150d311f6fa8b846ea0dd9d1 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Fri, 31 Dec 2021 02:07:38 -0600 Subject: [PATCH] Minor fixes --- docs/README.md | 3 ++- docs/patch_overwrite_ios.md | 2 +- main.go | 4 +--- patch_custom_ca.go | 8 ++++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/README.md b/docs/README.md index d9dba7b..18f7e06 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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. \ No newline at end of file + - [`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. \ No newline at end of file diff --git a/docs/patch_overwrite_ios.md b/docs/patch_overwrite_ios.md index 3ef0788..4ff2541 100644 --- a/docs/patch_overwrite_ios.md +++ b/docs/patch_overwrite_ios.md @@ -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. diff --git a/main.go b/main.go index 1af8dea..a59bde9 100644 --- a/main.go +++ b/main.go @@ -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) diff --git a/patch_custom_ca.go b/patch_custom_ca.go index e55b3c5..fa47a14 100644 --- a/patch_custom_ca.go +++ b/patch_custom_ca.go @@ -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.