From e9d0c566cf67ea85af5f194e62b51da183cc37b4 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 3 Nov 2015 19:55:40 -0800 Subject: [PATCH] Fix insert not adjusting overall file size Indirectly fixes pk3DS's TitleScreen loading bug where not enough data is returned. --- pk3DS/3DS/DARC.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pk3DS/3DS/DARC.cs b/pk3DS/3DS/DARC.cs index 70d0d76..eb0d1f1 100644 --- a/pk3DS/3DS/DARC.cs +++ b/pk3DS/3DS/DARC.cs @@ -338,7 +338,8 @@ internal static bool insertFile(ref DARC orig, int index, byte[] data) // Fix Offset references of other files foreach (var x in orig.Entries.Where(x => x.DataOffset >= offset + oldLength)) x.DataOffset += (uint) diff; - orig.Entries[index].DataLength = (uint)data.Length; + orig.Entries[index].DataLength = (uint)data.Length; + orig.Header.FileSize += (uint)diff; return true; } catch (Exception) { return false; }