Repository

vvollers/cstructsharp

CStructSharp

Open github.com

vvollers/cstructsharp

CStructSharp

C-style binary struct parser and writer for .NET, supporting runtime and compile-time (source generator) serialization/deserialization of binary data using C-struct definitions.

Visit project

Show me a random project

First shared
Sep 26, 2026
HN activity
10

Show HN@plusmax1Sep 26, 2026

Show HN: CStructSharp – C-struct (de)serialization for C# and JavaScript (WASM)

I've been working on this for a while now (I made a POC for myself some years ago which I didn't release. But AI helped me a lot to finally complete/polish it). Inspired by digital forensic toolkits, this library allows a user to take a c-struct definition and use that to serialize an deserialize binary data. It is a flexible library which features modern c# mechanisms and conventions. I tried to make it easy to use, easy to understand, performant and powerful. You can both use it to parse and use runtime user defined structures as well as use the C# source generator feature to build parsers/serializers at compile time. I also build and published a WASM version/javascript library which is used to showcase the features of the library (see the binary inspector demo app (https://vvollers.github.io/cstructsharp/inspector/) which you can use to run the library against various files, it includes sample definitions for many file formats). The library is quite usable on its own. I'm interested to hear your thoughts and if you have any questions feel free to ask.

Community

Hacker News discussion

Loading the thread…