From 0e3958a0f7f1914532d59360e6d9d25b2772d654 Mon Sep 17 00:00:00 2001 From: Gericom Date: Wed, 21 Jan 2015 18:56:01 +0100 Subject: [PATCH] Support for BE Sarc Files (not tested yet) --- 3DS/3DS.csproj | 3 +++ 3DS/SARC.cs | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/3DS/3DS.csproj b/3DS/3DS.csproj index 09b64a5..38cf88a 100644 --- a/3DS/3DS.csproj +++ b/3DS/3DS.csproj @@ -298,6 +298,9 @@ + + + copy "$(TargetPath)" "$(SolutionDir)\EveryFileExplorer\bin\Debug\Plugins\$(TargetFileName)" diff --git a/3DS/SARC.cs b/3DS/SARC.cs index f36102c..70b222c 100644 --- a/3DS/SARC.cs +++ b/3DS/SARC.cs @@ -64,7 +64,7 @@ namespace _3DS { Signature = "SARC"; HeaderSize = 0x14; - Endianness = 0xFEFF; + Endianness = 0xFFFE;//0xFEFF; FileSize = 0; FileDataOffset = 0; Unknown = 0x0100; @@ -77,7 +77,9 @@ namespace _3DS { er.Write(Signature, Encoding.ASCII, false); er.Write(HeaderSize); + er.Endianness = LibEveryFileExplorer.IO.Endianness.BigEndian; er.Write(Endianness); + if (Endianness == 0xFFFE) er.Endianness = LibEveryFileExplorer.IO.Endianness.LittleEndian; er.Write(FileSize); er.Write(FileDataOffset); er.Write(Unknown); @@ -86,7 +88,7 @@ namespace _3DS [BinaryFixedSize(4)] public String Signature; public UInt16 HeaderSize; - //[BinaryBOM(0xFEFF)] + [BinaryBOM(0xFFFE)] public UInt16 Endianness; public UInt32 FileSize; public UInt32 FileDataOffset;