From 04f03c72d3fd161028f3b8b3c2760c8f35680a10 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Fri, 31 Dec 2021 04:02:28 -0600 Subject: [PATCH] Fully save DOL once patched --- main.go | 6 +++++- modify_arc.go | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a59bde9..9e914cb 100644 --- a/main.go +++ b/main.go @@ -107,7 +107,11 @@ func main() { // Apply all DOL patches fmt.Println(aurora.Green("Applying DOL patches...")) applyDefaultPatches() - + + // Save main DOL + err = originalWad.UpdateContent(1, mainDol) + check(err) + // Load main ARC arcData, err := originalWad.GetContent(2) check(err) diff --git a/modify_arc.go b/modify_arc.go index 9d63fdd..5cc9f32 100644 --- a/modify_arc.go +++ b/modify_arc.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "crypto/x509" "encoding/binary" "fmt" @@ -27,7 +28,9 @@ miip:* [exclude] *`, baseDomain) - file.Write([]byte(filter)) + // Replace UNIX line (LR) returns with that of Windows (CRLF). + output := bytes.ReplaceAll([]byte(filter), []byte("\n"), []byte("\r\n")) + file.Write(output) } // Tag represents a single byte representing a tag's ID.