Skip to content

Commit

Permalink
Reorder keys per style guide (using ksylint), trim trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Jan 3, 2021
1 parent c678553 commit e510abe
Show file tree
Hide file tree
Showing 102 changed files with 877 additions and 885 deletions.
2 changes: 1 addition & 1 deletion archive/android_img.ksy
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
meta:
id: android_img
title: Android Boot Image
file-extension: img
tags:
- archive
- android
license: CC0-1.0
file-extension: img
endian: le
doc-ref: https://source.android.com/devices/bootloader/boot-image-header
seq:
Expand Down
2 changes: 1 addition & 1 deletion archive/lzh.ksy
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
meta:
id: lzh
endian: le
application: LHA (AKA LHarc) by Yoshizaki Haruyasu
file-extension: lzh
xref:
Expand All @@ -10,6 +9,7 @@ meta:
license: CC0-1.0
imports:
- /common/dos_datetime
endian: le
doc: |
LHA (LHarc, LZH) is a file format used by a popular freeware
eponymous archiver, created in 1988 by Haruyasu Yoshizaki. Over the
Expand Down
38 changes: 19 additions & 19 deletions archive/phar_without_stub.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,33 @@ doc: |
allow executing or including phar files as if they were regular PHP scripts.
PHP 5.3 and later include the phar extension, which adds native support for
reading and manipulating phar files.
The phar format was originally developed as part of the PEAR library
PHP_Archive, first released in 2005. Later, a native PHP extension
named "phar" was developed, which was first released on PECL in 2007,
and is included with PHP 5.3 and later. The phar extension has effectively
superseded the PHP_Archive library, which has not been updated since 2010.
The phar extension is also no longer released independently on PECL;
it is now developed and released as part of PHP itself.
Because of current limitations in Kaitai Struct
(seekaitai-io/kaitai_struct#158 and kaitai-io/kaitai_struct#538),
the executable PHP stub that precedes the rest of the archive is not handled
by this spec. Before parsing a phar using this spec, the stub must be
removed manually.
A phar's stub is terminated by the special token `__HALT_COMPILER();`
(which may be followed by at most one space, the PHP tag end `?>`,
and an optional line terminator). The stub termination sequence is
immediately followed by the remaining parts of the phar format,
as described in this spec.
The phar stub usually contains code that loads the phar and runs
a contained PHP file, but this is not required. A minimal valid phar stub
is `<?php __HALT_COMPILER();` - such a stub makes it impossible to execute
the phar directly, but still allows loading or manipulating it using the
phar extension.
Note: The phar format does not specify any encoding for text fields
(stub, alias name, and all file names), so these fields may contain arbitrary
binary data. The actual text encoding used in a specific phar file usually
Expand Down Expand Up @@ -76,7 +76,7 @@ seq:
doc: |
The archive's signature - a digest of all archive data before
the signature itself.
Note: Almost all of the available "signature" types are actually hashes,
not signatures, and cannot be used to verify that the archive has not
been tampered with. Only the OpenSSL signature type is a true
Expand Down Expand Up @@ -111,7 +111,7 @@ enums:
PHP_Archive 0.12.0 (even though it claims to only support
API version 1.1.0) and phar extension 1.3.0. This type is not
documented in the phar extension's documentation of the phar format.
Note: In older versions of the phar extension, this value was used
for an undocumented and unimplemented "PGP" signature type
(`PHAR_SIG_PGP`).
Expand Down Expand Up @@ -189,22 +189,13 @@ types:
api_version:
meta:
endian: be
seq:
- id: release
type: b4
- id: major
type: b4
- id: minor
type: b4
- id: unused
type: b4
doc: |
A phar API version number. This version number is meant to indicate
which features are used in a specific phar, so that tools reading
the phar can easily check that they support all necessary features.
The following API versions exist so far:
* 0.5, 0.6, 0.7, 0.7.1: The first official API versions. At this point,
the phar format was only used by the PHP_Archive library, and the
API version numbers were identical to the PHP_Archive versions that
Expand All @@ -231,6 +222,15 @@ types:
all features from API verison 1.1.1, but it reports API version 1.1.0.)
Adds the OpenSSL signature type and support for storing
empty directories.
seq:
- id: release
type: b4
- id: major
type: b4
- id: minor
type: b4
- id: unused
type: b4
global_flags:
seq:
- id: value
Expand Down Expand Up @@ -259,7 +259,7 @@ types:
type: u4
doc: |
The length of the manifest, in bytes.
Note: The phar extension does not allow reading manifests
larger than 100 MiB.
- id: num_files
Expand Down
6 changes: 3 additions & 3 deletions archive/rar.ksy
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
meta:
id: rar
file-extension: rar
application: RAR archiver
title: RAR (Roshall ARchiver) archive files
application: RAR archiver
file-extension: rar
xref:
forensicswiki: RAR
justsolve: RAR
Expand All @@ -15,10 +15,10 @@ meta:
- fmt/613
- x-fmt/264
wikidata: Q243303
license: CC0-1.0
ks-version: 0.7
imports:
- /common/dos_datetime
license: CC0-1.0
endian: le
doc: |
RAR is a archive format used by popular proprietary RAR archiver,
Expand Down
6 changes: 3 additions & 3 deletions cad/monomakh_sapr_chg.ksy
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
meta:
id: monomakh_sapr_chg
endian: le
file-extension: chg
application: MONOMAKH-SAPR
ks-version: 0.7
file-extension: chg
license: CC0-1.0
ks-version: 0.7
endian: le
doc: |
CHG is a container format file used by
[MONOMAKH-SAPR](https://www.liraland.com/mono/index.php), a software
Expand Down
12 changes: 6 additions & 6 deletions common/riff.ksy
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
meta:
id: riff
title: Resource Interchange File Format (RIFF)
license: CC0-1.0
endian: le
xref:
justsolve: RIFF
loc: fdd000025
wikidata: Q1196805
license: CC0-1.0
endian: le
doc: |
The Resource Interchange File Format (RIFF) is a generic file container format
for storing data in tagged chunks. It is primarily used to store multimedia
Expand All @@ -27,14 +27,14 @@ instances:
parent_chunk_data:
io: chunk.data_slot._io
pos: 0
if: is_riff_chunk
type: parent_chunk_data
if: is_riff_chunk
subchunks:
io: parent_chunk_data.subchunks_slot._io
pos: 0
if: is_riff_chunk
type: chunk_type
repeat: eos
if: is_riff_chunk
types:
chunk:
seq:
Expand Down Expand Up @@ -144,13 +144,13 @@ types:
pos: chunk_ofs
size: 4
is_unregistered_tag:
doc: |
Check if chunk_id contains lowercase characters ([a-z], ASCII 97 = a, ASCII 122 = z).
value: >-
(id_chars[0] >= 97 and id_chars[0] <= 122) or
(id_chars[1] >= 97 and id_chars[1] <= 122) or
(id_chars[2] >= 97 and id_chars[2] <= 122) or
(id_chars[3] >= 97 and id_chars[3] <= 122)
doc: |
Check if chunk_id contains lowercase characters ([a-z], ASCII 97 = a, ASCII 122 = z).
enums:
fourcc:
# little-endian
Expand Down
2 changes: 1 addition & 1 deletion common/utf8_string.ksy
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
meta:
id: utf8_string
title: UTF-8-encoded string
license: CC0-1.0
file-extension: txt
license: CC0-1.0
doc: |
UTF-8 is a popular character encoding scheme that allows to
represent strings as sequence of code points defined in Unicode
Expand Down
2 changes: 1 addition & 1 deletion database/dbf.ksy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
meta:
id: dbf
file-extension: dbf
application: dBASE
file-extension: dbf
xref:
justsolve: DBF
loc: fdd000325
Expand Down
32 changes: 16 additions & 16 deletions database/gettext_mo.ksy
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
meta:
id: gettext_mo
file-extension: mo
encoding: UTF-8
title: gettext binary database
application:
- GNU gettext
- libintl
file-extension: mo
tags:
- database
- linux
license: BSD-2-Clause
ks-version: 0.9
encoding: UTF-8

# Copyright (c) 2000, 2001 Citrus Project,
# All rights reserved.
Expand Down Expand Up @@ -69,7 +69,7 @@ types:
pos: 0
type: lookup_iteration(current.next, query)
if: not found

hashtable_lookup:
doc: |
def lookup(s:str, t:gettext_mo.GettextMo):
Expand All @@ -81,7 +81,7 @@ types:
return e.current
except:
raise Exception("Not found "+s+" in the hashtable!")
lookup(t.mo.originals[145].str, t)
doc-ref: https://gitlab.com/worr/libintl/raw/master/src/lib/libintl/gettext.c
params:
Expand Down Expand Up @@ -122,18 +122,18 @@ types:
'[0xde, 0x12, 0x04, 0x95]': le
'[0x95, 0x04, 0x12, 0xde]': be
seq:
- id: version
type: version
- id: num_translations
type: u4
- id: ofs_originals
type: u4
- id: ofs_translations
type: u4
- id: num_hashtable_items
type: u4
- id: ofs_hashtable_items
type: u4
- id: version
type: version
- id: num_translations
type: u4
- id: ofs_originals
type: u4
- id: ofs_translations
type: u4
- id: num_hashtable_items
type: u4
- id: ofs_hashtable_items
type: u4
instances:
originals:
io: _root._io
Expand Down
4 changes: 2 additions & 2 deletions database/sqlite3.ksy
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
meta:
id: sqlite3
title: SQLite3 database file
endian: be
license: CC0-1.0
imports:
- /common/vlq_base128_be
license: CC0-1.0
endian: be
doc: |
SQLite3 is a popular serverless SQL engine, implemented as a library
to be used within other applications. It keeps its databases as
Expand Down
Loading

0 comments on commit e510abe

Please sign in to comment.