https://github.com/chausner/pritools
Tools for parsing and exploring PRI (Package Resource Index) files
https://github.com/chausner/pritools
Last synced: 9 months ago
JSON representation
Tools for parsing and exploring PRI (Package Resource Index) files
- Host: GitHub
- URL: https://github.com/chausner/pritools
- Owner: chausner
- License: apache-2.0
- Created: 2016-10-24T19:44:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2025-06-07T15:19:30.000Z (about 1 year ago)
- Last Synced: 2025-10-27T23:25:41.487Z (10 months ago)
- Language: C#
- Size: 188 KB
- Stars: 42
- Watchers: 4
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PriTools
Tools for parsing and exploring PRI (Package Resource Index) files
## PRIExplorer
This sample application allows to open and browse the contents of PRI files.
It is also possible to export individual resources.
The application leverages the [XbfAnalyzer](https://github.com/chausner/XbfAnalyzer)
(originally by [misenhower](https://github.com/misenhower/XbfAnalyzer))
to provide on-the-fly decompilation of XBF2 resources back to XAML.
## PriFormat
This project implements a PRI file reader in C# for low-level access to pretty much all structures in the PRI file format.
Only file reading, not writing, is supported at the moment.
### Sample usage
You can use the following code to open a PRI file and print the names of all resource map items:
```csharp
using (FileStream stream = File.OpenRead(path))
{
PriFile priFile = PriFile.Parse(stream);
ResourceMapSection resourceMapSection = priFile.GetSectionByRef(priFile.PriDescriptorSection.PrimaryResourceMapSection.Value);
foreach (CandidateSet candidateSet in resourceMapSection.CandidateSets.Values)
{
ResourceMapItem resourceMapItem = priFile.GetResourceMapItemByRef(candidateSet.ResourceMapItem);
Console.WriteLine(resourceMapItem.FullName);
}
}
```
For more sample code, see the [PriInfo project](PriInfo/Program.cs).
## PRI File Format Specification
[Package Resource Index File Format.md](Package%20Resource%20Index%20File%20Format.md) contains a reasonably complete (but unofficial) description of data structures in the PRI file format.
## License
Apache 2.0, see LICENSE.
XBF2 decompilation code is originally based on the implementation by [misenhower](https://github.com/misenhower/XbfAnalyzer).