From 8fe87fb4d5262a54013cd6482f1f04a7d19b059e Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sat, 1 Jan 2022 18:57:21 -0600 Subject: [PATCH] Add EC Configuration Path patch --- docs/README.md | 3 ++- docs/patch_ec_cfg_path.md | 31 +++++++++++++++++++++++++++++++ modify_dol.go | 1 + patch_ec_cfg_path.go | 11 +++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 docs/patch_ec_cfg_path.md create mode 100644 patch_ec_cfg_path.go diff --git a/docs/README.md b/docs/README.md index b2f99ca..f30f2f5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,4 +7,5 @@ It does not attempt to handle things such as client certificates or user passwor - [`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. - [`patch_base_domain.md`](patch_base_domain.md): Information about what URLs are present within the main DOL and information about patching them. - - [`patch_ec_title_check.md`](patch_ec_title_check.md): Information about title checks run by EC, and why they were negated. \ No newline at end of file + - [`patch_ec_title_check.md`](patch_ec_title_check.md): Information about title checks run by EC, and why they were negated. + - [`patch_ec_cfg_path.md`](patch_ec_cfg_path.md): An explanation over why the path of `ec.cfg` is changed. \ No newline at end of file diff --git a/docs/patch_ec_cfg_path.md b/docs/patch_ec_cfg_path.md new file mode 100644 index 0000000..790d2af --- /dev/null +++ b/docs/patch_ec_cfg_path.md @@ -0,0 +1,31 @@ +# Patch: Change EC Configuration Path + +## Motivation +We want to store our own custom credentials for the Wii Shop Channel. +Between provisioning tickets, identifying users, and permitting download, this is essential to our operation. + +However, this file likely contains legitimate identifiers to Nintendo's services. We do not want to have users unable to download purchases of any kind should they wish. + +While Nintendo's servers may reprovision credentials as part of syncing, we do not want to risk the possibility of such not occurring for whatever reason. + +## Explanation +The Wii Shop Channel provides a file at `/title/00010002/48414241/data/ec.cfg`. It is utilized by every application that invokes EC - DLC applications, rentals, the Wii Shop, so forth. + +This file contains persistent data, such as the provisioned account ID and device token, utilized for authentication. It additionally persists values such as the last sync time. + +Other identifiers can be set via `ec.getPersistentValue(name)` or `ec.setPersistentValue(name, value)` within [ECommerceInterface](https://docs.oscwii.org/wii-shop-channel/js/ec/ecommerceinterface). + +It is quite important that our changes do not modify or overwrite the user's existing credentials. + +We evaluated several solutions: + - Not using account identifiers, and accepting any existing identifiers that hit our server. + - While most likely possible, it would be nice to not need to do so. Additionally for new clients, credentials we generate will not be accepted by Nintendo later. + - Similar to the above, utilizing our own set of identifiers via the exposed JS APIs with custom value names. + - This would prove complicated for similar reasons to the above. + - Modifying the configuration file's name. + - This is the most concise solution, and was chosen. + +## Execution +We replace the only instance of `ec.cfg` with `osc.cfg`, where OSC refers to the Open Shop Channel. + +A similar change will be necessary for any DLC titles wishing to take advantage of the Open Shop Channel's backend. \ No newline at end of file diff --git a/modify_dol.go b/modify_dol.go index 40e0f34..2749870 100644 --- a/modify_dol.go +++ b/modify_dol.go @@ -94,4 +94,5 @@ func applyDefaultPatches() { applyPatchSet("Load Custom CA within IOS", LoadCustomCA()) applyPatchSet("Change Base Domain", PatchBaseDomain()) applyPatchSet("Negate EC Title Check", NegateECTitle) + applyPatchSet("Change EC Configuration Path", PatchECCfgPath) } diff --git a/patch_ec_cfg_path.go b/patch_ec_cfg_path.go new file mode 100644 index 0000000..7ec2e1a --- /dev/null +++ b/patch_ec_cfg_path.go @@ -0,0 +1,11 @@ +package main + +var PatchECCfgPath = PatchSet{ + Patch{ + Name: "Change EC Configuration Path", + AtOffset: 3319968, + + Before: []byte("ec.cfg\x00\x00"), + After: []byte("osc.cfg\x00"), + }, +}