mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-15 05:45:05 +00:00
Formatting cleanup
This commit is contained in:
@@ -12,4 +12,4 @@ namespace SabreTools.Data.Models.InstallShieldExecutable
|
||||
/// </summary>
|
||||
public const string ISSetupSignatureString = "ISSetupStream";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace SabreTools.Data.Models.InstallShieldExecutable
|
||||
/// Length of the file. Stored in the installshield executable as a string.
|
||||
/// </summary>
|
||||
public ulong Length { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Offset of the file.
|
||||
/// </summary>
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace SabreTools.Serialization.Readers
|
||||
try
|
||||
{
|
||||
var sfx = new SFX();
|
||||
|
||||
|
||||
// Cache the initial offset
|
||||
long initialOffset = data.Position;
|
||||
|
||||
var sfxList = new List<FileEntry>();
|
||||
|
||||
|
||||
while (data.Position < data.Length)
|
||||
{
|
||||
// Try to parse the entry
|
||||
@@ -38,10 +38,10 @@ namespace SabreTools.Serialization.Readers
|
||||
data.SeekIfPossible(length, SeekOrigin.Current);
|
||||
sfxList.Add(fileEntry);
|
||||
}
|
||||
|
||||
|
||||
if (sfxList.Count == 0)
|
||||
return null;
|
||||
|
||||
|
||||
sfx.Entries = [.. sfxList];
|
||||
return sfx;
|
||||
}
|
||||
@@ -62,14 +62,14 @@ namespace SabreTools.Serialization.Readers
|
||||
string? name = data.ReadNullTerminatedAnsiString();
|
||||
if (name == null)
|
||||
return null;
|
||||
|
||||
|
||||
// Both of these strings indicate that this is a different kind of encrypted and/or compressed format of
|
||||
// ISEXE that is not yet supported, but will be in the future.
|
||||
// ISEXE that is not yet supported, but will be in the future.
|
||||
// They return early because no extraction can be performed, like how MsCab currently returns if a folder
|
||||
// is LZX or Quantum.
|
||||
if (name == ISSignatureString)
|
||||
return null;
|
||||
|
||||
|
||||
if (name == ISSetupSignatureString)
|
||||
return null;
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace SabreTools.Serialization.Readers
|
||||
obj.Version = version;
|
||||
obj.Length = lengthValue;
|
||||
obj.Offset = data.Position - initialOffset;
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace SabreTools.Serialization.Wrappers
|
||||
{
|
||||
var entry = Entries[i];
|
||||
_dataSource.SeekIfPossible(entry.Offset, SeekOrigin.Begin);
|
||||
|
||||
|
||||
// Get the length, and make sure it won't EOF
|
||||
long length = (long)entry.Length;
|
||||
if (length > _dataSource.Length - _dataSource.Position)
|
||||
break;
|
||||
|
||||
|
||||
// Ensure directory separators are consistent
|
||||
var filename = entry.Path.TrimEnd('\0');
|
||||
if (Path.DirectorySeparatorChar == '\\')
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
|
||||
/// <inheritdoc cref="SFX.FileEntry"/>
|
||||
public FileEntry[] Entries => Model.Entries;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
@@ -539,7 +539,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
// Attempt to extract package
|
||||
return MatroschkaPackage.Extract(outputDirectory, includeDebug);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Extract data from an Installshield Executable
|
||||
/// </summary>
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
} = null;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// InstallShield Executable wrapper, if it exists
|
||||
/// </summary>
|
||||
@@ -289,7 +289,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
_installshieldExecutableFailed = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// Parse the package
|
||||
lock (_dataSourceLock)
|
||||
{
|
||||
@@ -1087,7 +1087,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
/// Cached attempt at creation for <see cref="InstallShieldExecutable"/>
|
||||
/// </summary>
|
||||
private bool _installshieldExecutableFailed = false;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Lock object for <see cref="MatroschkaPackage"/>
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user