mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-05 05:37:44 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3f3f12b3e | ||
|
|
b41700ff92 | ||
|
|
e8a357546b | ||
|
|
68f0201c11 | ||
|
|
25b6493249 | ||
|
|
a551363c0b | ||
|
|
2fd92aea8f | ||
|
|
a61b3d0ed9 |
43
.github/workflows/build_nupkg.yml
vendored
Normal file
43
.github/workflows/build_nupkg.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Nuget Pack
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Pack
|
||||
run: dotnet pack
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: 'bin/Release/*.nupkg'
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: 'bin/Release/*.nupkg'
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
replacesArtifacts: True
|
||||
tag: "rolling"
|
||||
updateOnlyUnreleased: True
|
||||
17
.github/workflows/check_pr.yml
vendored
Normal file
17
.github/workflows/check_pr.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Build PR
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
|
||||
- name: Build
|
||||
run: dotnet build
|
||||
21
InstallShieldArchiveV3/Archive.cs
Normal file
21
InstallShieldArchiveV3/Archive.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.cpp"/>
|
||||
public class Archive
|
||||
{
|
||||
/// <summary>
|
||||
/// Archive header information
|
||||
/// </summary>
|
||||
public Header? Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directories found in the archive
|
||||
/// </summary>
|
||||
public Directory[]? Directories { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Files found in the archive
|
||||
/// </summary>
|
||||
public File[]? Files { get; set; }
|
||||
}
|
||||
}
|
||||
10
InstallShieldArchiveV3/Directory.cs
Normal file
10
InstallShieldArchiveV3/Directory.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.cpp"/>
|
||||
public class Directory
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
|
||||
public ushort FileCount { get; set; }
|
||||
}
|
||||
}
|
||||
11
InstallShieldArchiveV3/Enums.cs
Normal file
11
InstallShieldArchiveV3/Enums.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
public enum Attributes : byte
|
||||
{
|
||||
READONLY = 0x01,
|
||||
HIDDEN = 0x02,
|
||||
SYSTEM = 0x04,
|
||||
UNCOMPRESSED = 0x10,
|
||||
ARCHIVE = 0x20,
|
||||
}
|
||||
}
|
||||
32
InstallShieldArchiveV3/File.cs
Normal file
32
InstallShieldArchiveV3/File.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
|
||||
public class File
|
||||
{
|
||||
public byte VolumeEnd { get; set; }
|
||||
|
||||
public ushort Index { get; set; }
|
||||
|
||||
public uint UncompressedSize { get; set; }
|
||||
|
||||
public uint CompressedSize { get; set; }
|
||||
|
||||
public uint Offset { get; set; }
|
||||
|
||||
public uint DateTime { get; set; }
|
||||
|
||||
public uint Reserved0 { get; set; }
|
||||
|
||||
public ushort ChunkSize { get; set; }
|
||||
|
||||
public Attributes Attrib { get; set; }
|
||||
|
||||
public byte IsSplit { get; set; }
|
||||
|
||||
public byte Reserved1 { get; set; }
|
||||
|
||||
public byte VolumeStart { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
}
|
||||
50
InstallShieldArchiveV3/Header.cs
Normal file
50
InstallShieldArchiveV3/Header.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
|
||||
public class Header
|
||||
{
|
||||
public uint Signature1 { get; set; }
|
||||
|
||||
public uint Signature2 { get; set; }
|
||||
|
||||
public ushort Reserved0 { get; set; }
|
||||
|
||||
public ushort IsMultivolume { get; set; }
|
||||
|
||||
public ushort FileCount { get; set; }
|
||||
|
||||
public uint DateTime { get; set; }
|
||||
|
||||
public uint CompressedSize { get; set; }
|
||||
|
||||
public uint UncompressedSize { get; set; }
|
||||
|
||||
public uint Reserved1 { get; set; }
|
||||
|
||||
/// <remarks>
|
||||
/// Set in first vol only, zero in subsequent vols
|
||||
/// </remarks>
|
||||
public byte VolumeTotal { get; set; }
|
||||
|
||||
/// <remarks>
|
||||
/// [1...n]
|
||||
/// </remarks>
|
||||
public byte VolumeNumber { get; set; }
|
||||
|
||||
public byte Reserved2 { get; set; }
|
||||
|
||||
public uint SplitBeginAddress { get; set; }
|
||||
|
||||
public uint SplitEndAddress { get; set; }
|
||||
|
||||
public uint TocAddress { get; set; }
|
||||
|
||||
public uint Reserved3 { get; set; }
|
||||
|
||||
public ushort DirCount { get; set; }
|
||||
|
||||
public uint Reserved4 { get; set; }
|
||||
|
||||
public uint Reserved5 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -126,11 +126,11 @@ namespace SabreTools.Models.Metadata
|
||||
|
||||
string? asString = Read<string>(key);
|
||||
if (asString != null)
|
||||
return new string[] { asString };
|
||||
return [asString];
|
||||
|
||||
asString = this[key]!.ToString();
|
||||
if (asString != null)
|
||||
return new string[] { asString };
|
||||
return [asString];
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ namespace SabreTools.Models.Metadata
|
||||
/// </summary>
|
||||
private bool ValidateKey(string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(key))
|
||||
if (string.IsNullOrEmpty(key))
|
||||
return false;
|
||||
else if (!ContainsKey(key))
|
||||
return false;
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Assembly Properties -->
|
||||
<TargetFrameworks>net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.2.0</Version>
|
||||
<Version>1.3.0</Version>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
<Description>Common models used by other SabreTools projects</Description>
|
||||
<Copyright>Copyright (c) Matt Nadareski 2022-2023</Copyright>
|
||||
<Copyright>Copyright (c) Matt Nadareski 2022-2024</Copyright>
|
||||
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Models</RepositoryUrl>
|
||||
@@ -22,10 +22,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="README.md" Pack="true" PackagePath=""/>
|
||||
<None Include="README.md" Pack="true" PackagePath="" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Support for old .NET versions -->
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))">
|
||||
<PackageReference Include="MinValueTupleBridge" Version="0.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net4`))">
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
13
SafeDisc/Constants.cs
Normal file
13
SafeDisc/Constants.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SabreTools.Models.SafeDisc
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const uint EncryptedFileEntrySignature1 = 0xA8726B03;
|
||||
|
||||
public const uint EncryptedFileEntrySignature2 = 0xEF01996C;
|
||||
}
|
||||
}
|
||||
31
SafeDisc/EncryptedFileEntry.cs
Normal file
31
SafeDisc/EncryptedFileEntry.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace SabreTools.Models.SafeDisc
|
||||
{
|
||||
/// <see href="http://blog.w4kfu.com/tag/safedisc"/>
|
||||
public class EncryptedFileEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// 0xA8726B03
|
||||
/// </summary>
|
||||
public uint Signature1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 0xEF01996C
|
||||
/// </summary>
|
||||
public uint Signature2 { get; set; }
|
||||
|
||||
public uint FileNumber { get; set; }
|
||||
|
||||
public uint Offset1 { get; set; }
|
||||
|
||||
public uint Offset2 { get; set; }
|
||||
|
||||
public uint Unknown1 { get; set; }
|
||||
|
||||
public uint Unknown2 { get; set; }
|
||||
|
||||
/// <remarks>
|
||||
/// 0x0D bytes
|
||||
/// </remarks>
|
||||
public byte[]? Name { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user