Skip to content

Commit

Permalink
log: print archive name/dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenkai committed Aug 21, 2024
1 parent 7cd99f9 commit a64d861
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FF16PackLib.CLI/FF16PackLib.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.1.0</FileVersion>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions FF16PackLib.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ static void PackFiles(PackVerbs verbs)
public static void DumpPack(FF16Pack pack)
{
Console.WriteLine($"Pack Info:");
Console.WriteLine($"- Internal Archive Name/Dir: {(string.IsNullOrEmpty(pack.ArchiveDir) ? "(none)" : pack.ArchiveDir)}");
Console.WriteLine($"- Num Files: {pack.GetNumFiles()}");
Console.WriteLine($"- Chunks: {pack.GetNumChunks()}");
Console.WriteLine($"- Header Encryption: {pack.HeaderEncrypted}");
Expand Down
3 changes: 3 additions & 0 deletions FF16PackLib/FF16Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class FF16Pack : IDisposable
public const int MAX_DECOMPRESSED_SHARED_CHUNK_SIZE = 0x400000;
public const int MAX_DECOMPRESSED_MULTI_CHUNK_SIZE = 0x80000;

public string ArchiveDir { get; private set; }
public bool HeaderEncrypted { get; set; }
public bool UseChunks { get; set; }

Expand Down Expand Up @@ -79,6 +80,8 @@ public static FF16Pack Open(string path)
if (pack.HeaderEncrypted)
XorEncrypt.CryptHeaderPart(header.AsSpan(0x18, 0x100));

pack.ArchiveDir = Encoding.UTF8.GetString(header.AsSpan(0x18, 0x100)).TrimEnd('\0');

bs.Position = 0x118;
ulong chunksTableOffset = bs.ReadUInt64();
ulong stringsOffset = bs.ReadUInt64();
Expand Down

0 comments on commit a64d861

Please sign in to comment.