mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-06 05:35:33 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab2a12c996 | ||
|
|
362b123661 | ||
|
|
4a8a4746a2 | ||
|
|
3f368a3be8 |
7
.github/workflows/build_and_test.yml
vendored
7
.github/workflows/build_and_test.yml
vendored
@@ -17,6 +17,9 @@ jobs:
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Run tests
|
||||
run: dotnet test
|
||||
|
||||
- name: Run publish script
|
||||
run: ./publish-nix.sh
|
||||
@@ -25,13 +28,13 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: '*.nupkg'
|
||||
path: "*.nupkg,*.snupkg"
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: '*.nupkg'
|
||||
artifacts: "*.nupkg,*.snupkg"
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
|
||||
5
.github/workflows/check_pr.yml
vendored
5
.github/workflows/check_pr.yml
vendored
@@ -14,4 +14,7 @@ jobs:
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Build
|
||||
run: dotnet build
|
||||
run: dotnet build
|
||||
|
||||
- name: Run tests
|
||||
run: dotnet test
|
||||
|
||||
@@ -4,6 +4,16 @@ namespace SabreTools.Models.PlayStation3
|
||||
/// <see href="https://psdevwiki.com/ps3/PS3_DISC.SFB"/>
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifying bytes for SFO file
|
||||
/// </summary>
|
||||
public const uint SFOMagic = 0x00505346;
|
||||
|
||||
/// <summary>
|
||||
/// Identifying bytes for SFB file
|
||||
/// </summary>
|
||||
public const uint SFBMagic = 0x2E534642;
|
||||
|
||||
#region Hybrid Flags
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -9,8 +9,7 @@ namespace SabreTools.Models.PlayStation3
|
||||
/// <summary>
|
||||
/// ".SFB"
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public byte[]? Magic;
|
||||
public uint Magic;
|
||||
|
||||
/// <summary>
|
||||
/// File version(?)
|
||||
|
||||
@@ -9,8 +9,7 @@ namespace SabreTools.Models.PlayStation3
|
||||
/// <summary>
|
||||
/// "\0PSF"
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public byte[]? Magic;
|
||||
public uint Magic;
|
||||
|
||||
/// <summary>
|
||||
/// Version
|
||||
|
||||
237
SabreTools.Models/PlayStation4/AppPkgHeader.cs
Normal file
237
SabreTools.Models/PlayStation4/AppPkgHeader.cs
Normal file
@@ -0,0 +1,237 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.PlayStation4
|
||||
{
|
||||
/// <see href="https://www.psdevwiki.com/ps4/PKG_files"/>
|
||||
/// <remarks>All numeric values are big-endian</remarks>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class AppPkgHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifying bytes for app.pkg file, "\7FCNT"
|
||||
/// </summary>
|
||||
public uint Magic;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Type
|
||||
/// </summary>
|
||||
public uint Type;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Unknown Field
|
||||
/// </summary>
|
||||
public uint PKGUnknown;
|
||||
|
||||
/// <summary>
|
||||
/// PKG File count
|
||||
/// </summary>
|
||||
public uint FileCount;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Entry count
|
||||
/// </summary>
|
||||
public uint EntryCount;
|
||||
|
||||
/// <summary>
|
||||
/// SC Entry count
|
||||
/// </summary>
|
||||
public ushort SCEntryCount;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Entry count (duplicated)
|
||||
/// </summary>
|
||||
public ushort EntryCount2;
|
||||
|
||||
/// <summary>
|
||||
/// PKG File Table offset
|
||||
/// </summary>
|
||||
public uint TableOffset;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Entry data size
|
||||
/// </summary>
|
||||
public uint EntryDataSize;
|
||||
|
||||
/// <summary>
|
||||
/// Offset of PKG Entries
|
||||
/// </summary>
|
||||
public ulong BodyOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Length of all PKG Entries
|
||||
/// </summary>
|
||||
public ulong BodySize;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Content offset
|
||||
/// </summary>
|
||||
public ulong ContentOffset;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Content size
|
||||
/// </summary>
|
||||
public ulong ContentSize;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Content ID
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x24)]
|
||||
public string? ContentID;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Content Padding (Zeroes)
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC)]
|
||||
public byte[]? ContentZeroes;
|
||||
|
||||
/// <summary>
|
||||
/// PKG DRM Type
|
||||
/// </summary>
|
||||
public uint DRMType;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Content Type
|
||||
/// </summary>
|
||||
public uint ContentType;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Content Flags
|
||||
/// </summary>
|
||||
public uint ContentFlags;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Promote Size
|
||||
/// </summary>
|
||||
public uint PromoteSize;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Version Date
|
||||
/// </summary>
|
||||
public uint VersionDate;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Content Flags
|
||||
/// </summary>
|
||||
public uint VersionHash;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Padding Section 1
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x78)]
|
||||
public byte[]? Zeroes1;
|
||||
|
||||
/// <summary>
|
||||
/// PKG SHA256 for Main Entry 1
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
|
||||
public byte[]? MainEntry1SHA256;
|
||||
|
||||
/// <summary>
|
||||
/// PKG SHA256 for Main Entry 2
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
|
||||
public byte[]? MainEntry2SHA256;
|
||||
|
||||
/// <summary>
|
||||
/// PKG SHA256 for Digest Table
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
|
||||
public byte[]? DigestTableSHA256;
|
||||
|
||||
/// <summary>
|
||||
/// PKG SHA256 for Main Table
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
|
||||
public byte[]? MainTableSHA256;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Padding Section 2
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x280)]
|
||||
public byte[]? Zeroes2;
|
||||
|
||||
/// <summary>
|
||||
/// PFS Unknown Field
|
||||
/// </summary>
|
||||
public uint PFSUnknown;
|
||||
|
||||
/// <summary>
|
||||
/// PFS Image Count
|
||||
/// </summary>
|
||||
public uint PFSImageCount;
|
||||
|
||||
/// <summary>
|
||||
/// PFS Image Flags
|
||||
/// </summary>
|
||||
public ulong PFSImageFlags;
|
||||
|
||||
/// <summary>
|
||||
/// PFS Image Offset
|
||||
/// </summary>
|
||||
public ulong PFSImageOffset;
|
||||
|
||||
/// <summary>
|
||||
/// PFS Image Size
|
||||
/// </summary>
|
||||
public ulong PFSImageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Mount Image Offset
|
||||
/// </summary>
|
||||
public ulong MountImageOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Mount Image Size
|
||||
/// </summary>
|
||||
public ulong MountImageSize;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Size
|
||||
/// </summary>
|
||||
public ulong PKGSize;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Signed Size
|
||||
/// </summary>
|
||||
public uint PKGSignedSize;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Signed Size
|
||||
/// </summary>
|
||||
public uint PKGCacheSize;
|
||||
|
||||
/// <summary>
|
||||
/// SHA256 for PFS Image
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
|
||||
public byte[]? PFSImageSHA256;
|
||||
|
||||
/// <summary>
|
||||
/// SHA256 for PFS Signed
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
|
||||
public byte[]? PFSSignedSHA256;
|
||||
|
||||
/// <summary>
|
||||
/// PFS Split Size nth 0
|
||||
/// </summary>
|
||||
public ulong PFSSplitSize0;
|
||||
|
||||
/// <summary>
|
||||
/// PFS Split Size nth 1
|
||||
/// </summary>
|
||||
public ulong PFSSplitSize1;
|
||||
|
||||
/// <summary>
|
||||
/// PKG Padding Section 3
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xB50)]
|
||||
public byte[]? Zeroes3;
|
||||
|
||||
/// <summary>
|
||||
/// SHA256 for PKG
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
|
||||
public byte[]? PKGSHA256;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/PlayStation4/Constants.cs
Normal file
11
SabreTools.Models/PlayStation4/Constants.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.PlayStation4
|
||||
{
|
||||
/// <see href="https://www.psdevwiki.com/ps4/PKG_files"/>
|
||||
public class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifying bytes for app.pkg file, "\7FCNT"
|
||||
/// </summary>
|
||||
public const uint AppPkgMagic = 0x7F434E54;
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,13 @@
|
||||
<PropertyGroup>
|
||||
<!-- Assembly Properties -->
|
||||
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<NoWarn>CS0618</NoWarn>
|
||||
<Nullable>enable</Nullable>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.5.7</Version>
|
||||
<Version>1.5.8</Version>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
|
||||
Reference in New Issue
Block a user