mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-20 15:55:15 +00:00
Port GCF to new printing
This commit is contained in:
@@ -791,563 +791,10 @@ namespace BinaryObjectScanner.Wrappers
|
||||
public override StringBuilder PrettyPrint()
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.AppendLine("GCF Information:");
|
||||
builder.AppendLine("-------------------------");
|
||||
builder.AppendLine();
|
||||
|
||||
// Header
|
||||
PrintHeader(builder);
|
||||
|
||||
// Block Entries
|
||||
PrintBlockEntryHeader(builder);
|
||||
PrintBlockEntries(builder);
|
||||
|
||||
// Fragmentation Maps
|
||||
PrintFragmentationMapHeader(builder);
|
||||
PrintFragmentationMaps(builder);
|
||||
|
||||
// Block Entry Maps
|
||||
PrintBlockEntryMapHeader(builder);
|
||||
PrintBlockEntryMaps(builder);
|
||||
|
||||
// Directory and Directory Maps
|
||||
PrintDirectoryHeader(builder);
|
||||
PrintDirectoryEntries(builder);
|
||||
// TODO: Should we print out the entire string table?
|
||||
PrintDirectoryInfo1Entries(builder);
|
||||
PrintDirectoryInfo2Entries(builder);
|
||||
PrintDirectoryCopyEntries(builder);
|
||||
PrintDirectoryLocalEntries(builder);
|
||||
PrintDirectoryMapHeader(builder);
|
||||
PrintDirectoryMapEntries(builder);
|
||||
|
||||
// Checksums and Checksum Maps
|
||||
PrintChecksumHeader(builder);
|
||||
PrintChecksumMapHeader(builder);
|
||||
PrintChecksumMapEntries(builder);
|
||||
PrintChecksumEntries(builder);
|
||||
|
||||
// Data Blocks
|
||||
PrintDataBlockHeader(builder);
|
||||
|
||||
Printing.GCF.Print(builder, _model);
|
||||
return builder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
builder.AppendLine($" Dummy 0: {Dummy0} (0x{Dummy0:X})");
|
||||
builder.AppendLine($" Major version: {MajorVersion} (0x{MajorVersion:X})");
|
||||
builder.AppendLine($" Minor version: {MinorVersion} (0x{MinorVersion:X})");
|
||||
builder.AppendLine($" Cache ID: {CacheID} (0x{CacheID:X})");
|
||||
builder.AppendLine($" Last version played: {LastVersionPlayed} (0x{LastVersionPlayed:X})");
|
||||
builder.AppendLine($" Dummy 1: {Dummy1} (0x{Dummy1:X})");
|
||||
builder.AppendLine($" Dummy 2: {Dummy2} (0x{Dummy2:X})");
|
||||
builder.AppendLine($" File size: {FileSize} (0x{FileSize:X})");
|
||||
builder.AppendLine($" Block size: {BlockSize} (0x{BlockSize:X})");
|
||||
builder.AppendLine($" Block count: {BlockCount} (0x{BlockCount:X})");
|
||||
builder.AppendLine($" Dummy 3: {Dummy3} (0x{Dummy3:X})");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print block entry header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintBlockEntryHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Block Entry Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
builder.AppendLine($" Block count: {BEH_BlockCount} (0x{BEH_BlockCount:X})");
|
||||
builder.AppendLine($" Blocks used: {BEH_BlocksUsed} (0x{BEH_BlocksUsed:X})");
|
||||
builder.AppendLine($" Dummy 0: {BEH_Dummy0} (0x{BEH_Dummy0:X})");
|
||||
builder.AppendLine($" Dummy 1: {BEH_Dummy1} (0x{BEH_Dummy1:X})");
|
||||
builder.AppendLine($" Dummy 2: {BEH_Dummy2} (0x{BEH_Dummy2:X})");
|
||||
builder.AppendLine($" Dummy 3: {BEH_Dummy3} (0x{BEH_Dummy3:X})");
|
||||
builder.AppendLine($" Dummy 4: {BEH_Dummy4} (0x{BEH_Dummy4:X})");
|
||||
builder.AppendLine($" Checksum: {BEH_Checksum} (0x{BEH_Checksum:X})");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print block entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintBlockEntries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Block Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (BlockEntries == null || BlockEntries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No block entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < BlockEntries.Length; i++)
|
||||
{
|
||||
var blockEntry = BlockEntries[i];
|
||||
builder.AppendLine($" Block Entry {i}");
|
||||
if (blockEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Entry flags: {blockEntry.EntryFlags} (0x{blockEntry.EntryFlags:X})");
|
||||
builder.AppendLine($" File data offset: {blockEntry.FileDataOffset} (0x{blockEntry.FileDataOffset:X})");
|
||||
builder.AppendLine($" File data size: {blockEntry.FileDataSize} (0x{blockEntry.FileDataSize:X})");
|
||||
builder.AppendLine($" First data block index: {blockEntry.FirstDataBlockIndex} (0x{blockEntry.FirstDataBlockIndex:X})");
|
||||
builder.AppendLine($" Next block entry index: {blockEntry.NextBlockEntryIndex} (0x{blockEntry.NextBlockEntryIndex:X})");
|
||||
builder.AppendLine($" Previous block entry index: {blockEntry.PreviousBlockEntryIndex} (0x{blockEntry.PreviousBlockEntryIndex:X})");
|
||||
builder.AppendLine($" Directory index: {blockEntry.DirectoryIndex} (0x{blockEntry.DirectoryIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print fragmentation map header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintFragmentationMapHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Fragmentation Map Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
builder.AppendLine($" Block count: {FMH_BlockCount} (0x{FMH_BlockCount:X})");
|
||||
builder.AppendLine($" First unused entry: {FMH_FirstUnusedEntry} (0x{FMH_FirstUnusedEntry:X})");
|
||||
builder.AppendLine($" Terminator: {FMH_Terminator} (0x{FMH_Terminator:X})");
|
||||
builder.AppendLine($" Checksum: {FMH_Checksum} (0x{FMH_Checksum:X})");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print fragmentation maps information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintFragmentationMaps(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Fragmentation Maps Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (FragmentationMaps == null || FragmentationMaps.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No fragmentation maps");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < FragmentationMaps.Length; i++)
|
||||
{
|
||||
var fragmentationMap = FragmentationMaps[i];
|
||||
builder.AppendLine($" Fragmentation Map {i}");
|
||||
if (fragmentationMap == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Next data block index: {fragmentationMap.NextDataBlockIndex} (0x{fragmentationMap.NextDataBlockIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print block entry map header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintBlockEntryMapHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Block Entry Map Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (_model.BlockEntryMapHeader == null)
|
||||
{
|
||||
builder.AppendLine($" No block entry map header");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine($" Block count: {BEMH_BlockCount} (0x{BEMH_BlockCount:X})");
|
||||
builder.AppendLine($" First block entry index: {BEMH_FirstBlockEntryIndex} (0x{BEMH_FirstBlockEntryIndex:X})");
|
||||
builder.AppendLine($" Last block entry index: {BEMH_LastBlockEntryIndex} (0x{BEMH_LastBlockEntryIndex:X})");
|
||||
builder.AppendLine($" Dummy 0: {BEMH_Dummy0} (0x{BEMH_Dummy0:X})");
|
||||
builder.AppendLine($" Checksum: {BEMH_Checksum} (0x{BEMH_Checksum:X})");
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print block entry maps information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintBlockEntryMaps(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Block Entry Maps Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (BlockEntryMaps == null || BlockEntryMaps.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No block entry maps");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < BlockEntryMaps.Length; i++)
|
||||
{
|
||||
var blockEntryMap = BlockEntryMaps[i];
|
||||
builder.AppendLine($" Block Entry Map {i}");
|
||||
if (blockEntryMap == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Previous data block index: {blockEntryMap.PreviousBlockEntryIndex} (0x{blockEntryMap.PreviousBlockEntryIndex:X})");
|
||||
builder.AppendLine($" Next data block index: {blockEntryMap.NextBlockEntryIndex} (0x{blockEntryMap.NextBlockEntryIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
builder.AppendLine($" Dummy 0: {DH_Dummy0} (0x{DH_Dummy0:X})");
|
||||
builder.AppendLine($" Cache ID: {DH_CacheID} (0x{DH_CacheID:X})");
|
||||
builder.AppendLine($" Last version played: {DH_LastVersionPlayed} (0x{DH_LastVersionPlayed:X})");
|
||||
builder.AppendLine($" Item count: {DH_ItemCount} (0x{DH_ItemCount:X})");
|
||||
builder.AppendLine($" File count: {DH_FileCount} (0x{DH_FileCount:X})");
|
||||
builder.AppendLine($" Dummy 1: {DH_Dummy1} (0x{DH_Dummy1:X})");
|
||||
builder.AppendLine($" Directory size: {DH_DirectorySize} (0x{DH_DirectorySize:X})");
|
||||
builder.AppendLine($" Name size: {DH_NameSize} (0x{DH_NameSize:X})");
|
||||
builder.AppendLine($" Info 1 count: {DH_Info1Count} (0x{DH_Info1Count:X})");
|
||||
builder.AppendLine($" Copy count: {DH_CopyCount} (0x{DH_CopyCount:X})");
|
||||
builder.AppendLine($" Local count: {DH_LocalCount} (0x{DH_LocalCount:X})");
|
||||
builder.AppendLine($" Dummy 2: {DH_Dummy2} (0x{DH_Dummy2:X})");
|
||||
builder.AppendLine($" Dummy 3: {DH_Dummy3} (0x{DH_Dummy3:X})");
|
||||
builder.AppendLine($" Checksum: {DH_Checksum} (0x{DH_Checksum:X})");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryEntries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (DirectoryEntries == null || DirectoryEntries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No directory entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < DirectoryEntries.Length; i++)
|
||||
{
|
||||
var directoryEntry = DirectoryEntries[i];
|
||||
builder.AppendLine($" Directory Entry {i}");
|
||||
if (directoryEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Name offset: {directoryEntry.NameOffset} (0x{directoryEntry.NameOffset:X})");
|
||||
builder.AppendLine($" Name: {directoryEntry.Name ?? "[NULL]"}");
|
||||
builder.AppendLine($" Item size: {directoryEntry.ItemSize} (0x{directoryEntry.ItemSize:X})");
|
||||
builder.AppendLine($" Checksum index: {directoryEntry.ChecksumIndex} (0x{directoryEntry.ChecksumIndex:X})");
|
||||
builder.AppendLine($" Directory flags: {directoryEntry.DirectoryFlags} (0x{directoryEntry.DirectoryFlags:X})");
|
||||
builder.AppendLine($" Parent index: {directoryEntry.ParentIndex} (0x{directoryEntry.ParentIndex:X})");
|
||||
builder.AppendLine($" Next index: {directoryEntry.NextIndex} (0x{directoryEntry.NextIndex:X})");
|
||||
builder.AppendLine($" First index: {directoryEntry.FirstIndex} (0x{directoryEntry.FirstIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory info 1 entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryInfo1Entries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Info 1 Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (DirectoryInfo1Entries == null || DirectoryInfo1Entries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No directory info 1 entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < DirectoryInfo1Entries.Length; i++)
|
||||
{
|
||||
var directoryInfoEntry = DirectoryInfo1Entries[i];
|
||||
builder.AppendLine($" Directory Info 1 Entry {i}");
|
||||
if (directoryInfoEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Dummy 0: {directoryInfoEntry.Dummy0} (0x{directoryInfoEntry.Dummy0:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory info 2 entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryInfo2Entries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Info 2 Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (DirectoryInfo2Entries == null || DirectoryInfo2Entries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No directory info 2 entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < DirectoryInfo2Entries.Length; i++)
|
||||
{
|
||||
var directoryInfoEntry = DirectoryInfo2Entries[i];
|
||||
builder.AppendLine($" Directory Info 2 Entry {i}");
|
||||
if (directoryInfoEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Dummy 0: {directoryInfoEntry.Dummy0} (0x{directoryInfoEntry.Dummy0:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory copy entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryCopyEntries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Copy Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (DirectoryCopyEntries == null || DirectoryCopyEntries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No directory copy entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < DirectoryCopyEntries.Length; i++)
|
||||
{
|
||||
var directoryCopyEntry = DirectoryCopyEntries[i];
|
||||
builder.AppendLine($" Directory Copy Entry {i}");
|
||||
if (directoryCopyEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Directory index: {directoryCopyEntry.DirectoryIndex} (0x{directoryCopyEntry.DirectoryIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory local entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryLocalEntries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Local Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (DirectoryLocalEntries == null || DirectoryLocalEntries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No directory local entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < DirectoryLocalEntries.Length; i++)
|
||||
{
|
||||
var directoryLocalEntry = DirectoryLocalEntries[i];
|
||||
builder.AppendLine($" Directory Local Entry {i}");
|
||||
if (directoryLocalEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Directory index: {directoryLocalEntry.DirectoryIndex} (0x{directoryLocalEntry.DirectoryIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory map header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryMapHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Map Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (_model.DirectoryMapHeader == null)
|
||||
{
|
||||
builder.AppendLine($" No directory map header");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine($" Dummy 0: {DMH_Dummy0} (0x{DMH_Dummy0:X})");
|
||||
builder.AppendLine($" Dummy 1: {DMH_Dummy1} (0x{DMH_Dummy1:X})");
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print directory map entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDirectoryMapEntries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Directory Map Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (DirectoryMapEntries == null || DirectoryMapEntries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No directory map entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < DirectoryMapEntries.Length; i++)
|
||||
{
|
||||
var directoryMapEntry = DirectoryMapEntries[i];
|
||||
builder.AppendLine($" Directory Map Entry {i}");
|
||||
if (directoryMapEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" First block index: {directoryMapEntry.FirstBlockIndex} (0x{directoryMapEntry.FirstBlockIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print checksum header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintChecksumHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Checksum Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
builder.AppendLine($" Dummy 0: {CH_Dummy0} (0x{CH_Dummy0:X})");
|
||||
builder.AppendLine($" Checksum size: {CH_ChecksumSize} (0x{CH_ChecksumSize:X})");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print checksum map header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintChecksumMapHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Checksum Map Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
builder.AppendLine($" Dummy 0: {CMH_Dummy0} (0x{CMH_Dummy0:X})");
|
||||
builder.AppendLine($" Dummy 1: {CMH_Dummy1} (0x{CMH_Dummy1:X})");
|
||||
builder.AppendLine($" Item count: {CMH_ItemCount} (0x{CMH_ItemCount:X})");
|
||||
builder.AppendLine($" Checksum count: {CMH_ChecksumCount} (0x{CMH_ChecksumCount:X})");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print checksum map entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintChecksumMapEntries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Checksum Map Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (ChecksumMapEntries == null || ChecksumMapEntries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No checksum map entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < ChecksumMapEntries.Length; i++)
|
||||
{
|
||||
var checksumMapEntry = ChecksumMapEntries[i];
|
||||
builder.AppendLine($" Checksum Map Entry {i}");
|
||||
if (checksumMapEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Checksum count: {checksumMapEntry.ChecksumCount} (0x{checksumMapEntry.ChecksumCount:X})");
|
||||
builder.AppendLine($" First checksum index: {checksumMapEntry.FirstChecksumIndex} (0x{checksumMapEntry.FirstChecksumIndex:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print checksum entries information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintChecksumEntries(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Checksum Entries Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (ChecksumEntries == null || ChecksumEntries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No checksum entries");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < ChecksumEntries.Length; i++)
|
||||
{
|
||||
var checksumEntry = ChecksumEntries[i];
|
||||
builder.AppendLine($" Checksum Entry {i}");
|
||||
if (checksumEntry == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Checksum: {checksumEntry.Checksum} (0x{checksumEntry.Checksum:X})");
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print data block header information
|
||||
/// </summary>
|
||||
/// <param name="builder">StringBuilder to append information to</param>
|
||||
private void PrintDataBlockHeader(StringBuilder builder)
|
||||
{
|
||||
builder.AppendLine(" Data Block Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
builder.AppendLine($" Last version played: {DBH_LastVersionPlayed} (0x{DBH_LastVersionPlayed:X})");
|
||||
builder.AppendLine($" Block count: {DBH_BlockCount} (0x{DBH_BlockCount:X})");
|
||||
builder.AppendLine($" Block size: {DBH_BlockSize} (0x{DBH_BlockSize:X})");
|
||||
builder.AppendLine($" First block offset: {DBH_FirstBlockOffset} (0x{DBH_FirstBlockOffset:X})");
|
||||
builder.AppendLine($" Blocks used: {DBH_BlocksUsed} (0x{DBH_BlocksUsed:X})");
|
||||
builder.AppendLine($" Checksum: {DBH_Checksum} (0x{DBH_Checksum:X})");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
Reference in New Issue
Block a user