nrbf-parser
A high-performance Rust library for parsing and encoding MS-NRBF (Microsoft .NET Remoting Binary Format) streams.
This format is commonly used by .NET applications and Unity games for binary serialization.
Features
- Full MS-NRBF Support: Parses all major record types including classes, arrays, and primitive types.
- Bidirectional: Supports both decoding from binary and encoding back to binary.
- JSON Compatibility: Serialize/Deserialize records to/from JSON with
serde. - Verified Integrity: 100% byte-for-byte reconstruction verified on real-world data (Unity
.metafiles (not included for privacy reasons)). - Safe & Fast: Leverages Rust's memory safety and performance.
Installation
Usage
Parsing Binary to JSON
use Decoder;
use File;
use BufReader;
Encoding Records to Binary
use Encoder;
use File;
use BufWriter;
Verification
The library includes implementation examples for testing and verification:
cargo run --example parse_meta -- <file>: Simple parser example.cargo run --example round_trip -- <file>: Verifies that parsing and re-encoding returns identical binary data.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0 or later) by driedpampas [at] proton [dot] me.