diff --git a/common/writer.go b/common/writer.go index 06c22b6..ad45120 100644 --- a/common/writer.go +++ b/common/writer.go @@ -36,9 +36,10 @@ func Write(data Writable, path string) error { return err } - for len(writer.compressedData)%16 != 0 { + for len(writer.compressedData)%aes.BlockSize != 0 { writer.compressedData = append(writer.compressedData, 0) } + err = writer.Encrypt() if err != nil { return err diff --git a/go.mod b/go.mod index a4ac115..2269bac 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/WiiLink24/MiiContestChannel go 1.19 -require github.com/wii-tools/lzx v0.0.0-20221114001118-aaec5e424e43 +require github.com/wii-tools/lzx v0.0.0-20231115152519-4c1183c96cc6 require ( github.com/jackc/chunkreader/v2 v2.0.1 // indirect diff --git a/go.sum b/go.sum index 6938e47..95c1d33 100644 --- a/go.sum +++ b/go.sum @@ -105,6 +105,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/wii-tools/lzx v0.0.0-20221114001118-aaec5e424e43 h1:woCmRIngzz1fcUDj+1at7h9EW1Os8SK0tbOh4WEoyPQ= github.com/wii-tools/lzx v0.0.0-20221114001118-aaec5e424e43/go.mod h1:ufCQJfNwbD5fkg6jHpw69vc5opbc42TePvnloMFYbmY= +github.com/wii-tools/lzx v0.0.0-20231115152519-4c1183c96cc6 h1:2MzrLuFyqZDmzyglEC09bYZnj3EKW9vkUjVRsBGEWno= +github.com/wii-tools/lzx v0.0.0-20231115152519-4c1183c96cc6/go.mod h1:ufCQJfNwbD5fkg6jHpw69vc5opbc42TePvnloMFYbmY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=