• Stars
    star
    129
  • Rank 278,001 (Top 6 %)
  • Language
    C#
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A .NET library for reading and writing FromSoftware file formats.

SoulsFormats

A .NET library for reading and writing various FromSoftware file formats, targeting .NET Framework 4.6 and .NET Standard 2.1.
Dark Souls, Demon's Souls, Bloodborne, and Sekiro are the main focus, but other From games may be supported to varying degrees.
A brief description of each supported format can be found in FORMATS.md, with further documentation for some formats.

Usage

Objects for most formats can be created with the static method Read, which accepts either a byte array or a file path. Using a path is preferable as it will be read with a stream, reducing memory consumption.

BND3 bnd = BND3.Read(@"C:\your\path\here.chrbnd");

// or

byte[] bytes = File.ReadAllBytes(@"C:\your\path\here.chrbnd");
BND3 bnd = BND3.Read(bytes);

The Write method can be used to create a new file from an object. If given a path it will be written to that location with a stream, otherwise a byte array will be returned.

bnd.Write(@"C:\your\path\here.chrbnd");

// or

byte[] bytes = bnd.Write();
File.WriteAllBytes(@"C:\your\path\here.chrbnd", bytes);

DCX (compressed files) will be decompressed automatically and the compression type will be remembered and reapplied when writing the file.

BND3 bnd = BND3.Read(@"C:\your\path\here.chrbnd.dcx");
bnd.Write(@"C:\your\path\here.chrbnd.dcx");

The compression type can be changed by either setting the Compression field of the object, or specifying one when calling Write.

BND3 bnd = BND3.Read(@"C:\your\path\here.chrbnd.dcx");
bnd.Write(@"C:\your\path\here.chrbnd", DCX.Type.None);

// or

BND3 bnd = BND3.Read(@"C:\your\path\here.chrbnd.dcx");
bnd.Compression = DCX.Type.None;
bnd.Write(@"C:\your\path\here.chrbnd");

Finally, DCX files can be generically read and written with static methods if necessary. DCX holds no important metadata so they read/write directly to/from byte arrays instead of creating an object.

byte[] bndBytes = DCX.Decompress(@"C:\your\path\here.chrbnd.dcx");
BND3 bnd = BND3.Read(bndBytes);

// or

byte[] dcxBytes = File.ReadAllBytes(@"C:\your\path\here.chrbnd.dcx");
byte[] bndBytes = DCX.Decompress(dcxBytes);
BND3 bnd = BND3.Read(bndBytes);

Writing a new DCX requires a DCX.Type parameter indicating which game it is for. DCX.Decompress has an optional out parameter indicating the detected type which should usually be used instead of specifying your own.

byte[] bndBytes = DCX.Decompress(@"C:\your\path\here.chrbnd.dcx", out DCX.Type type);
DCX.Compress(bndBytes, type, @"C:\your\path\here.chrbnd.dcx");

// or

byte[] bndBytes = DCX.Decompress(@"C:\your\path\here.chrbnd.dcx", out DCX.Type type);
byte[] dcxBytes = DCX.Compress(bndBytes, type);
File.WriteAllBytes(@"C:\your\path\here.chrbnd.dcx", dcxBytes);

Special Thanks

To everyone below, for either creating tools that I learned from, or helping decipher these formats one way or another. Please yell at me on Discord if I missed you.

  • albeartron
  • Atvaark
  • B3LYP
  • horkrux
  • HotPocketRemix
  • katalash
  • Lance
  • Meowmaritus
  • Nyxojaele
  • Pav
  • SeanP
  • thefifthmatt
  • Wulf2k
  • Yoshimitsu

More Repositories

1

UXM

Enables file modding for DS2, SotFS, DS3, and Sekiro by unpacking game archives and patching the executable to load loose files instead.
C#
122
star
2

Yabber

Unpacker/repacker for From Software container formats.
C#
120
star
3

Yapped

An editor for DS3 game params.
C#
83
star
4

DSR-Gadget

A multi-purpose testing tool for Dark Souls: Remastered
C#
52
star
5

DS-Gadget

A multi-purpose testing tool for Dark Souls: Prepare to Die Edition.
C#
47
star
6

SoulsTemplates

My 010 Editor templates for FromSoft formats
23
star
7

DSR-TPUP

A utility to extract and replace textures in Dark Souls: Remastered
C#
22
star
8

SaveMerge

A basic editor for merging and transferring DS3 save files.
C#
14
star
9

PropertyHook

A .NET library that makes it easy to define an interface for another application's memory.
C#
12
star
10

BootBoost

Decreases initial boot time in DS3 by around 10-15 seconds.
C#
7
star
11

MTD-Editor

A material definition editor for FromSoftware games
C#
5
star
12

LtxParser

C# library for loading .ltx trees from the STALKER series
C#
4
star
13

Irregulator

Randomizes game params in Dark Souls 3.
C#
4
star
14

TexPup

A texture modding platform for Dark Souls 3 and beyond.
C#
3
star
15

DS-Filter-Customizer

A utility to customize the built-in visual filters of Dark Souls 1
C#
3
star
16

DRB-Icon-Appender

An item icon editing and creation tool for Dark Souls 1 and Remastered
C#
2
star
17

EzSembler

A postfix (dis)assembler for ESD bytecode.
C#
2
star
18

U3M

Unpacks archives and enables loose file loading for Dark Souls 3
C#
2
star
19

Erringulator

Chaotic param randomizer for Elden Ring
C#
1
star
20

DSFormats

DEPRECATED! Only use this if you need it to build an old project. Use SoulsFormats instead.
C#
1
star
21

tkUtilities

A collection of utility scripts for the STALKER series.
1
star
22

ST-Fov-Editor

Field of view editing utility for vanilla Stalker games
C#
1
star
23

DSR-Filter-Customizer

A utility to customize the built-in visual filters of Dark Souls: Remastered
C#
1
star
24

DRB-Editor

General-purpose editor for DS1 UI configs
C#
1
star
25

EventPocket

A simple realtime event flag and event value viewer for DS1 and DSR.
C#
1
star