A .NET library for working with RE Engine resource formats and PAK files. Primarily developed to support the biorand project, but useful for modding most RE engine games.
Add the package to your project by referencing the NuGet package in your .csproj:
<PackageReference Include="IntelOrca.Biohazard.REE" Version="1.4.2" />Basic example showing how to open a file from the game's patched pak files, modify it and write a new patch pak:
using IntelOrca.Biohazard.REE.Package;
using IntelOrca.Biohazard.REE.Rsz;
var repo = RszRepositorySerializer.Default.FromJsonFile(@"C:\reasy\rszre4.json");
using var pak = new RePakCollection(@"C:\Program Files (x86)\Steam\steamapps\common\RESIDENT EVIL 4 BIOHAZARD RE4");
// Get user data and create new modified version
const string guiParamPath = "natives/stm/_chainsaw/appsystem/ui/userdata/guiparamholdersettinguserdata.user.2";
var userFileBuilder = new UserFile(pak.GetEntryData(guiParamPath)).ToBuilder(repo);
var root = userFileBuilder.Objects[0];
root = root.Set("_InGameShopGuiParamHolder._HoldTime_Purchase", 0.1f);
userFileBuilder.Objects = [root];
var newUserFile = userFileBuilder.Build();
// Create new patch pak file with modified user file
var pakBuilder = new PakFileBuilder();
pakBuilder.AddEntry(guiParamPath, newUserFile.Data);
pakBuilder.Save("re_chunk_000.pak.patch_006.pak");- Requirements: .NET SDK 10.0.
- Build the solution:
dotnet build reeutils.sln- Run tests with the
dotnettest runner:
dotnet test-
Note: many tests require access to original game PAK files and RSZ type JSON dumps. You must configure local paths to where Resident Evil games are installed before running those tests.
- By default the test helper
test/IntelOrca.Biohazard.REE.Tests/OriginalPakHelper.cscontains example paths used on the author machine. Edit that file to point to your game installation directories or ensure equivalent paths exist on your machine. - The RSZ type JSON files used by tests are referenced from a local
reasyclone in the tests (seeGetTypeRepositoryinOriginalPakHelper.cs). Place or point those JSON dumps to the expected paths or update the test helper accordingly.
- By default the test helper
- The library is designed around immutability and builder patterns for thread-safety and efficient cloning. Builders provide explicit, safe mutation paths while core types remain immutable to allow safe sharing across threads and cheap copy-on-write style operations.
- Thanks to the REasy project for RSZ JSON dumps and type information used in tests and tooling.
- Historical tooling and ideas inspired by RSZTool.
- Additional contributions and community tooling from Namsku.
This repository is MIT licensed.