Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4492862051 | ||
|
|
b1cb4bccd4 | ||
|
|
2379e7ef5a | ||
|
|
ce5b610f92 | ||
|
|
048d70b473 | ||
|
|
0761450a8d | ||
|
|
82d53db68f | ||
|
|
f8a9c8515d | ||
|
|
0ef06c36e9 | ||
|
|
c1c25b5f5e | ||
|
|
c175fedbdb | ||
|
|
f7879bf9e8 | ||
|
|
fed9d6ea57 | ||
|
|
41946b6bc5 | ||
|
|
d585c4b534 | ||
|
|
1886e14a9b | ||
|
|
e8f4d88711 | ||
|
|
0dbc483a91 | ||
|
|
b6bb5f0582 | ||
|
|
ea3f6d3f96 | ||
|
|
4aa6aca25e | ||
|
|
a93c727ba2 | ||
|
|
55cab8202d | ||
|
|
1fa7380f06 | ||
|
|
a0acd91a55 | ||
|
|
6edb959e49 | ||
|
|
96b36fcabe | ||
|
|
9d03dbb7b1 | ||
|
|
c7b49d0c80 | ||
|
|
5ce81f9663 | ||
|
|
f74220efea | ||
|
|
6e529f0050 | ||
|
|
b862057123 | ||
|
|
cf19596ea7 | ||
|
|
6af41a9bb3 | ||
|
|
89c23622bd | ||
|
|
8ab6a9d694 | ||
|
|
bc3df52e75 | ||
|
|
23f8dce272 | ||
|
|
8e45432aab | ||
|
|
e9bb0ae00a | ||
|
|
4116c56b7d | ||
|
|
e30ac0961a | ||
|
|
1ef9f06e35 |
@@ -0,0 +1,73 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
project: [IRDKit]
|
||||||
|
runtime: [win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64, osx-arm64]
|
||||||
|
framework: [net8.0]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: 9.0.x
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c Release -p:DebugType=None -p:DebugSymbols=false
|
||||||
|
|
||||||
|
- name: Upload build
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}
|
||||||
|
path: ${{ matrix.project }}/bin/Release/${{ matrix.framework }}/${{ matrix.runtime }}/publish/*
|
||||||
|
|
||||||
|
pack:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
project: [LibIRD]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
|
||||||
|
- name: Setup MSBuild
|
||||||
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
|
- name: Setup NuGet
|
||||||
|
uses: NuGet/setup-nuget@v1
|
||||||
|
with:
|
||||||
|
nuget-version: 'latest'
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: 9.0.x
|
||||||
|
|
||||||
|
- name: Restore NuGet packages
|
||||||
|
run: nuget restore LibIRD/LibIRD.csproj
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: msbuild ${{ matrix.project }}/${{ matrix.project }}.csproj /p:Configuration=Release
|
||||||
|
|
||||||
|
- name: Pack
|
||||||
|
run: dotnet pack ${{ matrix.project }}/${{ matrix.project }}.csproj -c Release -o ./artifacts
|
||||||
|
|
||||||
|
- name: Upload nupkg
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.project }}
|
||||||
|
path: ./artifacts/*.nupkg
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
[submodule "DiscUtils"]
|
[submodule "DiscUtils"]
|
||||||
path = DiscUtils
|
path = LibIRD/DiscUtils
|
||||||
url = https://github.com/Deterous/DiscUtils
|
url = https://github.com/Deterous/DiscUtils
|
||||||
|
|||||||
-1
Submodule DiscUtils deleted from f53a1dab61
+18
-12
@@ -1,21 +1,25 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- Assembly Properties -->
|
<!-- Assembly Properties -->
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackAsTool>true</PackAsTool>
|
<TargetName>irdkit</TargetName>
|
||||||
<ToolCommandName>irdkit</ToolCommandName>
|
<AssemblyName>irdkit</AssemblyName>
|
||||||
<PackageOutputPath>./nupkg</PackageOutputPath>
|
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
|
|
||||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
||||||
|
<CheckEolTargetFramework>false</CheckEolTargetFramework>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||||
<Version>0.3.0</Version>
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||||
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
|
||||||
<!-- Package Properties -->
|
<!-- Package Properties -->
|
||||||
<Authors>Deterous</Authors>
|
<Authors>Deterous</Authors>
|
||||||
<Description>Library for ISO Rebuild Data</Description>
|
<Description>Library for ISO Rebuild Data</Description>
|
||||||
<Copyright>Copyright (c) Deterous 2023</Copyright>
|
<Copyright>Copyright (c) Deterous 2023-2025</Copyright>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
<RepositoryUrl>https://github.com/Deterous/LibIRD</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Deterous/LibIRD</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
@@ -28,11 +32,13 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\LibIRD\LibIRD.csproj" />
|
|
||||||
<ProjectReference Include="..\DiscUtils\Library\DiscUtils.Core\DiscUtils.Core.csproj" />
|
|
||||||
<ProjectReference Include="..\DiscUtils\Library\DiscUtils.Iso9660\DiscUtils.Iso9660.csproj" />
|
|
||||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||||
<PackageReference Include="SabreTools.RedumpLib" Version="1.3.2" />
|
<PackageReference Include="SabreTools.Hashing" Version="1.5.0" />
|
||||||
|
<PackageReference Include="SabreTools.RedumpLib" Version="1.7.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\LibIRD\LibIRD.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+549
-175
File diff suppressed because it is too large
Load Diff
+47
-6
@@ -1,7 +1,48 @@
|
|||||||
## How to use IRDKit
|
# How to use IRDKit
|
||||||
|
|
||||||
IRDKit is a tool that allows direct use of LibIRD functionality from the command line interface. The basic usage is:
|
IRDKit is a tool that allows direct use of LibIRD functionality from the command line interface.
|
||||||
```
|
For full help instructions, run `irdkit help`
|
||||||
irdkit game.iso game.ird
|
|
||||||
```
|
## Creating ISOs
|
||||||
For detailed usage, run `irdkit --help`
|
|
||||||
|
For all options, run `irdkit help create`
|
||||||
|
|
||||||
|
To create an IRD from an ISO, run `irdkit create game.iso`
|
||||||
|
Multiple ISOs can be processed at once with `irdkit create game1.iso game2.iso`
|
||||||
|
Or a whole directory of ISOs can be processed with `irdkit create ./ISO`, or recursively with `irdkit create -r ./ISO`
|
||||||
|
|
||||||
|
The IRD will be created in the same folder as the ISO, with the same filename.
|
||||||
|
A different IRD path and/or filename can be defined with `-o` or `--output=`
|
||||||
|
|
||||||
|
### Key
|
||||||
|
By default, IRDs will be created by pulling keys from redump.org
|
||||||
|
A key can be manually provided with `-k` or `--key=`
|
||||||
|
A key file can be provided with `-f game.key` or `--key-file=`
|
||||||
|
A key from GetKey log file can be used with `-l game.getkey.log` or `--getkey-log=`
|
||||||
|
|
||||||
|
### PIC
|
||||||
|
By default, a PIC will be generated assuming a default layerbreak
|
||||||
|
A layerbreak value can be provided with `-b` or `--layerbreak=`
|
||||||
|
A PIC from a GetKey log file can be used with `-l game.getkey.log` or `--getkey-log=`
|
||||||
|
|
||||||
|
## Printing info
|
||||||
|
|
||||||
|
For all options, run `irdkit help info`
|
||||||
|
|
||||||
|
To print info about an ISO or IRD file, run `irdkit info game.iso` or `irdkit info game.ird`
|
||||||
|
The info can be printed to a file, e.g. `-o out.txt` or `--output=`
|
||||||
|
The info can be formatted as a JSON with `-j` or `--json`
|
||||||
|
To print all info in the IRD use `-a` or `--all`
|
||||||
|
|
||||||
|
## Comparing IRDs
|
||||||
|
|
||||||
|
For all options, run `irdkit help diff`
|
||||||
|
|
||||||
|
To compare two IRDs, run `irdkit diff game1.ird game2.ird`
|
||||||
|
The comparison can be printed to a file, e.g. `-o out.txt` or `--output=`
|
||||||
|
|
||||||
|
## Renaming IRDs
|
||||||
|
|
||||||
|
For all options, run `irdkit help rename`
|
||||||
|
|
||||||
|
To rename an IRD (or folder of IRDs) according to a redump DAT, run `irdkit rename -d redump.dat game.ird`
|
||||||
|
|||||||
+2
-18
@@ -11,16 +11,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.gitattributes = .gitattributes
|
.gitattributes = .gitattributes
|
||||||
.gitignore = .gitignore
|
.gitignore = .gitignore
|
||||||
|
.gitmodules = .gitmodules
|
||||||
LICENSE.txt = LICENSE.txt
|
LICENSE.txt = LICENSE.txt
|
||||||
|
publish-irdkit.ps1 = publish-irdkit.ps1
|
||||||
README.md = README.md
|
README.md = README.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscUtils.Core", "DiscUtils\Library\DiscUtils.Core\DiscUtils.Core.csproj", "{9E71F5CD-887D-4A61-8460-9F7E8F110B46}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscUtils.Iso9660", "DiscUtils\Library\DiscUtils.Iso9660\DiscUtils.Iso9660.csproj", "{9E1EF05F-388B-42C6-A4E7-98BE20C7C8EC}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscUtils.Streams", "DiscUtils\Library\DiscUtils.Streams\DiscUtils.Streams.csproj", "{E8D0B8B0-F165-4FA1-AC7B-194F5F48A5F9}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -35,18 +31,6 @@ Global
|
|||||||
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Release|Any CPU.Build.0 = Release|Any CPU
|
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{9E71F5CD-887D-4A61-8460-9F7E8F110B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{9E71F5CD-887D-4A61-8460-9F7E8F110B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{9E71F5CD-887D-4A61-8460-9F7E8F110B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{9E71F5CD-887D-4A61-8460-9F7E8F110B46}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{9E1EF05F-388B-42C6-A4E7-98BE20C7C8EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{9E1EF05F-388B-42C6-A4E7-98BE20C7C8EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{9E1EF05F-388B-42C6-A4E7-98BE20C7C8EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{9E1EF05F-388B-42C6-A4E7-98BE20C7C8EC}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{E8D0B8B0-F165-4FA1-AC7B-194F5F48A5F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E8D0B8B0-F165-4FA1-AC7B-194F5F48A5F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E8D0B8B0-F165-4FA1-AC7B-194F5F48A5F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E8D0B8B0-F165-4FA1-AC7B-194F5F48A5F9}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Submodule
+1
Submodule LibIRD/DiscUtils added at 445a572137
+804
-323
File diff suppressed because it is too large
Load Diff
+18
-10
@@ -1,17 +1,22 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- Assembly Properties -->
|
<!-- Assembly Properties -->
|
||||||
<TargetFrameworks>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;net9.0</TargetFrameworks>
|
||||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
<CheckEolTargetFramework>false</CheckEolTargetFramework>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||||
<Version>0.3.0</Version>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<PackageOutputPath>../nupkg</PackageOutputPath>
|
||||||
|
|
||||||
|
<!-- Avoid inexact read with 'System.IO.Stream.Read' -->
|
||||||
|
<NoWarn>CA2022</NoWarn>
|
||||||
|
|
||||||
<!-- Package Properties -->
|
<!-- Package Properties -->
|
||||||
<Authors>Deterous</Authors>
|
<Authors>Deterous</Authors>
|
||||||
<Description>Library for ISO Rebuild Data</Description>
|
<Description>Library for ISO Rebuild Data</Description>
|
||||||
<Copyright>Copyright (c) Deterous 2024</Copyright>
|
<Copyright>Copyright (c) Deterous 2023-2025</Copyright>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
<RepositoryUrl>https://github.com/Deterous/LibIRD/</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Deterous/LibIRD/</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
@@ -24,11 +29,14 @@
|
|||||||
<None Include="./README.md" Pack="true" PackagePath="" />
|
<None Include="./README.md" Pack="true" PackagePath="" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!-- Support for old .NET versions -->
|
||||||
|
<ItemGroup Condition="$(TargetFramework.StartsWith(`net2`))">
|
||||||
|
<PackageReference Include="Net30.LinqBridge" Version="1.3.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\DiscUtils\Library\DiscUtils.Core\DiscUtils.Core.csproj" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<ProjectReference Include="..\DiscUtils\Library\DiscUtils.Iso9660\DiscUtils.Iso9660.csproj" />
|
<PackageReference Include="SabreTools.Hashing" Version="1.5.0" />
|
||||||
<ProjectReference Include="..\DiscUtils\Library\DiscUtils.Streams\DiscUtils.Streams.csproj" />
|
|
||||||
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace LibIRD
|
namespace LibIRD
|
||||||
{
|
{
|
||||||
@@ -27,18 +27,14 @@ namespace LibIRD
|
|||||||
/// A field within the PS3_DISC.SFB file
|
/// A field within the PS3_DISC.SFB file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>string Key, string Value</remarks>
|
/// <remarks>string Key, string Value</remarks>
|
||||||
public Dictionary<string, string> Field { get; private set; }
|
public Dictionary<string, string> Field { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor using a PARAM.SFO file path
|
/// Constructor using a PARAM.SFO file path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sfbPath">Full file path to the PS3_DISC.SFB file</param>
|
/// <param name="sfbPath">Full file path to the PS3_DISC.SFB file</param>
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
|
||||||
public PS3_DiscSFB(string sfbPath)
|
public PS3_DiscSFB(string sfbPath)
|
||||||
{
|
{
|
||||||
// Validate file path
|
|
||||||
ArgumentNullException.ThrowIfNull(sfbPath, nameof(sfbPath));
|
|
||||||
|
|
||||||
// Read file as a stream, and parse file
|
// Read file as a stream, and parse file
|
||||||
using FileStream fs = new(sfbPath, FileMode.Open, FileAccess.Read);
|
using FileStream fs = new(sfbPath, FileMode.Open, FileAccess.Read);
|
||||||
Parse(fs);
|
Parse(fs);
|
||||||
@@ -72,7 +68,7 @@ namespace LibIRD
|
|||||||
// Read SFB file version
|
// Read SFB file version
|
||||||
byte[] buf = br.ReadBytes(2);
|
byte[] buf = br.ReadBytes(2);
|
||||||
Array.Reverse(buf);
|
Array.Reverse(buf);
|
||||||
Version = BitConverter.ToUInt16(buf);
|
Version = BitConverter.ToUInt16(buf, 0);
|
||||||
|
|
||||||
// Process all field headers
|
// Process all field headers
|
||||||
sfbStream.Seek(0x20, SeekOrigin.Begin);
|
sfbStream.Seek(0x20, SeekOrigin.Begin);
|
||||||
@@ -142,7 +138,7 @@ namespace LibIRD
|
|||||||
public void PrintJson(string jsonPath = null)
|
public void PrintJson(string jsonPath = null)
|
||||||
{
|
{
|
||||||
// Serialise PS3_Disc.SFB data to a JSON object
|
// Serialise PS3_Disc.SFB data to a JSON object
|
||||||
string json = JsonSerializer.Serialize(Field, new JsonSerializerOptions { WriteIndented = true });
|
string json = JsonConvert.SerializeObject(Field, Formatting.Indented);
|
||||||
|
|
||||||
// If no path given, output to console
|
// If no path given, output to console
|
||||||
if (jsonPath == null)
|
if (jsonPath == null)
|
||||||
|
|||||||
+6
-11
@@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace LibIRD
|
namespace LibIRD
|
||||||
{
|
{
|
||||||
@@ -43,13 +43,8 @@ namespace LibIRD
|
|||||||
/// Constructor using a PARAM.SFO file path
|
/// Constructor using a PARAM.SFO file path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sfoPath">Full file path to the PARAM.SFO file</param>
|
/// <param name="sfoPath">Full file path to the PARAM.SFO file</param>
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
|
||||||
public ParamSFO(string sfoPath)
|
public ParamSFO(string sfoPath)
|
||||||
{
|
{
|
||||||
// Validate file path
|
|
||||||
if (sfoPath == null || sfoPath.Length <= 0)
|
|
||||||
throw new ArgumentNullException(nameof(sfoPath));
|
|
||||||
|
|
||||||
// Read file as a stream, and parse file
|
// Read file as a stream, and parse file
|
||||||
using FileStream fs = new(sfoPath, FileMode.Open, FileAccess.Read);
|
using FileStream fs = new(sfoPath, FileMode.Open, FileAccess.Read);
|
||||||
Parse(fs);
|
Parse(fs);
|
||||||
@@ -103,7 +98,7 @@ namespace LibIRD
|
|||||||
- keyOffset[i];
|
- keyOffset[i];
|
||||||
|
|
||||||
// Read ith key name
|
// Read ith key name
|
||||||
string key = Encoding.ASCII.GetString(br.ReadBytes((int) keyLen)).TrimEnd('\0');
|
string key = Encoding.ASCII.GetString(br.ReadBytes((int)keyLen)).TrimEnd('\0');
|
||||||
|
|
||||||
// Move stream to ith data
|
// Move stream to ith data
|
||||||
sfoStream.Position = dataTableStart + dataOffset[i];
|
sfoStream.Position = dataTableStart + dataOffset[i];
|
||||||
@@ -112,13 +107,13 @@ namespace LibIRD
|
|||||||
Field[key] = dataFormat[i] switch
|
Field[key] = dataFormat[i] switch
|
||||||
{
|
{
|
||||||
// Non-null-terminated UTF-8 String
|
// Non-null-terminated UTF-8 String
|
||||||
0x0004 => Encoding.UTF8.GetString(br.ReadBytes((int) dataLength[i])),
|
0x0004 => Encoding.UTF8.GetString(br.ReadBytes((int)dataLength[i])),
|
||||||
// Null-terminated UTF-8 String
|
// Null-terminated UTF-8 String
|
||||||
0x0204 => Encoding.UTF8.GetString(br.ReadBytes((int) dataLength[i])).TrimEnd('\0'),
|
0x0204 => Encoding.UTF8.GetString(br.ReadBytes((int)dataLength[i])).TrimEnd('\0'),
|
||||||
// Integer
|
// Integer
|
||||||
0x0404 => br.ReadInt32().ToString(),
|
0x0404 => br.ReadInt32().ToString(),
|
||||||
// Unknown data format, assume null-terminated string
|
// Unknown data format, assume null-terminated string
|
||||||
_ => Encoding.UTF8.GetString(br.ReadBytes((int) dataLength[i])).TrimEnd('\0'),
|
_ => Encoding.UTF8.GetString(br.ReadBytes((int)dataLength[i])).TrimEnd('\0'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,7 +161,7 @@ namespace LibIRD
|
|||||||
public void PrintJson(string jsonPath = null)
|
public void PrintJson(string jsonPath = null)
|
||||||
{
|
{
|
||||||
// Serialise PS3_Disc.SFB data to a JSON object
|
// Serialise PS3_Disc.SFB data to a JSON object
|
||||||
string json = JsonSerializer.Serialize(Field, new JsonSerializerOptions { WriteIndented = true });
|
string json = JsonConvert.SerializeObject(Field, Formatting.Indented);
|
||||||
|
|
||||||
// If no path given, output to console
|
// If no path given, output to console
|
||||||
if (jsonPath == null)
|
if (jsonPath == null)
|
||||||
|
|||||||
+69
-112
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Hashing;
|
|
||||||
|
|
||||||
namespace LibIRD
|
namespace LibIRD
|
||||||
{
|
{
|
||||||
@@ -51,15 +50,6 @@ namespace LibIRD
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ReIRD : IRD
|
public class ReIRD : IRD
|
||||||
{
|
{
|
||||||
#region Properties
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ISO file size
|
|
||||||
/// </summary>
|
|
||||||
private long Size { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -67,26 +57,7 @@ namespace LibIRD
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="isoPath">Path to the ISO</param>
|
/// <param name="isoPath">Path to the ISO</param>
|
||||||
/// <param name="getKeyLog">Path to the GetKey log file</param>
|
/// <param name="getKeyLog">Path to the GetKey log file</param>
|
||||||
/// <param name="layerbreak">Layerbreak value, in sectors</param>
|
public ReIRD(string isoPath, string getKeyLog) : base(isoPath, getKeyLog, true) { }
|
||||||
/// <exception cref="InvalidDataException"></exception>
|
|
||||||
public ReIRD(string isoPath, string getKeyLog, long? layerbreak = null) : base(isoPath, getKeyLog, true)
|
|
||||||
{
|
|
||||||
// Generate Unique Identifier using ISO CRC32
|
|
||||||
UID = GenerateUID(isoPath);
|
|
||||||
|
|
||||||
// Determine ISO file size
|
|
||||||
Size = CalculateSize(isoPath);
|
|
||||||
|
|
||||||
// Generate Data 2 using Disc ID
|
|
||||||
DiscID = GenerateID(Size);
|
|
||||||
|
|
||||||
// Generate Disc PIC
|
|
||||||
byte[] pic = GeneratePIC(Size, layerbreak * SectorSize);
|
|
||||||
|
|
||||||
// Check that GetKey log matches expected PIC
|
|
||||||
if (!((ReadOnlySpan<byte>)PIC).SequenceEqual(pic))
|
|
||||||
throw new InvalidDataException("Unexpected PIC in .getkey.log");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor with optional additional region to generate a specific Disc ID
|
/// Constructor with optional additional region to generate a specific Disc ID
|
||||||
@@ -94,23 +65,24 @@ namespace LibIRD
|
|||||||
/// <param name="isoPath">Path to the ISO</param>
|
/// <param name="isoPath">Path to the ISO</param>
|
||||||
/// <param name="key">Disc Key, redump-style (AES encrypted Data 1)</param>
|
/// <param name="key">Disc Key, redump-style (AES encrypted Data 1)</param>
|
||||||
/// <param name="layerbreak">Layerbreak value, in sectors</param>
|
/// <param name="layerbreak">Layerbreak value, in sectors</param>
|
||||||
|
/// <param name="uid">Unique ID, crc32 hash of ISO</param>
|
||||||
/// <param name="region">Disc Region</param>
|
/// <param name="region">Disc Region</param>
|
||||||
public ReIRD(string isoPath, byte[] key, long? layerbreak = null, Region region = Region.NONE) : base()
|
public ReIRD(string isoPath, byte[] key, long? layerbreak = null, uint? uid = null, Region region = Region.NONE) : base()
|
||||||
{
|
{
|
||||||
// Generate Unique Identifier using ISO CRC32
|
// If the ISO CRC32 is provided, use it as the Unique ID
|
||||||
UID = GenerateUID(isoPath);
|
UID = uid == null ? 0x00000000 : (uint)uid;
|
||||||
|
|
||||||
// Determine ISO file size
|
// Determine ISO file size
|
||||||
Size = CalculateSize(isoPath);
|
long size = CalculateSize(isoPath);
|
||||||
|
|
||||||
// Set Disc Key
|
// Set Disc Key
|
||||||
DiscKey = key;
|
DiscKey = key;
|
||||||
|
|
||||||
// Generate Data 2 using Disc ID
|
// Generate Data 2 using Disc ID
|
||||||
DiscID = GenerateID(Size, region);
|
DiscID = GenerateID(size, region);
|
||||||
|
|
||||||
// Generate Disc PIC
|
// Generate Disc PIC
|
||||||
PIC = GeneratePIC(Size, layerbreak * SectorSize);
|
PIC = GeneratePIC(isoPath, size, layerbreak * SectorSize);
|
||||||
|
|
||||||
// Generate IRD fields
|
// Generate IRD fields
|
||||||
GenerateIRD(isoPath, true);
|
GenerateIRD(isoPath, true);
|
||||||
@@ -143,12 +115,13 @@ namespace LibIRD
|
|||||||
/// <param name="layerbreak">Layer break value, byte at which disc layers are split across</param>
|
/// <param name="layerbreak">Layer break value, byte at which disc layers are split across</param>
|
||||||
/// <param name="exactIRD">True to generate a PIC in 3k3y style (0x03 at 115th byte for BD-50 discs)</param>
|
/// <param name="exactIRD">True to generate a PIC in 3k3y style (0x03 at 115th byte for BD-50 discs)</param>
|
||||||
/// <exception cref="ArgumentException"></exception>
|
/// <exception cref="ArgumentException"></exception>
|
||||||
private static byte[] GeneratePIC(long size, long? layerbreak = null, bool exactIRD = false)
|
private static byte[] GeneratePIC(string isoPath, long size, long? layerbreak = null, bool exactIRD = false)
|
||||||
{
|
{
|
||||||
// Validate size
|
// Validate size
|
||||||
if (size <= 0 || (size % SectorSize) != 0)
|
if (size <= 0 || (size % SectorSize) != 0)
|
||||||
throw new ArgumentException("ISO Size in bytes must be a positive integer multiple of 2048", nameof(size));
|
throw new ArgumentException("ISO Size in bytes must be a positive integer multiple of 2048", nameof(size));
|
||||||
// Validate layerbreak
|
|
||||||
|
// Validate provided layerbreak
|
||||||
if (layerbreak != null)
|
if (layerbreak != null)
|
||||||
{
|
{
|
||||||
if (layerbreak <= 0 || (layerbreak >= size))
|
if (layerbreak <= 0 || (layerbreak >= size))
|
||||||
@@ -156,70 +129,78 @@ namespace LibIRD
|
|||||||
if (layerbreak >= 2 * BDLayerSize || layerbreak % SectorSize != 0)
|
if (layerbreak >= 2 * BDLayerSize || layerbreak % SectorSize != 0)
|
||||||
throw new ArgumentException("Unexpected layerbreak value", nameof(size));
|
throw new ArgumentException("Unexpected layerbreak value", nameof(size));
|
||||||
}
|
}
|
||||||
// If layerbreak value was not set, assume it is a non-hybrid disc with default layerbreak
|
else if (size > BDLayerSize)
|
||||||
long layer_break = layerbreak ?? BDLayerSize;
|
{
|
||||||
|
// If no layerbreak provided, ensure ISO is not BD-Video hybrid
|
||||||
|
using FileStream fs = new FileStream(isoPath, FileMode.Open, FileAccess.Read) ?? throw new FileNotFoundException(isoPath);
|
||||||
|
DiscUtils.Iso9660.CDReader reader = new(fs);
|
||||||
|
if (reader.DirectoryExists("\\BDMV"))
|
||||||
|
throw new ArgumentException("Layerbreak must be provided for BD-Video hybrid discs");
|
||||||
|
// Assume disc has default layerbreak
|
||||||
|
layerbreak = BDLayerSize;
|
||||||
|
}
|
||||||
|
|
||||||
// Generate the PIC based on the size and layerbreak of the ISO
|
// Generate the PIC based on the size and layerbreak of the ISO
|
||||||
byte[] pic;
|
byte[] pic;
|
||||||
if (size > BDLayerSize) // if BD-50
|
if (size > BDLayerSize) // if BD-50
|
||||||
{
|
{
|
||||||
// Layer 0 start sector = 0x01000000
|
// Layer 0 start sector = 0x01000000
|
||||||
long l0_start_sector = 1048576;
|
long l0_start_sector = 1048576;
|
||||||
|
|
||||||
// Layer 0 end sector = start sector + layerbreak - 2
|
// Layer 0 end sector = start sector + layerbreak - 2
|
||||||
long l0_end_sector = (layer_break / SectorSize) + l0_start_sector - 2;
|
long l0_end_sector = ((long)layerbreak / SectorSize) + l0_start_sector - 2;
|
||||||
// Convert end sector location to hex values for PIC
|
// Convert end sector location to hex values for PIC
|
||||||
byte[] l0es = [(byte)((l0_end_sector >> 24) & 0xFF),
|
byte[] l0es = [(byte)((l0_end_sector >> 24) & 0xFF),
|
||||||
(byte)((l0_end_sector >> 16) & 0xFF),
|
(byte)((l0_end_sector >> 16) & 0xFF),
|
||||||
(byte)((l0_end_sector >> 8) & 0xFF),
|
(byte)((l0_end_sector >> 8) & 0xFF),
|
||||||
(byte)((l0_end_sector >> 0) & 0xFF)];
|
(byte)((l0_end_sector >> 0) & 0xFF)];
|
||||||
|
|
||||||
// Layer 1 start sector = end of disc (0x01EFFFFE) - layerbreak + 2
|
// Layer 1 start sector = end of disc (0x01EFFFFE) - layerbreak + 2
|
||||||
long l1_start_sector = 32505854 - (layer_break / SectorSize) + 2;
|
long l1_start_sector = 32505854 - ((long)layerbreak! / SectorSize) + 2;
|
||||||
// Convert start of start sector location to hex values for PIC
|
// Convert start of start sector location to hex values for PIC
|
||||||
byte[] l1ss = [(byte)((l1_start_sector >> 24) & 0xFF),
|
byte[] l1ss = [(byte)((l1_start_sector >> 24) & 0xFF),
|
||||||
(byte)((l1_start_sector >> 16) & 0xFF),
|
(byte)((l1_start_sector >> 16) & 0xFF),
|
||||||
(byte)((l1_start_sector >> 8) & 0xFF),
|
(byte)((l1_start_sector >> 8) & 0xFF),
|
||||||
(byte)((l1_start_sector >> 0) & 0xFF)];
|
(byte)((l1_start_sector >> 0) & 0xFF)];
|
||||||
|
|
||||||
// Total sectors used = num_sectors + Layer 0 start + sectors_between_layers (usually 0x01358C00 - 0x00CA73FE - 3)
|
// Total sectors used = num_sectors + Layer 0 start + sectors_between_layers (usually 0x01358C00 - 0x00CA73FE - 3)
|
||||||
long total_sectors = (size / SectorSize) + l0_start_sector + (l1_start_sector - l0_end_sector - 3);
|
long total_sectors = (size / SectorSize) + l0_start_sector + (l1_start_sector - l0_end_sector - 3);
|
||||||
byte[] ts = BitConverter.GetBytes((uint) total_sectors);
|
byte[] ts = BitConverter.GetBytes((uint)total_sectors);
|
||||||
|
|
||||||
// Define the PIC
|
// Define the PIC
|
||||||
pic = [
|
pic = [
|
||||||
// Initial portion of PIC (24 bytes)
|
// Initial portion of PIC (24 bytes)
|
||||||
// [4098 bytes] [2x 0x00] ["DI"] [v1] [10units] [DI num]
|
// [4098 bytes] [2x 0x00] ["DI"] [v1] [10units] [DI num]
|
||||||
0x10, 0x02, 0x00, 0x00, 0x44, 0x49, 0x01, 0x10, 0x00, 0x00, 0x20, 0x00,
|
0x10, 0x02, 0x00, 0x00, 0x44, 0x49, 0x01, 0x10, 0x00, 0x00, 0x20, 0x00,
|
||||||
// ["BDR"] [2 layers]
|
// ["BDR"] [2 layers]
|
||||||
0x42, 0x44, 0x4F, 0x01, 0x21, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x42, 0x44, 0x4F, 0x01, 0x21, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
// Total sectors used on disc (4 bytes)
|
// Total sectors used on disc (4 bytes)
|
||||||
ts[3], ts[2], ts[1], ts[0],
|
ts[3], ts[2], ts[1], ts[0],
|
||||||
// 1st Layer sector start location (4 bytes)
|
// 1st Layer sector start location (4 bytes)
|
||||||
0x00, 0x10, 0x00, 0x00,
|
0x00, 0x10, 0x00, 0x00,
|
||||||
// 1st Layer sector end location (4 bytes), 0x00CA73FE for default BD layerbreak of 12219392
|
// 1st Layer sector end location (4 bytes), 0x00CA73FE for default BD layerbreak of 12219392
|
||||||
l0es[0], l0es[1], l0es[2], l0es[3],
|
l0es[0], l0es[1], l0es[2], l0es[3],
|
||||||
// 32 bytes of zeros
|
// 32 bytes of zeros
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
// Initial portion of PIC again, for 2nd layer
|
// Initial portion of PIC again, for 2nd layer
|
||||||
// ["DI"] [v1] [11unit][DI num]
|
// ["DI"] [v1] [11unit][DI num]
|
||||||
0x44, 0x49, 0x01, 0x11, 0x00, 0x01, 0x20, 0x00,
|
0x44, 0x49, 0x01, 0x11, 0x00, 0x01, 0x20, 0x00,
|
||||||
// ["BDR"] [2 layers]
|
// ["BDR"] [2 layers]
|
||||||
0x42, 0x44, 0x4F, 0x01, 0x21, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x42, 0x44, 0x4F, 0x01, 0x21, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
// Total sectors used on disc
|
// Total sectors used on disc
|
||||||
ts[3], ts[2], ts[1], ts[0],
|
ts[3], ts[2], ts[1], ts[0],
|
||||||
// 2nd Layer sector start location, 0x01358C00 for default BD layerbreak of 12219392
|
// 2nd Layer sector start location, 0x01358C00 for default BD layerbreak of 12219392
|
||||||
l1ss[0], l1ss[1], l1ss[2], l1ss[3],
|
l1ss[0], l1ss[1], l1ss[2], l1ss[3],
|
||||||
// 2nd Layer sector end location
|
// 2nd Layer sector end location
|
||||||
0x01, 0xEF, 0xFF, 0xFE,
|
0x01, 0xEF, 0xFF, 0xFE,
|
||||||
// Remaining 32 bytes are zeroes
|
// Remaining 32 bytes are zeroes
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ];
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ];
|
||||||
// 3k3y style: 0x03 at last byte
|
// 3k3y style: 0x03 at last byte
|
||||||
if (exactIRD)
|
if (exactIRD)
|
||||||
pic[114] = 0x03;
|
pic[114] = 0x03;
|
||||||
|
|
||||||
}
|
}
|
||||||
else // if BD-25
|
else // if BD-25
|
||||||
{
|
{
|
||||||
// Total sectors used on disc: num_sectors + layer_sector_end (0x00100000) - 1
|
// Total sectors used on disc: num_sectors + layer_sector_end (0x00100000) - 1
|
||||||
@@ -249,48 +230,24 @@ namespace LibIRD
|
|||||||
return pic;
|
return pic;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Generates the UID field by computing the CRC32 hash of the ISO
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="isoPath">Path to the ISO</param>
|
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
|
||||||
/// <exception cref="FileNotFoundException"></exception>
|
|
||||||
private static uint GenerateUID(string isoPath)
|
|
||||||
{
|
|
||||||
// Validate ISO path
|
|
||||||
ArgumentNullException.ThrowIfNull(isoPath, nameof(isoPath));
|
|
||||||
|
|
||||||
// Check file exists
|
|
||||||
var iso = new FileInfo(isoPath);
|
|
||||||
if (!iso.Exists)
|
|
||||||
throw new FileNotFoundException(nameof(isoPath));
|
|
||||||
|
|
||||||
// Compute CRC32 hash
|
|
||||||
byte[] crc32;
|
|
||||||
using (FileStream fs = File.OpenRead(isoPath))
|
|
||||||
{
|
|
||||||
Crc32 hasher = new();
|
|
||||||
hasher.Append(fs);
|
|
||||||
crc32 = hasher.GetCurrentHash();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Redump ISO CRC32 hash is used as the Unique ID in the reproducible IRD
|
|
||||||
return BitConverter.ToUInt32(crc32, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculates ISO file size
|
/// Calculates ISO file size
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="isoPath">Path to the ISO</param>
|
/// <param name="isoPath">Path to the ISO</param>
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
/// <exception cref="ArgumentException"></exception>
|
||||||
/// <exception cref="FileNotFoundException"></exception>
|
/// <exception cref="FileNotFoundException"></exception>
|
||||||
private static long CalculateSize(string isoPath)
|
private static long CalculateSize(string isoPath)
|
||||||
{
|
{
|
||||||
// Validate ISO path
|
|
||||||
ArgumentNullException.ThrowIfNull(isoPath, nameof(isoPath));
|
|
||||||
|
|
||||||
// Check file exists
|
// Check file exists
|
||||||
var iso = new FileInfo(isoPath);
|
FileInfo iso;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
iso = new FileInfo(isoPath);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid ISO Path: " + e.Message);
|
||||||
|
}
|
||||||
if (!iso.Exists)
|
if (!iso.Exists)
|
||||||
throw new FileNotFoundException(nameof(isoPath));
|
throw new FileNotFoundException(nameof(isoPath));
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ IRDKit is a tool that allows direct use of LibIRD functionality from a command l
|
|||||||
- Printing info about all ISOs and IRDs in a folder: `irdkit info .`
|
- Printing info about all ISOs and IRDs in a folder: `irdkit info .`
|
||||||
- Creating an IRD from an ISO: `irdkit create game.iso`
|
- Creating an IRD from an ISO: `irdkit create game.iso`
|
||||||
- Finding differences between two IRDs: `irdkit diff game1.ird game2.ird`
|
- Finding differences between two IRDs: `irdkit diff game1.ird game2.ird`
|
||||||
|
- Renaming an IRD or folder of IRDs using a redump DAT: `irdkit rename -d redump.dat game.ird`
|
||||||
|
- Verify a JB Folder with an IRD: `irdkit verify game.ird folder`
|
||||||
|
|
||||||
For detailed usage, read more [here](IRDKit).
|
For detailed usage, read more [here](IRDKit).
|
||||||
|
|
||||||
## Using the LibIRD library
|
## Using the LibIRD library
|
||||||
|
|||||||
Reference in New Issue
Block a user