Giter Club home page Giter Club logo

kaitai_struct_csharp_runtime's Introduction

Kaitai Struct: runtime library for C# / .NET

NuGet version NuGet downloads

This library implements Kaitai Struct API for C#.

Kaitai Struct is a declarative language used for describe various binary data structures, laid out in files or in memory: i.e. binary file formats, network stream packet formats, etc.

Further reading:

Licensing

Copyright 2016-2024 Kaitai Project: MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

kaitai_struct_csharp_runtime's People

Contributors

arekbulski avatar arlorean avatar bibekdw avatar generalmimon avatar greycat avatar indrora avatar logicandtrick avatar pluskal avatar spyapalli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kaitai_struct_csharp_runtime's Issues

Relicense or dual-license under MIT too

I've noticed that @indrora originally applied Apache to his contribution, and all our subsequent commits thus were also Apache-licensed.

There is a problem with Apache license being incompatible with GPLv2, thus this license choice can potentially impede adoption of Kaitai Struct for free/open source projects which still use GPLv2.

The majority of other runtimes are MIT-licensed, so could I persuade you all to switch to MIT?

Nested regions in source

I'm trying to get all runtimes to use uniform order of methods and sectioning. Can you enlighten me if C#'s #region / #endregion can be nested?

I.e. I'd like to use something like (indented for the sake of illustration, won't be indented in real code):

#region Integer types
  #region Signed
    #region Big-endian
    #endregion
    #region Little-endian
    #endregion
  #endregion
...
#endregion

I guess that it's valid from compiler's POV, and, so far I've checked that:

  • it works flawlessly in KWrite/Kate (i.e. regions/subregions get properly folded)
  • it kind of works in MonoDevelop (only top-level regions are seen in document's structure view, and MonoDevelop does not seem to support folding at all)
  • Doxygen does not support nested regions properly, and thus messes up "group names" โ€” but, anyway, probably Doxygen is not a documentation generator of choice for C#?

Could you check if that would be ok with Visual Studio editor? What about major documentation generation tools?

Kaitai b32 result is inconsistent for some payload because of overflow

The method ReadBitsIntLe() uses left shift operation which may contribute to overflow. We could use Math.Pow() method for left shift to avoid the overflow

                ulong v = (ulong)(buf[i] * Math.Pow(2,BitsLeft));
                //ulong v = (ulong)(buf[i] << BitsLeft);

I can make this change and send a pull request

Update the NuGet Package version to 0.8

Hi Im currently trying to learn how to use this awesome tool and I have noticed that the version of the NuGet package available is 0.7 where version 0.8 exists.
Could you please upload the latest version?

FileStream implicit restriction

Some parts of the code implicitly depend on the stream being seekable and tellable, like FileStream. Arbitrary streams (like pipes?) may be non-seekable and non-tellable. Either clarify in documentation that such a restrition exists, or change the code somehow.

public bool IsEof
{
    get { return BaseStream.Position >= BaseStream.Length; }
}
public long Size
{
    get { return BaseStream.Length; }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.