Start work on CLI tool

This commit is contained in:
Deterous
2023-11-16 11:45:21 +13:00
parent b794ec8f96
commit e665391e47
11 changed files with 217 additions and 100 deletions
+10 -34
View File
@@ -2,42 +2,18 @@
.NET library for generating, writing, and reading IRD files. Functionality is provided for deterministically generating IRDs such that a redump ISO and key have a 1-to-1 correspondence with an IRD file.
## How to use LibIRD
## What is an IRD?
### Reproducible, redump-style IRDs
IRD files contain a summary of what data is on a PlayStation 3 disc. It can be used to rebuild ISOs from files (JB folders). IRD files are also useful for decrypting ISOs after they have been dumped on a PC blu-ray drive, such as for the purposes of legally emulating your PS3 games.
The standard way of generating a reproducible, redump-style IRD is with a redump ISO file and a redump key file (e.g. http://redump.org/disc/28721/key/):
```cs
byte[] discKey = File.ReadAllBytes("./game.key");
IRD ird = new ReIRD("./game.iso", discKey);
```
Alternatively, the disc key can be extracted from a [ManaGunZ](https://github.com/Zarh/ManaGunZ/) log file:
```cs
IRD ird = new ReIRD("./game.iso", "./game.getkey.log");
```
## How to use IRDKit
### Custom IRDs
IRDKit is a tool that allows direct use of LibIRD functionality from the command line interface. The basic usage is:
```
irdkit create game.iso
```
For detailed usage, read more [here](IRDKit/README.MD).
Functionality is also provided for creating IRDs with a custom disc key, disc ID, and PIC:
```cs
byte[] discKey = new byte[16];
byte[] discID = new byte[16];
byte[] PIC = new byte[115];
// Set vars to desired values
IRD ird = new IRD("./game.iso", discKey, discID, discPIC);
```
As before, a [ManaGunZ](https://github.com/Zarh/ManaGunZ/) log file can also be used with an ISO to create a custom IRD, with the disc key, disc ID, and PIC all being extracted from the log file (rather than just the key).
```cs
IRD ird = new IRD("./game.iso", "./game.getkey.log");
```
Finally, an existing IRD file can be read to create an IRD:
```cs
IRD ird = IRD.Read("./game.ird")
```
## Using the LibIRD library
An IRD can be then be tweaked, its fields printed, and written to a new IRD:
```cs
ird.UID = 0x9F1A51D8;
ird.Print();
ird.Write("game2.ird");
```
LibIRD was originally made for creating reproducible, redump-style IRDs when dumping PS3 discs with [MPF](https://github.com/SabreTools/MPF). If you wish to integrate LibIRD into your own application, read the examples [here](LibIRD/README.MD).