mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-02-16 22:08:26 +00:00
Fix narc files with no file names
This commit is contained in:
parent
e5a26bb4f1
commit
08ac7084e7
1 changed files with 9 additions and 3 deletions
|
@ -105,9 +105,8 @@ namespace FirstPlugin
|
|||
IsTexturesLoaded = true;
|
||||
foreach (var file in ArchiveFile.Files)
|
||||
{
|
||||
if (Utils.GetExtension(file.FileName) == ".cbntx")
|
||||
if (Utils.GetExtension(file.FileName) == ".ctex")
|
||||
{
|
||||
Console.WriteLine($"Opening cbntx {file.FileName}");
|
||||
file.FileFormat = file.OpenFile();
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +174,9 @@ namespace FirstPlugin
|
|||
List<byte> Data = new List<byte>();
|
||||
for (ushort i = 0; i < header.FATB.FileCount; i++)
|
||||
{
|
||||
FileEntries.Add(new FileEntry(this, names[i])
|
||||
string name = names.Count > i ? names[i] : $"File{i}";
|
||||
|
||||
FileEntries.Add(new FileEntry(this, name)
|
||||
{
|
||||
entry = header.FATB.FileEntries[i],
|
||||
fileImage = header.FIMG,
|
||||
|
@ -314,6 +315,11 @@ namespace FirstPlugin
|
|||
|
||||
reader.ReadSignature(4, "BTNF");
|
||||
Size = reader.ReadUInt32();
|
||||
if (Size == 16)
|
||||
{
|
||||
reader.Seek(8);
|
||||
return;
|
||||
}
|
||||
|
||||
directoryTable.Add(new DirectoryTableEntry(reader));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue