4 Commits
1.5.7 ... 1.5.8

Author SHA1 Message Date
Matt Nadareski
ab2a12c996 Bump version 2024-12-16 12:10:13 -05:00
Matt Nadareski
362b123661 Allow symbols to be packed 2024-12-16 11:37:18 -05:00
Matt Nadareski
4a8a4746a2 Add big-endian note for PS4 PKG 2024-12-16 11:31:38 -05:00
Deterous
3f368a3be8 Create model for PS4 app.pkg header (#7)
* Create model for PS4 app.pkg header

* Rename PS4 app.pkg class

* Fix typo

* Requested changes

* Add newline
2024-12-15 20:12:06 -05:00
8 changed files with 272 additions and 8 deletions

View File

@@ -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

View File

@@ -14,4 +14,7 @@ jobs:
dotnet-version: 9.0.x
- name: Build
run: dotnet build
run: dotnet build
- name: Run tests
run: dotnet test

View File

@@ -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>

View File

@@ -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(?)

View File

@@ -9,8 +9,7 @@ namespace SabreTools.Models.PlayStation3
/// <summary>
/// "\0PSF"
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[]? Magic;
public uint Magic;
/// <summary>
/// Version

View 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;
}
}

View 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;
}
}

View File

@@ -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>