{"id":50688367,"url":"https://github.com/isamorphic/quesostruct","last_synced_at":"2026-06-09T01:01:48.164Z","repository":{"id":115948756,"uuid":"368330248","full_name":"IsaMorphic/QuesoStruct","owner":"IsaMorphic","description":"A delicious binary serialization library that says no to boilerplate and yes to great code and design.","archived":false,"fork":false,"pushed_at":"2022-05-01T15:34:31.000Z","size":133,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-07T12:53:01.280Z","etag":null,"topics":["automation","binary-files","cheese","code-generation","framework","serialization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IsaMorphic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-17T21:50:06.000Z","updated_at":"2023-08-03T18:41:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c098037-aa04-46cd-a5bd-dcc284428eff","html_url":"https://github.com/IsaMorphic/QuesoStruct","commit_stats":null,"previous_names":["yodadude2003/quesostruct"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/IsaMorphic/QuesoStruct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IsaMorphic%2FQuesoStruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IsaMorphic%2FQuesoStruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IsaMorphic%2FQuesoStruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IsaMorphic%2FQuesoStruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IsaMorphic","download_url":"https://codeload.github.com/IsaMorphic/QuesoStruct/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IsaMorphic%2FQuesoStruct/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34086664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","binary-files","cheese","code-generation","framework","serialization"],"created_at":"2026-06-09T01:01:46.888Z","updated_at":"2026-06-09T01:01:48.145Z","avatar_url":"https://github.com/IsaMorphic.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuesoStruct 🧀\n\nBoilerplate is out, and *QuesoStruct* is in! ¿Porque queso? ¡¿Porque no?! Me gusta queso😋 \n\n**QuesoStruct is a pure C# .NET based source generation package** that allows its users to **instantly write binary serialization code** for **both reading and writing** scenarios, complete **with built-in support for data structures** common to binary file formats including:\n\n* **All C# .NET number primitives** (except `decimal`!) in **both little and big endian** byte orders\n* **Null terminating strings** (with **any encoding** you choose via built in `System.Text.Encoding`s)\n\n* **Sequential/contiguous structure arrays** (with **customizable termination behavior** i.e conditional per item, specific number of items, or until EOI)\n* **Singly/doubly linked lists** (implemented abstractly to **support any kind of built-in or user created pointer type**)\n* **Structured data substreams** (to wrap/expose certain sections of input data as a .NET `Stream`)\n\nand an easy way to **markup your classes and code** to make the magic happen!\n\n# ¿Que es eso? (What's the big idea?)\n\nTo best demonstrate the power of QuesoStruct, let's use a brief concrete code example to show you just how much you'll gain in both productivity and code quality by using the library! \n\nSuppose you want to write a collection of binary formatted data structures to a file on the disk. \n\nEach instance in the collection is laid out according to the following class definition:\n\n```csharp\npublic class MyStruct \n{ \n    public uint Id { get; set; }\n    \n    public float X { get; set; }\n    public float Y { get; set; }\n    public float Z { get; set; }\n}\n```\n\nNow lets see a before and after!\n\n### Before using QuesoStruct (reading from a file): \n\n```csharp\n/* below methods are defined somewhere in MyStruct class... */\npublic static MyStruct ReadInstance(BinaryReader reader) \n{\n    var myInstance = new MyStruct\n    {\n        Id = reader.ReadUInt32(),\n        \n        X = reader.ReadSingle(),\n        Y = reader.ReadSingle(),\n        Z = reader.ReadSingle(),\n    };\n    \n    return myInstance;\n}\n\npublic static MyStruct[] ReadCollection(BinaryReader reader)\n{\n    var collection = new List\u003cMyStruct\u003e();\n    \n    while(true) \n    { \n    \ttry\n\t    {\n            collection.Add(ReadInstance(reader));\n    \t} catch(EndOfStreamException) {\n            break;\n        }\n    }\n    \n    return collection.ToArray();\n}\n\n/* ...then used wherever else to retrieve the instances from a Stream wrapped in a BinaryReader. */\nusing var file = File.OpenRead(\"my-file.bin\");\nusing var reader = new BinaryReader(file);\n\nvar instances = MyStruct.ReadCollection(reader);\nforeach(var instance in instances)\n{\n    Console.WriteLine($\"Hello world from MyStruct with ID: {instance.Id}!\");\n}\n```\n\n### After using QuesoStruct (same example): \n\n`MyStruct` class code is slightly modified with annotations for the source generator:\n\n```csharp\nusing QuesoStruct;\n\n[StructType]\npublic partial class MyStruct /* class is now marked as partial to insert QuesoStruct goodies! */\n{ \n    [StructMember]\n    public uint Id { get; set; }\n    \n    [StructMember]\n    public float X { get; set; }\n    \n    [StructMember]\n    public float Y { get; set; }\n    \n    [StructMember]\n    public float Z { get; set; }\n    \n/* free to define other members (can be public, too) without the annotation so that they are not read or written. */\n}\n```\n\nAnd then we just use the generated code! Note how now, the verbose `BinaryReader` boilerplate is nowhere to be seen! It has instead been replaced by very minimal API boilerplate for abstractly accessing and configuring the generated code for our use case.\n\n```csharp\nusing QuesoStruct;\nusing QuesoStruct.Types.Collections;\n...\n/* in Main method of Program.cs or something */\nusing var file = File.OpenRead(\"my-file.bin\");\n\n// Minimal boilerplate for accessing QuesoStruct API:\n// 1. access generated code\nvar serializer = Serializers.Get\u003cCollection\u003cMyStruct\u003e\u003e();\n\n// 2. wrap stream, configuring endianess and string encoding\nvar context = new Context(file, Context.SystemEndianess, Encoding.ASCII);\n\n// 3. execute generated code!\nvar instances = serializer.Read(context);\n\n// 4. inside \"instances\" is now a QuesoStruct Collection\u003cMyStruct\u003e. Use it like a IList\u003cMyStruct\u003e!!!\nforeach(var instance in instances)\n{\n    Console.WriteLine($\"Hello world from MyStruct with ID: {instance.Id}!\");\n}\n```\n\nIn the \"before example\", imagine having to write code like that for several other classes, whose members might be many times more numerous! *It'd be a spaghetti code nightmare!!* **QuesoStruct saves you the trouble so you can focus exclusively on your schema and processing.**\n\n# How to get started?\n\nWe're on [NuGet](https://www.nuget.org/packages/QuesoStruct)! Just copy and paste the following into your project file:\n\n```xml\n\u003cPackageReference Include=\"QuesoStruct\" Version=\"1.0.*\" /\u003e\n```\n\nAnd you're ready to go! For more detailed information on how to use QuesoStruct to its fullest potential, see the [repository wiki](../../wiki) for up to date documentation.\n\n# Who uses QuesoStruct?\n\nCurrently, only me, haha.  I plan to use this in many of my future reverse engineering projects, including *StudSmelter*, which is a successor to [NuXtractor](https://github.com/yodadude2003/NuXtractor) that has yet to be written (coming soon maybe?).  \n\nDo let me know if you plan to use QuesoStruct in your own project! I'd love to put together a \"hall of fame\" section for this document to let some obscure projects shine!\n\n# Questions?\n\nIf you have any feedback or questions, feel free to open an issue! My goal is to make this project as useful as possible to as many people as possible.  Also don't hesitate to share any projects of yours that make use of QuesoStruct.  Cheers!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisamorphic%2Fquesostruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisamorphic%2Fquesostruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisamorphic%2Fquesostruct/lists"}