CFGBINManager 1.0.6
dotnet add package CFGBINManager --version 1.0.6
NuGet\Install-Package CFGBINManager -Version 1.0.6
<PackageReference Include="CFGBINManager" Version="1.0.6" />
<PackageVersion Include="CFGBINManager" Version="1.0.6" />
<PackageReference Include="CFGBINManager" />
paket add CFGBINManager --version 1.0.6
#r "nuget: CFGBINManager, 1.0.6"
#:package CFGBINManager@1.0.6
#addin nuget:?package=CFGBINManager&version=1.0.6
#tool nuget:?package=CFGBINManager&version=1.0.6
CFGBINManager v1.0.6
Add it to your project
Use a .NET 8, .NET 9 or .NET 10 project and install CFGBINManager from NuGet:
dotnet add package CFGBINManager --version 1.0.6
Building the library from source requires the .NET 10 SDK.
To use the source directly, add this to your .csproj, adjusting the relative path:
<ItemGroup>
<ProjectReference Include="../CFGBINManager/src/CFGBINManager/CFGBINManager.csproj" />
</ItemGroup>
Load a file
using CFGBINManager;
string catalogPath = Path.Combine(AppContext.BaseDirectory, "data", "structure.cfg");
var catalog = StructureCatalog.Parse(File.ReadAllText(catalogPath))
.ForProfile("VictoryRoad");
var document = BinCodec.Read(File.ReadAllBytes("input.cfg.bin"), catalog);
Choose the game name in your catalog. For a catalog without game profiles, omit .ForProfile(...).
To open a CFG instead, replace the last line with:
var document = CfgTextCodec.Read(File.ReadAllText("input.cfg"), catalog);
The original BIN is not needed. A plain text CFG can be loaded directly as T2B. For an exported RDBNP CFG, retain the reconstruction section included in the text file.
Read and change a value
var rows = document.FindRows("CHARA_BASE_INFO");
var row = rows[0]; // Choose an existing row.
string? name = row.GetValue("internalName").AsString();
row.SetValue("internalName", CfgValue.String("example_name"));
Use the entry and field names from your file. You can also address a field by position, keeping its existing value type:
var value = row.Values[0];
row.SetValue(0, CfgValue.Signed(123));
Remove rows
var removed = document.FindRows("NOUN_INFO").Take(10).ToArray();
document.RemoveRows(removed);
When removing a block, include its contained rows. A retained entry cannot keep a direct reference to a removed row.
Save the result
File.WriteAllBytes("edited.cfg.bin", BinCodec.Write(document));
File.WriteAllText("edited.cfg", CfgTextCodec.WriteReadable(document));
Use a different output filename to keep your input intact.
Work without files
string cfg = CfgTextCodec.WriteReadable(document);
var imported = CfgTextCodec.Read(cfg, catalog);
byte[] bin = BinCodec.Write(imported);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- System.Text.Json (>= 10.0.13)
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.