• Stars
    star
    492
  • Rank 89,476 (Top 2 %)
  • Language
    Scala
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated 6 months ago

Reviews

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

Repository Details

Kaitai Struct: compiler to translate .ksy => .cpp / .cs / .dot / .go / .java / .js / .lua / .nim / .php / .pm / .py / .rb

Kaitai Struct: compiler

Build Status Maven Central

npm@latest npm@next npm downloads

This project is an official reference compiler for Kaitai Struct project.

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

The main idea is that a particular format is described in Kaitai Struct language (.ksy files) only once and then can be compiled with this compiler into source files in one of the supported programming languages. These modules will include the generated code for a parser that can read described data structure from a file / stream and give access to it in a nice, easy-to-comprehend API.

Further information

If you're looking for information on:

  • Kaitai Struct language itself (.ksy files, general usage patterns) β€” refer to the user guide.
  • How to download and install Kaitai Struct β€” see the downloads.
  • How to build the compiler, run the test suite, and join the development β€” see the developer memo.

Licensing

Main code

Kaitai Struct compiler itself is copyright (C) 2015-2022 Kaitai Project.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

FastParse

Portions of Kaitai Struct compiler are loosely based on pythonparse from FastParse and are copyright (c) 2014 Li Haoyi ([email protected]).

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.

XMLUtils code

Portions of Kaitai Struct compiler are based on scala/xml/Utility.scala from Scala XML.

Copyright (c) 2002-2017 EPFL
Copyright (c) 2011-2017 Lightbend, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the EPFL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Libraries used

Kaitai Struct compiler depends on the following libraries:


Note that these clauses only apply only to compiler itself, not .ksy input files that one supplies in normal process of compilation, nor to compiler's output files β€” that consitutes normal usage process and you obviously keep copyright to both.

More Repositories

1

kaitai_struct

Kaitai Struct: declarative language to generate binary data parsers in C++ / C# / Go / Java / JavaScript / Lua / Nim / Perl / PHP / Python / Ruby
Shell
3,850
star
2

kaitai_struct_formats

Kaitai Struct: library of binary file formats (.ksy)
Kaitai Struct
702
star
3

kaitai_struct_visualizer

Kaitai Struct: visualizer and hex viewer tool
Ruby
271
star
4

kaitai_struct_webide

Online editor / visualizer for Kaitai Struct .ksy files
TypeScript
264
star
5

awesome-kaitai

A curated list of Kaitai Struct tools and resources
186
star
6

kaitai_struct_python_runtime

Kaitai Struct: runtime for Python
Python
92
star
7

kaitai_struct_go_runtime

Kaitai Struct: runtime for Go
Go
68
star
8

kaitai_struct_cpp_stl_runtime

Kaitai Struct: runtime for C++ using STL
C++
66
star
9

kaitai_struct_csharp_runtime

Kaitai Struct: runtime for C#/.NET
C#
58
star
10

kaitai_struct_rust_runtime

Kaitai Struct: runtime for Rust
Rust
55
star
11

kaitai_fs

KaitaiFS: mount any filesystem specified with a .ksy as a real file system
Python
54
star
12

kaitai_struct_java_runtime

Kaitai Struct: runtime for Java
Java
41
star
13

kaitai_struct_javascript_runtime

Kaitai Struct: runtime for JavaScript
JavaScript
32
star
14

kaitai_struct_gui

Kaitai Struct: visualizer and hex viewer tool GUI in Java
Java
23
star
15

kaitai_struct_lua_runtime

Kaitai Struct: runtime for Lua
Lua
20
star
16

kaitai_struct_ruby_runtime

Kaitai Struct: runtime for Ruby
Ruby
18
star
17

kaitai_struct_doc

Kaitai Struct: documentation
CSS
16
star
18

ide-kaitai-io.github.io

Stable deployment of Kaitai Web IDE using GitHub pages - https://ide.kaitai.io/
JavaScript
14
star
19

kaitai_struct_tests

Kaitai Struct: tests in all supported programming languages
Ruby
13
star
20

ksy_schema

Kaitai Struct YAML (KSY) schema specification
12
star
21

ksylint

A linter for ksy files.
Python
11
star
22

kaitai_struct_php_runtime

Kaitai Struct: runtime for PHP
PHP
11
star
23

kaitai_struct_swift_runtime

Kaitai Struct: runtime for Swift
Swift
10
star
24

kaitai_struct_nim_runtime

Kaitai Struct: runtime for Nim
Nim
9
star
25

kaitai_compress

Kaitai Struct: data compression algorithms processing routines
Shell
9
star
26

kaitai_struct_loader

Webpack loader for kaitai-struct .ksy definitions
JavaScript
7
star
27

formats-kaitai-io.github.io

Rendered HTML pages repository powering http://formats.kaitai.io/ β€” generated from https://github.com/kaitai-io/kaitai_struct_formats/
HTML
6
star
28

java_bytecode.ksy

Java bytecode spec for Kaitai Struct
Ruby
6
star
29

kaitai-io.github.io

Kaitai Project homepage
HTML
6
star
30

edid.ksy

EDID (VESA Enhanced Extended Display Identification Data) structure for Kaitai Struct
Kaitai Struct
5
star
31

kaitai_struct_benchmarks

Kaitai Struct: benchmarking suite
Kaitai Struct
5
star
32

kaitai_struct_samples

Kaitai Struct: library of sample files for testing
Python
4
star
33

kaitai_ci_ui

Kaitai Struct CI UI
Vue
3
star
34

kaitai_struct_perl_runtime

Kaitai Struct: runtime for Perl
Perl
3
star
35

doc-kaitai-io.github.io

Rendered HTML pages repository powering https://doc.kaitai.io/ β€” generated from https://github.com/kaitai-io/kaitai_struct_doc/
HTML
3
star
36

dicom.ksy

DICOM (Digital Imaging and Communications in Medicine) file format spec for Kaitai Struct
Ruby
3
star
37

kaitai_struct_c_runtime

Kaitai Struct: runtime for C
3
star
38

ci_targets

Kaitai Struct CI: test .ksy files compiled into target languages
C++
3
star
39

kaitai_struct_typescript_runtime

Kaitai Struct: Runtime for Typescript
2
star
40

kaitai_struct_examples

HTML
2
star
41

coreldraw_cdr.ksy

CDR (CorelDRAW drawing) format specification for Kaitai Struct
Kaitai Struct
2
star
42

windows_resource_file.ksy

Windows resource file spec for Kaitai Struct
2
star
43

webide-usercontent.kaitai.io

HTML
1
star
44

kaitai_struct_docker_images

Docker containers that are sufficient to run relevant portion of Kaitai Struct tests for a particular target language
Dockerfile
1
star
45

ci-kaitai-io.github.io

ci.kaitai.io website
HTML
1
star
46

kaitai_struct_webide_vue

The kaitai struct webide completely rewritten from the ground up with vuejs and web components
Vue
1
star
47

ci_artifacts

Kaitai Struct CI: test run results
1
star