Compare commits
140 Commits
64eae8730f
...
e2c8986f73
Author | SHA1 | Date | |
---|---|---|---|
|
e2c8986f73 | ||
|
943743dbaf | ||
|
1b85ae622b | ||
|
f6d7235449 | ||
|
aef47df26a | ||
|
1ec9748046 | ||
|
2e5514fc50 | ||
|
a59ba2a2fa | ||
|
7714fcf423 | ||
|
544cf4cc09 | ||
|
25ad5f1c8f | ||
|
9ff7da12a7 | ||
|
94cfbc670c | ||
|
163b3b609c | ||
|
cabb67e8ab | ||
|
64df8bdbf5 | ||
|
481ac91880 | ||
|
14ada50806 | ||
|
12f332064c | ||
|
0ff3e53c5f | ||
|
586cf142e5 | ||
|
fb20db5eb7 | ||
|
48868bd4ee | ||
|
c5c8b75c56 | ||
|
a5de74cd23 | ||
|
42730d7586 | ||
|
3a683b64f8 | ||
|
496849daa5 | ||
|
ebf063d1c0 | ||
|
b8eec4078f | ||
|
6e13b4b550 | ||
|
9eee65072f | ||
|
6db6a54d13 | ||
|
08ced4515f | ||
|
6059b9ee1b | ||
|
f746dab7b2 | ||
|
b482556025 | ||
|
4674060dfe | ||
|
ad2c032c7e | ||
|
d30755b06e | ||
|
2b12258eba | ||
|
efa847faf1 | ||
|
ee2ee24dbb | ||
|
d04a846f10 | ||
|
79992b341a | ||
|
ff718d8071 | ||
|
70b1b0d6a3 | ||
|
a3f5e29d8f | ||
|
f6609ccb0f | ||
|
4f90a2eaae | ||
|
63f7d79c32 | ||
|
240ae7f57d | ||
|
ebffb3be7b | ||
|
ad33225f20 | ||
|
208b3e6bf2 | ||
|
837de9f658 | ||
|
87b6c4dd6a | ||
|
5cbda8fbb0 | ||
|
8d31040fd2 | ||
|
8009b6f661 | ||
|
1784c43824 | ||
|
2f858b1c90 | ||
|
c8f9cdc9d7 | ||
|
b6ac25cb39 | ||
|
daba6b5497 | ||
|
1d6e6f590d | ||
|
b45d7d621c | ||
|
b2aa59f759 | ||
|
15a7060bff | ||
|
c2f0189371 | ||
|
2476330deb | ||
|
a0a5460cf6 | ||
|
33c93918ba | ||
|
77c000e6e9 | ||
|
0afb5b592e | ||
|
93eb6e83ef | ||
|
ed6851163f | ||
|
b67ce0268c | ||
|
c5e84236df | ||
|
bf7fa07c41 | ||
|
c6165c0caf | ||
|
48351028c5 | ||
|
4ac96a67e0 | ||
|
b542ff1d6c | ||
|
621d7f2c22 | ||
|
56cd9e83ed | ||
|
f5fd587350 | ||
|
90c0d9be94 | ||
|
7625b97a09 | ||
|
14aeab0b73 | ||
|
a3b63b1037 | ||
|
a00cfe0342 | ||
|
80bccc91ed | ||
|
ae519be2fd | ||
|
e26704049f | ||
|
3c93e21cfd | ||
|
689e9cc49a | ||
|
72b4569b15 | ||
|
4f55b6afc6 | ||
|
c364e1b661 | ||
|
b8be180e31 | ||
|
82d96cf990 | ||
|
94e80864d7 | ||
|
8f3c9cef20 | ||
|
2ea70c42ac | ||
|
961101ad0d | ||
|
ed3a126f0a | ||
|
853f78decc | ||
|
36e8287c2b | ||
|
8855d7addf | ||
|
f3b54042b1 | ||
|
b5a96e06e1 | ||
|
87052733e6 | ||
|
79e7c71c73 | ||
|
0db671f626 | ||
|
1e88b9d2c0 | ||
|
354f7eaabc | ||
|
2657988daf | ||
|
9aa99b47a3 | ||
|
ac596de1ad | ||
|
85f60df2a7 | ||
|
28ccfdd079 | ||
|
d30a8fe7bf | ||
|
ba9ecb5418 | ||
|
043f067f27 | ||
|
f7815d4c41 | ||
|
08df7f45c8 | ||
|
77b2c0225f | ||
|
735256b905 | ||
|
e8b28a6d39 | ||
|
aaa43dfb81 | ||
|
e6f98ae148 | ||
|
7500a8b767 | ||
|
ae296218cb | ||
|
3f5996171b | ||
|
a577c3987c | ||
|
1c24f64d9b | ||
|
a8dd146cb2 | ||
|
e741ca7888 | ||
|
f8f4473afd |
6
.github/workflows/ci.yml
vendored
@ -7,7 +7,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
GOLANGCILINT_VERSION: "1.56.1"
|
||||
GOLANGCILINT_VERSION: "1.58.2"
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
@ -15,7 +15,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.22.0"
|
||||
go-version: "1.22.3"
|
||||
- uses: actions/checkout@v3
|
||||
- uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
@ -47,7 +47,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.22.0"
|
||||
go-version: "1.22.3"
|
||||
- name: Test
|
||||
env:
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
|
4
.github/workflows/release.yml
vendored
@ -15,8 +15,8 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.22.0"
|
||||
- uses: goreleaser/goreleaser-action@v2
|
||||
go-version: "1.22.3"
|
||||
- uses: goreleaser/goreleaser-action@v5
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
|
@ -23,6 +23,8 @@ linters:
|
||||
- unconvert
|
||||
- unparam
|
||||
- wastedassign
|
||||
- staticcheck
|
||||
- govet
|
||||
|
||||
linters-settings:
|
||||
revive:
|
||||
@ -41,6 +43,13 @@ linters-settings:
|
||||
- rela
|
||||
- equalisation
|
||||
- synchronisation
|
||||
govet:
|
||||
enable-all: true
|
||||
disable:
|
||||
- fieldalignment
|
||||
- shadow
|
||||
staticcheck:
|
||||
checks: ["all"]
|
||||
|
||||
run:
|
||||
timeout: 5m
|
||||
|
@ -59,7 +59,7 @@ brews:
|
||||
repository:
|
||||
owner: wader
|
||||
name: homebrew-tap
|
||||
folder: Formula
|
||||
directory: Formula
|
||||
homepage: https://github.com/wader/fq
|
||||
description: jq for binary formats
|
||||
license: MIT
|
||||
|
86
CHANGES.md
@ -1,3 +1,88 @@
|
||||
# 0.11.0
|
||||
|
||||
New iNES/NES 2.0 ROM decoder (thanks @mlofjard) and basic JPEG 2000 format support. jq language improvements and fixes from gojq. And as always various decoder improvements and fixes.
|
||||
|
||||
## Changes
|
||||
|
||||
- Add `string_truncate` option to configure how to truncate long strings when displaying a decode value tree. `dd`, `dv` etc set truncate length to zero to not truncate. #919
|
||||
- gojq updates from upstream:
|
||||
- Implement `ltrim`, `rtrim`, and `trim` functions
|
||||
- Fix object construction with duplicate keys (`{x:0,y:1} | {a:.x,a:.y}`)
|
||||
- Fix `halt` and `halt_error` functions to stop the command execution immediately
|
||||
- Fix variable scope of binding syntax (`"a" as $v | def f: $v; "b" as $v | f`)
|
||||
- Fix `ltrimstr` and `rtrimstr` functions to emit error on non-string input
|
||||
- Fix `nearbyint` and `rint` functions to round ties to even
|
||||
- Improve parser to allow `reduce`, `foreach`, `if`, `try`-`catch` syntax as object values
|
||||
- Remove `pow10` in favor of `exp10`, define `scalbn` and `scalbln` by `ldexp`
|
||||
- Fix issue using decode value with `ltrimstr`/`rtrimstr`.
|
||||
|
||||
## Format changes
|
||||
|
||||
- `fit`
|
||||
- Skip array fields on pre read messages. #878
|
||||
- Fixed subfield referencing fields below self in message. #877
|
||||
- `jp2c` New JPEG 2000 codestream decoder. #928
|
||||
- `icc_profile` Strip whitespace in header and tag strings. #912
|
||||
- `mp4`
|
||||
- Add `jp2c`, `jp2h`, `ihdr` `jP` JPEG 2000 related boxes support. #928
|
||||
- Add `thmb` box support. #897
|
||||
- Turns out for qt brand `hdlr` component name might be zero bytes. #896
|
||||
- `nes` New iNES/NES 2.0 ROM decoder (thanks @mlofjard). #893
|
||||
|
||||
## Changelog
|
||||
|
||||
* f7b067b6 Fixed subfield referencing fields below self in message
|
||||
* 9aa99b47 Update docker-golang to 1.22.1 from 1.22.0
|
||||
* 0afb5b59 Update docker-golang to 1.22.2 from 1.22.1
|
||||
* 2657988d Update github-go-version to 1.22.1 from 1.22.0
|
||||
* 33c93918 Update github-go-version to 1.22.2 from 1.22.1
|
||||
* a577c398 Update github-golangci-lint to 1.56.2 from 1.56.1
|
||||
* 82d96cf9 Update github-golangci-lint to 1.57.0 from 1.56.2
|
||||
* 72b4569b Update github-golangci-lint to 1.57.1 from 1.57.0
|
||||
* 14aeab0b Update github-golangci-lint to 1.57.2 from 1.57.1
|
||||
* 735256b9 Update gomod-golang-x-crypto to 0.20.0 from 0.19.0
|
||||
* 043f067f Update gomod-golang-x-crypto to 0.21.0 from 0.20.0
|
||||
* 15a7060b Update gomod-golang-x-crypto to 0.22.0 from 0.21.0
|
||||
* 85f60df2 Update gomod-golang-x-net to 0.22.0 from 0.21.0
|
||||
* 77c000e6 Update gomod-golang-x-net to 0.23.0 from 0.22.0
|
||||
* daba6b54 Update gomod-golang-x-net to 0.24.0 from 0.23.0
|
||||
* ba9ecb54 Update gomod-golang-x-term to 0.18.0 from 0.17.0
|
||||
* b2aa59f7 Update gomod-golang-x-term to 0.19.0 from 0.18.0
|
||||
* 1c24f64d Update make-golangci-lint to 1.56.2 from 1.56.1
|
||||
* 94e80864 Update make-golangci-lint to 1.57.0 from 1.56.2
|
||||
* 4f55b6af Update make-golangci-lint to 1.57.1 from 1.57.0
|
||||
* a3b63b10 Update make-golangci-lint to 1.57.2 from 1.57.1
|
||||
* 208b3e6b chore: fix function name in comment
|
||||
* 621d7f2c decode: Align some heavily used structs to save space
|
||||
* ee2ee24d decode: Cleanup io panic a bit
|
||||
* e741ca78 doc: Add ImHex to related tools
|
||||
* 36e8287c doc: Regenerate after nes and new ansisvg
|
||||
* 225fd507 fit: Skip array fields on pre read messages
|
||||
* 7500a8b7 fq: Sort formats
|
||||
* bf7fa07c fq: Use go 1.20 and cleanup
|
||||
* e2670404 gojq: Update fq fork
|
||||
* f5fd5873 gojq: Update fq fork
|
||||
* ed685116 icc_profile: Strip whitespace in header and tag strings
|
||||
* c8f9cdc9 interp: Add string_truncate option
|
||||
* 0db671f6 interp: Add todo test for eval error in path
|
||||
* ebffb3be jp2c: Add jpeg2000 codestream format
|
||||
* 79992b34 jp2c: Fail probe faster
|
||||
* 63f7d79c jp2c: Support probe
|
||||
* b542ff1d lint: More linters and some fixes
|
||||
* c6165c0c mod: go get non-bump tracked modules
|
||||
* 1784c438 mp4,avi: Trim spaces for type
|
||||
* 2ea70c42 mp4: Add thmb box support
|
||||
* 4f90a2ea mp4: Decode jP box
|
||||
* 70b1b0d6 mp4: Decode uinf box
|
||||
* 87b6c4dd mp4: Fix jp2 test
|
||||
* 8009b6f6 mp4: JPEG200 boxes jp2h and ihdr
|
||||
* ed3a126f mp4: Turns out for qt brand hdlr component name might be zero bytes
|
||||
* f3b54042 nes: Add support for iNES/NES 2.0 ROM files
|
||||
* 80bccc91 opus,vorbis: More sym snake_case
|
||||
* 08df7f45 pkg/cli/test_exp.sh: use command -v
|
||||
* 87052733 pssh_playready: Use snake_case sym values
|
||||
* aaa43dfb test: Replace pmezard/go-difflib with go's internal diff
|
||||
|
||||
# 0.10.0
|
||||
|
||||
Adds support for various LevelDB formats (thanks @mikez) and Garmin Flexible and Interoperable Data Transfer format (FIT) (thanks @mlofjard).
|
||||
@ -43,7 +128,6 @@ And as usual some small fixes and dependency updates.
|
||||
$ fq -L . -r 'include "to_kml"; to_kml' file.fit > file.kml
|
||||
```
|
||||
|
||||
|
||||
- `hevc_sps` Fix some incorrect profile_tier_level decoding. #829
|
||||
- `html` Fix issue parsing elements including SOLIDUS "/". #870
|
||||
- Upstream issue https://github.com/golang/go/issues/63402
|
||||
|
@ -1,5 +1,5 @@
|
||||
# bump: docker-golang /FROM golang:([\d.]+)/ docker:golang|^1
|
||||
FROM golang:1.22.0-bookworm AS base
|
||||
FROM golang:1.22.3-bookworm AS base
|
||||
|
||||
# expect is used to test cli
|
||||
RUN \
|
||||
|
2
Makefile
@ -61,7 +61,7 @@ gogenerate: always
|
||||
lint: always
|
||||
# bump: make-golangci-lint /golangci-lint@v([\d.]+)/ git:https://github.com/golangci/golangci-lint.git|^1
|
||||
# bump: make-golangci-lint link "Release notes" https://github.com/golangci/golangci-lint/releases/tag/v$LATEST
|
||||
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.1 run
|
||||
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.2 run
|
||||
|
||||
depgraph.svg: always
|
||||
go run github.com/kisielk/godepgraph@latest github.com/wader/fq | dot -Tsvg -o godepgraph.svg
|
||||
|
29
README.md
@ -2,25 +2,23 @@
|
||||
|
||||
Tool, language and decoders for working with binary data.
|
||||
|
||||
TLDR: it aims to be jq, hexdump, dd and gdb for files combined into one.
|
||||
|
||||
![fq demo](doc/demo.svg)
|
||||
|
||||
Basic usage is `fq . file` or `fq d file`.
|
||||
Basic usage is `fq . file`, `fq d file` or `fq 'some query' file ...`.
|
||||
|
||||
For details see [usage.md](doc/usage.md).
|
||||
|
||||
### Background
|
||||
|
||||
fq is inspired by the well known jq tool and language that allows you to work with binary formats the same way you would using jq. In addition it can present data like a hex viewer, transform, slice and concatenate binary data. It also supports nested formats and has an interactive REPL with auto-completion.
|
||||
fq is inspired by the [jq](https://jqlang.github.io/jq/) tool and language and allows you to work with binary formats in the same way. In addition to using jq expressions it can also present decoded tree structures, transform, slice and concatenate binary data. It also supports nested formats and features an interactive REPL with auto-completion of functions and names.
|
||||
|
||||
It was originally designed to query, inspect and debug media codecs and containers like mp4, flac, mp3, jpeg. But since then it has been extended to support a variety of formats like executables, packet captures (with TCP reassembly) and serialization formats like JSON, YAML, XML, ASN1 BER, Avro, CBOR, protobuf. In addition it also has functions to work with URLs, convert to/from hex, number bases, search for things etc.
|
||||
|
||||
In summary it aims to be jq, hexdump, dd and gdb for files combined into one.
|
||||
|
||||
**NOTE:** fq is still early in development so things might change, be broken or do not make sense. That also means that there is a great opportunity to help out!
|
||||
It was originally designed to query, inspect and debug media codecs and containers like MP4, FLAC and JPEG but has since been extended to support a variety of formats like executables, packet captures (with TCP reassembly) and serialization formats like JSON, YAML, XML, CBOR, protobuf. In addition it also has functions to work with URLs, convert to/from hex, number bases, search for patterns etc.
|
||||
|
||||
### Goals
|
||||
|
||||
- Make binaries accessible, queryable and sliceable.
|
||||
- Make binaries more accessible, queryable and sliceable.
|
||||
- Nested formats and bit-oriented decoding.
|
||||
- Quick and comfortable CLI tool.
|
||||
- Bits and bytes transformations.
|
||||
@ -100,6 +98,7 @@ id3v11,
|
||||
id3v2,
|
||||
ipv4_packet,
|
||||
ipv6_packet,
|
||||
jp2c,
|
||||
jpeg,
|
||||
json,
|
||||
jsonl,
|
||||
@ -124,6 +123,7 @@ mpeg_pes_packet,
|
||||
mpeg_spu,
|
||||
mpeg_ts,
|
||||
[msgpack](doc/formats.md#msgpack),
|
||||
[nes](doc/formats.md#nes),
|
||||
ogg,
|
||||
ogg_page,
|
||||
[opentimestamps](doc/formats.md#opentimestamps),
|
||||
@ -239,9 +239,9 @@ apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing fq
|
||||
|
||||
### Build from source
|
||||
|
||||
Make sure you have [go](https://go.dev) 1.18 or later installed.
|
||||
Make sure you have [go](https://go.dev) 1.20 or later installed.
|
||||
|
||||
To install directly from git repository (no clone needed):
|
||||
To install directly from git repository (no git clone needed):
|
||||
```sh
|
||||
# build and install latest release
|
||||
go install github.com/wader/fq@latest
|
||||
@ -265,10 +265,6 @@ go build -o fq .
|
||||
make test fq
|
||||
```
|
||||
|
||||
## TODO and ideas
|
||||
|
||||
See [TODO.md](doc/TODO.md)
|
||||
|
||||
## Development and adding a new decoder
|
||||
|
||||
See [dev.md](doc/dev.md)
|
||||
@ -285,6 +281,7 @@ for inventing the [jq](https://github.com/stedolan/jq) language.
|
||||
#### Tools
|
||||
|
||||
- [HexFiend](https://github.com/HexFiend/HexFiend) - Hex editor for macOS with format template support.
|
||||
- [ImHex](https://github.com/WerWolv/ImHex) - A Hex Editor for Reverse Engineers.
|
||||
- [binspector](https://github.com/binspector/binspector) - Binary format analysis tool with query language and REPL.
|
||||
- [kaitai](https://kaitai.io) - Declarative binary format parsing.
|
||||
- [Wireshark](https://www.wireshark.org) - Decodes network traffic (tip: `tshark -T json`).
|
||||
@ -303,6 +300,10 @@ for inventing the [jq](https://github.com/stedolan/jq) language.
|
||||
- [Sustainability of Digital Formats](https://www.loc.gov/preservation/digital/formats/) at Library of Congress.
|
||||
- [Data Format Description Language (DFDL)](https://en.wikipedia.org/wiki/Data_Format_Description_Language).
|
||||
|
||||
## TODO and ideas
|
||||
|
||||
See [TODO.md](doc/TODO.md)
|
||||
|
||||
## License
|
||||
|
||||
`fq` is distributed under the terms of the MIT License.
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build exclude
|
||||
|
||||
// tool to convert go fuzz input files to bytes
|
||||
// Usage: cat format/testdata/fuzz/FuzzFormats/144bde49b40c90fd05d302ec90b6ddb2b6d6aea553bad520a8b954797e40fe72 | go run dev/fuzzbytes.go | go run .
|
||||
package main
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build exclude
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
88
doc/demo.svg
@ -28,49 +28,47 @@
|
||||
.fa15 { fill: #ffffff; }
|
||||
</style>
|
||||
<rect width="100%" height="100%" x="0" y="0" style="fill: #000000"/>
|
||||
<g x="0">
|
||||
<text y="0.5em"><tspan class="fa15"># Overview of mp3 file</tspan></text>
|
||||
<text y="1.5em"><tspan>$ fq . file.mp3</tspan></text>
|
||||
<text y="2.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.{}: file.mp3 (mp3)</tspan></text>
|
||||
<text y="3.5em"><tspan class="fa3">0x000</tspan><tspan>│49 44 33 </tspan><tspan class="bold">04 </tspan><tspan class="fa8">00 00 00 00 </tspan><tspan class="bold">15 </tspan><tspan>39 54 53 53 45 </tspan><tspan class="fa8">00 00</tspan><tspan>│ID3</tspan><tspan class="bold">.</tspan><tspan class="fa8">....</tspan><tspan class="bold">.</tspan><tspan>9TSSE</tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">headers</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]:</tspan></text>
|
||||
<text y="4.5em"><tspan class="fa3">* </tspan><tspan>│until 0xac2.7 (2755) │ │</tspan></text>
|
||||
<text y="5.5em"><tspan class="fa3">0xac0</tspan><tspan>│ </tspan><tspan class="bold">ff fb </tspan><tspan>40 </tspan><tspan class="bold">c0 </tspan><tspan class="fa8">00 00 00 00 00 00 00 00 00</tspan><tspan>│ </tspan><tspan class="bold">..</tspan><tspan>@</tspan><tspan class="bold">.</tspan><tspan class="fa8">.........</tspan><tspan>│ </tspan><tspan class="fa12">frames</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">3</tspan><tspan>]:</tspan></text>
|
||||
<text y="6.5em"><tspan class="fa3">0xad0</tspan><tspan>│</tspan><tspan class="fa8">00 00 00 00 00 00 00 00 </tspan><tspan>49 6e 66 6f </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">0f</tspan><tspan>│</tspan><tspan class="fa8">........</tspan><tspan>Info</tspan><tspan class="fa8">...</tspan><tspan class="bold">.</tspan><tspan>│</tspan></text>
|
||||
<text y="7.5em"><tspan class="fa3">* </tspan><tspan>│until 0xd19.7 (end) (599) │ │</tspan></text>
|
||||
<text y="8.5em"><tspan> │ │ │ </tspan><tspan class="fa12">footers</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">0</tspan><tspan>]:</tspan></text>
|
||||
<text y="10.5em"><tspan class="fa15"># Show header of first ID3v2 tag inside mp3 file</tspan></text>
|
||||
<text y="11.5em"><tspan>$ fq '.headers[0].header' file.mp3</tspan></text>
|
||||
<text y="12.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">headers</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>].</tspan><tspan class="fa12">header</tspan><tspan>{}:</tspan></text>
|
||||
<text y="13.5em"><tspan class="fa3">0x0</tspan><tspan>│49 44 33 │ID3 │ </tspan><tspan class="fa12">magic</tspan><tspan>: </tspan><tspan class="fa2">"ID3" </tspan><tspan>(valid)</tspan></text>
|
||||
<text y="14.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="bold">04 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">4 </tspan><tspan>(valid)</tspan></text>
|
||||
<text y="15.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">revision</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text y="16.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>{}:</tspan></text>
|
||||
<text y="17.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="fa8">00 00 </tspan><tspan class="bold">15 </tspan><tspan>39 │ </tspan><tspan class="fa8">..</tspan><tspan class="bold">.</tspan><tspan>9 │ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">2745</tspan></text>
|
||||
<text y="19.5em"><tspan class="fa15"># Show encoder software used</tspan></text>
|
||||
<text y="20.5em"><tspan>$ fq -r '.frames[0].tag.encoder | tovalue' file.mp3</tspan></text>
|
||||
<text y="21.5em"><tspan>Lavc58.13</tspan></text>
|
||||
<text y="23.5em"><tspan class="fa15"># Decode at two offsets as mp3_frame and show bitrate</tspan></text>
|
||||
<text y="24.5em"><tspan>$ fq -d bytes '.[0xb79,0xc49:] | mp3_frame.header.bitrate' file.mp3</tspan></text>
|
||||
<text y="25.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│</tspan></text>
|
||||
<text y="26.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │.</tspan><tspan class="fa12">header</tspan><tspan>.</tspan><tspan class="fa12">bitrate</tspan><tspan>: </tspan><tspan class="fa6">64000 </tspan><tspan>(</tspan><tspan class="fa6">5</tspan><tspan>)</tspan></text>
|
||||
<text y="27.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│</tspan></text>
|
||||
<text y="28.5em"><tspan class="fa3">0xc40</tspan><tspan>│ 52 │ R │.</tspan><tspan class="fa12">header</tspan><tspan>.</tspan><tspan class="fa12">bitrate</tspan><tspan>: </tspan><tspan class="fa6">64000 </tspan><tspan>(</tspan><tspan class="fa6">5</tspan><tspan>)</tspan></text>
|
||||
<text y="30.5em"><tspan class="fa15"># Extract PNG file</tspan></text>
|
||||
<text y="31.5em"><tspan>$ fq '.headers[].frames[] | select(.id == "APIC")?.picture | tobits' file.mp3 >file.png</tspan></text>
|
||||
<text y="32.5em"><tspan>$ file file.png</tspan></text>
|
||||
<text y="33.5em"><tspan>file.png: PNG image data, 320 x 240, 8-bit/color RGB, non-interlaced</tspan></text>
|
||||
<text y="35.5em"><tspan class="fa15"># Resolution of embedded PNG cover art as YAML</tspan></text>
|
||||
<text y="36.5em"><tspan>$ fq -r '.headers[0].frames[] | grep_by(.id == "APIC") | grep_by(.type == "IHDR") | {res: {width, height}} | to_yaml' file.mp3</tspan></text>
|
||||
<text y="37.5em"><tspan>res:</tspan></text>
|
||||
<text y="38.5em"><tspan> height: 240</tspan></text>
|
||||
<text y="39.5em"><tspan> width: 320</tspan></text>
|
||||
<text y="41.5em"><tspan class="fa15"># Add query parameter to URL</tspan></text>
|
||||
<text y="42.5em"><tspan>$ echo 'http://host?a=b' | fq -Rr 'from_url | .query.b = "a b c" | to_url'</tspan></text>
|
||||
<text y="43.5em"><tspan>http://host?a=b&b=a+b+c</tspan></text>
|
||||
<text y="45.5em"><tspan class="fa15"># Extract JSON and base64 encoded query parameter p</tspan></text>
|
||||
<text y="46.5em"><tspan>$ echo 'https://host?p=eyJhIjoiaGVsbG8ifQ%3D%3D' | fq -R 'from_url.query.p | from_base64 | fromjson'</tspan></text>
|
||||
<text y="47.5em"><tspan>{</tspan></text>
|
||||
<text y="48.5em"><tspan> </tspan><tspan class="fa12">"a"</tspan><tspan>: </tspan><tspan class="fa2">"hello"</tspan></text>
|
||||
<text y="49.5em"><tspan>}</tspan></text>
|
||||
</g>
|
||||
<text x="0ch" y="0.5em"><tspan class="fa15"># Overview of mp3 file</tspan></text>
|
||||
<text x="0ch" y="1.5em"><tspan>$ fq . file.mp3</tspan></text>
|
||||
<text x="0ch" y="2.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.{}: file.mp3 (mp3)</tspan></text>
|
||||
<text x="0ch" y="3.5em"><tspan class="fa3">0x000</tspan><tspan>│49 44 33 </tspan><tspan class="bold">04 </tspan><tspan class="fa8">00 00 00 00 </tspan><tspan class="bold">15 </tspan><tspan>39 54 53 53 45 </tspan><tspan class="fa8">00 00</tspan><tspan>│ID3</tspan><tspan class="bold">.</tspan><tspan class="fa8">....</tspan><tspan class="bold">.</tspan><tspan>9TSSE</tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">headers</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]:</tspan></text>
|
||||
<text x="0ch" y="4.5em"><tspan class="fa3">* </tspan><tspan>│until 0xac2.7 (2755) │ │</tspan></text>
|
||||
<text x="0ch" y="5.5em"><tspan class="fa3">0xac0</tspan><tspan>│ </tspan><tspan class="bold">ff fb </tspan><tspan>40 </tspan><tspan class="bold">c0 </tspan><tspan class="fa8">00 00 00 00 00 00 00 00 00</tspan><tspan>│ </tspan><tspan class="bold">..</tspan><tspan>@</tspan><tspan class="bold">.</tspan><tspan class="fa8">.........</tspan><tspan>│ </tspan><tspan class="fa12">frames</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">3</tspan><tspan>]:</tspan></text>
|
||||
<text x="0ch" y="6.5em"><tspan class="fa3">0xad0</tspan><tspan>│</tspan><tspan class="fa8">00 00 00 00 00 00 00 00 </tspan><tspan>49 6e 66 6f </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">0f</tspan><tspan>│</tspan><tspan class="fa8">........</tspan><tspan>Info</tspan><tspan class="fa8">...</tspan><tspan class="bold">.</tspan><tspan>│</tspan></text>
|
||||
<text x="0ch" y="7.5em"><tspan class="fa3">* </tspan><tspan>│until 0xd19.7 (end) (599) │ │</tspan></text>
|
||||
<text x="0ch" y="8.5em"><tspan> │ │ │ </tspan><tspan class="fa12">footers</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">0</tspan><tspan>]:</tspan></text>
|
||||
<text x="0ch" y="10.5em"><tspan class="fa15"># Show header of first ID3v2 tag inside mp3 file</tspan></text>
|
||||
<text x="0ch" y="11.5em"><tspan>$ fq '.headers[0].header' file.mp3</tspan></text>
|
||||
<text x="0ch" y="12.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">headers</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>].</tspan><tspan class="fa12">header</tspan><tspan>{}:</tspan></text>
|
||||
<text x="0ch" y="13.5em"><tspan class="fa3">0x0</tspan><tspan>│49 44 33 │ID3 │ </tspan><tspan class="fa12">magic</tspan><tspan>: </tspan><tspan class="fa2">"ID3" </tspan><tspan>(valid)</tspan></text>
|
||||
<text x="0ch" y="14.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="bold">04 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">4 </tspan><tspan>(valid)</tspan></text>
|
||||
<text x="0ch" y="15.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">revision</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text x="0ch" y="16.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>{}:</tspan></text>
|
||||
<text x="0ch" y="17.5em"><tspan class="fa3">0x0</tspan><tspan>│ </tspan><tspan class="fa8">00 00 </tspan><tspan class="bold">15 </tspan><tspan>39 │ </tspan><tspan class="fa8">..</tspan><tspan class="bold">.</tspan><tspan>9 │ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">2745</tspan></text>
|
||||
<text x="0ch" y="19.5em"><tspan class="fa15"># Show encoder software used</tspan></text>
|
||||
<text x="0ch" y="20.5em"><tspan>$ fq -r '.frames[0].tag.encoder | tovalue' file.mp3</tspan></text>
|
||||
<text x="0ch" y="21.5em"><tspan>Lavc58.13</tspan></text>
|
||||
<text x="0ch" y="23.5em"><tspan class="fa15"># Decode at two offsets as mp3_frame and show bitrate</tspan></text>
|
||||
<text x="0ch" y="24.5em"><tspan>$ fq -d bytes '.[0xb79,0xc49:] | mp3_frame.header.bitrate' file.mp3</tspan></text>
|
||||
<text x="0ch" y="25.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│</tspan></text>
|
||||
<text x="0ch" y="26.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │.</tspan><tspan class="fa12">header</tspan><tspan>.</tspan><tspan class="fa12">bitrate</tspan><tspan>: </tspan><tspan class="fa6">64000 </tspan><tspan>(</tspan><tspan class="fa6">5</tspan><tspan>)</tspan></text>
|
||||
<text x="0ch" y="27.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│</tspan></text>
|
||||
<text x="0ch" y="28.5em"><tspan class="fa3">0xc40</tspan><tspan>│ 52 │ R │.</tspan><tspan class="fa12">header</tspan><tspan>.</tspan><tspan class="fa12">bitrate</tspan><tspan>: </tspan><tspan class="fa6">64000 </tspan><tspan>(</tspan><tspan class="fa6">5</tspan><tspan>)</tspan></text>
|
||||
<text x="0ch" y="30.5em"><tspan class="fa15"># Extract PNG file</tspan></text>
|
||||
<text x="0ch" y="31.5em"><tspan>$ fq '.headers[].frames[] | select(.id == "APIC")?.picture | tobits' file.mp3 >file.png</tspan></text>
|
||||
<text x="0ch" y="32.5em"><tspan>$ file file.png</tspan></text>
|
||||
<text x="0ch" y="33.5em"><tspan>file.png: PNG image data, 320 x 240, 8-bit/color RGB, non-interlaced</tspan></text>
|
||||
<text x="0ch" y="35.5em"><tspan class="fa15"># Resolution of embedded PNG cover art as YAML</tspan></text>
|
||||
<text x="0ch" y="36.5em"><tspan>$ fq -r '.headers[0].frames[] | grep_by(.id == "APIC") | grep_by(.type == "IHDR") | {res: {width, height}} | to_yaml' file.mp3</tspan></text>
|
||||
<text x="0ch" y="37.5em"><tspan>res:</tspan></text>
|
||||
<text x="0ch" y="38.5em"><tspan> height: 240</tspan></text>
|
||||
<text x="0ch" y="39.5em"><tspan> width: 320</tspan></text>
|
||||
<text x="0ch" y="41.5em"><tspan class="fa15"># Add query parameter to URL</tspan></text>
|
||||
<text x="0ch" y="42.5em"><tspan>$ echo 'http://host?a=b' | fq -Rr 'from_url | .query.b = "a b c" | to_url'</tspan></text>
|
||||
<text x="0ch" y="43.5em"><tspan>http://host?a=b&b=a+b+c</tspan></text>
|
||||
<text x="0ch" y="45.5em"><tspan class="fa15"># Extract JSON and base64 encoded query parameter p</tspan></text>
|
||||
<text x="0ch" y="46.5em"><tspan>$ echo 'https://host?p=eyJhIjoiaGVsbG8ifQ%3D%3D' | fq -R 'from_url.query.p | from_base64 | fromjson'</tspan></text>
|
||||
<text x="0ch" y="47.5em"><tspan>{</tspan></text>
|
||||
<text x="0ch" y="48.5em"><tspan> </tspan><tspan class="fa12">"a"</tspan><tspan>: </tspan><tspan class="fa2">"hello"</tspan></text>
|
||||
<text x="0ch" y="49.5em"><tspan>}</tspan></text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.7 KiB |
@ -236,8 +236,8 @@ make test
|
||||
go test ./...
|
||||
# run all tests for one format
|
||||
go test -run TestFormats/mp4 ./format/
|
||||
# update all actual outputs in tests
|
||||
go test ./... -update
|
||||
# update all expected outputs for tests
|
||||
go test ./pkg/interp ./format -update
|
||||
# update actual output for specific tests
|
||||
go run ./format -run TestFormats/elf -update
|
||||
# color diff
|
||||
|
@ -27,16 +27,14 @@
|
||||
.fa12 { fill: #5555ff; }
|
||||
</style>
|
||||
<rect width="100%" height="100%" x="0" y="0" style="fill: #000000"/>
|
||||
<g x="0">
|
||||
<text y="0.5em"><tspan>$ fq 'first(grep_by(.type == "elst"))' file.mp4</tspan></text>
|
||||
<text y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">3</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>]{}: box</tspan></text>
|
||||
<text y="2.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">1c </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">28</tspan></text>
|
||||
<text y="3.5em"><tspan class="fa3">0xd60</tspan><tspan>│ 65 6c 73 74 │ elst │ </tspan><tspan class="fa12">type</tspan><tspan>: </tspan><tspan class="fa2">"elst" </tspan><tspan>(An edit list)</tspan></text>
|
||||
<text y="4.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text y="5.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00</tspan><tspan>│ </tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text y="6.5em"><tspan class="fa3">0xd70</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
<text y="7.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">01 </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">entry_count</tspan><tspan>: </tspan><tspan class="fa6">1</tspan></text>
|
||||
<text y="8.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan>28 </tspan><tspan class="fa8">00 00 00 00 00 </tspan><tspan class="bold">01 </tspan><tspan class="fa8">00</tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan>(</tspan><tspan class="fa8">.....</tspan><tspan class="bold">.</tspan><tspan class="fa8">.</tspan><tspan>│ </tspan><tspan class="fa12">entries</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]:</tspan></text>
|
||||
<text y="9.5em"><tspan class="fa3">0xd80</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
</g>
|
||||
<text x="0ch" y="0.5em"><tspan>$ fq 'first(grep_by(.type == "elst"))' file.mp4</tspan></text>
|
||||
<text x="0ch" y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">3</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>]{}: box</tspan></text>
|
||||
<text x="0ch" y="2.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">1c </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">28</tspan></text>
|
||||
<text x="0ch" y="3.5em"><tspan class="fa3">0xd60</tspan><tspan>│ 65 6c 73 74 │ elst │ </tspan><tspan class="fa12">type</tspan><tspan>: </tspan><tspan class="fa2">"elst" </tspan><tspan>(An edit list)</tspan></text>
|
||||
<text x="0ch" y="4.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text x="0ch" y="5.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00</tspan><tspan>│ </tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text x="0ch" y="6.5em"><tspan class="fa3">0xd70</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
<text x="0ch" y="7.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">01 </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">entry_count</tspan><tspan>: </tspan><tspan class="fa6">1</tspan></text>
|
||||
<text x="0ch" y="8.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan>28 </tspan><tspan class="fa8">00 00 00 00 00 </tspan><tspan class="bold">01 </tspan><tspan class="fa8">00</tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan>(</tspan><tspan class="fa8">.....</tspan><tspan class="bold">.</tspan><tspan class="fa8">.</tspan><tspan>│ </tspan><tspan class="fa12">entries</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]:</tspan></text>
|
||||
<text x="0ch" y="9.5em"><tspan class="fa3">0xd80</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.2 KiB |
@ -27,20 +27,18 @@
|
||||
.fa12 { fill: #5555ff; }
|
||||
</style>
|
||||
<rect width="100%" height="100%" x="0" y="0" style="fill: #000000"/>
|
||||
<g x="0">
|
||||
<text y="0.5em"><tspan>$ fq 'first(grep_by(.type == "elst")) | d' file.mp4</tspan></text>
|
||||
<text y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">3</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>]{}: box</tspan></text>
|
||||
<text y="2.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">1c </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">28</tspan></text>
|
||||
<text y="3.5em"><tspan class="fa3">0xd60</tspan><tspan>│ 65 6c 73 74 │ elst │ </tspan><tspan class="fa12">type</tspan><tspan>: </tspan><tspan class="fa2">"elst" </tspan><tspan>(An edit list)</tspan></text>
|
||||
<text y="4.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text y="5.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00</tspan><tspan>│ </tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text y="6.5em"><tspan class="fa3">0xd70</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
<text y="7.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">01 </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">entry_count</tspan><tspan>: </tspan><tspan class="fa6">1</tspan></text>
|
||||
<text y="8.5em"><tspan> │ │ │ </tspan><tspan class="fa12">entries</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]:</tspan></text>
|
||||
<text y="9.5em"><tspan> │ │ │ [</tspan><tspan class="fa6">0</tspan><tspan>]{}: entry</tspan></text>
|
||||
<text y="10.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan>28 │ </tspan><tspan class="fa8">...</tspan><tspan>( │ </tspan><tspan class="fa12">segment_duration</tspan><tspan>: </tspan><tspan class="fa6">40</tspan></text>
|
||||
<text y="11.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 00 </tspan><tspan>│ </tspan><tspan class="fa8">.... </tspan><tspan>│ </tspan><tspan class="fa12">media_time</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text y="12.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan class="bold">01 </tspan><tspan class="fa8">00</tspan><tspan>│ </tspan><tspan class="fa8">.</tspan><tspan class="bold">.</tspan><tspan class="fa8">.</tspan><tspan>│ </tspan><tspan class="fa12">media_rate</tspan><tspan>: </tspan><tspan class="fa6">1</tspan></text>
|
||||
<text y="13.5em"><tspan class="fa3">0xd80</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
</g>
|
||||
<text x="0ch" y="0.5em"><tspan>$ fq 'first(grep_by(.type == "elst")) | d' file.mp4</tspan></text>
|
||||
<text x="0ch" y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">3</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>]{}: box</tspan></text>
|
||||
<text x="0ch" y="2.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">1c </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">28</tspan></text>
|
||||
<text x="0ch" y="3.5em"><tspan class="fa3">0xd60</tspan><tspan>│ 65 6c 73 74 │ elst │ </tspan><tspan class="fa12">type</tspan><tspan>: </tspan><tspan class="fa2">"elst" </tspan><tspan>(An edit list)</tspan></text>
|
||||
<text x="0ch" y="4.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text x="0ch" y="5.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00</tspan><tspan>│ </tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text x="0ch" y="6.5em"><tspan class="fa3">0xd70</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
<text x="0ch" y="7.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">01 </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">entry_count</tspan><tspan>: </tspan><tspan class="fa6">1</tspan></text>
|
||||
<text x="0ch" y="8.5em"><tspan> │ │ │ </tspan><tspan class="fa12">entries</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]:</tspan></text>
|
||||
<text x="0ch" y="9.5em"><tspan> │ │ │ [</tspan><tspan class="fa6">0</tspan><tspan>]{}: entry</tspan></text>
|
||||
<text x="0ch" y="10.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan>28 │ </tspan><tspan class="fa8">...</tspan><tspan>( │ </tspan><tspan class="fa12">segment_duration</tspan><tspan>: </tspan><tspan class="fa6">40</tspan></text>
|
||||
<text x="0ch" y="11.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 00 </tspan><tspan>│ </tspan><tspan class="fa8">.... </tspan><tspan>│ </tspan><tspan class="fa12">media_time</tspan><tspan>: </tspan><tspan class="fa6">0</tspan></text>
|
||||
<text x="0ch" y="12.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan class="bold">01 </tspan><tspan class="fa8">00</tspan><tspan>│ </tspan><tspan class="fa8">.</tspan><tspan class="bold">.</tspan><tspan class="fa8">.</tspan><tspan>│ </tspan><tspan class="fa12">media_rate</tspan><tspan>: </tspan><tspan class="fa6">1</tspan></text>
|
||||
<text x="0ch" y="13.5em"><tspan class="fa3">0xd80</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.2 KiB |
@ -27,20 +27,18 @@
|
||||
.fa12 { fill: #5555ff; }
|
||||
</style>
|
||||
<rect width="100%" height="100%" x="0" y="0" style="fill: #000000"/>
|
||||
<g x="0">
|
||||
<text y="0.5em"><tspan>$ fq 'first(grep_by(.type == "elst")) | dv' file.mp4</tspan></text>
|
||||
<text y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">3</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>]{}: box 0xd65-0xd81 (28)</tspan></text>
|
||||
<text y="2.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">1c </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">28 </tspan><tspan>0xd65-0xd69 (4)</tspan></text>
|
||||
<text y="3.5em"><tspan class="fa3">0xd60</tspan><tspan>│ 65 6c 73 74 │ elst │ </tspan><tspan class="fa12">type</tspan><tspan>: </tspan><tspan class="fa2">"elst" </tspan><tspan>(An edit list) 0xd69-0xd6d (4)</tspan></text>
|
||||
<text y="4.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xd6d-0xd6e (1)</tspan></text>
|
||||
<text y="5.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00</tspan><tspan>│ </tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xd6e-0xd71 (3)</tspan></text>
|
||||
<text y="6.5em"><tspan class="fa3">0xd70</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
<text y="7.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">01 </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">entry_count</tspan><tspan>: </tspan><tspan class="fa6">1 </tspan><tspan>0xd71-0xd75 (4)</tspan></text>
|
||||
<text y="8.5em"><tspan> │ │ │ </tspan><tspan class="fa12">entries</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]: 0xd75-0xd81 (12)</tspan></text>
|
||||
<text y="9.5em"><tspan> │ │ │ [</tspan><tspan class="fa6">0</tspan><tspan>]{}: entry 0xd75-0xd81 (12)</tspan></text>
|
||||
<text y="10.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan>28 │ </tspan><tspan class="fa8">...</tspan><tspan>( │ </tspan><tspan class="fa12">segment_duration</tspan><tspan>: </tspan><tspan class="fa6">40 </tspan><tspan>0xd75-0xd79 (4)</tspan></text>
|
||||
<text y="11.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 00 </tspan><tspan>│ </tspan><tspan class="fa8">.... </tspan><tspan>│ </tspan><tspan class="fa12">media_time</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xd79-0xd7d (4)</tspan></text>
|
||||
<text y="12.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan class="bold">01 </tspan><tspan class="fa8">00</tspan><tspan>│ </tspan><tspan class="fa8">.</tspan><tspan class="bold">.</tspan><tspan class="fa8">.</tspan><tspan>│ </tspan><tspan class="fa12">media_rate</tspan><tspan>: </tspan><tspan class="fa6">1 </tspan><tspan>0xd7d-0xd81 (4)</tspan></text>
|
||||
<text y="13.5em"><tspan class="fa3">0xd80</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
</g>
|
||||
<text x="0ch" y="0.5em"><tspan>$ fq 'first(grep_by(.type == "elst")) | dv' file.mp4</tspan></text>
|
||||
<text x="0ch" y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">3</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">boxes</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>]{}: box 0xd65-0xd81 (28)</tspan></text>
|
||||
<text x="0ch" y="2.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">1c </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">size</tspan><tspan>: </tspan><tspan class="fa6">28 </tspan><tspan>0xd65-0xd69 (4)</tspan></text>
|
||||
<text x="0ch" y="3.5em"><tspan class="fa3">0xd60</tspan><tspan>│ 65 6c 73 74 │ elst │ </tspan><tspan class="fa12">type</tspan><tspan>: </tspan><tspan class="fa2">"elst" </tspan><tspan>(An edit list) 0xd69-0xd6d (4)</tspan></text>
|
||||
<text x="0ch" y="4.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan>│ </tspan><tspan class="fa8">. </tspan><tspan>│ </tspan><tspan class="fa12">version</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xd6d-0xd6e (1)</tspan></text>
|
||||
<text x="0ch" y="5.5em"><tspan class="fa3">0xd60</tspan><tspan>│ </tspan><tspan class="fa8">00 00</tspan><tspan>│ </tspan><tspan class="fa8">..</tspan><tspan>│ </tspan><tspan class="fa12">flags</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xd6e-0xd71 (3)</tspan></text>
|
||||
<text x="0ch" y="6.5em"><tspan class="fa3">0xd70</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
<text x="0ch" y="7.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan class="bold">01 </tspan><tspan>│ </tspan><tspan class="fa8">...</tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">entry_count</tspan><tspan>: </tspan><tspan class="fa6">1 </tspan><tspan>0xd71-0xd75 (4)</tspan></text>
|
||||
<text x="0ch" y="8.5em"><tspan> │ │ │ </tspan><tspan class="fa12">entries</tspan><tspan>[</tspan><tspan class="fa6">0</tspan><tspan>:</tspan><tspan class="fa6">1</tspan><tspan>]: 0xd75-0xd81 (12)</tspan></text>
|
||||
<text x="0ch" y="9.5em"><tspan> │ │ │ [</tspan><tspan class="fa6">0</tspan><tspan>]{}: entry 0xd75-0xd81 (12)</tspan></text>
|
||||
<text x="0ch" y="10.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 </tspan><tspan>28 │ </tspan><tspan class="fa8">...</tspan><tspan>( │ </tspan><tspan class="fa12">segment_duration</tspan><tspan>: </tspan><tspan class="fa6">40 </tspan><tspan>0xd75-0xd79 (4)</tspan></text>
|
||||
<text x="0ch" y="11.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 00 00 00 </tspan><tspan>│ </tspan><tspan class="fa8">.... </tspan><tspan>│ </tspan><tspan class="fa12">media_time</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xd79-0xd7d (4)</tspan></text>
|
||||
<text x="0ch" y="12.5em"><tspan class="fa3">0xd70</tspan><tspan>│ </tspan><tspan class="fa8">00 </tspan><tspan class="bold">01 </tspan><tspan class="fa8">00</tspan><tspan>│ </tspan><tspan class="fa8">.</tspan><tspan class="bold">.</tspan><tspan class="fa8">.</tspan><tspan>│ </tspan><tspan class="fa12">media_rate</tspan><tspan>: </tspan><tspan class="fa6">1 </tspan><tspan>0xd7d-0xd81 (4)</tspan></text>
|
||||
<text x="0ch" y="13.5em"><tspan class="fa3">0xd80</tspan><tspan>│</tspan><tspan class="fa8">00 </tspan><tspan>│</tspan><tspan class="fa8">. </tspan><tspan>│</tspan></text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.4 KiB |
@ -26,22 +26,20 @@
|
||||
.fa12 { fill: #5555ff; }
|
||||
</style>
|
||||
<rect width="100%" height="100%" x="0" y="0" style="fill: #000000"/>
|
||||
<g x="0">
|
||||
<text y="0.5em"><tspan>$ fq '.frames[1].header | dv' file.mp3</tspan></text>
|
||||
<text y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">frames</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">header</tspan><tspan>{}: 0xb79-0xb7d (4)</tspan></text>
|
||||
<text y="2.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">ff fb </tspan><tspan>│ </tspan><tspan class="bold">.. </tspan><tspan>│ </tspan><tspan class="fa12">sync</tspan><tspan>: </tspan><tspan class="fa6">0b11111111111 </tspan><tspan>(valid) 0xb79-0xb7a.3 (1.3)</tspan></text>
|
||||
<text y="3.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">fb </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">mpeg_version</tspan><tspan>: </tspan><tspan class="fa2">"1" </tspan><tspan>(</tspan><tspan class="fa6">3</tspan><tspan>) (MPEG Version 1) 0xb7a.3-0xb7a.5 (0.2)</tspan></text>
|
||||
<text y="4.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">fb </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">layer</tspan><tspan>: </tspan><tspan class="fa6">3 </tspan><tspan>(</tspan><tspan class="fa6">1</tspan><tspan>) (MPEG Layer 3) 0xb7a.5-0xb7a.7 (0.2)</tspan></text>
|
||||
<text y="5.5em"><tspan> │ │ │ </tspan><tspan class="fa12">sample_count</tspan><tspan>: </tspan><tspan class="fa6">1152</tspan></text>
|
||||
<text y="6.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">fb </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">protection_absent</tspan><tspan>: </tspan><tspan class="fa3">true </tspan><tspan>(No CRC) 0xb7a.7-0xb7b (0.1)</tspan></text>
|
||||
<text y="7.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">bitrate</tspan><tspan>: </tspan><tspan class="fa6">64000 </tspan><tspan>(</tspan><tspan class="fa6">5</tspan><tspan>) 0xb7b-0xb7b.4 (0.4)</tspan></text>
|
||||
<text y="8.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">sample_rate</tspan><tspan>: </tspan><tspan class="fa6">44100 </tspan><tspan>(</tspan><tspan class="fa6">0</tspan><tspan>) 0xb7b.4-0xb7b.6 (0.2)</tspan></text>
|
||||
<text y="9.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">padding</tspan><tspan>: </tspan><tspan class="fa2">"not_padded" </tspan><tspan>(</tspan><tspan class="fa6">0b0</tspan><tspan>) 0xb7b.6-0xb7b.7 (0.1)</tspan></text>
|
||||
<text y="10.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">private</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xb7b.7-0xb7c (0.1)</tspan></text>
|
||||
<text y="11.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">channels</tspan><tspan>: </tspan><tspan class="fa2">"mono" </tspan><tspan>(</tspan><tspan class="fa6">0b11</tspan><tspan>) 0xb7c-0xb7c.2 (0.2)</tspan></text>
|
||||
<text y="12.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">channel_mode</tspan><tspan>: </tspan><tspan class="fa2">"none" </tspan><tspan>(</tspan><tspan class="fa6">0b0</tspan><tspan>) 0xb7c.2-0xb7c.4 (0.2)</tspan></text>
|
||||
<text y="13.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">copyright</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xb7c.4-0xb7c.5 (0.1)</tspan></text>
|
||||
<text y="14.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">original</tspan><tspan>: </tspan><tspan class="fa6">1 </tspan><tspan>0xb7c.5-0xb7c.6 (0.1)</tspan></text>
|
||||
<text y="15.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">emphasis</tspan><tspan>: </tspan><tspan class="fa2">"none" </tspan><tspan>(</tspan><tspan class="fa6">0b0</tspan><tspan>) 0xb7c.6-0xb7d (0.2)</tspan></text>
|
||||
</g>
|
||||
<text x="0ch" y="0.5em"><tspan>$ fq '.frames[1].header | dv' file.mp3</tspan></text>
|
||||
<text x="0ch" y="1.5em"><tspan> │</tspan><tspan class="underline fa3">00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f</tspan><tspan>│</tspan><tspan class="underline fa3">0123456789abcdef</tspan><tspan>│.</tspan><tspan class="fa12">frames</tspan><tspan>[</tspan><tspan class="fa6">1</tspan><tspan>].</tspan><tspan class="fa12">header</tspan><tspan>{}: 0xb79-0xb7d (4)</tspan></text>
|
||||
<text x="0ch" y="2.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">ff fb </tspan><tspan>│ </tspan><tspan class="bold">.. </tspan><tspan>│ </tspan><tspan class="fa12">sync</tspan><tspan>: </tspan><tspan class="fa6">0b11111111111 </tspan><tspan>(valid) 0xb79-0xb7a.3 (1.3)</tspan></text>
|
||||
<text x="0ch" y="3.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">fb </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">mpeg_version</tspan><tspan>: </tspan><tspan class="fa2">"1" </tspan><tspan>(</tspan><tspan class="fa6">3</tspan><tspan>) (MPEG Version 1) 0xb7a.3-0xb7a.5 (0.2)</tspan></text>
|
||||
<text x="0ch" y="4.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">fb </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">layer</tspan><tspan>: </tspan><tspan class="fa6">3 </tspan><tspan>(</tspan><tspan class="fa6">1</tspan><tspan>) (MPEG Layer 3) 0xb7a.5-0xb7a.7 (0.2)</tspan></text>
|
||||
<text x="0ch" y="5.5em"><tspan> │ │ │ </tspan><tspan class="fa12">sample_count</tspan><tspan>: </tspan><tspan class="fa6">1152</tspan></text>
|
||||
<text x="0ch" y="6.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">fb </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">protection_absent</tspan><tspan>: </tspan><tspan class="fa3">true </tspan><tspan>(No CRC) 0xb7a.7-0xb7b (0.1)</tspan></text>
|
||||
<text x="0ch" y="7.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">bitrate</tspan><tspan>: </tspan><tspan class="fa6">64000 </tspan><tspan>(</tspan><tspan class="fa6">5</tspan><tspan>) 0xb7b-0xb7b.4 (0.4)</tspan></text>
|
||||
<text x="0ch" y="8.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">sample_rate</tspan><tspan>: </tspan><tspan class="fa6">44100 </tspan><tspan>(</tspan><tspan class="fa6">0</tspan><tspan>) 0xb7b.4-0xb7b.6 (0.2)</tspan></text>
|
||||
<text x="0ch" y="9.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">padding</tspan><tspan>: </tspan><tspan class="fa2">"not_padded" </tspan><tspan>(</tspan><tspan class="fa6">0b0</tspan><tspan>) 0xb7b.6-0xb7b.7 (0.1)</tspan></text>
|
||||
<text x="0ch" y="10.5em"><tspan class="fa3">0xb70</tspan><tspan>│ 50 │ P │ </tspan><tspan class="fa12">private</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xb7b.7-0xb7c (0.1)</tspan></text>
|
||||
<text x="0ch" y="11.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">channels</tspan><tspan>: </tspan><tspan class="fa2">"mono" </tspan><tspan>(</tspan><tspan class="fa6">0b11</tspan><tspan>) 0xb7c-0xb7c.2 (0.2)</tspan></text>
|
||||
<text x="0ch" y="12.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">channel_mode</tspan><tspan>: </tspan><tspan class="fa2">"none" </tspan><tspan>(</tspan><tspan class="fa6">0b0</tspan><tspan>) 0xb7c.2-0xb7c.4 (0.2)</tspan></text>
|
||||
<text x="0ch" y="13.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">copyright</tspan><tspan>: </tspan><tspan class="fa6">0 </tspan><tspan>0xb7c.4-0xb7c.5 (0.1)</tspan></text>
|
||||
<text x="0ch" y="14.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">original</tspan><tspan>: </tspan><tspan class="fa6">1 </tspan><tspan>0xb7c.5-0xb7c.6 (0.1)</tspan></text>
|
||||
<text x="0ch" y="15.5em"><tspan class="fa3">0xb70</tspan><tspan>│ </tspan><tspan class="bold">c4 </tspan><tspan>│ </tspan><tspan class="bold">. </tspan><tspan>│ </tspan><tspan class="fa12">emphasis</tspan><tspan>: </tspan><tspan class="fa2">"none" </tspan><tspan>(</tspan><tspan class="fa6">0b0</tspan><tspan>) 0xb7c.6-0xb7d (0.2)</tspan></text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.2 KiB |
@ -17,10 +17,8 @@
|
||||
.fa2 { fill: #00bb00; }
|
||||
</style>
|
||||
<rect width="100%" height="100%" x="0" y="0" style="fill: #000000"/>
|
||||
<g x="0">
|
||||
<text y="0.5em"><tspan>$ fq -n '"hello"'</tspan></text>
|
||||
<text y="1.5em"><tspan class="fa2">"hello"</tspan></text>
|
||||
<text y="3.5em"><tspan>$ fq -n '"hello" | d'</tspan></text>
|
||||
<text y="4.5em"><tspan class="fa2">"hello"</tspan></text>
|
||||
</g>
|
||||
<text x="0ch" y="0.5em"><tspan>$ fq -n '"hello"'</tspan></text>
|
||||
<text x="0ch" y="1.5em"><tspan class="fa2">"hello"</tspan></text>
|
||||
<text x="0ch" y="3.5em"><tspan>$ fq -n '"hello" | d'</tspan></text>
|
||||
<text x="0ch" y="4.5em"><tspan class="fa2">"hello"</tspan></text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 929 B After Width: | Height: | Size: 946 B |
@ -70,6 +70,7 @@
|
||||
|`id3v2` |ID3v2 metadata |<sub>`image`</sub>|
|
||||
|`ipv4_packet` |Internet protocol v4 packet |<sub>`ip_packet`</sub>|
|
||||
|`ipv6_packet` |Internet protocol v6 packet |<sub>`ip_packet`</sub>|
|
||||
|`jp2c` |JPEG 2000 codestream |<sub></sub>|
|
||||
|`jpeg` |Joint Photographic Experts Group file |<sub>`exif` `icc_profile`</sub>|
|
||||
|`json` |JavaScript Object Notation |<sub></sub>|
|
||||
|`jsonl` |JavaScript Object Notation Lines |<sub></sub>|
|
||||
@ -86,7 +87,7 @@
|
||||
|`mp3_frame` |MPEG audio layer 3 frame |<sub>`mp3_frame_tags`</sub>|
|
||||
|`mp3_frame_vbri` |MP3 frame Fraunhofer encoder variable bitrate tag |<sub></sub>|
|
||||
|`mp3_frame_xing` |MP3 frame Xing/Info tag |<sub></sub>|
|
||||
|[`mp4`](#mp4) |ISOBMFF, QuickTime and similar |<sub>`aac_frame` `av1_ccr` `av1_frame` `avc_au` `avc_dcr` `flac_frame` `flac_metadatablocks` `hevc_au` `hevc_dcr` `icc_profile` `id3v2` `image` `jpeg` `mp3_frame` `mpeg_es` `mpeg_pes_packet` `opus_packet` `png` `prores_frame` `protobuf_widevine` `pssh_playready` `vorbis_packet` `vp9_frame` `vpx_ccr`</sub>|
|
||||
|[`mp4`](#mp4) |ISOBMFF, QuickTime and similar |<sub>`aac_frame` `av1_ccr` `av1_frame` `avc_au` `avc_dcr` `flac_frame` `flac_metadatablocks` `hevc_au` `hevc_dcr` `icc_profile` `id3v2` `image` `jp2c` `jpeg` `mp3_frame` `mpeg_es` `mpeg_pes_packet` `opus_packet` `png` `prores_frame` `protobuf_widevine` `pssh_playready` `vorbis_packet` `vp9_frame` `vpx_ccr`</sub>|
|
||||
|`mpeg_asc` |MPEG-4 Audio Specific Config |<sub></sub>|
|
||||
|`mpeg_es` |MPEG Elementary Stream |<sub>`mpeg_asc` `vorbis_packet`</sub>|
|
||||
|`mpeg_pes` |MPEG Packetized elementary stream |<sub>`mpeg_pes_packet` `mpeg_spu`</sub>|
|
||||
@ -94,6 +95,7 @@
|
||||
|`mpeg_spu` |Sub Picture Unit (DVD subtitle) |<sub></sub>|
|
||||
|`mpeg_ts` |MPEG Transport Stream |<sub></sub>|
|
||||
|[`msgpack`](#msgpack) |MessagePack |<sub></sub>|
|
||||
|[`nes`](#nes) |iNES/NES 2.0 cartridge ROM format |<sub></sub>|
|
||||
|`ogg` |OGG file |<sub>`ogg_page` `vorbis_packet` `opus_packet` `flac_metadatablock` `flac_frame`</sub>|
|
||||
|`ogg_page` |OGG page |<sub></sub>|
|
||||
|[`opentimestamps`](#opentimestamps) |OpenTimestamps file |<sub></sub>|
|
||||
@ -130,12 +132,12 @@
|
||||
|[`xml`](#xml) |Extensible Markup Language |<sub></sub>|
|
||||
|`yaml` |YAML Ain't Markup Language |<sub></sub>|
|
||||
|[`zip`](#zip) |ZIP archive |<sub>`probe`</sub>|
|
||||
|`image` |Group |<sub>`gif` `jpeg` `mp4` `png` `tiff` `webp`</sub>|
|
||||
|`image` |Group |<sub>`gif` `jp2c` `jpeg` `mp4` `png` `tiff` `webp`</sub>|
|
||||
|`inet_packet` |Group |<sub>`ipv4_packet` `ipv6_packet`</sub>|
|
||||
|`ip_packet` |Group |<sub>`icmp` `icmpv6` `tcp_segment` `udp_datagram`</sub>|
|
||||
|`link_frame` |Group |<sub>`bsd_loopback_frame` `ether8023_frame` `ipv4_packet` `ipv6_packet` `sll2_packet` `sll_packet`</sub>|
|
||||
|`mp3_frame_tags` |Group |<sub>`mp3_frame_vbri` `mp3_frame_xing`</sub>|
|
||||
|`probe` |Group |<sub>`adts` `aiff` `apple_bookmark` `ar` `avi` `avro_ocf` `bitcoin_blkdat` `bplist` `bzip2` `caff` `elf` `fit` `flac` `gif` `gzip` `html` `jpeg` `json` `jsonl` `leveldb_table` `luajit` `macho` `macho_fat` `matroska` `moc3` `mp3` `mp4` `mpeg_ts` `ogg` `opentimestamps` `pcap` `pcapng` `png` `tar` `tiff` `toml` `tzif` `wasm` `wav` `webp` `xml` `yaml` `zip`</sub>|
|
||||
|`probe` |Group |<sub>`adts` `aiff` `apple_bookmark` `ar` `avi` `avro_ocf` `bitcoin_blkdat` `bplist` `bzip2` `caff` `elf` `fit` `flac` `gif` `gzip` `html` `jp2c` `jpeg` `json` `jsonl` `leveldb_table` `luajit` `macho` `macho_fat` `matroska` `moc3` `mp3` `mp4` `mpeg_ts` `nes` `ogg` `opentimestamps` `pcap` `pcapng` `png` `tar` `tiff` `toml` `tzif` `wasm` `wav` `webp` `xml` `yaml` `zip`</sub>|
|
||||
|`tcp_stream` |Group |<sub>`dns_tcp` `rtmp` `tls`</sub>|
|
||||
|`udp_payload` |Group |<sub>`dns`</sub>|
|
||||
|
||||
@ -940,6 +942,42 @@ $ fq -d msgpack torepr file.msgpack
|
||||
### References
|
||||
- https://github.com/msgpack/msgpack/blob/master/spec.md
|
||||
|
||||
## nes
|
||||
|
||||
### Limitations
|
||||
|
||||
- `prg_rom`, `chr_rom` and `trainer` fields may contain data that is just random
|
||||
junk from the memory chips, since they are of a fixed size.
|
||||
- The `nes_toasm` function outputs ALL opcodes, including the unofficial ones,
|
||||
which means that none of the regular assemblers can recompile it.
|
||||
- The `nes_tokitty` function works on tiles in `chr_rom` but only outputs a Kitty
|
||||
graphics compatible string. You need to manually `printf` that string to get
|
||||
Kitty (or another compatible terminal) to output the graphics.
|
||||
|
||||
### Decompile PRG ROM
|
||||
```
|
||||
$ fq -r '.prg_rom[] | nes_toasm' file.nes
|
||||
```
|
||||
|
||||
### Print out first CHR ROM tile in Kitty (or Konsole, wayst, WezTerm) at size 5
|
||||
```
|
||||
$ printf $(fq -r -d nes '.chr_rom[0] | nes_tokitty(5)' file.nes)
|
||||
```
|
||||
|
||||
### Print out all CHR ROM tiles in Kitty (with Bash) at size 5
|
||||
```
|
||||
$ for line in $(fq -r '.chr_rom[] | nes_tokitty(5)' file.nes);do printf "%b%s" "$line";done
|
||||
```
|
||||
|
||||
### Authors
|
||||
- Mikael Lofjärd mikael.lofjard@gmail.com, original author
|
||||
|
||||
### References
|
||||
- https://www.nesdev.org/wiki/INES
|
||||
- https://www.nesdev.org/wiki/NES_2.0
|
||||
- https://www.nesdev.org/wiki/CPU
|
||||
- https://bugzmanov.github.io/nes_ebook/chapter_6_3.html
|
||||
|
||||
## opentimestamps
|
||||
|
||||
### View a full OpenTimestamps file
|
||||
|
2146
doc/formats.svg
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 156 KiB |
@ -1,3 +1,9 @@
|
||||
//go:build exclude
|
||||
|
||||
package bts2022
|
||||
|
||||
import "github.com/wader/fq/pkg/decode"
|
||||
|
||||
func avcHdrParameters(d *decode.D) {
|
||||
cpbCnt := d.FieldUintFn("cpb_cnt", uEV, scalar.UAdd(1))
|
||||
d.FieldU4("bit_rate_scale")
|
||||
|
@ -1,3 +1,7 @@
|
||||
//go:build exclude
|
||||
|
||||
package bts2022
|
||||
|
||||
func decode(d *decode.D) any {
|
||||
d.FieldArray("headers", func(d *decode.D) {
|
||||
for !d.End() {
|
||||
|
15
doc/usage.md
@ -168,9 +168,9 @@ Here the `sync` pattern starts at `0xb79` (bit `0`) and ends at `0xb7a.3` (exclu
|
||||
|
||||
There are also some other `display` aliases:
|
||||
- `da` is `display({array_truncate: 0})` don't truncate arrays.
|
||||
- `dd` is `display({array_truncate: 0, display_bytes: 0})` don't truncate arrays and raw bytes.
|
||||
- `dv` is `display({array_truncate: 0, verbose: true})` don't truncate arrays and display verbosely.
|
||||
- `ddv` is `display({array_truncate: 0, display_bytes: 0 verbose: true})` don't truncate arrays and raw bytes. and display verbosely.
|
||||
- `dd` is `display({array_truncate: 0, string_truncate: 0, display_bytes: 0})` don't truncate arrays and raw bytes.
|
||||
- `dv` is `display({array_truncate: 0, string_truncate: 0, verbose: true})` don't truncate arrays and display verbosely.
|
||||
- `ddv` is `display({array_truncate: 0, string_truncate: 0, display_bytes: 0 verbose: true})` don't truncate arrays and raw bytes. and display verbosely.
|
||||
|
||||
## Interactive REPL
|
||||
|
||||
@ -844,6 +844,15 @@ In query
|
||||
tovalue({skip_gaps: true})
|
||||
```
|
||||
|
||||
### `-o array_truncate=<number>`
|
||||
|
||||
By default truncate long array when displaying decode value tree. Use `dd` or `d({array_truncate: 0})` to not truncate.
|
||||
|
||||
### `-o string_truncate=<number>`
|
||||
|
||||
By default truncate long strings when displaying decode value tree. Use `dd` or `d({string_truncate: 0})` to not truncate.
|
||||
|
||||
|
||||
## Color and unicode output
|
||||
|
||||
fq by default tries to use colors if possible, this can be disabled with `-M`. You can also
|
||||
|
@ -14,6 +14,7 @@ $ fq -n _registry.groups.probe
|
||||
"flac",
|
||||
"gif",
|
||||
"gzip",
|
||||
"jp2c",
|
||||
"jpeg",
|
||||
"leveldb_table",
|
||||
"luajit",
|
||||
@ -22,6 +23,7 @@ $ fq -n _registry.groups.probe
|
||||
"matroska",
|
||||
"moc3",
|
||||
"mp4",
|
||||
"nes",
|
||||
"ogg",
|
||||
"opentimestamps",
|
||||
"pcap",
|
||||
@ -111,6 +113,7 @@ id3v11 ID3v1.1 metadata
|
||||
id3v2 ID3v2 metadata
|
||||
ipv4_packet Internet protocol v4 packet
|
||||
ipv6_packet Internet protocol v6 packet
|
||||
jp2c JPEG 2000 codestream
|
||||
jpeg Joint Photographic Experts Group file
|
||||
json JavaScript Object Notation
|
||||
jsonl JavaScript Object Notation Lines
|
||||
@ -135,6 +138,7 @@ mpeg_pes_packet MPEG Packetized elementary stream packet
|
||||
mpeg_spu Sub Picture Unit (DVD subtitle)
|
||||
mpeg_ts MPEG Transport Stream
|
||||
msgpack MessagePack
|
||||
nes iNES/NES 2.0 cartridge ROM format
|
||||
ogg OGG file
|
||||
ogg_page OGG page
|
||||
opentimestamps OpenTimestamps file
|
||||
|
@ -41,6 +41,7 @@ import (
|
||||
_ "github.com/wader/fq/format/mp4"
|
||||
_ "github.com/wader/fq/format/mpeg"
|
||||
_ "github.com/wader/fq/format/msgpack"
|
||||
_ "github.com/wader/fq/format/nes"
|
||||
_ "github.com/wader/fq/format/ogg"
|
||||
_ "github.com/wader/fq/format/opentimestamps"
|
||||
_ "github.com/wader/fq/format/opus"
|
||||
|
30
format/apple/bplist/testdata/Info.fqtest
vendored
@ -80,7 +80,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
| | | [4]{}: entry 0xf-0x264 (597)
|
||||
@ -492,7 +492,7 @@ $ fq dv Info.plist
|
||||
0x410| 10 | . | exponent: 0 0x41a.4-0x41b (0.4)
|
||||
0x410| 33 | 3 | size_bigint: 51 0x41b-0x41c (1)
|
||||
| | | size: 51
|
||||
0x410| 63 6f 6d 2e| com.| value: "com.apple.videotoolbox.videodecoder.prores.embe..." 0x41c-0x44f (51)
|
||||
0x410| 63 6f 6d 2e| com.| value: "com.apple.videotoolbox.videodecoder.prores.embedded" 0x41c-0x44f (51)
|
||||
0x420|61 70 70 6c 65 2e 76 69 64 65 6f 74 6f 6f 6c 62|apple.videotoolb|
|
||||
* |until 0x44e.7 (51) | |
|
||||
| | | [5]{}: entry 0x313-0x45f (332)
|
||||
@ -533,7 +533,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
0x310| 33 | 3 | key_index: 51 0x314-0x315 (1)
|
||||
@ -735,7 +735,7 @@ $ fq dv Info.plist
|
||||
0x540| 10| .| exponent: 0 0x54f.4-0x550 (0.4)
|
||||
0x550|3a |: | size_bigint: 58 0x550-0x551 (1)
|
||||
| | | size: 58
|
||||
0x550| 63 6f 6d 2e 61 70 70 6c 65 2e 76 69 64 65 6f| com.apple.video| value: "com.apple.videotoolbox.videoencoder.prores-4444..." 0x551-0x58b (58)
|
||||
0x550| 63 6f 6d 2e 61 70 70 6c 65 2e 76 69 64 65 6f| com.apple.video| value: "com.apple.videotoolbox.videoencoder.prores-4444xq.embedded" 0x551-0x58b (58)
|
||||
0x560|74 6f 6f 6c 62 6f 78 2e 76 69 64 65 6f 65 6e 63|toolbox.videoenc|
|
||||
* |until 0x58a.7 (58) | |
|
||||
| | | [5]{}: entry 0x4cc-0x54e (130)
|
||||
@ -810,7 +810,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
| | | key{}: 0x3b4-0x3c0 (12)
|
||||
@ -975,7 +975,7 @@ $ fq dv Info.plist
|
||||
0x600| 10 | . | exponent: 0 0x601.4-0x602 (0.4)
|
||||
0x600| 38 | 8 | size_bigint: 56 0x602-0x603 (1)
|
||||
| | | size: 56
|
||||
0x600| 63 6f 6d 2e 61 70 70 6c 65 2e 76 69 64| com.apple.vid| value: "com.apple.videotoolbox.videoencoder.prores-4444..." 0x603-0x63b (56)
|
||||
0x600| 63 6f 6d 2e 61 70 70 6c 65 2e 76 69 64| com.apple.vid| value: "com.apple.videotoolbox.videoencoder.prores-4444.embedded" 0x603-0x63b (56)
|
||||
0x610|65 6f 74 6f 6f 6c 62 6f 78 2e 76 69 64 65 6f 65|eotoolbox.videoe|
|
||||
* |until 0x63a.7 (56) | |
|
||||
| | | [5]{}: entry 0x4e9-0x600 (279)
|
||||
@ -1050,7 +1050,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
| | | key{}: 0x3b4-0x3c0 (12)
|
||||
@ -1216,7 +1216,7 @@ $ fq dv Info.plist
|
||||
0x680| 10| .| exponent: 0 0x68f.4-0x690 (0.4)
|
||||
0x690|39 |9 | size_bigint: 57 0x690-0x691 (1)
|
||||
| | | size: 57
|
||||
0x690| 63 6f 6d 2e 61 70 70 6c 65 2e 76 69 64 65 6f| com.apple.video| value: "com.apple.videotoolbox.videoencoder.prores-422h..." 0x691-0x6ca (57)
|
||||
0x690| 63 6f 6d 2e 61 70 70 6c 65 2e 76 69 64 65 6f| com.apple.video| value: "com.apple.videotoolbox.videoencoder.prores-422hq.embedded" 0x691-0x6ca (57)
|
||||
0x6a0|74 6f 6f 6c 62 6f 78 2e 76 69 64 65 6f 65 6e 63|toolbox.videoenc|
|
||||
* |until 0x6c9.7 (57) | |
|
||||
| | | [5]{}: entry 0x4e9-0x68e (421)
|
||||
@ -1291,7 +1291,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
| | | key{}: 0x3b4-0x3c0 (12)
|
||||
@ -1457,7 +1457,7 @@ $ fq dv Info.plist
|
||||
0x710| 10 | . | exponent: 0 0x718.4-0x719 (0.4)
|
||||
0x710| 37 | 7 | size_bigint: 55 0x719-0x71a (1)
|
||||
| | | size: 55
|
||||
0x710| 63 6f 6d 2e 61 70| com.ap| value: "com.apple.videotoolbox.videoencoder.prores-422...." 0x71a-0x751 (55)
|
||||
0x710| 63 6f 6d 2e 61 70| com.ap| value: "com.apple.videotoolbox.videoencoder.prores-422.embedded" 0x71a-0x751 (55)
|
||||
0x720|70 6c 65 2e 76 69 64 65 6f 74 6f 6f 6c 62 6f 78|ple.videotoolbox|
|
||||
* |until 0x750.7 (55) | |
|
||||
| | | [5]{}: entry 0x4e9-0x717 (558)
|
||||
@ -1532,7 +1532,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
| | | key{}: 0x3b4-0x3c0 (12)
|
||||
@ -1697,7 +1697,7 @@ $ fq dv Info.plist
|
||||
0x7a0| 10 | . | exponent: 0 0x7a5.4-0x7a6 (0.4)
|
||||
0x7a0| 39 | 9 | size_bigint: 57 0x7a6-0x7a7 (1)
|
||||
| | | size: 57
|
||||
0x7a0| 63 6f 6d 2e 61 70 70 6c 65| com.apple| value: "com.apple.videotoolbox.videoencoder.prores-422l..." 0x7a7-0x7e0 (57)
|
||||
0x7a0| 63 6f 6d 2e 61 70 70 6c 65| com.apple| value: "com.apple.videotoolbox.videoencoder.prores-422lt.embedded" 0x7a7-0x7e0 (57)
|
||||
0x7b0|2e 76 69 64 65 6f 74 6f 6f 6c 62 6f 78 2e 76 69|.videotoolbox.vi|
|
||||
* |until 0x7df.7 (57) | |
|
||||
| | | [5]{}: entry 0x4e9-0x7a4 (699)
|
||||
@ -1772,7 +1772,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
| | | key{}: 0x3b4-0x3c0 (12)
|
||||
@ -1937,7 +1937,7 @@ $ fq dv Info.plist
|
||||
0x830| 10 | . | exponent: 0 0x83a.4-0x83b (0.4)
|
||||
0x830| 3c | < | size_bigint: 60 0x83b-0x83c (1)
|
||||
| | | size: 60
|
||||
0x830| 63 6f 6d 2e| com.| value: "com.apple.videotoolbox.videoencoder.prores-422p..." 0x83c-0x878 (60)
|
||||
0x830| 63 6f 6d 2e| com.| value: "com.apple.videotoolbox.videoencoder.prores-422proxy.embedded" 0x83c-0x878 (60)
|
||||
0x840|61 70 70 6c 65 2e 76 69 64 65 6f 74 6f 6f 6c 62|apple.videotoolb|
|
||||
* |until 0x877.7 (60) | |
|
||||
| | | [5]{}: entry 0x4e9-0x839 (848)
|
||||
@ -2012,7 +2012,7 @@ $ fq dv Info.plist
|
||||
0x220| 10 | . | exponent: 0 0x224.4-0x225 (0.4)
|
||||
0x220| 37 | 7 | size_bigint: 55 0x225-0x226 (1)
|
||||
| | | size: 55
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights r..." 0x226-0x25d (55)
|
||||
0x220| 43 6f 70 79 72 69 67 68 74 20| Copyright | value: "Copyright (c) 2011-2021 Apple Inc. All rights reserved." 0x226-0x25d (55)
|
||||
0x230|28 63 29 20 32 30 31 31 2d 32 30 32 31 20 41 70|(c) 2011-2021 Ap|
|
||||
* |until 0x25c.7 (55) | |
|
||||
| | | key{}: 0x3b4-0x3c0 (12)
|
||||
|
@ -281,7 +281,7 @@ func decodeASN1BERValue(d *decode.D, bib *bitio.Buffer, sb *strings.Builder, par
|
||||
if bib != nil {
|
||||
// TODO: helper?
|
||||
if _, err := bitio.Copy(bib, br); err != nil {
|
||||
d.IOPanic(err, "bitio.Copy")
|
||||
d.IOPanic(err, "value", "bitio.Copy")
|
||||
}
|
||||
}
|
||||
if unusedBitsCount > 0 {
|
||||
@ -292,7 +292,7 @@ func decodeASN1BERValue(d *decode.D, bib *bitio.Buffer, sb *strings.Builder, par
|
||||
if bib != nil {
|
||||
// TODO: helper?
|
||||
if _, err := bitio.Copy(bib, br); err != nil {
|
||||
d.IOPanic(err, "bitio.Copy")
|
||||
d.IOPanic(err, "value", "bitio.Copy")
|
||||
}
|
||||
}
|
||||
case class == classUniversal && tag == universalTypeNull:
|
||||
|
2
format/avro/testdata/allDataTypes.fqtest
vendored
@ -14,7 +14,7 @@ $ fq dv allDataTypes.avro
|
||||
0x010|61 |a |
|
||||
| | | value{}: 0x11-0x3fd (1004)
|
||||
0x010| d4 0f | .. | length: 1002 0x11-0x13 (2)
|
||||
0x010| 7b 22 66 69 65 6c 64 73 22 3a 5b 7b 22| {"fields":[{"| data: "{\"fields\":[{\"name\":\"null\",\"type\":\"null\"},{\"name..." 0x13-0x3fd (1002)
|
||||
0x010| 7b 22 66 69 65 6c 64 73 22 3a 5b 7b 22| {"fields":[{"| data: "{\"fields\":[{\"name\":\"null\",\"type\":\"null\"},{\"name\":\"boolean\",\"type\":\"boolean\"},{\"name\":\"int\",\"type\":\"int\"},{\"name\":\"long\",\"type\":\"long\"},{\"name\":\"float\",\"type\":\"float\"},{\"name\":\"double\",\"type\":\"double\"},{\"name\":\"bytes\",\"type\":\"bytes\"},{\"name\":\"string\",\"type\":\"string\"},{\"name\":\"enum\",\"type\":{\"name\":\"enum\",\"symbols\":[\"A\",\"B\",\"C\"],\"type\":\"enum\"}},{\"name\":\"array\",\"type\":{\"items\":\"string\",\"name\":\"array\",\"type\":\"array\"}},{\"name\":\"map\",\"type\":{\"name\":\"map\",\"type\":\"map\",\"values\":\"string\"}},{\"name\":\"union\",\"type\":[\"int\",\"string\"]},{\"name\":\"fixed\",\"type\":{\"name\":\"fixed\",\"size\":16,\"type\":\"fixed\"}},{\"name\":\"date\",\"type\":{\"logicalType\":\"date\",\"type\":\"int\"}},{\"name\":\"timeMillis\",\"type\":{\"logicalType\":\"time-millis\",\"type\":\"long\"}},{\"name\":\"timeMicros\",\"type\":{\"logicalType\":\"time-micros\",\"type\":\"long\"}},{\"name\":\"timestampMillis\",\"type\":{\"logicalType\":\"timestamp-millis\",\"type\":\"long\"}},{\"name\":\"timestampMicros\",\"type\":{\"logicalType\":\"timestamp-micros\",\"type\":\"long\"}}],\"name\":\"AllDataTypes\",\"type\":\"record\"}" 0x13-0x3fd (1002)
|
||||
0x020|6e 61 6d 65 22 3a 22 6e 75 6c 6c 22 2c 22 74 79|name":"null","ty|
|
||||
* |until 0x3fc.7 (1002) | |
|
||||
| | | [1]{}: entry 0x3fd-0x40d (16)
|
||||
|
@ -21,7 +21,7 @@ $ fq 'dv({array_truncate: 5})' quickstop-deflate.avro
|
||||
0x000020|68 65 6d 61 |hema |
|
||||
| | | value{}: 0x24-0x119 (245)
|
||||
0x000020| e6 03 | .. | length: 243 0x24-0x26 (2)
|
||||
0x000020| 7b 22 74 79 70 65 22 3a 22 72| {"type":"r| data: "{\"type\":\"record\",\"name\":\"Person\",\"fields\":[{\"na..." 0x26-0x119 (243)
|
||||
0x000020| 7b 22 74 79 70 65 22 3a 22 72| {"type":"r| data: "{\"type\":\"record\",\"name\":\"Person\",\"fields\":[{\"name\":\"ID\",\"type\":{\"type\":\"long\"}},{\"name\":\"First\",\"type\":{\"type\":\"string\"}},{\"name\":\"Last\",\"type\":{\"type\":\"string\"}},{\"name\":\"Phone\",\"type\":{\"type\":\"string\"}},{\"name\":\"Age\",\"type\":{\"type\":\"int\"}}]}" 0x26-0x119 (243)
|
||||
0x000030|65 63 6f 72 64 22 2c 22 6e 61 6d 65 22 3a 22 50|ecord","name":"P|
|
||||
* |until 0x118.7 (243) | |
|
||||
| | | [1]{}: block 0x119-0x11a (1)
|
||||
|
2
format/avro/testdata/snappy.fqtest
vendored
@ -14,7 +14,7 @@ $ fq 'dv({array_truncate: 25})' snappy.avro
|
||||
0x00010|61 |a |
|
||||
| | | value{}: 0x11-0x3fd (1004)
|
||||
0x00010| d4 0f | .. | length: 1002 0x11-0x13 (2)
|
||||
0x00010| 7b 22 66 69 65 6c 64 73 22 3a 5b 7b 22| {"fields":[{"| data: "{\"fields\":[{\"name\":\"null\",\"type\":\"null\"},{\"name..." 0x13-0x3fd (1002)
|
||||
0x00010| 7b 22 66 69 65 6c 64 73 22 3a 5b 7b 22| {"fields":[{"| data: "{\"fields\":[{\"name\":\"null\",\"type\":\"null\"},{\"name\":\"boolean\",\"type\":\"boolean\"},{\"name\":\"int\",\"type\":\"int\"},{\"name\":\"long\",\"type\":\"long\"},{\"name\":\"float\",\"type\":\"float\"},{\"name\":\"double\",\"type\":\"double\"},{\"name\":\"bytes\",\"type\":\"bytes\"},{\"name\":\"string\",\"type\":\"string\"},{\"name\":\"enum\",\"type\":{\"name\":\"enum\",\"symbols\":[\"A\",\"B\",\"C\"],\"type\":\"enum\"}},{\"name\":\"array\",\"type\":{\"items\":\"string\",\"name\":\"array\",\"type\":\"array\"}},{\"name\":\"map\",\"type\":{\"name\":\"map\",\"type\":\"map\",\"values\":\"string\"}},{\"name\":\"union\",\"type\":[\"int\",\"string\"]},{\"name\":\"fixed\",\"type\":{\"name\":\"fixed\",\"size\":16,\"type\":\"fixed\"}},{\"name\":\"date\",\"type\":{\"logicalType\":\"date\",\"type\":\"int\"}},{\"name\":\"timeMillis\",\"type\":{\"logicalType\":\"time-millis\",\"type\":\"long\"}},{\"name\":\"timeMicros\",\"type\":{\"logicalType\":\"time-micros\",\"type\":\"long\"}},{\"name\":\"timestampMillis\",\"type\":{\"logicalType\":\"timestamp-millis\",\"type\":\"long\"}},{\"name\":\"timestampMicros\",\"type\":{\"logicalType\":\"timestamp-micros\",\"type\":\"long\"}}],\"name\":\"AllDataTypes\",\"type\":\"record\"}" 0x13-0x3fd (1002)
|
||||
0x00020|6e 61 6d 65 22 3a 22 6e 75 6c 6c 22 2c 22 74 79|name":"null","ty|
|
||||
* |until 0x3fc.7 (1002) | |
|
||||
| | | [1]{}: entry 0x3fd-0x40f (18)
|
||||
|
2
format/avro/testdata/twitter.fqtest
vendored
@ -14,7 +14,7 @@ $ fq dv twitter.avro
|
||||
0x010|61 |a |
|
||||
| | | value{}: 0x11-0x187 (374)
|
||||
0x010| e8 05 | .. | length: 372 0x11-0x13 (2)
|
||||
0x010| 7b 22 74 79 70 65 22 3a 22 72 65 63 6f| {"type":"reco| data: "{\"type\":\"record\",\"name\":\"twitter_schema\",\"names..." 0x13-0x187 (372)
|
||||
0x010| 7b 22 74 79 70 65 22 3a 22 72 65 63 6f| {"type":"reco| data: "{\"type\":\"record\",\"name\":\"twitter_schema\",\"namespace\":\"com.miguno.avro\",\"fields\":[{\"name\":\"username\",\"type\":\"string\",\"doc\":\"Name of the user account on Twitter.com\"},{\"name\":\"tweet\",\"type\":\"string\",\"doc\":\"The content of the user's Twitter message\"},{\"name\":\"timestamp\",\"type\":\"long\",\"doc\":\"Unix epoch time in seconds\"}],\"doc:\":\"A basic schema for storing Twitter messages\"}" 0x13-0x187 (372)
|
||||
0x020|72 64 22 2c 22 6e 61 6d 65 22 3a 22 74 77 69 74|rd","name":"twit|
|
||||
* |until 0x186.7 (372) | |
|
||||
| | | [1]{}: entry 0x187-0x197 (16)
|
||||
|
6
format/bencode/testdata/bbb.fqtest
vendored
@ -1,4 +1,4 @@
|
||||
$ fq -d bencode dv bbb.torrent
|
||||
$ fq -d bencode 'dv({string_truncate: 50})' bbb.torrent
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: bbb.torrent (bencode) 0x0-0x3796 (14230)
|
||||
0x0000|64 |d | type: "dictionary" ("d") 0x0-0x1 (1)
|
||||
| | | pairs[0:9]: 0x1-0x3795 (14228)
|
||||
@ -181,7 +181,7 @@ $ fq -d bencode dv bbb.torrent
|
||||
0x01a0| 31 33| 13| length: 13580 0x1ae-0x1b3 (5)
|
||||
0x01b0|35 38 30 |580 |
|
||||
0x01b0| 3a | : | separator: ":" (valid) 0x1b3-0x1b4 (1)
|
||||
0x01b0| 99 71 9b 2c 2e aa b6 80 df fa 1f 36| .q.,.......6| value: "<22>q<EFBFBD>,.<2E><><EFBFBD><EFBFBD><EFBFBD>\x1f6\x0e<30>LS<4C>x<EFBFBD><78><EFBFBD>)\xef..." 0x1b4-0x36c0 (13580)
|
||||
0x01b0| 99 71 9b 2c 2e aa b6 80 df fa 1f 36| .q.,.......6| value: "<22>q<EFBFBD>,.<2E><><EFBFBD><EFBFBD><EFBFBD>\x1f6\x0e<30>LS<4C>x<EFBFBD><78><EFBFBD>)<EFBFBD>><3E><><EFBFBD><EFBFBD>\x03\x19%<25>\x04\x04<30>}<7D>\v<>Ķ{\rB<72><42><EFBFBD>wT\r<>" 0x1b4-0x36c0 (13580)
|
||||
0x01c0|0e e0 4c 53 f3 78 bb 84 82 29 c8 3e 98 91 93 f9|..LS.x...).>....|
|
||||
* |until 0x36bf.7 (13580) | |
|
||||
| | | [6]{}: pair 0x36c0-0x3701 (65)
|
||||
@ -257,7 +257,7 @@ $ fq -d bencode dv bbb.torrent
|
||||
0x3700| 39 | 9 | type: "string" ("9") 0x370d-0x370e (1)
|
||||
0x3700| 39 30 | 90 | length: 90 0x370d-0x370f (2)
|
||||
0x3700| 3a| :| separator: ":" (valid) 0x370f-0x3710 (1)
|
||||
0x3710|68 74 74 70 3a 2f 2f 64 69 73 74 72 69 62 75 74|http://distribut| value: "http://distribution.bbb3d.renderfarming.net/vid..." 0x3710-0x376a (90)
|
||||
0x3710|68 74 74 70 3a 2f 2f 64 69 73 74 72 69 62 75 74|http://distribut| value: "http://distribution.bbb3d.renderfarming.net/video/" 0x3710-0x376a (90)
|
||||
* |until 0x3769.7 (90) | |
|
||||
0x3760| 65 | e | end: "e" (valid) 0x376a-0x376b (1)
|
||||
| | | [8]{}: pair 0x376b-0x3795 (42)
|
||||
|
6
format/bitcoin/testdata/genesis.fqtest
vendored
@ -5,10 +5,10 @@ $ fq dd genesis.dat
|
||||
0x000| 1d 01 00 00 | .... | size: 285
|
||||
| | | header{}:
|
||||
0x000| 01 00 00 00 | .... | version: 0x1
|
||||
0x000| 00 00 00 00| ....| previous_block_hash: "00000000000000000000000000000000000000000000000..." (raw bits)
|
||||
0x000| 00 00 00 00| ....| previous_block_hash: "0000000000000000000000000000000000000000000000000000000000000000" (raw bits)
|
||||
0x010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|
|
||||
0x020|00 00 00 00 00 00 00 00 00 00 00 00 |............ |
|
||||
0x020| 3b a3 ed fd| ;...| merkle_root: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77..." (raw bits)
|
||||
0x020| 3b a3 ed fd| ;...| merkle_root: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b" (raw bits)
|
||||
0x030|7a 7b 12 b2 7a c7 2c 3e 67 76 8f 61 7f c8 1b c3|z{..z.,>gv.a....|
|
||||
0x040|88 8a 51 32 3a 9f b8 aa 4b 1e 5e 4a |..Q2:...K.^J |
|
||||
0x040| 29 ab 5f 49| )._I| time: 1231006505 (2009-01-03T18:15:05Z)
|
||||
@ -21,7 +21,7 @@ $ fq dd genesis.dat
|
||||
0x050| 01 | . | input_count: 1
|
||||
| | | inputs[0:1]:
|
||||
| | | [0]{}: input
|
||||
0x050| 00 00| ..| txid: "00000000000000000000000000000000000000000000000..." (raw bits) (coinbase)
|
||||
0x050| 00 00| ..| txid: "0000000000000000000000000000000000000000000000000000000000000000" (raw bits) (coinbase)
|
||||
0x060|00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|
|
||||
0x070|00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.............. |
|
||||
0x070| ff ff| ..| vout: 4294967295
|
||||
|
2
format/bitcoin/testdata/tx_b941ddad.fqtest
vendored
@ -6,7 +6,7 @@ $ fq -d bitcoin_transaction dv tx_b941ddad.dat
|
||||
0x000| 01 | . | input_count: 1 0x6-0x7 (1)
|
||||
| | | inputs[0:1]: 0x7-0x30 (41)
|
||||
| | | [0]{}: input 0x7-0x30 (41)
|
||||
0x000| 05 89 f2 e6 c0 7d 7c d7 d0| .....}|..| txid: "1efe0f1537ddd0b2f94d93b56d14f30f570b7495cfbf6cd..." (raw bits) 0x7-0x27 (32)
|
||||
0x000| 05 89 f2 e6 c0 7d 7c d7 d0| .....}|..| txid: "1efe0f1537ddd0b2f94d93b56d14f30f570b7495cfbf6cd0d77c7dc0e6f28905" (raw bits) 0x7-0x27 (32)
|
||||
0x010|6c bf cf 95 74 0b 57 0f f3 14 6d b5 93 4d f9 b2|l...t.W...m..M..|
|
||||
0x020|d0 dd 37 15 0f fe 1e |..7.... |
|
||||
0x020| 00 00 00 00 | .... | vout: 0 0x27-0x2b (4)
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/mathex"
|
||||
"github.com/wader/fq/internal/mathx"
|
||||
"github.com/wader/fq/pkg/bitio"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
@ -117,7 +117,7 @@ func decodeCBORValue(d *decode.D) any {
|
||||
}},
|
||||
majorTypeNegativeInt: {s: scalar.Uint{Sym: "negative_int"}, d: func(d *decode.D, shortCount uint64, count uint64) any {
|
||||
n := new(big.Int)
|
||||
n.SetUint64(count).Neg(n).Sub(n, mathex.BigIntOne)
|
||||
n.SetUint64(count).Neg(n).Sub(n, mathx.BigIntOne)
|
||||
d.FieldValueBigInt("value", n)
|
||||
return nil
|
||||
}},
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"io"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/gojqex"
|
||||
"github.com/wader/fq/internal/gojqx"
|
||||
"github.com/wader/fq/pkg/bitio"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
@ -83,11 +83,11 @@ func toCSV(_ *interp.Interp, c []any, opts ToCSVOpts) any {
|
||||
w.Comma = rune(opts.Comma[0])
|
||||
}
|
||||
for _, row := range c {
|
||||
rs, ok := gojqex.Cast[[]any](row)
|
||||
rs, ok := gojqx.Cast[[]any](row)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected row to be an array, got %s", gojqex.TypeErrorPreview(row))
|
||||
return fmt.Errorf("expected row to be an array, got %s", gojqx.TypeErrorPreview(row))
|
||||
}
|
||||
vs, ok := gojqex.NormalizeToStrings(rs).([]any)
|
||||
vs, ok := gojqx.NormalizeToStrings(rs).([]any)
|
||||
if !ok {
|
||||
panic("not array")
|
||||
}
|
||||
@ -95,7 +95,7 @@ func toCSV(_ *interp.Interp, c []any, opts ToCSVOpts) any {
|
||||
for _, v := range vs {
|
||||
s, ok := v.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected row record to be scalars, got %s", gojqex.TypeErrorPreview(v))
|
||||
return fmt.Errorf("expected row record to be scalars, got %s", gojqx.TypeErrorPreview(v))
|
||||
}
|
||||
ss = append(ss, s)
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x3d30|04 00 00 00 |.... | addralign: 4 0x3d30-0x3d34 (4)
|
||||
0x3d30| 10 00 00 00 | .... | entsize: 16 0x3d34-0x3d38 (4)
|
||||
| | | [5]{}: section_header 0x2c8-0x3d60 (15000)
|
||||
0x02c0| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__register_frame_info_base..." 0x2c8-0x393 (203)
|
||||
0x02c0| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__register_frame_info_bases\x00_ITM_registerTMCloneTable\x00__deregister_frame_info_bases\x00_ITM_deregisterTMCloneTable\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-x86.so.1\x00" 0x2c8-0x393 (203)
|
||||
0x02d0|63 78 61 5f 66 69 6e 61 6c 69 7a 65 00 5f 5f 72|cxa_finalize.__r|
|
||||
* |until 0x392.7 (203) | |
|
||||
0x3d30| 48 00 00 00 | H... | name: ".dynstr" (72) 0x3d38-0x3d3c (4)
|
||||
@ -1686,7 +1686,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x4160| 04 00 00 00 | .... | addralign: 4 0x4168-0x416c (4)
|
||||
0x4160| 10 00 00 00| ....| entsize: 16 0x416c-0x4170 (4)
|
||||
| | | [32]{}: section_header 0x38f0-0x4198 (2216)
|
||||
0x38f0|00 53 63 72 74 31 2e 63 00 63 72 74 73 74 75 66|.Scrt1.c.crtstuf| string: "\x00Scrt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__..." 0x38f0-0x3b41 (593)
|
||||
0x38f0|00 53 63 72 74 31 2e 63 00 63 72 74 73 74 75 66|.Scrt1.c.crtstuf| string: "\x00Scrt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.2\x00dtor_idx.1\x00frame_dummy\x00object.0\x00__CTOR_END__\x00__FRAME_END__\x00__do_global_ctors_aux\x00a.c\x00_DYNAMIC\x00__GNU_EH_FRAME_HDR\x00_GLOBAL_OFFSET_TABLE_\x00__x86.get_pc_thunk.di\x00__TMC_END__\x00__DTOR_END__\x00puts\x00__cxa_finalize\x00__x86.get_pc_thunk.ax\x00__dso_handle\x00aaa\x00__x86.get_pc_thunk.dx\x00_init\x00__register_frame_info_bases\x00_ITM_registerTMCloneTable\x00__deregister_frame_info_bases\x00_start_c\x00__x86.get_pc_thunk.bx\x00_ITM_deregisterTMCloneTable\x00__bss_start\x00_fini\x00_edata\x00_end\x00libbbb_bbb\x00__libc_start_main\x00" 0x38f0-0x3b41 (593)
|
||||
* |until 0x3b40.7 (593) | |
|
||||
0x4170|09 00 00 00 |.... | name: ".strtab" (9) 0x4170-0x4174 (4)
|
||||
0x4170| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x4174-0x4178 (4)
|
||||
@ -1713,7 +1713,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x4190|01 00 00 00 |.... | addralign: 1 0x4190-0x4194 (4)
|
||||
0x4190| 00 00 00 00 | .... | entsize: 0 0x4194-0x4198 (4)
|
||||
| | | [33]{}: section_header 0x3b41-0x41c0 (1663)
|
||||
0x3b40| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74 61| ..symtab..strta| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.note.gnu.pr..." 0x3b41-0x3c6f (302)
|
||||
0x3b40| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74 61| ..symtab..strta| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.note.gnu.property\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.plt.got\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.ctors\x00.dtors\x00.dynamic\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x3b41-0x3c6f (302)
|
||||
0x3b50|62 00 2e 73 68 73 74 72 74 61 62 00 2e 69 6e 74|b..shstrtab..int|
|
||||
* |until 0x3c6e.7 (302) | |
|
||||
0x4190| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x4198-0x419c (4)
|
||||
|
@ -2088,7 +2088,7 @@ $ fq -d elf dv a_static
|
||||
0x11700| 04 00 00 00 | .... | addralign: 4 0x11708-0x1170c (4)
|
||||
0x11700| 10 00 00 00| ....| entsize: 16 0x1170c-0x11710 (4)
|
||||
| | | [23]{}: section_header 0x10c40-0x11738 (2808)
|
||||
0x10c40|00 63 72 74 31 2e 63 00 63 72 74 73 74 75 66 66|.crt1.c.crtstuff| string: "\x00crt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00..." 0x10c40-0x1128b (1611)
|
||||
0x10c40|00 63 72 74 31 2e 63 00 63 72 74 73 74 75 66 66|.crt1.c.crtstuff| string: "\x00crt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.2\x00dtor_idx.1\x00frame_dummy\x00object.0\x00__CTOR_END__\x00__FRAME_END__\x00__do_global_ctors_aux\x00a.c\x00libbbb.c\x00__libc_start_main.c\x00dummy1\x00libc_start_main_stage2\x00libc.c\x00stdout.c\x00buf\x00__environ.c\x00__init_tls.c\x00static_init_tls\x00main_tls\x00builtin_tls\x00_Exit.c\x00__lockfile.c\x00__overflow.c\x00__stdio_close.c\x00__stdio_seek.c\x00__stdout_write.c\x00__towrite.c\x00fputs.c\x00fwrite.c\x00strlen.c\x00default_attr.c\x00lseek.c\x00syscall_ret.c\x00__stdio_exit.c\x00close_file\x00dummy_file\x00__stdio_write.c\x00ofl.c\x00ofl_head\x00__lock.c\x00__errno_location.c\x00__fini_array_end\x00__fini_array_start\x00__init_array_end\x00_GLOBAL_OFFSET_TABLE_\x00__init_array_start\x00__thread_list_lock\x00__stdout_used\x00stdout\x00__x86.get_pc_thunk.si\x00__init_libc\x00__syscall_ret\x00__stdout_write\x00__ofl_unlock\x00__unlockfile\x00__hwcap\x00__stdio_write\x00__towrite\x00memcpy\x00__ofl_lock\x00__TMC_END__\x00__unlock\x00__DTOR_END__\x00__overflow\x00__libc\x00__x86.get_pc_thunk.ax\x00__dso_handle\x00__set_thread_area\x00__stdin_used\x00__copy_tls\x00__stdio_seek\x00__lockfile\x00___errno_location\x00aaa\x00_Exit\x00__towrite_needs_stdio_exit\x00__init_tls\x00__funcs_on_exit\x00__memcpy_fwd\x00__stdio_ofl_lockptr\x00fputs_unlocked\x00___environ\x00__progname\x00_start_c\x00__stdout_FILE\x00program_invocation_short_name\x00__libc_start_init\x00__init_tp\x00__x86.get_pc_thunk.bx\x00__init_ssp\x00__fwritex\x00__x86.get_pc_thunk.bp\x00__bss_start\x00__stdio_exit\x00__lock\x00__aio_close\x00__lseek\x00__libc_exit_fini\x00fwrite_unlocked\x00fwrite\x00_edata\x00__stdio_close\x00__stderr_used\x00__stdio_exit_needed\x00libbbb_bbb\x00__libc_start_main\x00strlen\x00lseek64\x00program_invocation_name\x00__default_stacksize\x00fputs\x00__default_guardsize\x00__sysinfo\x00__progname_full\x00" 0x10c40-0x1128b (1611)
|
||||
* |until 0x1128a.7 (1611) | |
|
||||
0x11710|09 00 00 00 |.... | name: ".strtab" (9) 0x11710-0x11714 (4)
|
||||
0x11710| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x11714-0x11718 (4)
|
||||
@ -2115,7 +2115,7 @@ $ fq -d elf dv a_static
|
||||
0x11730|01 00 00 00 |.... | addralign: 1 0x11730-0x11734 (4)
|
||||
0x11730| 00 00 00 00 | .... | entsize: 0 0x11734-0x11738 (4)
|
||||
| | | [24]{}: section_header 0x1128b-0x11760 (1237)
|
||||
0x11280| 00 2e 73 79 6d| ..sym| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.note.gnu.property\x00...." 0x1128b-0x11377 (236)
|
||||
0x11280| 00 2e 73 79 6d| ..sym| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.note.gnu.property\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.ctors\x00.dtors\x00.data.rel.ro\x00.got\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x1128b-0x11377 (236)
|
||||
0x11290|74 61 62 00 2e 73 74 72 74 61 62 00 2e 73 68 73|tab..strtab..shs|
|
||||
* |until 0x11376.7 (236) | |
|
||||
0x11730| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x11738-0x1173c (4)
|
||||
|
@ -470,7 +470,7 @@ $ fq -d elf dv a_stripped
|
||||
0x31b0|04 00 00 00 |.... | addralign: 4 0x31b0-0x31b4 (4)
|
||||
0x31b0| 10 00 00 00 | .... | entsize: 16 0x31b4-0x31b8 (4)
|
||||
| | | [5]{}: section_header 0x2c8-0x31e0 (12056)
|
||||
0x02c0| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__register_frame_info_base..." 0x2c8-0x393 (203)
|
||||
0x02c0| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__register_frame_info_bases\x00_ITM_registerTMCloneTable\x00__deregister_frame_info_bases\x00_ITM_deregisterTMCloneTable\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-x86.so.1\x00" 0x2c8-0x393 (203)
|
||||
0x02d0|63 78 61 5f 66 69 6e 61 6c 69 7a 65 00 5f 5f 72|cxa_finalize.__r|
|
||||
* |until 0x392.7 (203) | |
|
||||
0x31b0| 38 00 00 00 | 8... | name: ".dynstr" (56) 0x31b8-0x31bc (4)
|
||||
@ -1024,7 +1024,7 @@ $ fq -d elf dv a_stripped
|
||||
0x3480|01 00 00 00 |.... | addralign: 1 0x3480-0x3484 (4)
|
||||
0x3480| 01 00 00 00 | .... | entsize: 1 0x3484-0x3488 (4)
|
||||
| | | [23]{}: section_header 0x3035-0x34b0 (1147)
|
||||
0x3030| 00 2e 73 68 73 74 72 74 61 62 00| ..shstrtab.| string: "\x00.shstrtab\x00.interp\x00.note.gnu.property\x00.gnu.hash..." 0x3035-0x30ed (184)
|
||||
0x3030| 00 2e 73 68 73 74 72 74 61 62 00| ..shstrtab.| string: "\x00.shstrtab\x00.interp\x00.note.gnu.property\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.plt.got\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.ctors\x00.dtors\x00.dynamic\x00.data\x00.bss\x00.comment\x00" 0x3035-0x30ed (184)
|
||||
0x3040|2e 69 6e 74 65 72 70 00 2e 6e 6f 74 65 2e 67 6e|.interp..note.gn|
|
||||
* |until 0x30ec.7 (184) | |
|
||||
0x3480| 01 00 00 00 | .... | name: ".shstrtab" (1) 0x3488-0x348c (4)
|
||||
|
@ -553,7 +553,7 @@ $ fq -d ar dv libbbb.a
|
||||
0x590| 04 00 00 00 | .... | addralign: 4 0x596-0x59a (4)
|
||||
0x590| 10 00 00 00 | .... | entsize: 16 0x59a-0x59e (4)
|
||||
| | | [14]{}: section_header 0x25e-0x5c6 (872)
|
||||
0x250| 00 6c| .l| string: "\x00libbbb.c\x00libbbb_bbb\x00__x86.get_pc_thunk.ax\x00_GLO..." 0x25e-0x2a4 (70)
|
||||
0x250| 00 6c| .l| string: "\x00libbbb.c\x00libbbb_bbb\x00__x86.get_pc_thunk.ax\x00_GLOBAL_OFFSET_TABLE_\x00puts\x00" 0x25e-0x2a4 (70)
|
||||
0x260|69 62 62 62 62 2e 63 00 6c 69 62 62 62 62 5f 62|ibbbb.c.libbbb_b|
|
||||
* |until 0x2a3.7 (70) | |
|
||||
0x590| 09 00| ..| name: ".strtab" (9) 0x59e-0x5a2 (4)
|
||||
@ -584,7 +584,7 @@ $ fq -d ar dv libbbb.a
|
||||
0x5c0|00 00 |.. |
|
||||
0x5c0| 00 00 00 00 | .... | entsize: 0 0x5c2-0x5c6 (4)
|
||||
| | | [15]{}: section_header 0x2d6-0x5ee (792)
|
||||
0x2d0| 00 2e 73 79 6d 74 61 62 00 2e| ..symtab..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rel.text\x00.data\x00.bss..." 0x2d6-0x36b (149)
|
||||
0x2d0| 00 2e 73 79 6d 74 61 62 00 2e| ..symtab..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rel.text\x00.data\x00.bss\x00.rodata\x00.text.__x86.get_pc_thunk.ax\x00.comment\x00.note.GNU-stack\x00.note.gnu.property\x00.rel.eh_frame\x00.group\x00" 0x2d6-0x36b (149)
|
||||
0x2e0|73 74 72 74 61 62 00 2e 73 68 73 74 72 74 61 62|strtab..shstrtab|
|
||||
* |until 0x36a.7 (149) | |
|
||||
0x5c0| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x5c6-0x5ca (4)
|
||||
|
@ -377,7 +377,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x3800| 04 00 00 00 | .... | addralign: 4 0x3808-0x380c (4)
|
||||
0x3800| 10 00 00 00| ....| entsize: 16 0x380c-0x3810 (4)
|
||||
| | | [3]{}: section_header 0x240-0x3838 (13816)
|
||||
0x0240|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_r..." 0x240-0x2ef (175)
|
||||
0x0240|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_registerTMCloneTable\x00__cxa_finalize\x00__deregister_frame_info_bases\x00__register_frame_info_bases\x00libbbb_bbb\x00puts\x00libc.musl-x86.so.1\x00" 0x240-0x2ef (175)
|
||||
* |until 0x2ee.7 (175) | |
|
||||
0x3810|2d 00 00 00 |-... | name: ".dynstr" (45) 0x3810-0x3814 (4)
|
||||
0x3810| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x3814-0x3818 (4)
|
||||
@ -1475,7 +1475,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x3c10| 04 00 00 00 | .... | addralign: 4 0x3c18-0x3c1c (4)
|
||||
0x3c10| 10 00 00 00| ....| entsize: 16 0x3c1c-0x3c20 (4)
|
||||
| | | [29]{}: section_header 0x3470-0x3c48 (2008)
|
||||
0x3470|00 63 72 74 73 74 75 66 66 2e 63 00 5f 5f 43 54|.crtstuff.c.__CT| string: "\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FR..." 0x3470-0x3687 (535)
|
||||
0x3470|00 63 72 74 73 74 75 66 66 2e 63 00 5f 5f 43 54|.crtstuff.c.__CT| string: "\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.2\x00dtor_idx.1\x00frame_dummy\x00object.0\x00__CTOR_END__\x00__FRAME_END__\x00__do_global_ctors_aux\x00libbbb.c\x00__x86.get_pc_thunk.di\x00_DYNAMIC\x00__TMC_END__\x00__DTOR_END__\x00__x86.get_pc_thunk.ax\x00__dso_handle\x00__x86.get_pc_thunk.dx\x00__x86.get_pc_thunk.bx\x00__GNU_EH_FRAME_HDR\x00_GLOBAL_OFFSET_TABLE_\x00puts\x00__cxa_finalize\x00_init\x00__register_frame_info_bases\x00_ITM_registerTMCloneTable\x00__deregister_frame_info_bases\x00_ITM_deregisterTMCloneTable\x00_fini\x00libbbb_bbb\x00" 0x3470-0x3687 (535)
|
||||
* |until 0x3686.7 (535) | |
|
||||
0x3c20|09 00 00 00 |.... | name: ".strtab" (9) 0x3c20-0x3c24 (4)
|
||||
0x3c20| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x3c24-0x3c28 (4)
|
||||
@ -1502,7 +1502,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x3c40|01 00 00 00 |.... | addralign: 1 0x3c40-0x3c44 (4)
|
||||
0x3c40| 00 00 00 00 | .... | entsize: 0 0x3c44-0x3c48 (4)
|
||||
| | | [30]{}: section_header 0x3687-0x3c70 (1513)
|
||||
0x3680| 00 2e 73 79 6d 74 61 62 00| ..symtab.| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.d..." 0x3687-0x3795 (270)
|
||||
0x3680| 00 2e 73 79 6d 74 61 62 00| ..symtab.| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.plt.got\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.note.gnu.property\x00.ctors\x00.dtors\x00.dynamic\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_str\x00.debug_ranges\x00" 0x3687-0x3795 (270)
|
||||
0x3690|2e 73 74 72 74 61 62 00 2e 73 68 73 74 72 74 61|.strtab..shstrta|
|
||||
* |until 0x3794.7 (270) | |
|
||||
0x3c40| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x3c48-0x3c4c (4)
|
||||
|
@ -476,7 +476,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x3fc0|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x3fc0-0x3fc8 (8)
|
||||
0x3fc0| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x3fc8-0x3fd0 (8)
|
||||
| | | [5]{}: section_header 0x468-0x4010 (15272)
|
||||
0x0460| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x468-0x52a (194)
|
||||
0x0460| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-x86_64.so.1\x00" 0x468-0x52a (194)
|
||||
0x0470|63 78 61 5f 66 69 6e 61 6c 69 7a 65 00 5f 5f 64|cxa_finalize.__d|
|
||||
* |until 0x529.7 (194) | |
|
||||
0x3fd0|48 00 00 00 |H... | name: ".dynstr" (72) 0x3fd0-0x3fd4 (4)
|
||||
@ -1678,7 +1678,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x4680|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x4680-0x4688 (8)
|
||||
0x4680| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x4688-0x4690 (8)
|
||||
| | | [32]{}: section_header 0x3b70-0x46d0 (2912)
|
||||
0x3b70|00 53 63 72 74 31 2e 63 00 63 72 74 73 74 75 66|.Scrt1.c.crtstuf| string: "\x00Scrt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__..." 0x3b70-0x3d5d (493)
|
||||
0x3b70|00 53 63 72 74 31 2e 63 00 63 72 74 73 74 75 66|.Scrt1.c.crtstuf| string: "\x00Scrt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.2\x00dtor_idx.1\x00frame_dummy\x00object.0\x00__CTOR_END__\x00__FRAME_END__\x00__do_global_ctors_aux\x00a.c\x00_DYNAMIC\x00__GNU_EH_FRAME_HDR\x00_GLOBAL_OFFSET_TABLE_\x00__TMC_END__\x00__DTOR_END__\x00puts\x00__cxa_finalize\x00__dso_handle\x00aaa\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_start_c\x00_ITM_deregisterTMCloneTable\x00__bss_start\x00_fini\x00_edata\x00_end\x00libbbb_bbb\x00__libc_start_main\x00__register_frame_info\x00" 0x3b70-0x3d5d (493)
|
||||
* |until 0x3d5c.7 (493) | |
|
||||
0x4690|09 00 00 00 |.... | name: ".strtab" (9) 0x4690-0x4694 (4)
|
||||
0x4690| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x4694-0x4698 (4)
|
||||
@ -1706,7 +1706,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x46c0|01 00 00 00 00 00 00 00 |........ | addralign: 1 0x46c0-0x46c8 (8)
|
||||
0x46c0| 00 00 00 00 00 00 00 00| ........| entsize: 0 0x46c8-0x46d0 (8)
|
||||
| | | [33]{}: section_header 0x3d5d-0x4710 (2483)
|
||||
0x3d50| 00 2e 73| ..s| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.note.gnu.pr..." 0x3d5d-0x3e8d (304)
|
||||
0x3d50| 00 2e 73| ..s| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.note.gnu.property\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rela.dyn\x00.rela.plt\x00.init\x00.plt.got\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.ctors\x00.dtors\x00.dynamic\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x3d5d-0x3e8d (304)
|
||||
0x3d60|79 6d 74 61 62 00 2e 73 74 72 74 61 62 00 2e 73|ymtab..strtab..s|
|
||||
* |until 0x3e8c.7 (304) | |
|
||||
0x46d0|11 00 00 00 |.... | name: ".shstrtab" (17) 0x46d0-0x46d4 (4)
|
||||
|
@ -2037,7 +2037,7 @@ $ fq -d elf dv a_static
|
||||
0x14410|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x14410-0x14418 (8)
|
||||
0x14410| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x14418-0x14420 (8)
|
||||
| | | [22]{}: section_header 0x137c8-0x14460 (3224)
|
||||
0x137c0| 00 63 72 74 31 2e 63 00| .crt1.c.| string: "\x00crt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00..." 0x137c8-0x13db2 (1514)
|
||||
0x137c0| 00 63 72 74 31 2e 63 00| .crt1.c.| string: "\x00crt1.c\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.2\x00dtor_idx.1\x00frame_dummy\x00object.0\x00__CTOR_END__\x00__FRAME_END__\x00__do_global_ctors_aux\x00a.c\x00libbbb.c\x00__libc_start_main.c\x00dummy1\x00libc_start_main_stage2\x00defsysinfo.c\x00libc.c\x00stdout.c\x00buf\x00__environ.c\x00__init_tls.c\x00static_init_tls\x00main_tls\x00builtin_tls\x00_Exit.c\x00__lockfile.c\x00__overflow.c\x00__stdio_close.c\x00__stdio_seek.c\x00__stdout_write.c\x00__towrite.c\x00fputs.c\x00fwrite.c\x00strlen.c\x00default_attr.c\x00lseek.c\x00syscall_ret.c\x00__stdio_exit.c\x00close_file\x00dummy_file\x00__stdio_write.c\x00ofl.c\x00ofl_head\x00__lock.c\x00__errno_location.c\x00__fini_array_end\x00__fini_array_start\x00__init_array_end\x00__init_array_start\x00__thread_list_lock\x00__stdout_used\x00stdout\x00__init_libc\x00__syscall_ret\x00__stdout_write\x00__ofl_unlock\x00__unlockfile\x00__hwcap\x00__stdio_write\x00__towrite\x00memcpy\x00__ofl_lock\x00__TMC_END__\x00__unlock\x00__DTOR_END__\x00__overflow\x00__libc\x00__dso_handle\x00__set_thread_area\x00__stdin_used\x00__copy_tls\x00__stdio_seek\x00__lockfile\x00___errno_location\x00aaa\x00_Exit\x00__towrite_needs_stdio_exit\x00__init_tls\x00__funcs_on_exit\x00__memcpy_fwd\x00__stdio_ofl_lockptr\x00fputs_unlocked\x00___environ\x00__progname\x00_start_c\x00__stdout_FILE\x00program_invocation_short_name\x00__libc_start_init\x00__init_tp\x00__init_ssp\x00__fwritex\x00__bss_start\x00__stdio_exit\x00__lock\x00__aio_close\x00__lseek\x00__libc_exit_fini\x00fwrite_unlocked\x00fwrite\x00_edata\x00__stdio_close\x00__stderr_used\x00__stdio_exit_needed\x00libbbb_bbb\x00__libc_start_main\x00strlen\x00lseek64\x00program_invocation_name\x00__default_stacksize\x00fputs\x00__default_guardsize\x00__sysinfo\x00__progname_full\x00" 0x137c8-0x13db2 (1514)
|
||||
0x137d0|63 72 74 73 74 75 66 66 2e 63 00 5f 5f 43 54 4f|crtstuff.c.__CTO|
|
||||
* |until 0x13db1.7 (1514) | |
|
||||
0x14420|09 00 00 00 |.... | name: ".strtab" (9) 0x14420-0x14424 (4)
|
||||
@ -2066,7 +2066,7 @@ $ fq -d elf dv a_static
|
||||
0x14450|01 00 00 00 00 00 00 00 |........ | addralign: 1 0x14450-0x14458 (8)
|
||||
0x14450| 00 00 00 00 00 00 00 00| ........| entsize: 0 0x14458-0x14460 (8)
|
||||
| | | [23]{}: section_header 0x13db2-0x144a0 (1774)
|
||||
0x13db0| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74| ..symtab..strt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.note.gnu.property\x00...." 0x13db2-0x13e99 (231)
|
||||
0x13db0| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74| ..symtab..strt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.note.gnu.property\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.ctors\x00.dtors\x00.data.rel.ro\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x13db2-0x13e99 (231)
|
||||
0x13dc0|61 62 00 2e 73 68 73 74 72 74 61 62 00 2e 6e 6f|ab..shstrtab..no|
|
||||
* |until 0x13e98.7 (231) | |
|
||||
0x14460|11 00 00 00 |.... | name: ".shstrtab" (17) 0x14460-0x14464 (4)
|
||||
|
@ -476,7 +476,7 @@ $ fq -d elf dv a_stripped
|
||||
0x3220| 08 00 00 00 00 00 00 00| ........| addralign: 8 0x3228-0x3230 (8)
|
||||
0x3230|18 00 00 00 00 00 00 00 |........ | entsize: 24 0x3230-0x3238 (8)
|
||||
| | | [5]{}: section_header 0x468-0x3278 (11792)
|
||||
0x0460| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x468-0x52a (194)
|
||||
0x0460| 00 70 75 74 73 00 5f 5f| .puts.__| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-x86_64.so.1\x00" 0x468-0x52a (194)
|
||||
0x0470|63 78 61 5f 66 69 6e 61 6c 69 7a 65 00 5f 5f 64|cxa_finalize.__d|
|
||||
* |until 0x529.7 (194) | |
|
||||
0x3230| 38 00 00 00 | 8... | name: ".dynstr" (56) 0x3238-0x323c (4)
|
||||
@ -1046,7 +1046,7 @@ $ fq -d elf dv a_stripped
|
||||
0x36a0| 01 00 00 00 00 00 00 00| ........| addralign: 1 0x36a8-0x36b0 (8)
|
||||
0x36b0|01 00 00 00 00 00 00 00 |........ | entsize: 1 0x36b0-0x36b8 (8)
|
||||
| | | [23]{}: section_header 0x3039-0x36f8 (1727)
|
||||
0x3030| 00 2e 73 68 73 74 72| ..shstr| string: "\x00.shstrtab\x00.interp\x00.note.gnu.property\x00.gnu.hash..." 0x3039-0x30f3 (186)
|
||||
0x3030| 00 2e 73 68 73 74 72| ..shstr| string: "\x00.shstrtab\x00.interp\x00.note.gnu.property\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rela.dyn\x00.rela.plt\x00.init\x00.plt.got\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.ctors\x00.dtors\x00.dynamic\x00.data\x00.bss\x00.comment\x00" 0x3039-0x30f3 (186)
|
||||
0x3040|74 61 62 00 2e 69 6e 74 65 72 70 00 2e 6e 6f 74|tab..interp..not|
|
||||
* |until 0x30f2.7 (186) | |
|
||||
0x36b0| 01 00 00 00 | .... | name: ".shstrtab" (1) 0x36b8-0x36bc (4)
|
||||
|
@ -517,7 +517,7 @@ $ fq -d ar dv libbbb.a
|
||||
0x630|00 00 00 00 |.... |
|
||||
0x630| 00 00 00 00 00 00 00 00 | ........ | entsize: 0 0x634-0x63c (8)
|
||||
| | | [13]{}: section_header 0x284-0x67c (1016)
|
||||
0x280| 00 2e 73 79 6d 74 61 62 00 2e 73 74| ..symtab..st| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rela.text\x00.data\x00.bs..." 0x284-0x2f8 (116)
|
||||
0x280| 00 2e 73 79 6d 74 61 62 00 2e 73 74| ..symtab..st| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rela.text\x00.data\x00.bss\x00.rodata\x00.comment\x00.note.GNU-stack\x00.note.gnu.property\x00.rela.eh_frame\x00" 0x284-0x2f8 (116)
|
||||
0x290|72 74 61 62 00 2e 73 68 73 74 72 74 61 62 00 2e|rtab..shstrtab..|
|
||||
* |until 0x2f7.7 (116) | |
|
||||
0x630| 11 00 00 00| ....| name: ".shstrtab" (17) 0x63c-0x640 (4)
|
||||
|
@ -379,7 +379,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x3940|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x3940-0x3948 (8)
|
||||
0x3940| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x3948-0x3950 (8)
|
||||
| | | [3]{}: section_header 0x390-0x3990 (13824)
|
||||
0x0390|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_r..." 0x390-0x436 (166)
|
||||
0x0390|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_registerTMCloneTable\x00__cxa_finalize\x00__deregister_frame_info\x00__register_frame_info\x00libbbb_bbb\x00puts\x00libc.musl-x86_64.so.1\x00" 0x390-0x436 (166)
|
||||
* |until 0x435.7 (166) | |
|
||||
0x3950|2d 00 00 00 |-... | name: ".dynstr" (45) 0x3950-0x3954 (4)
|
||||
0x3950| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x3954-0x3958 (4)
|
||||
@ -1466,7 +1466,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x3fc0|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x3fc0-0x3fc8 (8)
|
||||
0x3fc0| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x3fc8-0x3fd0 (8)
|
||||
| | | [29]{}: section_header 0x35c8-0x4010 (2632)
|
||||
0x35c0| 00 63 72 74 73 74 75 66| .crtstuf| string: "\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FR..." 0x35c8-0x377b (435)
|
||||
0x35c0| 00 63 72 74 73 74 75 66| .crtstuf| string: "\x00crtstuff.c\x00__CTOR_LIST__\x00__DTOR_LIST__\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.2\x00dtor_idx.1\x00frame_dummy\x00object.0\x00__CTOR_END__\x00__FRAME_END__\x00__do_global_ctors_aux\x00libbbb.c\x00_DYNAMIC\x00__TMC_END__\x00__DTOR_END__\x00__dso_handle\x00__GNU_EH_FRAME_HDR\x00_GLOBAL_OFFSET_TABLE_\x00puts\x00__cxa_finalize\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00_fini\x00libbbb_bbb\x00__register_frame_info\x00" 0x35c8-0x377b (435)
|
||||
0x35d0|66 2e 63 00 5f 5f 43 54 4f 52 5f 4c 49 53 54 5f|f.c.__CTOR_LIST_|
|
||||
* |until 0x377a.7 (435) | |
|
||||
0x3fd0|09 00 00 00 |.... | name: ".strtab" (9) 0x3fd0-0x3fd4 (4)
|
||||
@ -1495,7 +1495,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x4000|01 00 00 00 00 00 00 00 |........ | addralign: 1 0x4000-0x4008 (8)
|
||||
0x4000| 00 00 00 00 00 00 00 00| ........| entsize: 0 0x4008-0x4010 (8)
|
||||
| | | [30]{}: section_header 0x377b-0x4050 (2261)
|
||||
0x3770| 00 2e 73 79 6d| ..sym| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.d..." 0x377b-0x388b (272)
|
||||
0x3770| 00 2e 73 79 6d| ..sym| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rela.dyn\x00.rela.plt\x00.init\x00.plt.got\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.note.gnu.property\x00.ctors\x00.dtors\x00.dynamic\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_str\x00.debug_ranges\x00" 0x377b-0x388b (272)
|
||||
0x3780|74 61 62 00 2e 73 74 72 74 61 62 00 2e 73 68 73|tab..strtab..shs|
|
||||
* |until 0x388a.7 (272) | |
|
||||
0x4010|11 00 00 00 |.... | name: ".shstrtab" (17) 0x4010-0x4014 (4)
|
||||
|
@ -391,7 +391,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x2430|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x2430-0x2438 (8)
|
||||
0x2430| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x2438-0x2440 (8)
|
||||
| | | [4]{}: section_header 0x380-0x2480 (8448)
|
||||
0x0380|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x380-0x443 (195)
|
||||
0x0380|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-aarch64.so.1\x00" 0x380-0x443 (195)
|
||||
* |until 0x442.7 (195) | |
|
||||
0x2440|35 00 00 00 |5... | name: ".dynstr" (53) 0x2440-0x2444 (4)
|
||||
0x2440| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x2444-0x2448 (4)
|
||||
@ -1998,7 +1998,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x2ab0|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x2ab0-0x2ab8 (8)
|
||||
0x2ab0| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x2ab8-0x2ac0 (8)
|
||||
| | | [30]{}: section_header 0x2008-0x2b00 (2808)
|
||||
0x2000| 00 53 63 72 74 31 2e 63| .Scrt1.c| string: "\x00Scrt1.c\x00$x\x00crti.o\x00crtn.o\x00crtstuff.c\x00$d\x00__EH_FR..." 0x2008-0x221a (530)
|
||||
0x2000| 00 53 63 72 74 31 2e 63| .Scrt1.c| string: "\x00Scrt1.c\x00$x\x00crti.o\x00crtn.o\x00crtstuff.c\x00$d\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00a.c\x00__FRAME_END__\x00_DYNAMIC\x00__GNU_EH_FRAME_HDR\x00_GLOBAL_OFFSET_TABLE_\x00__TMC_END__\x00puts\x00__cxa_finalize\x00__bss_start__\x00__dso_handle\x00aaa\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00__bss_end__\x00_start_c\x00_ITM_deregisterTMCloneTable\x00__bss_start\x00__end__\x00_fini\x00_edata\x00_end\x00libbbb_bbb\x00__libc_start_main\x00__register_frame_info\x00" 0x2008-0x221a (530)
|
||||
0x2010|00 24 78 00 63 72 74 69 2e 6f 00 63 72 74 6e 2e|.$x.crti.o.crtn.|
|
||||
* |until 0x2219.7 (530) | |
|
||||
0x2ac0|09 00 00 00 |.... | name: ".strtab" (9) 0x2ac0-0x2ac4 (4)
|
||||
@ -2027,7 +2027,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x2af0|01 00 00 00 00 00 00 00 |........ | addralign: 1 0x2af0-0x2af8 (8)
|
||||
0x2af0| 00 00 00 00 00 00 00 00| ........| entsize: 0 0x2af8-0x2b00 (8)
|
||||
| | | [31]{}: section_header 0x221a-0x2b40 (2342)
|
||||
0x2210| 00 2e 73 79 6d 74| ..symt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.gnu.hash\x00.d..." 0x221a-0x233d (291)
|
||||
0x2210| 00 2e 73 79 6d 74| ..symt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rela.dyn\x00.rela.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x221a-0x233d (291)
|
||||
0x2220|61 62 00 2e 73 74 72 74 61 62 00 2e 73 68 73 74|ab..strtab..shst|
|
||||
* |until 0x233c.7 (291) | |
|
||||
0x2b00|11 00 00 00 |.... | name: ".shstrtab" (17) 0x2b00-0x2b04 (4)
|
||||
|
@ -2916,7 +2916,7 @@ $ fq -d elf dv a_static
|
||||
0x154d0|08 00 00 00 00 00 00 00 |........ | addralign: 8 0x154d0-0x154d8 (8)
|
||||
0x154d0| 18 00 00 00 00 00 00 00| ........| entsize: 24 0x154d8-0x154e0 (8)
|
||||
| | | [22]{}: section_header 0x14830-0x15520 (3312)
|
||||
0x14830|00 63 72 74 69 2e 6f 00 24 78 00 63 72 74 6e 2e|.crti.o.$x.crtn.| string: "\x00crti.o\x00$x\x00crtn.o\x00crt1.c\x00crtstuff.c\x00$d\x00__EH_FRA..." 0x14830-0x14e78 (1608)
|
||||
0x14830|00 63 72 74 69 2e 6f 00 24 78 00 63 72 74 6e 2e|.crti.o.$x.crtn.| string: "\x00crti.o\x00$x\x00crtn.o\x00crt1.c\x00crtstuff.c\x00$d\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00a.c\x00libbbb.c\x00__libc_start_main.c\x00dummy1\x00libc_start_main_stage2\x00defsysinfo.c\x00libc.c\x00stdout.c\x00buf\x00memset.lo\x00__environ.c\x00__init_tls.c\x00static_init_tls\x00builtin_tls\x00main_tls\x00_Exit.c\x00__lockfile.c\x00__overflow.c\x00__stdio_close.c\x00__stdio_seek.c\x00__stdout_write.c\x00__towrite.c\x00fputs.c\x00fwrite.c\x00memcpy.lo\x00strlen.c\x00__set_thread_area.lo\x00default_attr.c\x00lseek.c\x00syscall_ret.c\x00__stdio_exit.c\x00close_file\x00dummy_file\x00__stdio_write.c\x00ofl.c\x00ofl_head\x00__lock.c\x00__errno_location.c\x00__FRAME_END__\x00__fini_array_end\x00__fini_array_start\x00__init_array_end\x00_GLOBAL_OFFSET_TABLE_\x00__init_array_start\x00__thread_list_lock\x00__stdout_used\x00stdout\x00__init_libc\x00__syscall_ret\x00__stdout_write\x00__ofl_unlock\x00__unlockfile\x00__hwcap\x00__stdio_write\x00__towrite\x00memcpy\x00__ofl_lock\x00__TMC_END__\x00__unlock\x00__overflow\x00__libc\x00__bss_start__\x00__dso_handle\x00__set_thread_area\x00__stdin_used\x00__copy_tls\x00__stdio_seek\x00__lockfile\x00___errno_location\x00aaa\x00_Exit\x00__towrite_needs_stdio_exit\x00__init_tls\x00__funcs_on_exit\x00__stdio_ofl_lockptr\x00fputs_unlocked\x00__bss_end__\x00___environ\x00__progname\x00_start_c\x00__stdout_FILE\x00program_invocation_short_name\x00__libc_start_init\x00__init_tp\x00__init_ssp\x00__fwritex\x00__bss_start\x00memset\x00__stdio_exit\x00__lock\x00__end__\x00__aio_close\x00__lseek\x00__libc_exit_fini\x00fwrite_unlocked\x00fwrite\x00_edata\x00__stdio_close\x00__stderr_used\x00__stdio_exit_needed\x00libbbb_bbb\x00__libc_start_main\x00strlen\x00lseek64\x00program_invocation_name\x00__default_stacksize\x00fputs\x00__default_guardsize\x00__sysinfo\x00__progname_full\x00" 0x14830-0x14e78 (1608)
|
||||
* |until 0x14e77.7 (1608) | |
|
||||
0x154e0|09 00 00 00 |.... | name: ".strtab" (9) 0x154e0-0x154e4 (4)
|
||||
0x154e0| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x154e4-0x154e8 (4)
|
||||
@ -2944,7 +2944,7 @@ $ fq -d elf dv a_static
|
||||
0x15510|01 00 00 00 00 00 00 00 |........ | addralign: 1 0x15510-0x15518 (8)
|
||||
0x15510| 00 00 00 00 00 00 00 00| ........| entsize: 0 0x15518-0x15520 (8)
|
||||
| | | [23]{}: section_header 0x14e78-0x15560 (1768)
|
||||
0x14e70| 00 2e 73 79 6d 74 61 62| ..symtab| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.init\x00.text\x00.fini\x00.r..." 0x14e78-0x14f5b (227)
|
||||
0x14e70| 00 2e 73 79 6d 74 61 62| ..symtab| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.data.rel.ro\x00.got\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x14e78-0x14f5b (227)
|
||||
0x14e80|00 2e 73 74 72 74 61 62 00 2e 73 68 73 74 72 74|..strtab..shstrt|
|
||||
* |until 0x14f5a.7 (227) | |
|
||||
0x15520|11 00 00 00 |.... | name: ".shstrtab" (17) 0x15520-0x15524 (4)
|
||||
|
@ -391,7 +391,7 @@ $ fq -d elf dv a_stripped
|
||||
0x11d0| 08 00 00 00 00 00 00 00| ........| addralign: 8 0x11d8-0x11e0 (8)
|
||||
0x11e0|18 00 00 00 00 00 00 00 |........ | entsize: 24 0x11e0-0x11e8 (8)
|
||||
| | | [4]{}: section_header 0x380-0x1228 (3752)
|
||||
0x0380|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x380-0x443 (195)
|
||||
0x0380|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-aarch64.so.1\x00" 0x380-0x443 (195)
|
||||
* |until 0x442.7 (195) | |
|
||||
0x11e0| 25 00 00 00 | %... | name: ".dynstr" (37) 0x11e8-0x11ec (4)
|
||||
0x11e0| 03 00 00 00| ....| type: "strtab" (0x3) (String table) 0x11ec-0x11f0 (4)
|
||||
@ -942,7 +942,7 @@ $ fq -d elf dv a_stripped
|
||||
0x1610| 01 00 00 00 00 00 00 00| ........| addralign: 1 0x1618-0x1620 (8)
|
||||
0x1620|01 00 00 00 00 00 00 00 |........ | entsize: 1 0x1620-0x1628 (8)
|
||||
| | | [21]{}: section_header 0x1039-0x1668 (1583)
|
||||
0x1030| 00 2e 73 68 73 74 72| ..shstr| string: "\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.r..." 0x1039-0x10e6 (173)
|
||||
0x1030| 00 2e 73 68 73 74 72| ..shstr| string: "\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rela.dyn\x00.rela.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00" 0x1039-0x10e6 (173)
|
||||
0x1040|74 61 62 00 2e 69 6e 74 65 72 70 00 2e 67 6e 75|tab..interp..gnu|
|
||||
* |until 0x10e5.7 (173) | |
|
||||
0x1620| 01 00 00 00 | .... | name: ".shstrtab" (1) 0x1628-0x162c (4)
|
||||
|
@ -552,7 +552,7 @@ $ fq -d ar dv libbbb.a
|
||||
0x690| 00 00 00 00| ....| entsize: 0 0x69c-0x6a4 (8)
|
||||
0x6a0|00 00 00 00 |.... |
|
||||
| | | [12]{}: section_header 0x33c-0x6e4 (936)
|
||||
0x330| 00 2e 73 79| ..sy| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rela.text\x00.data\x00.bs..." 0x33c-0x39d (97)
|
||||
0x330| 00 2e 73 79| ..sy| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rela.text\x00.data\x00.bss\x00.rodata\x00.comment\x00.note.GNU-stack\x00.rela.eh_frame\x00" 0x33c-0x39d (97)
|
||||
0x340|6d 74 61 62 00 2e 73 74 72 74 61 62 00 2e 73 68|mtab..strtab..sh|
|
||||
* |until 0x39c.7 (97) | |
|
||||
0x6a0| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x6a4-0x6a8 (4)
|
||||
|
@ -327,7 +327,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x1cd0| 08 00 00 00 00 00 00 00| ........| addralign: 8 0x1cd8-0x1ce0 (8)
|
||||
0x1ce0|18 00 00 00 00 00 00 00 |........ | entsize: 24 0x1ce0-0x1ce8 (8)
|
||||
| | | [3]{}: section_header 0x2e0-0x1d28 (6728)
|
||||
0x02e0|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_r..." 0x2e0-0x387 (167)
|
||||
0x02e0|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_registerTMCloneTable\x00__cxa_finalize\x00__deregister_frame_info\x00__register_frame_info\x00libbbb_bbb\x00puts\x00libc.musl-aarch64.so.1\x00" 0x2e0-0x387 (167)
|
||||
* |until 0x386.7 (167) | |
|
||||
0x1ce0| 2d 00 00 00 | -... | name: ".dynstr" (45) 0x1ce8-0x1cec (4)
|
||||
0x1ce0| 03 00 00 00| ....| type: "strtab" (0x3) (String table) 0x1cec-0x1cf0 (4)
|
||||
@ -1715,7 +1715,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x22d0| 08 00 00 00 00 00 00 00| ........| addralign: 8 0x22d8-0x22e0 (8)
|
||||
0x22e0|18 00 00 00 00 00 00 00 |........ | entsize: 24 0x22e0-0x22e8 (8)
|
||||
| | | [27]{}: section_header 0x1968-0x2328 (2496)
|
||||
0x1960| 00 63 72 74 69 2e 6f 00| .crti.o.| string: "\x00crti.o\x00$x\x00crtn.o\x00crtstuff.c\x00$d\x00__EH_FRAME_BEGI..." 0x1968-0x1b1e (438)
|
||||
0x1960| 00 63 72 74 69 2e 6f 00| .crti.o.| string: "\x00crti.o\x00$x\x00crtn.o\x00crtstuff.c\x00$d\x00__EH_FRAME_BEGIN__\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00libbbb.c\x00__FRAME_END__\x00_DYNAMIC\x00__TMC_END__\x00__dso_handle\x00__GNU_EH_FRAME_HDR\x00_GLOBAL_OFFSET_TABLE_\x00puts\x00__cxa_finalize\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00_fini\x00libbbb_bbb\x00__register_frame_info\x00" 0x1968-0x1b1e (438)
|
||||
0x1970|24 78 00 63 72 74 6e 2e 6f 00 63 72 74 73 74 75|$x.crtn.o.crtstu|
|
||||
* |until 0x1b1d.7 (438) | |
|
||||
0x22e0| 09 00 00 00 | .... | name: ".strtab" (9) 0x22e8-0x22ec (4)
|
||||
@ -1744,7 +1744,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x2310| 01 00 00 00 00 00 00 00| ........| addralign: 1 0x2318-0x2320 (8)
|
||||
0x2320|00 00 00 00 00 00 00 00 |........ | entsize: 0 0x2320-0x2328 (8)
|
||||
| | | [28]{}: section_header 0x1b1e-0x2368 (2122)
|
||||
0x1b10| 00 2e| ..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.d..." 0x1b1e-0x1c21 (259)
|
||||
0x1b10| 00 2e| ..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rela.dyn\x00.rela.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame_hdr\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_str\x00.debug_ranges\x00" 0x1b1e-0x1c21 (259)
|
||||
0x1b20|73 79 6d 74 61 62 00 2e 73 74 72 74 61 62 00 2e|symtab..strtab..|
|
||||
* |until 0x1c20.7 (259) | |
|
||||
0x2320| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x2328-0x232c (4)
|
||||
|
@ -374,7 +374,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x20f0| 04 00 00 00 | .... | addralign: 4 0x20f4-0x20f8 (4)
|
||||
0x20f0| 10 00 00 00 | .... | entsize: 16 0x20f8-0x20fc (4)
|
||||
| | | [4]{}: section_header 0x220-0x2124 (7940)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x220-0x2e1 (193)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-armhf.so.1\x00" 0x220-0x2e1 (193)
|
||||
* |until 0x2e0.7 (193) | |
|
||||
0x20f0| 35 00 00 00| 5...| name: ".dynstr" (53) 0x20fc-0x2100 (4)
|
||||
0x2100|03 00 00 00 |.... | type: "strtab" (0x3) (String table) 0x2100-0x2104 (4)
|
||||
@ -2092,7 +2092,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x2500| 04 00 00 00 | .... | addralign: 4 0x2504-0x2508 (4)
|
||||
0x2500| 10 00 00 00 | .... | entsize: 16 0x2508-0x250c (4)
|
||||
| | | [30]{}: section_header 0x1d38-0x2534 (2044)
|
||||
0x1d30| 00 53 63 72 74 31 2e 63| .Scrt1.c| string: "\x00Scrt1.c\x00$a\x00$d\x00crti.o\x00crtn.o\x00crtstuff.c\x00all_imp..." 0x1d38-0x1f36 (510)
|
||||
0x1d30| 00 53 63 72 74 31 2e 63| .Scrt1.c| string: "\x00Scrt1.c\x00$a\x00$d\x00crti.o\x00crtn.o\x00crtstuff.c\x00all_implied_fbits\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00a.c\x00__FRAME_END__\x00_DYNAMIC\x00_GLOBAL_OFFSET_TABLE_\x00__TMC_END__\x00puts\x00__cxa_finalize\x00__bss_start__\x00__dso_handle\x00aaa\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00__bss_end__\x00_start_c\x00_ITM_deregisterTMCloneTable\x00__bss_start\x00__end__\x00_fini\x00_edata\x00_end\x00libbbb_bbb\x00__libc_start_main\x00__register_frame_info\x00" 0x1d38-0x1f36 (510)
|
||||
0x1d40|00 24 61 00 24 64 00 63 72 74 69 2e 6f 00 63 72|.$a.$d.crti.o.cr|
|
||||
* |until 0x1f35.7 (510) | |
|
||||
0x2500| 09 00 00 00| ....| name: ".strtab" (9) 0x250c-0x2510 (4)
|
||||
@ -2120,7 +2120,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x2520| 01 00 00 00| ....| addralign: 1 0x252c-0x2530 (4)
|
||||
0x2530|00 00 00 00 |.... | entsize: 0 0x2530-0x2534 (4)
|
||||
| | | [31]{}: section_header 0x1f36-0x255c (1574)
|
||||
0x1f30| 00 2e 73 79 6d 74 61 62 00 2e| ..symtab..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.gnu.hash\x00.d..." 0x1f36-0x2059 (291)
|
||||
0x1f30| 00 2e 73 79 6d 74 61 62 00 2e| ..symtab..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x1f36-0x2059 (291)
|
||||
0x1f40|73 74 72 74 61 62 00 2e 73 68 73 74 72 74 61 62|strtab..shstrtab|
|
||||
* |until 0x2058.7 (291) | |
|
||||
0x2530| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x2534-0x2538 (4)
|
||||
|
@ -3788,7 +3788,7 @@ $ fq -d elf dv a_static
|
||||
0x14d50|04 00 00 00 |.... | addralign: 4 0x14d50-0x14d54 (4)
|
||||
0x14d50| 10 00 00 00 | .... | entsize: 16 0x14d54-0x14d58 (4)
|
||||
| | | [23]{}: section_header 0x14060-0x14d80 (3360)
|
||||
0x14060|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00$d\x00crt1.c\x00crtstuff.c\x00all_impl..." 0x14060-0x148cd (2157)
|
||||
0x14060|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00$d\x00crt1.c\x00crtstuff.c\x00all_implied_fbits\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00libbbb.c\x00__libc_start_main.c\x00dummy1\x00libc_start_main_stage2\x00defsysinfo.c\x00libc.c\x00stdout.c\x00buf\x00memset.c\x00__environ.c\x00__init_tls.c\x00static_init_tls\x00builtin_tls\x00main_tls\x00_Exit.c\x00__lockfile.c\x00a_barrier\x00__overflow.c\x00__stdio_close.c\x00__stdio_seek.c\x00__stdout_write.c\x00__towrite.c\x00fputs.c\x00fwrite.c\x00memcpy.lo\x00copy_last_3_and_return\x00src_aligned\x00non_congruent\x00congruent_aligned32\x00cached_aligned32\x00less_than_32_left\x00partial_word_tail\x00less_than_thirtytwo\x00loop24\x00loop8\x00loop16\x00strlen.c\x00__set_thread_area.c\x00atomics.lo\x00default_attr.c\x00lseek.c\x00syscall_ret.c\x00__stdio_exit.c\x00close_file\x00dummy_file\x00__stdio_write.c\x00ofl.c\x00ofl_head\x00__lock.c\x00__errno_location.c\x00_udivsi3.o\x00.udivsi3_skip_div0_test\x00shift\x00_dvmd_lnx.o\x00raise.c\x00block.c\x00all_mask\x00app_mask\x00__FRAME_END__\x00__fini_array_end\x00__fini_array_start\x00__init_array_end\x00_GLOBAL_OFFSET_TABLE_\x00__init_array_start\x00__a_barrier_v7\x00__thread_list_lock\x00__a_gettp_ptr\x00__stdout_used\x00stdout\x00__a_barrier_ptr\x00__init_libc\x00__syscall_ret\x00__stdout_write\x00__ofl_unlock\x00__unlockfile\x00__hwcap\x00__restore_sigs\x00__stdio_write\x00__towrite\x00memcpy\x00__ofl_lock\x00__TMC_END__\x00__unlock\x00__overflow\x00__libc\x00__udivsi3\x00__bss_start__\x00__dso_handle\x00__set_thread_area\x00__stdin_used\x00__copy_tls\x00__stdio_seek\x00__lockfile\x00___errno_location\x00aaa\x00_Exit\x00__towrite_needs_stdio_exit\x00__a_gettp_cp15\x00__a_cas_v7\x00__init_tls\x00__funcs_on_exit\x00__a_cas_dummy\x00__stdio_ofl_lockptr\x00fputs_unlocked\x00__a_barrier_oldkuser\x00__bss_end__\x00___environ\x00__progname\x00_start_c\x00__block_all_sigs\x00__stdout_FILE\x00program_invocation_short_name\x00__libc_start_init\x00__init_tp\x00__init_ssp\x00__aeabi_ldiv0\x00__fwritex\x00__bss_start\x00memset\x00__a_barrier_v6\x00__stdio_exit\x00__aeabi_uidiv\x00__lock\x00__end__\x00__a_cas_v6\x00__aio_close\x00__lseek\x00__a_cas_ptr\x00__libc_exit_fini\x00fwrite_unlocked\x00__aeabi_uidivmod\x00fwrite\x00_edata\x00__stdio_close\x00__stderr_used\x00__stdio_exit_needed\x00__a_barrier_dummy\x00__aeabi_idiv0\x00libbbb_bbb\x00__libc_start_main\x00strlen\x00lseek64\x00program_invocation_name\x00__default_stacksize\x00fputs\x00__default_guardsize\x00__block_app_sigs\x00__sysinfo\x00__progname_full\x00raise\x00" 0x14060-0x148cd (2157)
|
||||
* |until 0x148cc.7 (2157) | |
|
||||
0x14d50| 09 00 00 00 | .... | name: ".strtab" (9) 0x14d58-0x14d5c (4)
|
||||
0x14d50| 03 00 00 00| ....| type: "strtab" (0x3) (String table) 0x14d5c-0x14d60 (4)
|
||||
@ -3815,7 +3815,7 @@ $ fq -d elf dv a_static
|
||||
0x14d70| 01 00 00 00 | .... | addralign: 1 0x14d78-0x14d7c (4)
|
||||
0x14d70| 00 00 00 00| ....| entsize: 0 0x14d7c-0x14d80 (4)
|
||||
| | | [24]{}: section_header 0x148cd-0x14da8 (1243)
|
||||
0x148c0| 00 2e 73| ..s| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.init\x00.text\x00.fini\x00.r..." 0x148cd-0x149c0 (243)
|
||||
0x148c0| 00 2e 73| ..s| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.data.rel.ro\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x148cd-0x149c0 (243)
|
||||
0x148d0|79 6d 74 61 62 00 2e 73 74 72 74 61 62 00 2e 73|ymtab..strtab..s|
|
||||
* |until 0x149bf.7 (243) | |
|
||||
0x14d80|11 00 00 00 |.... | name: ".shstrtab" (17) 0x14d80-0x14d84 (4)
|
||||
|
@ -374,7 +374,7 @@ $ fq -d elf dv a_stripped
|
||||
0x11b0|04 00 00 00 |.... | addralign: 4 0x11b0-0x11b4 (4)
|
||||
0x11b0| 10 00 00 00 | .... | entsize: 16 0x11b4-0x11b8 (4)
|
||||
| | | [4]{}: section_header 0x220-0x11e0 (4032)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x220-0x2e1 (193)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-armhf.so.1\x00" 0x220-0x2e1 (193)
|
||||
* |until 0x2e0.7 (193) | |
|
||||
0x11b0| 25 00 00 00 | %... | name: ".dynstr" (37) 0x11b8-0x11bc (4)
|
||||
0x11b0| 03 00 00 00| ....| type: "strtab" (0x3) (String table) 0x11bc-0x11c0 (4)
|
||||
@ -915,7 +915,7 @@ $ fq -d elf dv a_stripped
|
||||
0x1450| 01 00 00 00 | .... | addralign: 1 0x1458-0x145c (4)
|
||||
0x1450| 00 00 00 00| ....| entsize: 0 0x145c-0x1460 (4)
|
||||
| | | [21]{}: section_header 0x1068-0x1488 (1056)
|
||||
0x1060| 00 2e 73 68 73 74 72 74| ..shstrt| string: "\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.r..." 0x1068-0x1115 (173)
|
||||
0x1060| 00 2e 73 68 73 74 72 74| ..shstrt| string: "\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00" 0x1068-0x1115 (173)
|
||||
0x1070|61 62 00 2e 69 6e 74 65 72 70 00 2e 67 6e 75 2e|ab..interp..gnu.|
|
||||
* |until 0x1114.7 (173) | |
|
||||
0x1460|01 00 00 00 |.... | name: ".shstrtab" (1) 0x1460-0x1464 (4)
|
||||
|
@ -473,7 +473,7 @@ $ fq -d ar dv libbbb.a
|
||||
0x480|01 00 00 00 |.... | addralign: 1 0x480-0x484 (4)
|
||||
0x480| 00 00 00 00 | .... | entsize: 0 0x484-0x488 (4)
|
||||
| | | [11]{}: section_header 0x26c-0x4b0 (580)
|
||||
0x260| 00 2e 73 79| ..sy| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rel.text\x00.data\x00.bss..." 0x26c-0x2cd (97)
|
||||
0x260| 00 2e 73 79| ..sy| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rel.text\x00.data\x00.bss\x00.rodata\x00.comment\x00.note.GNU-stack\x00.ARM.attributes\x00" 0x26c-0x2cd (97)
|
||||
0x270|6d 74 61 62 00 2e 73 74 72 74 61 62 00 2e 73 68|mtab..strtab..sh|
|
||||
* |until 0x2cc.7 (97) | |
|
||||
0x480| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x488-0x48c (4)
|
||||
|
@ -305,7 +305,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x1a80| 04 00 00 00 | .... | addralign: 4 0x1a88-0x1a8c (4)
|
||||
0x1a80| 10 00 00 00| ....| entsize: 16 0x1a8c-0x1a90 (4)
|
||||
| | | [3]{}: section_header 0x1c0-0x1ab8 (6392)
|
||||
0x01c0|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_r..." 0x1c0-0x265 (165)
|
||||
0x01c0|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_registerTMCloneTable\x00__cxa_finalize\x00__deregister_frame_info\x00__register_frame_info\x00libbbb_bbb\x00puts\x00libc.musl-armhf.so.1\x00" 0x1c0-0x265 (165)
|
||||
* |until 0x264.7 (165) | |
|
||||
0x1a90|2d 00 00 00 |-... | name: ".dynstr" (45) 0x1a90-0x1a94 (4)
|
||||
0x1a90| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x1a94-0x1a98 (4)
|
||||
@ -1769,7 +1769,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x1e40| 04 00 00 00 | .... | addralign: 4 0x1e48-0x1e4c (4)
|
||||
0x1e40| 10 00 00 00| ....| entsize: 16 0x1e4c-0x1e50 (4)
|
||||
| | | [27]{}: section_header 0x1770-0x1e78 (1800)
|
||||
0x1770|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00crtstuff.c\x00$d\x00all_implied_fbi..." 0x1770-0x1912 (418)
|
||||
0x1770|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00crtstuff.c\x00$d\x00all_implied_fbits\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00libbbb.c\x00__FRAME_END__\x00_DYNAMIC\x00__TMC_END__\x00__dso_handle\x00_GLOBAL_OFFSET_TABLE_\x00puts\x00__cxa_finalize\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00_fini\x00libbbb_bbb\x00__register_frame_info\x00" 0x1770-0x1912 (418)
|
||||
* |until 0x1911.7 (418) | |
|
||||
0x1e50|09 00 00 00 |.... | name: ".strtab" (9) 0x1e50-0x1e54 (4)
|
||||
0x1e50| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x1e54-0x1e58 (4)
|
||||
@ -1796,7 +1796,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x1e70|01 00 00 00 |.... | addralign: 1 0x1e70-0x1e74 (4)
|
||||
0x1e70| 00 00 00 00 | .... | entsize: 0 0x1e74-0x1e78 (4)
|
||||
| | | [28]{}: section_header 0x1912-0x1ea0 (1422)
|
||||
0x1910| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74| ..symtab..strt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.d..." 0x1912-0x1a15 (259)
|
||||
0x1910| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74| ..symtab..strt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_str\x00.debug_ranges\x00" 0x1912-0x1a15 (259)
|
||||
0x1920|61 62 00 2e 73 68 73 74 72 74 61 62 00 2e 67 6e|ab..shstrtab..gn|
|
||||
* |until 0x1a14.7 (259) | |
|
||||
0x1e70| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x1e78-0x1e7c (4)
|
||||
|
@ -374,7 +374,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x20f0| 04 00 00 00 | .... | addralign: 4 0x20f4-0x20f8 (4)
|
||||
0x20f0| 10 00 00 00 | .... | entsize: 16 0x20f8-0x20fc (4)
|
||||
| | | [4]{}: section_header 0x220-0x2124 (7940)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x220-0x2e1 (193)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-armhf.so.1\x00" 0x220-0x2e1 (193)
|
||||
* |until 0x2e0.7 (193) | |
|
||||
0x20f0| 35 00 00 00| 5...| name: ".dynstr" (53) 0x20fc-0x2100 (4)
|
||||
0x2100|03 00 00 00 |.... | type: "strtab" (0x3) (String table) 0x2100-0x2104 (4)
|
||||
@ -2092,7 +2092,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x2500| 04 00 00 00 | .... | addralign: 4 0x2504-0x2508 (4)
|
||||
0x2500| 10 00 00 00 | .... | entsize: 16 0x2508-0x250c (4)
|
||||
| | | [30]{}: section_header 0x1d38-0x2534 (2044)
|
||||
0x1d30| 00 53 63 72 74 31 2e 63| .Scrt1.c| string: "\x00Scrt1.c\x00$a\x00$d\x00crti.o\x00crtn.o\x00crtstuff.c\x00all_imp..." 0x1d38-0x1f36 (510)
|
||||
0x1d30| 00 53 63 72 74 31 2e 63| .Scrt1.c| string: "\x00Scrt1.c\x00$a\x00$d\x00crti.o\x00crtn.o\x00crtstuff.c\x00all_implied_fbits\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00a.c\x00__FRAME_END__\x00_DYNAMIC\x00_GLOBAL_OFFSET_TABLE_\x00__TMC_END__\x00puts\x00__cxa_finalize\x00__bss_start__\x00__dso_handle\x00aaa\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00__bss_end__\x00_start_c\x00_ITM_deregisterTMCloneTable\x00__bss_start\x00__end__\x00_fini\x00_edata\x00_end\x00libbbb_bbb\x00__libc_start_main\x00__register_frame_info\x00" 0x1d38-0x1f36 (510)
|
||||
0x1d40|00 24 61 00 24 64 00 63 72 74 69 2e 6f 00 63 72|.$a.$d.crti.o.cr|
|
||||
* |until 0x1f35.7 (510) | |
|
||||
0x2500| 09 00 00 00| ....| name: ".strtab" (9) 0x250c-0x2510 (4)
|
||||
@ -2120,7 +2120,7 @@ $ fq -d elf dv a_dynamic
|
||||
0x2520| 01 00 00 00| ....| addralign: 1 0x252c-0x2530 (4)
|
||||
0x2530|00 00 00 00 |.... | entsize: 0 0x2530-0x2534 (4)
|
||||
| | | [31]{}: section_header 0x1f36-0x255c (1574)
|
||||
0x1f30| 00 2e 73 79 6d 74 61 62 00 2e| ..symtab..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.gnu.hash\x00.d..." 0x1f36-0x2059 (291)
|
||||
0x1f30| 00 2e 73 79 6d 74 61 62 00 2e| ..symtab..| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x1f36-0x2059 (291)
|
||||
0x1f40|73 74 72 74 61 62 00 2e 73 68 73 74 72 74 61 62|strtab..shstrtab|
|
||||
* |until 0x2058.7 (291) | |
|
||||
0x2530| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x2534-0x2538 (4)
|
||||
|
@ -3788,7 +3788,7 @@ $ fq -d elf dv a_static
|
||||
0x14d50|04 00 00 00 |.... | addralign: 4 0x14d50-0x14d54 (4)
|
||||
0x14d50| 10 00 00 00 | .... | entsize: 16 0x14d54-0x14d58 (4)
|
||||
| | | [23]{}: section_header 0x14060-0x14d80 (3360)
|
||||
0x14060|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00$d\x00crt1.c\x00crtstuff.c\x00all_impl..." 0x14060-0x148cd (2157)
|
||||
0x14060|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00$d\x00crt1.c\x00crtstuff.c\x00all_implied_fbits\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00libbbb.c\x00__libc_start_main.c\x00dummy1\x00libc_start_main_stage2\x00defsysinfo.c\x00libc.c\x00stdout.c\x00buf\x00memset.c\x00__environ.c\x00__init_tls.c\x00static_init_tls\x00builtin_tls\x00main_tls\x00_Exit.c\x00__lockfile.c\x00a_barrier\x00__overflow.c\x00__stdio_close.c\x00__stdio_seek.c\x00__stdout_write.c\x00__towrite.c\x00fputs.c\x00fwrite.c\x00memcpy.lo\x00copy_last_3_and_return\x00src_aligned\x00non_congruent\x00congruent_aligned32\x00cached_aligned32\x00less_than_32_left\x00partial_word_tail\x00less_than_thirtytwo\x00loop24\x00loop8\x00loop16\x00strlen.c\x00__set_thread_area.c\x00atomics.lo\x00default_attr.c\x00lseek.c\x00syscall_ret.c\x00__stdio_exit.c\x00close_file\x00dummy_file\x00__stdio_write.c\x00ofl.c\x00ofl_head\x00__lock.c\x00__errno_location.c\x00_udivsi3.o\x00.udivsi3_skip_div0_test\x00shift\x00_dvmd_lnx.o\x00raise.c\x00block.c\x00all_mask\x00app_mask\x00__FRAME_END__\x00__fini_array_end\x00__fini_array_start\x00__init_array_end\x00_GLOBAL_OFFSET_TABLE_\x00__init_array_start\x00__a_barrier_v7\x00__thread_list_lock\x00__a_gettp_ptr\x00__stdout_used\x00stdout\x00__a_barrier_ptr\x00__init_libc\x00__syscall_ret\x00__stdout_write\x00__ofl_unlock\x00__unlockfile\x00__hwcap\x00__restore_sigs\x00__stdio_write\x00__towrite\x00memcpy\x00__ofl_lock\x00__TMC_END__\x00__unlock\x00__overflow\x00__libc\x00__udivsi3\x00__bss_start__\x00__dso_handle\x00__set_thread_area\x00__stdin_used\x00__copy_tls\x00__stdio_seek\x00__lockfile\x00___errno_location\x00aaa\x00_Exit\x00__towrite_needs_stdio_exit\x00__a_gettp_cp15\x00__a_cas_v7\x00__init_tls\x00__funcs_on_exit\x00__a_cas_dummy\x00__stdio_ofl_lockptr\x00fputs_unlocked\x00__a_barrier_oldkuser\x00__bss_end__\x00___environ\x00__progname\x00_start_c\x00__block_all_sigs\x00__stdout_FILE\x00program_invocation_short_name\x00__libc_start_init\x00__init_tp\x00__init_ssp\x00__aeabi_ldiv0\x00__fwritex\x00__bss_start\x00memset\x00__a_barrier_v6\x00__stdio_exit\x00__aeabi_uidiv\x00__lock\x00__end__\x00__a_cas_v6\x00__aio_close\x00__lseek\x00__a_cas_ptr\x00__libc_exit_fini\x00fwrite_unlocked\x00__aeabi_uidivmod\x00fwrite\x00_edata\x00__stdio_close\x00__stderr_used\x00__stdio_exit_needed\x00__a_barrier_dummy\x00__aeabi_idiv0\x00libbbb_bbb\x00__libc_start_main\x00strlen\x00lseek64\x00program_invocation_name\x00__default_stacksize\x00fputs\x00__default_guardsize\x00__block_app_sigs\x00__sysinfo\x00__progname_full\x00raise\x00" 0x14060-0x148cd (2157)
|
||||
* |until 0x148cc.7 (2157) | |
|
||||
0x14d50| 09 00 00 00 | .... | name: ".strtab" (9) 0x14d58-0x14d5c (4)
|
||||
0x14d50| 03 00 00 00| ....| type: "strtab" (0x3) (String table) 0x14d5c-0x14d60 (4)
|
||||
@ -3815,7 +3815,7 @@ $ fq -d elf dv a_static
|
||||
0x14d70| 01 00 00 00 | .... | addralign: 1 0x14d78-0x14d7c (4)
|
||||
0x14d70| 00 00 00 00| ....| entsize: 0 0x14d7c-0x14d80 (4)
|
||||
| | | [24]{}: section_header 0x148cd-0x14da8 (1243)
|
||||
0x148c0| 00 2e 73| ..s| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.init\x00.text\x00.fini\x00.r..." 0x148cd-0x149c0 (243)
|
||||
0x148c0| 00 2e 73| ..s| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.data.rel.ro\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_frame\x00.debug_str\x00.debug_loc\x00.debug_ranges\x00" 0x148cd-0x149c0 (243)
|
||||
0x148d0|79 6d 74 61 62 00 2e 73 74 72 74 61 62 00 2e 73|ymtab..strtab..s|
|
||||
* |until 0x149bf.7 (243) | |
|
||||
0x14d80|11 00 00 00 |.... | name: ".shstrtab" (17) 0x14d80-0x14d84 (4)
|
||||
|
@ -374,7 +374,7 @@ $ fq -d elf dv a_stripped
|
||||
0x11b0|04 00 00 00 |.... | addralign: 4 0x11b0-0x11b4 (4)
|
||||
0x11b0| 10 00 00 00 | .... | entsize: 16 0x11b4-0x11b8 (4)
|
||||
| | | [4]{}: section_header 0x220-0x11e0 (4032)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_I..." 0x220-0x2e1 (193)
|
||||
0x0220|00 70 75 74 73 00 5f 5f 63 78 61 5f 66 69 6e 61|.puts.__cxa_fina| string: "\x00puts\x00__cxa_finalize\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00__register_frame_info\x00_init\x00_fini\x00libbbb_bbb\x00__libc_start_main\x00libbbb.so\x00libc.musl-armhf.so.1\x00" 0x220-0x2e1 (193)
|
||||
* |until 0x2e0.7 (193) | |
|
||||
0x11b0| 25 00 00 00 | %... | name: ".dynstr" (37) 0x11b8-0x11bc (4)
|
||||
0x11b0| 03 00 00 00| ....| type: "strtab" (0x3) (String table) 0x11bc-0x11c0 (4)
|
||||
@ -915,7 +915,7 @@ $ fq -d elf dv a_stripped
|
||||
0x1450| 01 00 00 00 | .... | addralign: 1 0x1458-0x145c (4)
|
||||
0x1450| 00 00 00 00| ....| entsize: 0 0x145c-0x1460 (4)
|
||||
| | | [21]{}: section_header 0x1068-0x1488 (1056)
|
||||
0x1060| 00 2e 73 68 73 74 72 74| ..shstrt| string: "\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.r..." 0x1068-0x1115 (173)
|
||||
0x1060| 00 2e 73 68 73 74 72 74| ..shstrt| string: "\x00.shstrtab\x00.interp\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00" 0x1068-0x1115 (173)
|
||||
0x1070|61 62 00 2e 69 6e 74 65 72 70 00 2e 67 6e 75 2e|ab..interp..gnu.|
|
||||
* |until 0x1114.7 (173) | |
|
||||
0x1460|01 00 00 00 |.... | name: ".shstrtab" (1) 0x1460-0x1464 (4)
|
||||
|
@ -473,7 +473,7 @@ $ fq -d ar dv libbbb.a
|
||||
0x480|01 00 00 00 |.... | addralign: 1 0x480-0x484 (4)
|
||||
0x480| 00 00 00 00 | .... | entsize: 0 0x484-0x488 (4)
|
||||
| | | [11]{}: section_header 0x26c-0x4b0 (580)
|
||||
0x260| 00 2e 73 79| ..sy| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rel.text\x00.data\x00.bss..." 0x26c-0x2cd (97)
|
||||
0x260| 00 2e 73 79| ..sy| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.rel.text\x00.data\x00.bss\x00.rodata\x00.comment\x00.note.GNU-stack\x00.ARM.attributes\x00" 0x26c-0x2cd (97)
|
||||
0x270|6d 74 61 62 00 2e 73 74 72 74 61 62 00 2e 73 68|mtab..strtab..sh|
|
||||
* |until 0x2cc.7 (97) | |
|
||||
0x480| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x488-0x48c (4)
|
||||
|
@ -305,7 +305,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x1a80| 04 00 00 00 | .... | addralign: 4 0x1a88-0x1a8c (4)
|
||||
0x1a80| 10 00 00 00| ....| entsize: 16 0x1a8c-0x1a90 (4)
|
||||
| | | [3]{}: section_header 0x1c0-0x1ab8 (6392)
|
||||
0x01c0|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_r..." 0x1c0-0x265 (165)
|
||||
0x01c0|00 5f 69 6e 69 74 00 5f 66 69 6e 69 00 5f 49 54|._init._fini._IT| string: "\x00_init\x00_fini\x00_ITM_deregisterTMCloneTable\x00_ITM_registerTMCloneTable\x00__cxa_finalize\x00__deregister_frame_info\x00__register_frame_info\x00libbbb_bbb\x00puts\x00libc.musl-armhf.so.1\x00" 0x1c0-0x265 (165)
|
||||
* |until 0x264.7 (165) | |
|
||||
0x1a90|2d 00 00 00 |-... | name: ".dynstr" (45) 0x1a90-0x1a94 (4)
|
||||
0x1a90| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x1a94-0x1a98 (4)
|
||||
@ -1769,7 +1769,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x1e40| 04 00 00 00 | .... | addralign: 4 0x1e48-0x1e4c (4)
|
||||
0x1e40| 10 00 00 00| ....| entsize: 16 0x1e4c-0x1e50 (4)
|
||||
| | | [27]{}: section_header 0x1770-0x1e78 (1800)
|
||||
0x1770|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00crtstuff.c\x00$d\x00all_implied_fbi..." 0x1770-0x1912 (418)
|
||||
0x1770|00 63 72 74 69 2e 6f 00 24 61 00 63 72 74 6e 2e|.crti.o.$a.crtn.| string: "\x00crti.o\x00$a\x00crtn.o\x00crtstuff.c\x00$d\x00all_implied_fbits\x00deregister_tm_clones\x00__do_global_dtors_aux\x00completed.1\x00__do_global_dtors_aux_fini_array_entry\x00frame_dummy\x00object.0\x00__frame_dummy_init_array_entry\x00libbbb.c\x00__FRAME_END__\x00_DYNAMIC\x00__TMC_END__\x00__dso_handle\x00_GLOBAL_OFFSET_TABLE_\x00puts\x00__cxa_finalize\x00_init\x00__deregister_frame_info\x00_ITM_registerTMCloneTable\x00_ITM_deregisterTMCloneTable\x00_fini\x00libbbb_bbb\x00__register_frame_info\x00" 0x1770-0x1912 (418)
|
||||
* |until 0x1911.7 (418) | |
|
||||
0x1e50|09 00 00 00 |.... | name: ".strtab" (9) 0x1e50-0x1e54 (4)
|
||||
0x1e50| 03 00 00 00 | .... | type: "strtab" (0x3) (String table) 0x1e54-0x1e58 (4)
|
||||
@ -1796,7 +1796,7 @@ $ fq -d elf dv libbbb.so
|
||||
0x1e70|01 00 00 00 |.... | addralign: 1 0x1e70-0x1e74 (4)
|
||||
0x1e70| 00 00 00 00 | .... | entsize: 0 0x1e74-0x1e78 (4)
|
||||
| | | [28]{}: section_header 0x1912-0x1ea0 (1422)
|
||||
0x1910| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74| ..symtab..strt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.d..." 0x1912-0x1a15 (259)
|
||||
0x1910| 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74| ..symtab..strt| string: "\x00.symtab\x00.strtab\x00.shstrtab\x00.gnu.hash\x00.dynsym\x00.dynstr\x00.rel.dyn\x00.rel.plt\x00.init\x00.text\x00.fini\x00.rodata\x00.eh_frame\x00.init_array\x00.fini_array\x00.dynamic\x00.got\x00.data\x00.bss\x00.comment\x00.ARM.attributes\x00.debug_aranges\x00.debug_info\x00.debug_abbrev\x00.debug_line\x00.debug_str\x00.debug_ranges\x00" 0x1912-0x1a15 (259)
|
||||
0x1920|61 62 00 2e 73 68 73 74 72 74 61 62 00 2e 67 6e|ab..shstrtab..gn|
|
||||
* |until 0x1a14.7 (259) | |
|
||||
0x1e70| 11 00 00 00 | .... | name: ".shstrtab" (17) 0x1e78-0x1e7c (4)
|
||||
|
@ -6,7 +6,7 @@ package fit
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"sort"
|
||||
"slices"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/format/fit/mappers"
|
||||
@ -344,7 +344,7 @@ func fitDecodeDataMessage(d *decode.D, drc *dataRecordContext, lmfd localFieldDe
|
||||
keys[i] = int(k)
|
||||
i++
|
||||
}
|
||||
sort.Ints(keys)
|
||||
slices.Sort(keys)
|
||||
|
||||
isDevDep := isDevMap[drc.localMessageType]
|
||||
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/mathex"
|
||||
"github.com/wader/fq/internal/mathx"
|
||||
"github.com/wader/fq/pkg/bitio"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
@ -65,7 +65,7 @@ func flacDecode(d *decode.D) any {
|
||||
|
||||
samplesInFrame := ffo.Samples
|
||||
if streamTotalSamples > 0 {
|
||||
samplesInFrame = mathex.Min(streamTotalSamples-streamDecodedSamples, ffo.Samples)
|
||||
samplesInFrame = mathx.Min(streamTotalSamples-streamDecodedSamples, ffo.Samples)
|
||||
}
|
||||
frameStreamSamplesBuf := ffo.SamplesBuf[0 : samplesInFrame*uint64(ffo.Channels*ffo.BitsPerSample/8)]
|
||||
framesNDecodedSamples += ffo.Samples
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"math/bits"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/mathex"
|
||||
"github.com/wader/fq/internal/mathx"
|
||||
"github.com/wader/fq/pkg/checksum"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
@ -478,7 +478,7 @@ func frameDecode(d *decode.D) any {
|
||||
for j := 0; j < count; j++ {
|
||||
high := d.Unary(0)
|
||||
low := d.U(riceParameter)
|
||||
samples[n] = mathex.ZigZag[uint64, int64](high<<riceParameter | low)
|
||||
samples[n] = mathx.ZigZag[uint64, int64](high<<riceParameter | low)
|
||||
n++
|
||||
}
|
||||
samplesStop := d.Pos()
|
||||
|
@ -45,17 +45,17 @@ type Probe_Args_In struct {
|
||||
|
||||
var (
|
||||
Image = &decode.Group{Name: "image"}
|
||||
Probe = &decode.Group{Name: "probe", DefaultInArg: Probe_In{}}
|
||||
Probe_Args = &decode.Group{Name: "probe_args", DefaultInArg: Probe_Args_In{}}
|
||||
Link_Frame = &decode.Group{Name: "link_frame", DefaultInArg: Link_Frame_In{}} // ex: ethernet
|
||||
INET_Packet = &decode.Group{Name: "inet_packet", DefaultInArg: INET_Packet_In{}} // ex: ipv4
|
||||
IP_Packet = &decode.Group{Name: "ip_packet", DefaultInArg: INET_Packet_In{}} // ex: tcp
|
||||
Link_Frame = &decode.Group{Name: "link_frame", DefaultInArg: Link_Frame_In{}} // ex: ethernet
|
||||
MP3_Frame_Tags = &decode.Group{Name: "mp3_frame_tags"}
|
||||
Probe = &decode.Group{Name: "probe", DefaultInArg: Probe_In{}}
|
||||
Probe_Args = &decode.Group{Name: "probe_args", DefaultInArg: Probe_Args_In{}}
|
||||
TCP_Stream = &decode.Group{Name: "tcp_stream", DefaultInArg: TCP_Stream_In{}} // ex: http
|
||||
UDP_Payload = &decode.Group{Name: "udp_payload", DefaultInArg: UDP_Payload_In{}} // ex: dns
|
||||
MP3_Frame_Tags = &decode.Group{Name: "mp3_frame_tags"}
|
||||
|
||||
Bytes = &decode.Group{Name: "bytes"}
|
||||
Bits = &decode.Group{Name: "bits"}
|
||||
Bytes = &decode.Group{Name: "bytes"}
|
||||
|
||||
AAC_Frame = &decode.Group{Name: "aac_frame"}
|
||||
ADTS = &decode.Group{Name: "adts"}
|
||||
@ -83,7 +83,6 @@ var (
|
||||
Bitcoin_Block = &decode.Group{Name: "bitcoin_block"}
|
||||
Bitcoin_Script = &decode.Group{Name: "bitcoin_script"}
|
||||
Bitcoin_Transaction = &decode.Group{Name: "bitcoin_transaction"}
|
||||
Opentimestamps = &decode.Group{Name: "opentimestamps"}
|
||||
Bplist = &decode.Group{Name: "bplist"}
|
||||
BSD_Loopback_Frame = &decode.Group{Name: "bsd_loopback_frame"}
|
||||
BSON = &decode.Group{Name: "bson"}
|
||||
@ -123,6 +122,7 @@ var (
|
||||
ID3v2 = &decode.Group{Name: "id3v2"}
|
||||
IPv4Packet = &decode.Group{Name: "ipv4_packet"}
|
||||
IPv6Packet = &decode.Group{Name: "ipv6_packet"}
|
||||
JP2C = &decode.Group{Name: "jp2c"}
|
||||
JPEG = &decode.Group{Name: "jpeg"}
|
||||
JSON = &decode.Group{Name: "json"}
|
||||
JSONL = &decode.Group{Name: "jsonl"}
|
||||
@ -142,13 +142,15 @@ var (
|
||||
MP4 = &decode.Group{Name: "mp4"}
|
||||
MPEG_ASC = &decode.Group{Name: "mpeg_asc"}
|
||||
MPEG_ES = &decode.Group{Name: "mpeg_es"}
|
||||
MPES_PES = &decode.Group{Name: "mpeg_pes"}
|
||||
MPEG_PES_Packet = &decode.Group{Name: "mpeg_pes_packet"}
|
||||
MPEG_SPU = &decode.Group{Name: "mpeg_spu"}
|
||||
MPEG_TS = &decode.Group{Name: "mpeg_ts"}
|
||||
MPES_PES = &decode.Group{Name: "mpeg_pes"}
|
||||
MsgPack = &decode.Group{Name: "msgpack"}
|
||||
NES = &decode.Group{Name: "nes"}
|
||||
Ogg = &decode.Group{Name: "ogg"}
|
||||
Ogg_Page = &decode.Group{Name: "ogg_page"}
|
||||
Opentimestamps = &decode.Group{Name: "opentimestamps"}
|
||||
Opus_Packet = &decode.Group{Name: "opus_packet"}
|
||||
PCAP = &decode.Group{Name: "pcap"}
|
||||
PCAPNG = &decode.Group{Name: "pcapng"}
|
||||
|
@ -114,7 +114,7 @@ func gzipDecodeMember(d *decode.D) bitio.ReaderAtSeeker {
|
||||
readCompressedSize, uncompressedBR, err =
|
||||
d.FieldReaderRange("uncompressed", d.Pos(), d.BitsLeft(), rFn)
|
||||
if err != nil {
|
||||
d.IOPanic(err, "TryFieldReaderRange")
|
||||
d.IOPanic(err, "uncompressed", "FieldReaderRange")
|
||||
}
|
||||
d.FieldRawLen("compressed", readCompressedSize)
|
||||
crc32W := crc32.NewIEEE()
|
||||
@ -149,7 +149,7 @@ func gzipDecode(d *decode.D) any {
|
||||
|
||||
cbr, err := bitio.NewMultiReader(brs...)
|
||||
if err != nil {
|
||||
d.IOPanic(err, "NewMultiReader")
|
||||
d.IOPanic(err, "members", "NewMultiReader")
|
||||
}
|
||||
dv, _, _ := d.TryFieldFormatBitBuf("uncompressed", cbr, &probeGroup, format.Probe_In{})
|
||||
if dv == nil {
|
||||
|
@ -5,9 +5,10 @@ package icc
|
||||
|
||||
import (
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/mathex"
|
||||
"github.com/wader/fq/internal/mathx"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -111,13 +112,13 @@ func iccProfileDecode(d *decode.D) any {
|
||||
d.FramedFn(int64(size)*8, func(d *decode.D) {
|
||||
d.FieldStruct("header", func(d *decode.D) {
|
||||
d.FieldU32("size")
|
||||
d.FieldUTF8NullFixedLen("cmm_type_signature", 4)
|
||||
d.FieldUTF8NullFixedLen("cmm_type_signature", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUintFn("version_major", decodeBCDU8)
|
||||
d.FieldUintFn("version_minor", decodeBCDU8)
|
||||
d.FieldU16("version_reserved")
|
||||
d.FieldUTF8NullFixedLen("device_class_signature", 4)
|
||||
d.FieldUTF8NullFixedLen("color_space", 4)
|
||||
d.FieldUTF8NullFixedLen("connection_space", 4)
|
||||
d.FieldUTF8NullFixedLen("device_class_signature", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("color_space", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("connection_space", 4, scalar.ActualTrimSpace)
|
||||
d.FieldStruct("timestamp", func(d *decode.D) {
|
||||
d.FieldU16("year")
|
||||
d.FieldU16("month")
|
||||
@ -127,16 +128,16 @@ func iccProfileDecode(d *decode.D) any {
|
||||
d.FieldU16("seconds")
|
||||
|
||||
})
|
||||
d.FieldUTF8NullFixedLen("file_signature", 4)
|
||||
d.FieldUTF8NullFixedLen("primary_platform", 4)
|
||||
d.FieldUTF8NullFixedLen("file_signature", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("primary_platform", 4, scalar.ActualTrimSpace)
|
||||
d.FieldU32("flags")
|
||||
d.FieldUTF8NullFixedLen("device_manufacturer", 4)
|
||||
d.FieldUTF8NullFixedLen("device_model", 4)
|
||||
d.FieldUTF8NullFixedLen("device_attribute", 8)
|
||||
d.FieldUTF8NullFixedLen("render_intent", 4)
|
||||
d.FieldUTF8NullFixedLen("xyz_illuminant", 12)
|
||||
d.FieldUTF8NullFixedLen("profile_creator_signature", 4)
|
||||
d.FieldUTF8NullFixedLen("profile_id", 16)
|
||||
d.FieldUTF8NullFixedLen("device_manufacturer", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("device_model", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("device_attribute", 8, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("render_intent", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("xyz_illuminant", 12, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("profile_creator_signature", 4, scalar.ActualTrimSpace)
|
||||
d.FieldUTF8NullFixedLen("profile_id", 16, scalar.ActualTrimSpace)
|
||||
d.FieldRawLen("reserved", 28*8, d.BitBufIsZero())
|
||||
})
|
||||
|
||||
@ -145,13 +146,13 @@ func iccProfileDecode(d *decode.D) any {
|
||||
d.FieldArray("table", func(d *decode.D) {
|
||||
for i := uint64(0); i < tagCount; i++ {
|
||||
d.FieldStruct("element", func(d *decode.D) {
|
||||
d.FieldUTF8NullFixedLen("signature", 4)
|
||||
d.FieldUTF8NullFixedLen("signature", 4, scalar.ActualTrimSpace)
|
||||
offset := d.FieldU32("offset")
|
||||
size := d.FieldU32("size")
|
||||
|
||||
d.RangeFn(int64(offset)*8, int64(size)*8, func(d *decode.D) {
|
||||
tagStart := d.Pos()
|
||||
typ := d.FieldUTF8NullFixedLen("type", 4)
|
||||
typ := d.FieldUTF8NullFixedLen("type", 4, scalar.ActualTrimSpace)
|
||||
d.FieldU32("reserved")
|
||||
|
||||
if fn, ok := typeToDecode[typ]; ok {
|
||||
@ -166,7 +167,7 @@ func iccProfileDecode(d *decode.D) any {
|
||||
// was. instead add alignment after if offset+size does not align and to be sure clamp it if outside buffer.
|
||||
alignStart := int64(offset) + int64(size)
|
||||
alignBytes := (4 - (int64(offset)+int64(size))%4) % 4
|
||||
alignBytes = mathex.Min(d.Len()/8-alignStart, alignBytes)
|
||||
alignBytes = mathx.Min(d.Len()/8-alignStart, alignBytes)
|
||||
if alignBytes != 0 {
|
||||
d.RangeFn(alignStart*8, alignBytes*8, func(d *decode.D) {
|
||||
d.FieldRawLen("alignment", d.BitsLeft())
|
||||
|
@ -302,7 +302,7 @@ func textNullLenFn(encoding int, notFoundFixedBytes int) func(d *decode.D) strin
|
||||
func(v uint64) bool { return v == 0 },
|
||||
)
|
||||
if err != nil {
|
||||
d.IOPanic(err, "textNullLenFn")
|
||||
d.IOPanic(err, "", "textNullLenFn")
|
||||
}
|
||||
if offset < 0 {
|
||||
if notFoundFixedBytes < 0 {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/bitioex"
|
||||
"github.com/wader/fq/internal/bitiox"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
@ -105,7 +105,7 @@ var hopByHopTypeNames = scalar.UintMapSymStr{
|
||||
|
||||
var mapUToIPv6Sym = scalar.BitBufFn(func(s scalar.BitBuf) (scalar.BitBuf, error) {
|
||||
b := &bytes.Buffer{}
|
||||
if _, err := bitioex.CopyBits(b, s.Actual); err != nil {
|
||||
if _, err := bitiox.CopyBits(b, s.Actual); err != nil {
|
||||
return s, err
|
||||
}
|
||||
s.Sym = net.IP(b.Bytes()).String()
|
||||
|
144
format/jpeg/jp2c.go
Normal file
@ -0,0 +1,144 @@
|
||||
package jpeg
|
||||
|
||||
import (
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
)
|
||||
|
||||
func init() {
|
||||
interp.RegisterFormat(
|
||||
format.JP2C,
|
||||
&decode.Format{
|
||||
Description: "JPEG 2000 codestream",
|
||||
Groups: []*decode.Group{format.Probe, format.Image},
|
||||
DecodeFn: jp2cDecode,
|
||||
RootName: "segments",
|
||||
RootArray: true,
|
||||
})
|
||||
}
|
||||
|
||||
const (
|
||||
JP2_SOC = 0xff_4f /* start of codestream */
|
||||
JP2_SOT = 0xff_90 /* start of tile */
|
||||
JP2_SOD = 0xff_93 /* start of data */
|
||||
JP2_EOC = 0xff_d9 /* end of codestream */
|
||||
/* fixed information segment */
|
||||
JP2_SIZ = 0xff_51 /* image and tile size */
|
||||
/* functional segments */
|
||||
JP2_COD = 0xff_52 /* coding style default */
|
||||
JP2_COC = 0xff_53 /* coding style component */
|
||||
JP2_RGN = 0xff_5e /* region of interest */
|
||||
JP2_QCD = 0xff_5c /* quantization default */
|
||||
JP2_QCC = 0xff_5d /* quantization component */
|
||||
JP2_POC = 0xff_5f /* progression order change */
|
||||
/* pointer segments */
|
||||
JP2_TLM = 0xff_55 /* tile-part lengths */
|
||||
JP2_PLM = 0xff_57 /* packet length (main header) */
|
||||
JP2_PLT = 0xff_58 /* packet length (tile-part header) */
|
||||
JP2_PPM = 0xff_60 /* packed packet headers (main header) */
|
||||
JP2_PPT = 0xff_61 /* packet packet headers (tile-part header) */
|
||||
/* bitstream internal markers and segments */
|
||||
JP2_SOP = 0xff_91 /* start of packet */
|
||||
JP2_EPH = 0xff_92 /* end of packet header */
|
||||
/* informational segments */
|
||||
JP2_CRG = 0xff_63 /* component registration */
|
||||
JP2_COM = 0xff_64 /* comment */
|
||||
)
|
||||
|
||||
var jp2Markers = scalar.UintMap{
|
||||
JP2_SOC: {Sym: "soc", Description: "Start of codestream"},
|
||||
JP2_SOT: {Sym: "sot", Description: "Start of tile"},
|
||||
JP2_SOD: {Sym: "sod", Description: "Start of data"},
|
||||
JP2_EOC: {Sym: "eoc", Description: "End of codestream"},
|
||||
JP2_SIZ: {Sym: "siz", Description: "Image and tile size"},
|
||||
JP2_COD: {Sym: "cod", Description: "Coding style default"},
|
||||
JP2_COC: {Sym: "coc", Description: "Coding style component"},
|
||||
JP2_RGN: {Sym: "rgn", Description: "Region of interest"},
|
||||
JP2_QCD: {Sym: "qcd", Description: "Quantization default"},
|
||||
JP2_QCC: {Sym: "qcc", Description: "Quantization component"},
|
||||
JP2_POC: {Sym: "poc", Description: "Progression order change"},
|
||||
JP2_TLM: {Sym: "tlm", Description: "Tile-part lengths"},
|
||||
JP2_PLM: {Sym: "plm", Description: "Packet length (main header)"},
|
||||
JP2_PLT: {Sym: "plt", Description: "Packet length (tile-part header)"},
|
||||
JP2_PPM: {Sym: "ppm", Description: "Packed packet headers (main header)"},
|
||||
JP2_PPT: {Sym: "ppt", Description: "Packet packet headers (tile-part header)"},
|
||||
JP2_SOP: {Sym: "sop", Description: "Start of packet"},
|
||||
JP2_EPH: {Sym: "eph", Description: "End of packet header"},
|
||||
JP2_CRG: {Sym: "crg", Description: "Component registration"},
|
||||
JP2_COM: {Sym: "com", Description: "Comment"},
|
||||
}
|
||||
|
||||
func jp2cDecode(d *decode.D) any {
|
||||
if d.PeekUintBits(16) != JP2_SOC {
|
||||
d.Fatalf("no SOC marker")
|
||||
}
|
||||
|
||||
seenSOC := false
|
||||
seenSIZ := false
|
||||
seenEOC := false
|
||||
|
||||
for !seenEOC && !d.End() {
|
||||
d.FieldStruct("segment", func(d *decode.D) {
|
||||
marker := d.FieldU16("marker", jp2Markers, scalar.UintHex)
|
||||
switch marker {
|
||||
case JP2_SOC:
|
||||
// zero length
|
||||
seenSOC = true
|
||||
return
|
||||
case JP2_SOD:
|
||||
l, _ := d.PeekFind(16, 8, d.BitsLeft(), func(v uint64) bool {
|
||||
return v == JP2_SOT || v == JP2_EOC
|
||||
})
|
||||
d.FieldRawLen("data", l)
|
||||
case JP2_SOT:
|
||||
d.FieldU16("l_sot")
|
||||
d.FieldU16("i_sot")
|
||||
d.FieldU32("p_sot")
|
||||
d.FieldU8("tp_sot")
|
||||
d.FieldU8("tn_sot")
|
||||
case JP2_SIZ:
|
||||
seenSIZ = true
|
||||
d.FieldU16("l_siz")
|
||||
d.FieldU16("r_siz")
|
||||
d.FieldU32("x_siz")
|
||||
d.FieldU32("y_siz")
|
||||
d.FieldU32("xo_siz")
|
||||
d.FieldU32("yo_siz")
|
||||
d.FieldU32("xt_siz")
|
||||
d.FieldU32("yt_siz")
|
||||
d.FieldU32("xto_siz")
|
||||
d.FieldU32("yto_siz")
|
||||
cSiz := d.FieldU16("c_siz")
|
||||
d.FieldArray("components", func(d *decode.D) {
|
||||
for i := 0; i < int(cSiz); i++ {
|
||||
d.FieldStruct("component", func(d *decode.D) {
|
||||
d.FieldU8("s_sizi")
|
||||
d.FieldU8("xr_sizi")
|
||||
d.FieldU8("yr_sizi")
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
case JP2_COM:
|
||||
length := d.FieldU16("length")
|
||||
d.FieldU16("r_cme")
|
||||
d.FieldUTF8("data", int(length-4))
|
||||
case JP2_EOC:
|
||||
// zero length
|
||||
seenEOC = true
|
||||
return
|
||||
default:
|
||||
length := d.FieldU16("length")
|
||||
d.FieldRawLen("data", int64(length-2)*8)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if !(seenSOC && seenSIZ && seenEOC) {
|
||||
d.Fatalf("SOC, SIZ or EOC marker not found")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -124,7 +124,7 @@ var markers = scalar.UintMap{
|
||||
RST6: {Sym: "rst6", Description: "Restart with modulo 8 count 6"},
|
||||
RST7: {Sym: "rst7", Description: "Restart with modulo 8 count 7"},
|
||||
SOI: {Sym: "soi", Description: "Start of image"},
|
||||
EOI: {Sym: "eoi", Description: "End of image true"},
|
||||
EOI: {Sym: "eoi", Description: "End of image"},
|
||||
SOS: {Sym: "sos", Description: "Start of scan"},
|
||||
DQT: {Sym: "dqt", Description: "Define quantization table(s)"},
|
||||
DNL: {Sym: "dnl", Description: "Define number of lines"},
|
||||
@ -262,6 +262,29 @@ func jpegDecode(d *decode.D) any {
|
||||
}
|
||||
})
|
||||
})
|
||||
case DHT:
|
||||
lH := int64(d.FieldU16("lh"))
|
||||
d.FramedFn(lH*8-16, func(d *decode.D) {
|
||||
d.FieldArray("hs", func(d *decode.D) {
|
||||
for d.NotEnd() {
|
||||
d.FieldStruct("h", func(d *decode.D) {
|
||||
d.FieldU4("tc")
|
||||
d.FieldU4("th")
|
||||
hK := uint64(0)
|
||||
hV := uint64(0)
|
||||
d.FieldArrayLoop("l", func() bool { return hK < 16 }, func(d *decode.D) {
|
||||
hV += d.FieldU8("l")
|
||||
hK++
|
||||
})
|
||||
hK = 0
|
||||
d.FieldArrayLoop("v", func() bool { return hK < hV }, func(d *decode.D) {
|
||||
d.FieldU8("v")
|
||||
hK++
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
case RST0, RST1, RST2, RST3, RST4, RST5, RST6, RST7:
|
||||
inECD = true
|
||||
case TEM:
|
||||
|
56
format/jpeg/testdata/4x4.fqtest
vendored
@ -109,15 +109,57 @@ $ fq -d jpeg dv 4x4.jpg
|
||||
| | | [4]{}: marker 0x66-0x7c (22)
|
||||
0x60| ff | . | prefix: raw bits (valid) 0x66-0x67 (1)
|
||||
0x60| c4 | . | code: "dht" (196) (Define Huffman table(s)) 0x67-0x68 (1)
|
||||
0x60| 00 14 | .. | length: 20 0x68-0x6a (2)
|
||||
0x60| 00 01 00 00 00 00| ......| data: raw bits 0x6a-0x7c (18)
|
||||
0x70|00 00 00 00 00 00 00 00 00 00 00 08 |............ |
|
||||
0x60| 00 14 | .. | lh: 20 0x68-0x6a (2)
|
||||
| | | hs[0:1]: 0x6a-0x7c (18)
|
||||
| | | [0]{}: h 0x6a-0x7c (18)
|
||||
0x60| 00 | . | tc: 0 0x6a-0x6a.4 (0.4)
|
||||
0x60| 00 | . | th: 0 0x6a.4-0x6b (0.4)
|
||||
| | | l[0:16]: 0x6b-0x7b (16)
|
||||
0x60| 01 | . | [0]: 1 l 0x6b-0x6c (1)
|
||||
0x60| 00 | . | [1]: 0 l 0x6c-0x6d (1)
|
||||
0x60| 00 | . | [2]: 0 l 0x6d-0x6e (1)
|
||||
0x60| 00 | . | [3]: 0 l 0x6e-0x6f (1)
|
||||
0x60| 00| .| [4]: 0 l 0x6f-0x70 (1)
|
||||
0x70|00 |. | [5]: 0 l 0x70-0x71 (1)
|
||||
0x70| 00 | . | [6]: 0 l 0x71-0x72 (1)
|
||||
0x70| 00 | . | [7]: 0 l 0x72-0x73 (1)
|
||||
0x70| 00 | . | [8]: 0 l 0x73-0x74 (1)
|
||||
0x70| 00 | . | [9]: 0 l 0x74-0x75 (1)
|
||||
0x70| 00 | . | [10]: 0 l 0x75-0x76 (1)
|
||||
0x70| 00 | . | [11]: 0 l 0x76-0x77 (1)
|
||||
0x70| 00 | . | [12]: 0 l 0x77-0x78 (1)
|
||||
0x70| 00 | . | [13]: 0 l 0x78-0x79 (1)
|
||||
0x70| 00 | . | [14]: 0 l 0x79-0x7a (1)
|
||||
0x70| 00 | . | [15]: 0 l 0x7a-0x7b (1)
|
||||
| | | v[0:1]: 0x7b-0x7c (1)
|
||||
0x70| 08 | . | [0]: 8 v 0x7b-0x7c (1)
|
||||
| | | [5]{}: marker 0x7c-0x92 (22)
|
||||
0x70| ff | . | prefix: raw bits (valid) 0x7c-0x7d (1)
|
||||
0x70| c4 | . | code: "dht" (196) (Define Huffman table(s)) 0x7d-0x7e (1)
|
||||
0x70| 00 14| ..| length: 20 0x7e-0x80 (2)
|
||||
0x80|10 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................| data: raw bits 0x80-0x92 (18)
|
||||
0x90|00 00 |.. |
|
||||
0x70| 00 14| ..| lh: 20 0x7e-0x80 (2)
|
||||
| | | hs[0:1]: 0x80-0x92 (18)
|
||||
| | | [0]{}: h 0x80-0x92 (18)
|
||||
0x80|10 |. | tc: 1 0x80-0x80.4 (0.4)
|
||||
0x80|10 |. | th: 0 0x80.4-0x81 (0.4)
|
||||
| | | l[0:16]: 0x81-0x91 (16)
|
||||
0x80| 01 | . | [0]: 1 l 0x81-0x82 (1)
|
||||
0x80| 00 | . | [1]: 0 l 0x82-0x83 (1)
|
||||
0x80| 00 | . | [2]: 0 l 0x83-0x84 (1)
|
||||
0x80| 00 | . | [3]: 0 l 0x84-0x85 (1)
|
||||
0x80| 00 | . | [4]: 0 l 0x85-0x86 (1)
|
||||
0x80| 00 | . | [5]: 0 l 0x86-0x87 (1)
|
||||
0x80| 00 | . | [6]: 0 l 0x87-0x88 (1)
|
||||
0x80| 00 | . | [7]: 0 l 0x88-0x89 (1)
|
||||
0x80| 00 | . | [8]: 0 l 0x89-0x8a (1)
|
||||
0x80| 00 | . | [9]: 0 l 0x8a-0x8b (1)
|
||||
0x80| 00 | . | [10]: 0 l 0x8b-0x8c (1)
|
||||
0x80| 00 | . | [11]: 0 l 0x8c-0x8d (1)
|
||||
0x80| 00 | . | [12]: 0 l 0x8d-0x8e (1)
|
||||
0x80| 00 | . | [13]: 0 l 0x8e-0x8f (1)
|
||||
0x80| 00| .| [14]: 0 l 0x8f-0x90 (1)
|
||||
0x90|00 |. | [15]: 0 l 0x90-0x91 (1)
|
||||
| | | v[0:1]: 0x91-0x92 (1)
|
||||
0x90| 00 | . | [0]: 0 v 0x91-0x92 (1)
|
||||
| | | [6]{}: marker 0x92-0x9c (10)
|
||||
0x90| ff | . | prefix: raw bits (valid) 0x92-0x93 (1)
|
||||
0x90| da | . | code: "sos" (218) (Start of scan) 0x93-0x94 (1)
|
||||
@ -135,4 +177,4 @@ $ fq -d jpeg dv 4x4.jpg
|
||||
0x90| 3f bf | ?. | [7]: raw bits entropy_coded_data 0x9c-0x9e (2)
|
||||
| | | [8]{}: marker 0x9e-0xa0 (2)
|
||||
0x90| ff | . | prefix: raw bits (valid) 0x9e-0x9f (1)
|
||||
0x90| d9| .| code: "eoi" (217) (End of image true) 0x9f-0xa0 (1)
|
||||
0x90| d9| .| code: "eoi" (217) (End of image) 0x9f-0xa0 (1)
|
||||
|
BIN
format/jpeg/testdata/jp2c_3c.jp2
vendored
Normal file
129
format/jpeg/testdata/jp2c_3c.jp2.fqtest
vendored
Normal file
@ -0,0 +1,129 @@
|
||||
# jp2c with 3 components
|
||||
# gm convert -size 4x4 'gradient:#ff00ff-#00ff00' -colors 254 jp2c_3c.jp2
|
||||
$ fq dv jp2c_3c.jp2
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: jp2c_3c.jp2 (mp4) 0x0-0x18a (394)
|
||||
| | | boxes[0:4]: 0x0-0x18a (394)
|
||||
| | | [0]{}: box 0x0-0xc (12)
|
||||
0x000|00 00 00 0c |.... | size: 12 0x0-0x4 (4)
|
||||
0x000| 6a 50 20 20 | jP | type: "jP" (JPEG 2000 Signature) 0x4-0x8 (4)
|
||||
0x000| 0d 0a 87 0a | .... | signature: raw bits (valid) 0x8-0xc (4)
|
||||
| | | [1]{}: box 0xc-0x20 (20)
|
||||
0x000| 00 00 00 14| ....| size: 20 0xc-0x10 (4)
|
||||
0x010|66 74 79 70 |ftyp | type: "ftyp" (File type and compatibility) 0x10-0x14 (4)
|
||||
0x010| 6a 70 32 20 | jp2 | major_brand: "jp2" 0x14-0x18 (4)
|
||||
0x010| 00 00 00 00 | .... | minor_version: 0 0x18-0x1c (4)
|
||||
| | | brands[0:1]: 0x1c-0x20 (4)
|
||||
0x010| 6a 70 32 20| jp2 | [0]: "jp2" brand 0x1c-0x20 (4)
|
||||
| | | [2]{}: box 0x20-0x4d (45)
|
||||
0x020|00 00 00 2d |...- | size: 45 0x20-0x24 (4)
|
||||
0x020| 6a 70 32 68 | jp2h | type: "jp2h" (Header) 0x24-0x28 (4)
|
||||
| | | boxes[0:2]: 0x28-0x4d (37)
|
||||
| | | [0]{}: box 0x28-0x3e (22)
|
||||
0x020| 00 00 00 16 | .... | size: 22 0x28-0x2c (4)
|
||||
0x020| 69 68 64 72| ihdr| type: "ihdr" (Image Header) 0x2c-0x30 (4)
|
||||
0x030|00 00 00 04 |.... | width: 4 0x30-0x34 (4)
|
||||
0x030| 00 00 00 04 | .... | height: 4 0x34-0x38 (4)
|
||||
0x030| 00 03 | .. | nc: 3 0x38-0x3a (2)
|
||||
0x030| 0f | . | bpc: 16 0x3a-0x3b (1)
|
||||
0x030| 07 | . | c: "jpeg_2000" (7) 0x3b-0x3c (1)
|
||||
0x030| 00 | . | unk_c: 0 0x3c-0x3d (1)
|
||||
0x030| 00 | . | ipr: 0 0x3d-0x3e (1)
|
||||
| | | [1]{}: box 0x3e-0x4d (15)
|
||||
0x030| 00 00| ..| size: 15 0x3e-0x42 (4)
|
||||
0x040|00 0f |.. |
|
||||
0x040| 63 6f 6c 72 | colr | type: "colr" (Specifies the colourspace of the image) 0x42-0x46 (4)
|
||||
0x040| 01 00 00 00 | .... | parameter_type: "\x01\x00\x00\x00" 0x46-0x4a (4)
|
||||
0x040| 00 00 10 | ... | data: raw bits 0x4a-0x4d (3)
|
||||
| | | [3]{}: box 0x4d-0x18a (317)
|
||||
0x040| 00 00 00| ...| size: 0 (Rest of file) 0x4d-0x51 (4)
|
||||
0x050|00 |. |
|
||||
0x050| 6a 70 32 63 | jp2c | type: "jp2c" (JPEG 2000 contiguous codestream) 0x51-0x55 (4)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| segments[0:13]: (jp2c) 0x55-0x18a (309)
|
||||
| | | [0]{}: segment 0x55-0x57 (2)
|
||||
0x050| ff 4f | .O | marker: "soc" (0xff4f) (Start of codestream) 0x55-0x57 (2)
|
||||
| | | [1]{}: segment 0x57-0x88 (49)
|
||||
0x050| ff 51 | .Q | marker: "siz" (0xff51) (Image and tile size) 0x57-0x59 (2)
|
||||
0x050| 00 2f | ./ | l_siz: 47 0x59-0x5b (2)
|
||||
0x050| 00 00 | .. | r_siz: 0 0x5b-0x5d (2)
|
||||
0x050| 00 00 00| ...| x_siz: 4 0x5d-0x61 (4)
|
||||
0x060|04 |. |
|
||||
0x060| 00 00 00 04 | .... | y_siz: 4 0x61-0x65 (4)
|
||||
0x060| 00 00 00 00 | .... | xo_siz: 0 0x65-0x69 (4)
|
||||
0x060| 00 00 00 00 | .... | yo_siz: 0 0x69-0x6d (4)
|
||||
0x060| 00 00 00| ...| xt_siz: 4 0x6d-0x71 (4)
|
||||
0x070|04 |. |
|
||||
0x070| 00 00 00 04 | .... | yt_siz: 4 0x71-0x75 (4)
|
||||
0x070| 00 00 00 00 | .... | xto_siz: 0 0x75-0x79 (4)
|
||||
0x070| 00 00 00 00 | .... | yto_siz: 0 0x79-0x7d (4)
|
||||
0x070| 00 03 | .. | c_siz: 3 0x7d-0x7f (2)
|
||||
| | | components[0:3]: 0x7f-0x88 (9)
|
||||
| | | [0]{}: component 0x7f-0x82 (3)
|
||||
0x070| 0f| .| s_sizi: 15 0x7f-0x80 (1)
|
||||
0x080|01 |. | xr_sizi: 1 0x80-0x81 (1)
|
||||
0x080| 01 | . | yr_sizi: 1 0x81-0x82 (1)
|
||||
| | | [1]{}: component 0x82-0x85 (3)
|
||||
0x080| 0f | . | s_sizi: 15 0x82-0x83 (1)
|
||||
0x080| 01 | . | xr_sizi: 1 0x83-0x84 (1)
|
||||
0x080| 01 | . | yr_sizi: 1 0x84-0x85 (1)
|
||||
| | | [2]{}: component 0x85-0x88 (3)
|
||||
0x080| 0f | . | s_sizi: 15 0x85-0x86 (1)
|
||||
0x080| 01 | . | xr_sizi: 1 0x86-0x87 (1)
|
||||
0x080| 01 | . | yr_sizi: 1 0x87-0x88 (1)
|
||||
| | | [2]{}: segment 0x88-0xac (36)
|
||||
0x080| ff 64 | .d | marker: "com" (0xff64) (Comment) 0x88-0x8a (2)
|
||||
0x080| 00 22 | ." | length: 34 0x8a-0x8c (2)
|
||||
0x080| 00 01 | .. | r_cme: 1 0x8c-0x8e (2)
|
||||
0x080| 43 72| Cr| data: "Creator: JasPer Version 2.0.33" 0x8e-0xac (30)
|
||||
0x090|65 61 74 6f 72 3a 20 4a 61 73 50 65 72 20 56 65|eator: JasPer Ve|
|
||||
0x0a0|72 73 69 6f 6e 20 32 2e 30 2e 33 33 |rsion 2.0.33 |
|
||||
| | | [3]{}: segment 0xac-0xba (14)
|
||||
0x0a0| ff 52 | .R | marker: "cod" (0xff52) (Coding style default) 0xac-0xae (2)
|
||||
0x0a0| 00 0c| ..| length: 12 0xae-0xb0 (2)
|
||||
0x0b0|00 00 00 01 01 05 04 04 00 01 |.......... | data: raw bits 0xb0-0xba (10)
|
||||
| | | [4]{}: segment 0xba-0xcf (21)
|
||||
0x0b0| ff 5c | .\ | marker: "qcd" (0xff5c) (Quantization default) 0xba-0xbc (2)
|
||||
0x0b0| 00 13 | .. | length: 19 0xbc-0xbe (2)
|
||||
0x0b0| 40 80| @.| data: raw bits 0xbe-0xcf (17)
|
||||
0x0c0|88 88 90 88 88 90 88 88 90 88 88 90 88 88 90 |............... |
|
||||
| | | [5]{}: segment 0xcf-0xe5 (22)
|
||||
0x0c0| ff| .| marker: "qcc" (0xff5d) (Quantization component) 0xcf-0xd1 (2)
|
||||
0x0d0|5d |] |
|
||||
0x0d0| 00 14 | .. | length: 20 0xd1-0xd3 (2)
|
||||
0x0d0| 01 40 80 88 88 90 88 88 90 88 88 90 88| .@...........| data: raw bits 0xd3-0xe5 (18)
|
||||
0x0e0|88 90 88 88 90 |..... |
|
||||
| | | [6]{}: segment 0xe5-0xfb (22)
|
||||
0x0e0| ff 5d | .] | marker: "qcc" (0xff5d) (Quantization component) 0xe5-0xe7 (2)
|
||||
0x0e0| 00 14 | .. | length: 20 0xe7-0xe9 (2)
|
||||
0x0e0| 02 40 80 88 88 90 88| .@.....| data: raw bits 0xe9-0xfb (18)
|
||||
0x0f0|88 90 88 88 90 88 88 90 88 88 90 |........... |
|
||||
| | | [7]{}: segment 0xfb-0x107 (12)
|
||||
0x0f0| ff 90 | .. | marker: "sot" (0xff90) (Start of tile) 0xfb-0xfd (2)
|
||||
0x0f0| 00 0a | .. | l_sot: 10 0xfd-0xff (2)
|
||||
0x0f0| 00| .| i_sot: 0 0xff-0x101 (2)
|
||||
0x100|00 |. |
|
||||
0x100| 00 00 00 8d | .... | p_sot: 141 0x101-0x105 (4)
|
||||
0x100| 00 | . | tp_sot: 0 0x105-0x106 (1)
|
||||
0x100| 01 | . | tn_sot: 1 0x106-0x107 (1)
|
||||
| | | [8]{}: segment 0x107-0x11d (22)
|
||||
0x100| ff 5d | .] | marker: "qcc" (0xff5d) (Quantization component) 0x107-0x109 (2)
|
||||
0x100| 00 14 | .. | length: 20 0x109-0x10b (2)
|
||||
0x100| 00 40 80 00 00| .@...| data: raw bits 0x10b-0x11d (18)
|
||||
0x110|00 00 00 00 00 00 00 88 88 90 88 88 90 |............. |
|
||||
| | | [9]{}: segment 0x11d-0x133 (22)
|
||||
0x110| ff 5d | .] | marker: "qcc" (0xff5d) (Quantization component) 0x11d-0x11f (2)
|
||||
0x110| 00| .| length: 20 0x11f-0x121 (2)
|
||||
0x120|14 |. |
|
||||
0x120| 01 40 80 00 00 00 00 00 00 00 00 00 88 88 90| .@.............| data: raw bits 0x121-0x133 (18)
|
||||
0x130|88 88 90 |... |
|
||||
| | | [10]{}: segment 0x133-0x149 (22)
|
||||
0x130| ff 5d | .] | marker: "qcc" (0xff5d) (Quantization component) 0x133-0x135 (2)
|
||||
0x130| 00 14 | .. | length: 20 0x135-0x137 (2)
|
||||
0x130| 02 40 80 00 00 00 00 00 00| .@.......| data: raw bits 0x137-0x149 (18)
|
||||
0x140|00 00 00 88 88 90 88 88 90 |......... |
|
||||
| | | [11]{}: segment 0x149-0x188 (63)
|
||||
0x140| ff 93 | .. | marker: "sod" (0xff93) (Start of data) 0x149-0x14b (2)
|
||||
0x140| c0 00 21 07 cf| ..!..| data: raw bits 0x14b-0x188 (61)
|
||||
0x150|fc 30 08 05 3f cf fc 30 08 05 3f 80 80 80 80 80|.0..?..0..?.....|
|
||||
* |until 0x187.7 (61) | |
|
||||
| | | [12]{}: segment 0x188-0x18a (2)
|
||||
0x180| ff d9| | ..| | marker: "eoc" (0xffd9) (End of codestream) 0x188-0x18a (2)
|
BIN
format/jpeg/testdata/test.j2c
vendored
Normal file
59
format/jpeg/testdata/test.j2c.fqtest
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
# test probe
|
||||
$ fq dv test.j2c
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.[0:9]: test.j2c (jp2c) 0x0-0xa4 (164)
|
||||
| | | [0]{}: segment 0x0-0x2 (2)
|
||||
0x00|ff 4f |.O | marker: "soc" (0xff4f) (Start of codestream) 0x0-0x2 (2)
|
||||
| | | [1]{}: segment 0x2-0x2d (43)
|
||||
0x00| ff 51 | .Q | marker: "siz" (0xff51) (Image and tile size) 0x2-0x4 (2)
|
||||
0x00| 00 29 | .) | l_siz: 41 0x4-0x6 (2)
|
||||
0x00| 00 00 | .. | r_siz: 0 0x6-0x8 (2)
|
||||
0x00| 00 00 00 01 | .... | x_siz: 1 0x8-0xc (4)
|
||||
0x00| 00 00 00 01| ....| y_siz: 1 0xc-0x10 (4)
|
||||
0x10|00 00 00 00 |.... | xo_siz: 0 0x10-0x14 (4)
|
||||
0x10| 00 00 00 00 | .... | yo_siz: 0 0x14-0x18 (4)
|
||||
0x10| 00 00 00 01 | .... | xt_siz: 1 0x18-0x1c (4)
|
||||
0x10| 00 00 00 01| ....| yt_siz: 1 0x1c-0x20 (4)
|
||||
0x20|00 00 00 00 |.... | xto_siz: 0 0x20-0x24 (4)
|
||||
0x20| 00 00 00 00 | .... | yto_siz: 0 0x24-0x28 (4)
|
||||
0x20| 00 01 | .. | c_siz: 1 0x28-0x2a (2)
|
||||
| | | components[0:1]: 0x2a-0x2d (3)
|
||||
| | | [0]{}: component 0x2a-0x2d (3)
|
||||
0x20| 0f | . | s_sizi: 15 0x2a-0x2b (1)
|
||||
0x20| 01 | . | xr_sizi: 1 0x2b-0x2c (1)
|
||||
0x20| 01 | . | yr_sizi: 1 0x2c-0x2d (1)
|
||||
| | | [2]{}: segment 0x2d-0x51 (36)
|
||||
0x20| ff 64 | .d | marker: "com" (0xff64) (Comment) 0x2d-0x2f (2)
|
||||
0x20| 00| .| length: 34 0x2f-0x31 (2)
|
||||
0x30|22 |" |
|
||||
0x30| 00 01 | .. | r_cme: 1 0x31-0x33 (2)
|
||||
0x30| 43 72 65 61 74 6f 72 3a 20 4a 61 73 50| Creator: JasP| data: "Creator: JasPer Version 2.0.33" 0x33-0x51 (30)
|
||||
0x40|65 72 20 56 65 72 73 69 6f 6e 20 32 2e 30 2e 33|er Version 2.0.3|
|
||||
0x50|33 |3 |
|
||||
| | | [3]{}: segment 0x51-0x5f (14)
|
||||
0x50| ff 52 | .R | marker: "cod" (0xff52) (Coding style default) 0x51-0x53 (2)
|
||||
0x50| 00 0c | .. | length: 12 0x53-0x55 (2)
|
||||
0x50| 00 00 00 01 00 05 04 04 00 01 | .......... | data: raw bits 0x55-0x5f (10)
|
||||
| | | [4]{}: segment 0x5f-0x74 (21)
|
||||
0x50| ff| .| marker: "qcd" (0xff5c) (Quantization default) 0x5f-0x61 (2)
|
||||
0x60|5c |\ |
|
||||
0x60| 00 13 | .. | length: 19 0x61-0x63 (2)
|
||||
0x60| 40 80 88 88 90 88 88 90 88 88 90 88 88| @............| data: raw bits 0x63-0x74 (17)
|
||||
0x70|90 88 88 90 |.... |
|
||||
| | | [5]{}: segment 0x74-0x80 (12)
|
||||
0x70| ff 90 | .. | marker: "sot" (0xff90) (Start of tile) 0x74-0x76 (2)
|
||||
0x70| 00 0a | .. | l_sot: 10 0x76-0x78 (2)
|
||||
0x70| 00 00 | .. | i_sot: 0 0x78-0x7a (2)
|
||||
0x70| 00 00 00 2e | .... | p_sot: 46 0x7a-0x7e (4)
|
||||
0x70| 00 | . | tp_sot: 0 0x7e-0x7f (1)
|
||||
0x70| 01| .| tn_sot: 1 0x7f-0x80 (1)
|
||||
| | | [6]{}: segment 0x80-0x96 (22)
|
||||
0x80|ff 5d |.] | marker: "qcc" (0xff5d) (Quantization component) 0x80-0x82 (2)
|
||||
0x80| 00 14 | .. | length: 20 0x82-0x84 (2)
|
||||
0x80| 00 40 80 00 00 00 00 00 00 00 00 00| .@..........| data: raw bits 0x84-0x96 (18)
|
||||
0x90|00 00 00 00 00 00 |...... |
|
||||
| | | [7]{}: segment 0x96-0xa2 (12)
|
||||
0x90| ff 93 | .. | marker: "sod" (0xff93) (Start of data) 0x96-0x98 (2)
|
||||
0x90| df f8 90 08 07 80 80 80| ........| data: raw bits 0x98-0xa2 (10)
|
||||
0xa0|80 80 |.. |
|
||||
| | | [8]{}: segment 0xa2-0xa4 (2)
|
||||
0xa0| ff d9| | ..| | marker: "eoc" (0xffd9) (End of codestream) 0xa2-0xa4 (2)
|
BIN
format/jpeg/testdata/test.jp2
vendored
Normal file
98
format/jpeg/testdata/test.jp2.fqtest
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
# gm convert "xc:#000000" test.jp2
|
||||
$ fq dv test.jp2
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: test.jp2 (mp4) 0x0-0xf9 (249)
|
||||
| | | boxes[0:4]: 0x0-0xf9 (249)
|
||||
| | | [0]{}: box 0x0-0xc (12)
|
||||
0x00|00 00 00 0c |.... | size: 12 0x0-0x4 (4)
|
||||
0x00| 6a 50 20 20 | jP | type: "jP" (JPEG 2000 Signature) 0x4-0x8 (4)
|
||||
0x00| 0d 0a 87 0a | .... | signature: raw bits (valid) 0x8-0xc (4)
|
||||
| | | [1]{}: box 0xc-0x20 (20)
|
||||
0x00| 00 00 00 14| ....| size: 20 0xc-0x10 (4)
|
||||
0x10|66 74 79 70 |ftyp | type: "ftyp" (File type and compatibility) 0x10-0x14 (4)
|
||||
0x10| 6a 70 32 20 | jp2 | major_brand: "jp2" 0x14-0x18 (4)
|
||||
0x10| 00 00 00 00 | .... | minor_version: 0 0x18-0x1c (4)
|
||||
| | | brands[0:1]: 0x1c-0x20 (4)
|
||||
0x10| 6a 70 32 20| jp2 | [0]: "jp2" brand 0x1c-0x20 (4)
|
||||
| | | [2]{}: box 0x20-0x4d (45)
|
||||
0x20|00 00 00 2d |...- | size: 45 0x20-0x24 (4)
|
||||
0x20| 6a 70 32 68 | jp2h | type: "jp2h" (Header) 0x24-0x28 (4)
|
||||
| | | boxes[0:2]: 0x28-0x4d (37)
|
||||
| | | [0]{}: box 0x28-0x3e (22)
|
||||
0x20| 00 00 00 16 | .... | size: 22 0x28-0x2c (4)
|
||||
0x20| 69 68 64 72| ihdr| type: "ihdr" (Image Header) 0x2c-0x30 (4)
|
||||
0x30|00 00 00 01 |.... | width: 1 0x30-0x34 (4)
|
||||
0x30| 00 00 00 01 | .... | height: 1 0x34-0x38 (4)
|
||||
0x30| 00 01 | .. | nc: 1 0x38-0x3a (2)
|
||||
0x30| 0f | . | bpc: 16 0x3a-0x3b (1)
|
||||
0x30| 07 | . | c: "jpeg_2000" (7) 0x3b-0x3c (1)
|
||||
0x30| 00 | . | unk_c: 0 0x3c-0x3d (1)
|
||||
0x30| 00 | . | ipr: 0 0x3d-0x3e (1)
|
||||
| | | [1]{}: box 0x3e-0x4d (15)
|
||||
0x30| 00 00| ..| size: 15 0x3e-0x42 (4)
|
||||
0x40|00 0f |.. |
|
||||
0x40| 63 6f 6c 72 | colr | type: "colr" (Specifies the colourspace of the image) 0x42-0x46 (4)
|
||||
0x40| 01 00 00 00 | .... | parameter_type: "\x01\x00\x00\x00" 0x46-0x4a (4)
|
||||
0x40| 00 00 11 | ... | data: raw bits 0x4a-0x4d (3)
|
||||
| | | [3]{}: box 0x4d-0xf9 (172)
|
||||
0x40| 00 00 00| ...| size: 0 (Rest of file) 0x4d-0x51 (4)
|
||||
0x50|00 |. |
|
||||
0x50| 6a 70 32 63 | jp2c | type: "jp2c" (JPEG 2000 contiguous codestream) 0x51-0x55 (4)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| segments[0:9]: (jp2c) 0x55-0xf9 (164)
|
||||
| | | [0]{}: segment 0x55-0x57 (2)
|
||||
0x50| ff 4f | .O | marker: "soc" (0xff4f) (Start of codestream) 0x55-0x57 (2)
|
||||
| | | [1]{}: segment 0x57-0x82 (43)
|
||||
0x50| ff 51 | .Q | marker: "siz" (0xff51) (Image and tile size) 0x57-0x59 (2)
|
||||
0x50| 00 29 | .) | l_siz: 41 0x59-0x5b (2)
|
||||
0x50| 00 00 | .. | r_siz: 0 0x5b-0x5d (2)
|
||||
0x50| 00 00 00| ...| x_siz: 1 0x5d-0x61 (4)
|
||||
0x60|01 |. |
|
||||
0x60| 00 00 00 01 | .... | y_siz: 1 0x61-0x65 (4)
|
||||
0x60| 00 00 00 00 | .... | xo_siz: 0 0x65-0x69 (4)
|
||||
0x60| 00 00 00 00 | .... | yo_siz: 0 0x69-0x6d (4)
|
||||
0x60| 00 00 00| ...| xt_siz: 1 0x6d-0x71 (4)
|
||||
0x70|01 |. |
|
||||
0x70| 00 00 00 01 | .... | yt_siz: 1 0x71-0x75 (4)
|
||||
0x70| 00 00 00 00 | .... | xto_siz: 0 0x75-0x79 (4)
|
||||
0x70| 00 00 00 00 | .... | yto_siz: 0 0x79-0x7d (4)
|
||||
0x70| 00 01 | .. | c_siz: 1 0x7d-0x7f (2)
|
||||
| | | components[0:1]: 0x7f-0x82 (3)
|
||||
| | | [0]{}: component 0x7f-0x82 (3)
|
||||
0x70| 0f| .| s_sizi: 15 0x7f-0x80 (1)
|
||||
0x80|01 |. | xr_sizi: 1 0x80-0x81 (1)
|
||||
0x80| 01 | . | yr_sizi: 1 0x81-0x82 (1)
|
||||
| | | [2]{}: segment 0x82-0xa6 (36)
|
||||
0x80| ff 64 | .d | marker: "com" (0xff64) (Comment) 0x82-0x84 (2)
|
||||
0x80| 00 22 | ." | length: 34 0x84-0x86 (2)
|
||||
0x80| 00 01 | .. | r_cme: 1 0x86-0x88 (2)
|
||||
0x80| 43 72 65 61 74 6f 72 3a| Creator:| data: "Creator: JasPer Version 2.0.33" 0x88-0xa6 (30)
|
||||
0x90|20 4a 61 73 50 65 72 20 56 65 72 73 69 6f 6e 20| JasPer Version |
|
||||
0xa0|32 2e 30 2e 33 33 |2.0.33 |
|
||||
| | | [3]{}: segment 0xa6-0xb4 (14)
|
||||
0xa0| ff 52 | .R | marker: "cod" (0xff52) (Coding style default) 0xa6-0xa8 (2)
|
||||
0xa0| 00 0c | .. | length: 12 0xa8-0xaa (2)
|
||||
0xa0| 00 00 00 01 00 05| ......| data: raw bits 0xaa-0xb4 (10)
|
||||
0xb0|04 04 00 01 |.... |
|
||||
| | | [4]{}: segment 0xb4-0xc9 (21)
|
||||
0xb0| ff 5c | .\ | marker: "qcd" (0xff5c) (Quantization default) 0xb4-0xb6 (2)
|
||||
0xb0| 00 13 | .. | length: 19 0xb6-0xb8 (2)
|
||||
0xb0| 40 80 88 88 90 88 88 90| @.......| data: raw bits 0xb8-0xc9 (17)
|
||||
0xc0|88 88 90 88 88 90 88 88 90 |......... |
|
||||
| | | [5]{}: segment 0xc9-0xd5 (12)
|
||||
0xc0| ff 90 | .. | marker: "sot" (0xff90) (Start of tile) 0xc9-0xcb (2)
|
||||
0xc0| 00 0a | .. | l_sot: 10 0xcb-0xcd (2)
|
||||
0xc0| 00 00 | .. | i_sot: 0 0xcd-0xcf (2)
|
||||
0xc0| 00| .| p_sot: 46 0xcf-0xd3 (4)
|
||||
0xd0|00 00 2e |... |
|
||||
0xd0| 00 | . | tp_sot: 0 0xd3-0xd4 (1)
|
||||
0xd0| 01 | . | tn_sot: 1 0xd4-0xd5 (1)
|
||||
| | | [6]{}: segment 0xd5-0xeb (22)
|
||||
0xd0| ff 5d | .] | marker: "qcc" (0xff5d) (Quantization component) 0xd5-0xd7 (2)
|
||||
0xd0| 00 14 | .. | length: 20 0xd7-0xd9 (2)
|
||||
0xd0| 00 40 80 00 00 00 00| .@.....| data: raw bits 0xd9-0xeb (18)
|
||||
0xe0|00 00 00 00 00 00 00 00 00 00 00 |........... |
|
||||
| | | [7]{}: segment 0xeb-0xf7 (12)
|
||||
0xe0| ff 93 | .. | marker: "sod" (0xff93) (Start of data) 0xeb-0xed (2)
|
||||
0xe0| df f8 90| ...| data: raw bits 0xed-0xf7 (10)
|
||||
0xf0|08 07 80 80 80 80 80 |....... |
|
||||
| | | [8]{}: segment 0xf7-0xf9 (2)
|
||||
0xf0| ff d9| | ..| | marker: "eoc" (0xffd9) (End of codestream) 0xf7-0xf9 (2)
|
@ -7,7 +7,7 @@ package leveldb
|
||||
// - MANIFEST-*
|
||||
|
||||
import (
|
||||
"github.com/wader/fq/internal/mathex"
|
||||
"github.com/wader/fq/internal/mathx"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
)
|
||||
@ -49,7 +49,7 @@ func readBlockSequence(rro recordReadOptions, d *decode.D) {
|
||||
|
||||
d.FieldArray("blocks", func(d *decode.D) {
|
||||
for d.BitsLeft() >= headerSize {
|
||||
d.LimitedFn(mathex.Min(blockSize, d.BitsLeft()), func(d *decode.D) {
|
||||
d.LimitedFn(mathx.Min(blockSize, d.BitsLeft()), func(d *decode.D) {
|
||||
d.FieldStruct("block", bind(readLogBlock, rro))
|
||||
})
|
||||
}
|
||||
|
8
format/leveldb/testdata/leveldb_log.fqtest
vendored
@ -20,7 +20,7 @@ $ fq -d leveldb_log dv log_only.ldb/000003.log
|
||||
0x010| 6c 6f 72 65 6d 2e 6c 6f 72 65 6d| lorem.lorem| data: "lorem.lorem" 0x15-0x20 (11)
|
||||
| | | value{}: 0x20-0x1df (447)
|
||||
0x020|bd 03 |.. | length: 445 0x20-0x22 (2)
|
||||
0x020| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f| Lorem ipsum do| data: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x22-0x1df (445)
|
||||
0x020| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f| Lorem ipsum do| data: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x22-0x1df (445)
|
||||
0x030|6c 6f 72 20 73 69 74 20 61 6d 65 74 2c 20 63 6f|lor sit amet, co|
|
||||
* |until 0x1de.7 (445) | |
|
||||
| | | [1]{}: record 0x1df-0x3be (479)
|
||||
@ -42,7 +42,7 @@ $ fq -d leveldb_log dv log_only.ldb/000003.log
|
||||
| | | value{}: 0x1ff-0x3be (447)
|
||||
0x1f0| bd| .| length: 445 0x1ff-0x201 (2)
|
||||
0x200|03 |. |
|
||||
0x200| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c| Lorem ipsum dol| data: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x201-0x3be (445)
|
||||
0x200| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c| Lorem ipsum dol| data: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x201-0x3be (445)
|
||||
0x210|6f 72 20 73 69 74 20 61 6d 65 74 2c 20 63 6f 6e|or sit amet, con|
|
||||
* |until 0x3bd.7 (445) | |
|
||||
| | | [2]{}: record 0x3be-0x59d (479)
|
||||
@ -63,7 +63,7 @@ $ fq -d leveldb_log dv log_only.ldb/000003.log
|
||||
0x3d0| 6c 6f 72 65 6d 2e 64 6f 6c 6f 72 | lorem.dolor | data: "lorem.dolor" 0x3d3-0x3de (11)
|
||||
| | | value{}: 0x3de-0x59d (447)
|
||||
0x3d0| bd 03| ..| length: 445 0x3de-0x3e0 (2)
|
||||
0x3e0|4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f|Lorem ipsum dolo| data: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x3e0-0x59d (445)
|
||||
0x3e0|4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f|Lorem ipsum dolo| data: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x3e0-0x59d (445)
|
||||
* |until 0x59c.7 (445) | |
|
||||
| | | [3]{}: record 0x59d-0x62c (143)
|
||||
| | | header{}: 0x59d-0x5a4 (7)
|
||||
@ -82,6 +82,6 @@ $ fq -d leveldb_log dv log_only.ldb/000003.log
|
||||
0x5b0| 72 6f 77 | row | data: "row" 0x5b2-0x5b5 (3)
|
||||
| | | value{}: 0x5b5-0x62c (119)
|
||||
0x5b0| 76 | v | length: 118 0x5b5-0x5b6 (1)
|
||||
0x5b0| 52 6f 77 2c 20 72 6f 77 2c 20| Row, row, | data: "Row, row, row your boat\nGently down the stream...." 0x5b6-0x62c (118)
|
||||
0x5b0| 52 6f 77 2c 20 72 6f 77 2c 20| Row, row, | data: "Row, row, row your boat\nGently down the stream.\nMerrily, merrily, merrily, merrily,\nLife is but a dream. 🚣\u200d♂️" 0x5b6-0x62c (118)
|
||||
0x5c0|72 6f 77 20 79 6f 75 72 20 62 6f 61 74 0a 47 65|row your boat.Ge|
|
||||
* |until 0x62b.7 (end) (118) | |
|
||||
|
@ -12,7 +12,7 @@ $ fq -d leveldb_table dv snappy.ldb/000005.ldb
|
||||
0x000| 6c 6f 72 65 6d 2e 64 6f 6c 6f 72 | lorem.dolor | user_key: "lorem.dolor" 0x4-0xf (11)
|
||||
0x000| 01| .| type: "value" (0x1) 0xf-0x10 (1)
|
||||
0x001|03 00 00 00 00 00 00 |....... | sequence_number: 3 0x10-0x17 (7)
|
||||
0x001| 4c 6f 72 65 6d 20 69 70 73| Lorem ips| value: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x17-0x1d4 (445)
|
||||
0x001| 4c 6f 72 65 6d 20 69 70 73| Lorem ips| value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x17-0x1d4 (445)
|
||||
0x002|75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65|um dolor sit ame|
|
||||
* |until 0x1d3.7 (445) | |
|
||||
| | | [1]{}: entry 0x1d4-0x3a2 (462)
|
||||
@ -25,7 +25,7 @@ $ fq -d leveldb_table dv snappy.ldb/000005.ldb
|
||||
0x01d| 01 | . | type: "value" (0x1) 0x1dd-0x1de (1)
|
||||
0x01d| 02 00| ..| sequence_number: 2 0x1de-0x1e5 (7)
|
||||
0x01e|00 00 00 00 00 |..... |
|
||||
0x01e| 4c 6f 72 65 6d 20 69 70 73 75 6d| Lorem ipsum| value: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x1e5-0x3a2 (445)
|
||||
0x01e| 4c 6f 72 65 6d 20 69 70 73 75 6d| Lorem ipsum| value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x1e5-0x3a2 (445)
|
||||
0x01f|20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2c| dolor sit amet,|
|
||||
* |until 0x3a1.7 (445) | |
|
||||
| | | [2]{}: entry 0x3a2-0x570 (462)
|
||||
@ -38,7 +38,7 @@ $ fq -d leveldb_table dv snappy.ldb/000005.ldb
|
||||
0x03a| 01 | . | type: "value" (0x1) 0x3ab-0x3ac (1)
|
||||
0x03a| 01 00 00 00| ....| sequence_number: 1 0x3ac-0x3b3 (7)
|
||||
0x03b|00 00 00 |... |
|
||||
0x03b| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64| Lorem ipsum d| value: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x3b3-0x570 (445)
|
||||
0x03b| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64| Lorem ipsum d| value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x3b3-0x570 (445)
|
||||
0x03c|6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2c 20 63|olor sit amet, c|
|
||||
* |until 0x56f.7 (445) | |
|
||||
| | | [3]{}: entry 0x570-0x5f4 (132)
|
||||
@ -49,7 +49,7 @@ $ fq -d leveldb_table dv snappy.ldb/000005.ldb
|
||||
0x057| 72 6f 77 | row | user_key: "row" 0x573-0x576 (3)
|
||||
0x057| 01 | . | type: "value" (0x1) 0x576-0x577 (1)
|
||||
0x057| 04 00 00 00 00 00 00 | ....... | sequence_number: 4 0x577-0x57e (7)
|
||||
0x057| 52 6f| Ro| value: "Row, row, row your boat\nGently down the stream...." 0x57e-0x5f4 (118)
|
||||
0x057| 52 6f| Ro| value: "Row, row, row your boat\nGently down the stream.\nMerrily, merrily, merrily, merrily,\nLife is but a dream. 🚣\u200d♂️" 0x57e-0x5f4 (118)
|
||||
0x058|77 2c 20 72 6f 77 2c 20 72 6f 77 20 79 6f 75 72|w, row, row your|
|
||||
* |until 0x5f3.7 (118) | |
|
||||
| | | trailer{}: 0x5f4-0x5fc (8)
|
||||
|
@ -12,7 +12,7 @@ $ fq -d leveldb_table dv uncompressed.ldb/000005.ldb
|
||||
0x000| 6c 6f 72 65 6d 2e 64 6f 6c 6f 72 | lorem.dolor | user_key: "lorem.dolor" 0x4-0xf (11)
|
||||
0x000| 01| .| type: "value" (0x1) 0xf-0x10 (1)
|
||||
0x010|03 00 00 00 00 00 00 |....... | sequence_number: 3 0x10-0x17 (7)
|
||||
0x010| 4c 6f 72 65 6d 20 69 70 73| Lorem ips| value: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x17-0x1d4 (445)
|
||||
0x010| 4c 6f 72 65 6d 20 69 70 73| Lorem ips| value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x17-0x1d4 (445)
|
||||
0x020|75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65|um dolor sit ame|
|
||||
* |until 0x1d3.7 (445) | |
|
||||
| | | [1]{}: entry 0x1d4-0x3a2 (462)
|
||||
@ -25,7 +25,7 @@ $ fq -d leveldb_table dv uncompressed.ldb/000005.ldb
|
||||
0x1d0| 01 | . | type: "value" (0x1) 0x1dd-0x1de (1)
|
||||
0x1d0| 02 00| ..| sequence_number: 2 0x1de-0x1e5 (7)
|
||||
0x1e0|00 00 00 00 00 |..... |
|
||||
0x1e0| 4c 6f 72 65 6d 20 69 70 73 75 6d| Lorem ipsum| value: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x1e5-0x3a2 (445)
|
||||
0x1e0| 4c 6f 72 65 6d 20 69 70 73 75 6d| Lorem ipsum| value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x1e5-0x3a2 (445)
|
||||
0x1f0|20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2c| dolor sit amet,|
|
||||
* |until 0x3a1.7 (445) | |
|
||||
| | | [2]{}: entry 0x3a2-0x570 (462)
|
||||
@ -38,7 +38,7 @@ $ fq -d leveldb_table dv uncompressed.ldb/000005.ldb
|
||||
0x3a0| 01 | . | type: "value" (0x1) 0x3ab-0x3ac (1)
|
||||
0x3a0| 01 00 00 00| ....| sequence_number: 1 0x3ac-0x3b3 (7)
|
||||
0x3b0|00 00 00 |... |
|
||||
0x3b0| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64| Lorem ipsum d| value: "Lorem ipsum dolor sit amet, consectetur adipisc..." 0x3b3-0x570 (445)
|
||||
0x3b0| 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64| Lorem ipsum d| value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 0x3b3-0x570 (445)
|
||||
0x3c0|6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2c 20 63|olor sit amet, c|
|
||||
* |until 0x56f.7 (445) | |
|
||||
| | | [3]{}: entry 0x570-0x5f4 (132)
|
||||
@ -49,7 +49,7 @@ $ fq -d leveldb_table dv uncompressed.ldb/000005.ldb
|
||||
0x570| 72 6f 77 | row | user_key: "row" 0x573-0x576 (3)
|
||||
0x570| 01 | . | type: "value" (0x1) 0x576-0x577 (1)
|
||||
0x570| 04 00 00 00 00 00 00 | ....... | sequence_number: 4 0x577-0x57e (7)
|
||||
0x570| 52 6f| Ro| value: "Row, row, row your boat\nGently down the stream...." 0x57e-0x5f4 (118)
|
||||
0x570| 52 6f| Ro| value: "Row, row, row your boat\nGently down the stream.\nMerrily, merrily, merrily, merrily,\nLife is but a dream. 🚣\u200d♂️" 0x57e-0x5f4 (118)
|
||||
0x580|77 2c 20 72 6f 77 2c 20 72 6f 77 20 79 6f 75 72|w, row, row your|
|
||||
* |until 0x5f3.7 (118) | |
|
||||
| | | trailer{}: 0x5f4-0x5fc (8)
|
||||
|
12
format/matroska/testdata/opus.fqtest
vendored
@ -379,8 +379,8 @@ $ fq -d matroska dv opus.mkv
|
||||
| | | toc{}: 0x24a-0x2c3 (121)
|
||||
| | | config{}: 0x24a-0x24a.5 (0.5)
|
||||
0x240| f8 | . | config: 31 0x24a-0x24a.5 (0.5)
|
||||
| | | mode: "CELT-only"
|
||||
| | | bandwidth: "FB"
|
||||
| | | mode: "celt_only"
|
||||
| | | bandwidth: "fb"
|
||||
| | | frame_size: 20
|
||||
0x240| f8 | . | stereo: false 0x24a.5-0x24a.6 (0.1)
|
||||
| | | frames_per_packet{}: 0x24a.6-0x24b (0.2)
|
||||
@ -407,8 +407,8 @@ $ fq -d matroska dv opus.mkv
|
||||
| | | toc{}: 0x2c9-0x342 (121)
|
||||
| | | config{}: 0x2c9-0x2c9.5 (0.5)
|
||||
0x2c0| f8 | . | config: 31 0x2c9-0x2c9.5 (0.5)
|
||||
| | | mode: "CELT-only"
|
||||
| | | bandwidth: "FB"
|
||||
| | | mode: "celt_only"
|
||||
| | | bandwidth: "fb"
|
||||
| | | frame_size: 20
|
||||
0x2c0| f8 | . | stereo: false 0x2c9.5-0x2c9.6 (0.1)
|
||||
| | | frames_per_packet{}: 0x2c9.6-0x2ca (0.2)
|
||||
@ -439,8 +439,8 @@ $ fq -d matroska dv opus.mkv
|
||||
| | | toc{}: 0x351-0x3ca (121)
|
||||
| | | config{}: 0x351-0x351.5 (0.5)
|
||||
0x350| f8 | . | config: 31 0x351-0x351.5 (0.5)
|
||||
| | | mode: "CELT-only"
|
||||
| | | bandwidth: "FB"
|
||||
| | | mode: "celt_only"
|
||||
| | | bandwidth: "fb"
|
||||
| | | frame_size: 20
|
||||
0x350| f8 | . | stereo: false 0x351.5-0x351.6 (0.1)
|
||||
| | | frames_per_packet{}: 0x351.6-0x352 (0.2)
|
||||
|
12
format/matroska/testdata/vorbis.fqtest
vendored
@ -243,7 +243,7 @@ $ fq -d matroska dv vorbis.mkv
|
||||
0x0170| 10 | . | [1]: 16 lace_size 0x178-0x179 (1)
|
||||
| | | laces[0:3]: 0x179-0xe56 (3293)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: packet (vorbis_packet) 0x179-0x197 (30)
|
||||
0x0170| 01 | . | packet_type: "Identification" (1) 0x179-0x17a (1)
|
||||
0x0170| 01 | . | packet_type: "identification" (1) 0x179-0x17a (1)
|
||||
0x0170| 76 6f 72 62 69 73| vorbis| magic: "vorbis" (valid) 0x17a-0x180 (6)
|
||||
0x0180|00 00 00 00 |.... | vorbis_version: 0 (valid) 0x180-0x184 (4)
|
||||
0x0180| 02 | . | audio_channels: 2 0x184-0x185 (1)
|
||||
@ -257,7 +257,7 @@ $ fq -d matroska dv vorbis.mkv
|
||||
0x0190| 01 | . | padding0: raw bits (all zero) 0x196-0x196.7 (0.7)
|
||||
0x0190| 01 | . | framing_flag: 1 (valid) 0x196.7-0x197 (0.1)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: packet (vorbis_packet) 0x197-0x1a7 (16)
|
||||
0x0190| 03 | . | packet_type: "Comment" (3) 0x197-0x198 (1)
|
||||
0x0190| 03 | . | packet_type: "comment" (3) 0x197-0x198 (1)
|
||||
0x0190| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (valid) 0x198-0x19e (6)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| comment{}: (vorbis_comment) 0x19e-0x1a6 (8)
|
||||
0x0190| 00 00| ..| vendor_length: 0 0x19e-0x1a2 (4)
|
||||
@ -268,7 +268,7 @@ $ fq -d matroska dv vorbis.mkv
|
||||
0x01a0| 01 | . | padding0: raw bits (all zero) 0x1a6-0x1a6.7 (0.7)
|
||||
0x01a0| 01 | . | frame_bit: 1 (valid) 0x1a6.7-0x1a7 (0.1)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: packet (vorbis_packet) 0x1a7-0xe56 (3247)
|
||||
0x01a0| 05 | . | packet_type: "Setup" (5) 0x1a7-0x1a8 (1)
|
||||
0x01a0| 05 | . | packet_type: "setup" (5) 0x1a7-0x1a8 (1)
|
||||
0x01a0| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (valid) 0x1a8-0x1ae (6)
|
||||
0x01a0| 1c | . | vorbis_codebook_count: 29 0x1ae-0x1af (1)
|
||||
0x01a0| 42| B| codecooke_sync: 0x564342 (valid) 0x1af-0x1b2 (3)
|
||||
@ -396,7 +396,7 @@ $ fq -d matroska dv vorbis.mkv
|
||||
0x0f10|80 |. | lacing: "none" (0) 0xf10.5-0xf10.7 (0.2)
|
||||
0x0f10|80 |. | discardable: false 0xf10.7-0xf11 (0.1)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| packet{}: (vorbis_packet) 0xf11-0xfc7 (182)
|
||||
0x0f10| be | . | packet_type: "Audio" (0) 0xf11-0xf12 (1)
|
||||
0x0f10| be | . | packet_type: "audio" (0) 0xf11-0xf12 (1)
|
||||
0x0f10| b7 f2 81 46 74 15 42 0b 52 08 17 32 8e 43| ...Ft.B.R..2.C| data: raw bits 0xf12-0xfc7 (181)
|
||||
0x0f20|08 65 84 84 f6 56 3e d0 88 ae 42 68 41 0a e1 42|.e...V>...BhA..B|
|
||||
* |until 0xfc6.7 (181) | |
|
||||
@ -413,7 +413,7 @@ $ fq -d matroska dv vorbis.mkv
|
||||
0x0fc0| 80 | . | lacing: "none" (0) 0xfcc.5-0xfcc.7 (0.2)
|
||||
0x0fc0| 80 | . | discardable: false 0xfcc.7-0xfcd (0.1)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| packet{}: (vorbis_packet) 0xfcd-0x1019 (76)
|
||||
0x0fc0| be | . | packet_type: "Audio" (0) 0xfcd-0xfce (1)
|
||||
0x0fc0| be | . | packet_type: "audio" (0) 0xfcd-0xfce (1)
|
||||
0x0fc0| 13 a2| ..| data: raw bits 0xfce-0x1019 (75)
|
||||
0x0fd0|9b 06 0a b6 ff 13 10 ff 25 62 ec 8f d9 f7 a2 11|........%b......|
|
||||
* |until 0x1018.7 (75) | |
|
||||
@ -435,7 +435,7 @@ $ fq -d matroska dv vorbis.mkv
|
||||
0x1020| 00 | . | lacing: "none" (0) 0x1028.5-0x1028.7 (0.2)
|
||||
0x1020| 00 | . | not_used: false 0x1028.7-0x1029 (0.1)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| packet{}: (vorbis_packet) 0x1029-0x10d8 (175)
|
||||
0x1020| be | . | packet_type: "Audio" (0) 0x1029-0x102a (1)
|
||||
0x1020| be | . | packet_type: "audio" (0) 0x1029-0x102a (1)
|
||||
0x1020| a7 f2 81 46 bb c2| ...F..| data: raw bits 0x102a-0x10d8 (174)
|
||||
0x1030|48 52 08 27 b8 83 10 ca 08 b1 a7 f2 81 46 bb c2|HR.'.........F..|
|
||||
* |until 0x10d7.7 (174) | |
|
||||
|
@ -248,7 +248,7 @@ func decodeSampleFlags(d *decode.D) {
|
||||
|
||||
func decodeBoxWithParentData(ctx *decodeContext, d *decode.D, parentData any, extraTypeMappers ...scalar.StrMapper) {
|
||||
var dataSize uint64
|
||||
typeMappers := []scalar.StrMapper{boxDescriptions}
|
||||
typeMappers := []scalar.StrMapper{scalar.ActualTrimSpace, boxDescriptions}
|
||||
if len(extraTypeMappers) > 0 {
|
||||
typeMappers = append(typeMappers, extraTypeMappers...)
|
||||
}
|
||||
@ -339,13 +339,7 @@ type keysBox struct {
|
||||
keys []keysBoxKey
|
||||
}
|
||||
|
||||
func decodeBoxIrefEntry(ctx *decodeContext, d *decode.D) {
|
||||
irefBox, ok := ctx.parent().data.(*irefBox)
|
||||
if !ok {
|
||||
d.FieldRawLen("data", d.BitsLeft())
|
||||
return
|
||||
}
|
||||
|
||||
func decodeBoxIrefEntry(irefBox *irefBox, d *decode.D) {
|
||||
idSize := 16
|
||||
if irefBox.version != 0 {
|
||||
idSize = 32
|
||||
@ -525,7 +519,7 @@ func decodeBox(ctx *decodeContext, d *decode.D, typ string) {
|
||||
d.FieldU8("version")
|
||||
d.FieldU24("flags")
|
||||
d.FieldUTF8NullFixedLen("component_type", 4)
|
||||
subType := d.FieldUTF8("component_subtype", 4, subTypeNames, scalar.ActualTrimSpace)
|
||||
subType := d.FieldUTF8("component_subtype", 4, scalar.ActualTrimSpace, subTypeNames)
|
||||
d.FieldUTF8NullFixedLen("component_manufacturer", 4)
|
||||
d.FieldU32("component_flags")
|
||||
d.FieldU32("component_flags_mask")
|
||||
@ -533,7 +527,12 @@ func decodeBox(ctx *decodeContext, d *decode.D, typ string) {
|
||||
switch majorBrand {
|
||||
case "qt":
|
||||
// qt brand seems to use length prefixed strings
|
||||
// From QuickTime File Format specification:
|
||||
// > A (counted) string that specifies the name of the component—that is, the media handler used
|
||||
// > when this media was created. This field may contain a zero-length (empty) string.
|
||||
if d.BitsLeft() > 0 {
|
||||
d.FieldUTF8ShortStringFixedLen("component_name", int(d.BitsLeft()/8))
|
||||
}
|
||||
default:
|
||||
d.FieldUTF8NullFixedLen("component_name", int(d.BitsLeft()/8))
|
||||
}
|
||||
@ -560,7 +559,7 @@ func decodeBox(ctx *decodeContext, d *decode.D, typ string) {
|
||||
var drefURL string
|
||||
d.FieldStructArrayLoop("boxes", "box", func() bool { return i < entryCount }, func(d *decode.D) {
|
||||
size := d.FieldU32("size")
|
||||
typ := d.FieldUTF8("type", 4)
|
||||
typ := d.FieldUTF8("type", 4, scalar.ActualTrimSpace)
|
||||
d.FieldU8("version")
|
||||
d.FieldU24("flags")
|
||||
dataSize := size - 12
|
||||
@ -590,7 +589,7 @@ func decodeBox(ctx *decodeContext, d *decode.D, typ string) {
|
||||
d.FieldArrayLoop("boxes", func() bool { return i < entryCount }, func(d *decode.D) {
|
||||
d.FieldStruct("box", func(d *decode.D) {
|
||||
size := d.FieldU32("size")
|
||||
dataFormat := d.FieldUTF8("type", 4, dataFormatNames)
|
||||
dataFormat := d.FieldUTF8("type", 4, dataFormatNames, scalar.ActualTrimSpace)
|
||||
subType := ""
|
||||
if t := ctx.currentTrack(); t != nil {
|
||||
t.sampleDescriptions = append(t.sampleDescriptions, sampleDescription{
|
||||
@ -1709,11 +1708,26 @@ func decodeBox(ctx *decodeContext, d *decode.D, typ string) {
|
||||
d.FieldU24("flags")
|
||||
decodeBoxesWithParentData(ctx, d, &irefBox{version: int(version)})
|
||||
case "dimg":
|
||||
decodeBoxIrefEntry(ctx, d)
|
||||
if irefBox, ok := ctx.parent().data.(*irefBox); ok {
|
||||
decodeBoxIrefEntry(irefBox, d)
|
||||
} else {
|
||||
d.FieldRawLen("data", d.BitsLeft())
|
||||
}
|
||||
case "thmb":
|
||||
decodeBoxIrefEntry(ctx, d)
|
||||
if irefBox, ok := ctx.parent().data.(*irefBox); ok {
|
||||
decodeBoxIrefEntry(irefBox, d)
|
||||
} else {
|
||||
d.FieldU8("version")
|
||||
d.FieldU24("flags")
|
||||
d.FieldUTF8("format", 4)
|
||||
d.FieldFormatOrRawLen("image", d.BitsLeft(), &imageGroup, nil)
|
||||
}
|
||||
case "cdsc":
|
||||
decodeBoxIrefEntry(ctx, d)
|
||||
if irefBox, ok := ctx.parent().data.(*irefBox); ok {
|
||||
decodeBoxIrefEntry(irefBox, d)
|
||||
} else {
|
||||
d.FieldRawLen("data", d.BitsLeft())
|
||||
}
|
||||
case "irot":
|
||||
d.FieldU8("rotation", scalar.UintMapSymUint{
|
||||
0: 0,
|
||||
@ -1784,6 +1798,40 @@ func decodeBox(ctx *decodeContext, d *decode.D, typ string) {
|
||||
default:
|
||||
d.FieldRawLen("message_data", d.BitsLeft())
|
||||
}
|
||||
case "jp2h":
|
||||
decodeBoxes(ctx, d)
|
||||
case "ihdr":
|
||||
d.FieldU32("width")
|
||||
d.FieldU32("height")
|
||||
d.FieldU16("nc")
|
||||
d.FieldU8("bpc", scalar.UintActualAdd(1))
|
||||
d.FieldU8("c", scalar.UintMapSymStr{
|
||||
0: "uncompressed",
|
||||
1: "modified_huffman",
|
||||
2: "modified_read",
|
||||
3: "modified_modified_read",
|
||||
4: "jbig_bi_level",
|
||||
5: "jpeg",
|
||||
6: "jpeg_ls",
|
||||
7: "jpeg_2000",
|
||||
8: "jbig2",
|
||||
9: "jbig",
|
||||
})
|
||||
d.FieldU8("unk_c")
|
||||
d.FieldU8("ipr")
|
||||
case "jP":
|
||||
d.FieldRawLen("signature", 4*8, d.AssertBitBuf([]byte{0x0d, 0x0a, 0x87, 0x0a}))
|
||||
case "jp2c":
|
||||
d.FieldFormat("segments", &jp2cGroup, nil)
|
||||
case "uinf":
|
||||
decodeBoxes(ctx, d)
|
||||
case "ulst":
|
||||
nu := d.FieldU16("nu")
|
||||
d.FieldArray("uids", func(d *decode.D) {
|
||||
for i := 0; i < int(nu); i++ {
|
||||
d.FieldRawLen("uid", 128)
|
||||
}
|
||||
})
|
||||
|
||||
default:
|
||||
// there are at least 4 ways to encode udta metadata in mov/mp4 files.
|
||||
|
@ -16,11 +16,12 @@ package mp4
|
||||
// TODO: better probe, find first 2 boxes, should be free,ftyp or mdat?
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"embed"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/cmpex"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
"golang.org/x/exp/slices"
|
||||
@ -42,6 +43,7 @@ var hevcCDCRGroup decode.Group
|
||||
var iccProfileGroup decode.Group
|
||||
var id3v2Group decode.Group
|
||||
var imageGroup decode.Group
|
||||
var jp2cGroup decode.Group
|
||||
var jpegGroup decode.Group
|
||||
var mp3FrameGroup decode.Group
|
||||
var mpegESGroup decode.Group
|
||||
@ -82,6 +84,7 @@ func init() {
|
||||
{Groups: []*decode.Group{format.ICC_Profile}, Out: &iccProfileGroup},
|
||||
{Groups: []*decode.Group{format.ID3v2}, Out: &id3v2Group},
|
||||
{Groups: []*decode.Group{format.Image}, Out: &imageGroup},
|
||||
{Groups: []*decode.Group{format.JP2C}, Out: &jp2cGroup},
|
||||
{Groups: []*decode.Group{format.JPEG}, Out: &jpegGroup},
|
||||
{Groups: []*decode.Group{format.MP3_Frame}, Out: &mp3FrameGroup},
|
||||
{Groups: []*decode.Group{format.MPEG_ES}, Out: &mpegESGroup},
|
||||
@ -240,10 +243,10 @@ func mp4Tracks(d *decode.D, ctx *decodeContext) {
|
||||
|
||||
// sort by id then order in file
|
||||
slices.SortStableFunc(tracksCollected, func(a, b *trackCollected) int {
|
||||
if r := cmpex.Compare(a.track.id, b.track.id); r != 0 {
|
||||
if r := cmp.Compare(a.track.id, b.track.id); r != 0 {
|
||||
return r
|
||||
}
|
||||
return cmpex.Compare(a.order, b.order)
|
||||
return cmp.Compare(a.order, b.order)
|
||||
})
|
||||
|
||||
d.FieldArray("tracks", func(d *decode.D) {
|
||||
@ -465,7 +468,7 @@ func mp4Decode(d *decode.D) any {
|
||||
if size < 8 {
|
||||
d.Fatalf("first box size too small < 8")
|
||||
}
|
||||
firstType := d.UTF8(4)
|
||||
firstType := strings.TrimSpace(d.UTF8(4))
|
||||
switch firstType {
|
||||
case "styp", // mp4 segment
|
||||
"ftyp", // mp4 file
|
||||
|
@ -22,8 +22,8 @@ const (
|
||||
)
|
||||
|
||||
var recordTypeNames = scalar.UintMapSymStr{
|
||||
recordTypeRightsManagementHeader: "Rights management header",
|
||||
recordTypeLicenseStore: "License store",
|
||||
recordTypeRightsManagementHeader: "rights_management_header",
|
||||
recordTypeLicenseStore: "license_store",
|
||||
}
|
||||
|
||||
func playreadyPsshDecode(d *decode.D) any {
|
||||
|
2
format/mp4/testdata/emsg.fqtest
vendored
@ -6,7 +6,7 @@ $ fq -o force=true -d mp4 dv emsg.mp4
|
||||
0x000| 65 6d 73 67 | emsg | type: "emsg" (Event message) 0x4-0x8 (4)
|
||||
0x000| 00 | . | version: 0 0x8-0x9 (1)
|
||||
0x000| 00 00 00 | ... | flags: 0 0x9-0xc (3)
|
||||
0x000| 68 74 74 70| http| scheme_id_uri: "http://youtube.com/streaming/metadata/segment/1..." 0xc-0x41 (53)
|
||||
0x000| 68 74 74 70| http| scheme_id_uri: "http://youtube.com/streaming/metadata/segment/102015" 0xc-0x41 (53)
|
||||
0x010|3a 2f 2f 79 6f 75 74 75 62 65 2e 63 6f 6d 2f 73|://youtube.com/s|
|
||||
* |until 0x40.7 (53) | |
|
||||
0x040| 00 | . | value: "" 0x41-0x42 (1)
|
||||
|
16
format/mp4/testdata/opus.fqtest
vendored
@ -212,8 +212,8 @@ $ fq -d mp4 dv opus.mp4
|
||||
| | | toc{}: 0x368-0x373 (11)
|
||||
| | | config{}: 0x368-0x368.5 (0.5)
|
||||
0x360| 00 | . | config: 0 0x368-0x368.5 (0.5)
|
||||
| | | mode: "SILK-only"
|
||||
| | | bandwidth: "NB"
|
||||
| | | mode: "silk_only"
|
||||
| | | bandwidth: "nb"
|
||||
| | | frame_size: 10
|
||||
0x360| 00 | . | stereo: false 0x368.5-0x368.6 (0.1)
|
||||
| | | frames_per_packet{}: 0x368.6-0x369 (0.2)
|
||||
@ -314,8 +314,8 @@ $ fq -d mp4 dv opus.mp4
|
||||
| | | toc{}: 0x2c-0xa5 (121)
|
||||
| | | config{}: 0x2c-0x2c.5 (0.5)
|
||||
0x020| f8 | . | config: 31 0x2c-0x2c.5 (0.5)
|
||||
| | | mode: "CELT-only"
|
||||
| | | bandwidth: "FB"
|
||||
| | | mode: "celt_only"
|
||||
| | | bandwidth: "fb"
|
||||
| | | frame_size: 20
|
||||
0x020| f8 | . | stereo: false 0x2c.5-0x2c.6 (0.1)
|
||||
| | | frames_per_packet{}: 0x2c.6-0x2d (0.2)
|
||||
@ -330,8 +330,8 @@ $ fq -d mp4 dv opus.mp4
|
||||
| | | toc{}: 0xa5-0x11e (121)
|
||||
| | | config{}: 0xa5-0xa5.5 (0.5)
|
||||
0x0a0| f8 | . | config: 31 0xa5-0xa5.5 (0.5)
|
||||
| | | mode: "CELT-only"
|
||||
| | | bandwidth: "FB"
|
||||
| | | mode: "celt_only"
|
||||
| | | bandwidth: "fb"
|
||||
| | | frame_size: 20
|
||||
0x0a0| f8 | . | stereo: false 0xa5.5-0xa5.6 (0.1)
|
||||
| | | frames_per_packet{}: 0xa5.6-0xa6 (0.2)
|
||||
@ -346,8 +346,8 @@ $ fq -d mp4 dv opus.mp4
|
||||
| | | toc{}: 0x11e-0x197 (121)
|
||||
| | | config{}: 0x11e-0x11e.5 (0.5)
|
||||
0x110| f8 | . | config: 31 0x11e-0x11e.5 (0.5)
|
||||
| | | mode: "CELT-only"
|
||||
| | | bandwidth: "FB"
|
||||
| | | mode: "celt_only"
|
||||
| | | bandwidth: "fb"
|
||||
| | | frame_size: 20
|
||||
0x110| f8 | . | stereo: false 0x11e.5-0x11e.6 (0.1)
|
||||
| | | frames_per_packet{}: 0x11e.6-0x11f (0.2)
|
||||
|
4
format/mp4/testdata/pssh.fqtest
vendored
@ -25,9 +25,9 @@ $ fq ddv pssh.mp4
|
||||
0x040| 01 00 | .. | count: 1 0x48-0x4a (2)
|
||||
| | | records[0:1]: 0x4a-0x47e (1076)
|
||||
| | | [0]{}: record 0x4a-0x47e (1076)
|
||||
0x040| 01 00 | .. | type: "Rights management header" (1) 0x4a-0x4c (2)
|
||||
0x040| 01 00 | .. | type: "rights_management_header" (1) 0x4a-0x4c (2)
|
||||
0x040| 30 04 | 0. | len: 1072 0x4c-0x4e (2)
|
||||
0x040| 3c 00| <.| xml: "<WRMHEADER xmlns=\"http://schemas.microsoft.com/..." 0x4e-0x47e (1072)
|
||||
0x040| 3c 00| <.| xml: "<WRMHEADER xmlns=\"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader\" version=\"4.0.0.0\"><DATA><PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>xIA3iIGpTEm5lJ6TeS/4pw==</KID><CHECKSUM>32NQEM0v8BU=</CHECKSUM><LA_URL>https://manifest.prod.boltdns.net/license/v1/cenc/playready/6240731308001/01af0a57-214d-4fdd-86fd-f792135ce46f/883780c4-a981-494c-b994-9e93792ff8a7?fastly_token=NjQ3MTU2YTZfYmE2ZjNjNDVlMDQ1NWE3MGMyZjAyYmQzNDVhMGQ3YWQ1ZWE0MzU4NGNjMzQ0NzhhOWVjY2ZlMTkyYjk0MTQ1MA%3D%3D</LA_URL></DATA></WRMHEADER>" 0x4e-0x47e (1072)
|
||||
0x050|57 00 52 00 4d 00 48 00 45 00 41 00 44 00 45 00|W.R.M.H.E.A.D.E.|
|
||||
0x060|52 00 20 00 78 00 6d 00 6c 00 6e 00 73 00 3d 00|R. .x.m.l.n.s.=.|
|
||||
0x070|22 00 68 00 74 00 74 00 70 00 3a 00 2f 00 2f 00|".h.t.t.p.:././.|
|
||||
|
BIN
format/mp4/testdata/qt_brand_zero_byte_hdlr_component_name.mp4
vendored
Normal file
23
format/mp4/testdata/qt_brand_zero_byte_hdlr_component_name.mp4.fqtest
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
$ fq dv qt_brand_zero_byte_hdlr_component_name.mp4
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: qt_brand_zero_byte_hdlr_component_name.mp4 (mp4) 0x0-0x40 (64)
|
||||
| | | boxes[0:2]: 0x0-0x40 (64)
|
||||
| | | [0]{}: box 0x0-0x20 (32)
|
||||
0x00|00 00 00 20 |... | size: 32 0x0-0x4 (4)
|
||||
0x00| 66 74 79 70 | ftyp | type: "ftyp" (File type and compatibility) 0x4-0x8 (4)
|
||||
0x00| 71 74 20 20 | qt | major_brand: "qt" 0x8-0xc (4)
|
||||
0x00| 20 05 03 00| ...| minor_version: 537199360 (0032.03) 0xc-0x10 (4)
|
||||
| | | brands[0:4]: 0x10-0x20 (16)
|
||||
0x10|71 74 20 20 |qt | [0]: "qt" brand 0x10-0x14 (4)
|
||||
0x10| 00 00 00 00 | .... | [1]: "\x00\x00\x00\x00" brand 0x14-0x18 (4)
|
||||
0x10| 00 00 00 00 | .... | [2]: "\x00\x00\x00\x00" brand 0x18-0x1c (4)
|
||||
0x10| 00 00 00 00| ....| [3]: "\x00\x00\x00\x00" brand 0x1c-0x20 (4)
|
||||
| | | [1]{}: box 0x20-0x40 (32)
|
||||
0x20|00 00 00 20 |... | size: 32 0x20-0x24 (4)
|
||||
0x20| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x24-0x28 (4)
|
||||
0x20| 00 | . | version: 0 0x28-0x29 (1)
|
||||
0x20| 00 00 00 | ... | flags: 0 0x29-0x2c (3)
|
||||
0x20| 00 00 00 00| ....| component_type: "" 0x2c-0x30 (4)
|
||||
0x30|6d 64 74 61 |mdta | component_subtype: "mdta" (Metadata Tags) 0x30-0x34 (4)
|
||||
0x30| 00 00 00 00 | .... | component_manufacturer: "" 0x34-0x38 (4)
|
||||
0x30| 00 00 00 00 | .... | component_flags: 0 0x38-0x3c (4)
|
||||
0x30| 00 00 00 00| ....| component_flags_mask: 0 0x3c-0x40 (4)
|
BIN
format/mp4/testdata/thmb.mp4
vendored
Normal file
10
format/mp4/testdata/thmb.mp4.fqtest
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
$ fq dv -o force=true thmb.mp4
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: thmb.mp4 (mp4) 0x0-0x14 (20)
|
||||
| | | boxes[0:1]: 0x0-0x14 (20)
|
||||
| | | [0]{}: box 0x0-0x14 (20)
|
||||
0x00|00 00 00 14 |.... | size: 20 0x0-0x4 (4)
|
||||
0x00| 74 68 6d 62 | thmb | type: "thmb" (Thumbnail image of the media) 0x4-0x8 (4)
|
||||
0x00| 00 | . | version: 0 0x8-0x9 (1)
|
||||
0x00| 00 00 00 | ... | flags: 0 0x9-0xc (3)
|
||||
0x00| 66 6f 72 6d| form| format: "form" 0xc-0x10 (4)
|
||||
0x10|64 61 74 61| |data| | image: raw bits 0x10-0x14 (4)
|
BIN
format/mp4/testdata/uinf.mp4
vendored
Normal file
22
format/mp4/testdata/uinf.mp4.fqtest
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
$ fq -d mp4 -o force=true dv uinf.mp4
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: uinf.mp4 (mp4) 0x0-0x64 (100)
|
||||
| | | boxes[0:1]: 0x0-0x64 (100)
|
||||
| | | [0]{}: box 0x0-0x64 (100)
|
||||
0x00|00 00 00 64 |...d | size: 100 0x0-0x4 (4)
|
||||
0x00| 75 69 6e 66 | uinf | type: "uinf" (A tool by which a vendor may provide access to additional information associated with a UUID) 0x4-0x8 (4)
|
||||
| | | boxes[0:2]: 0x8-0x64 (92)
|
||||
| | | [0]{}: box 0x8-0x32 (42)
|
||||
0x00| 00 00 00 2a | ...* | size: 42 0x8-0xc (4)
|
||||
0x00| 75 6c 73 74| ulst| type: "ulst" (A list of UUID’s) 0xc-0x10 (4)
|
||||
0x10|00 02 |.. | nu: 2 0x10-0x12 (2)
|
||||
| | | uids[0:2]: 0x12-0x32 (32)
|
||||
0x10| 6a 70 6a 70 6a 70 6a 70 6a 70 6a 70 6a 70| jpjpjpjpjpjpjp| [0]: raw bits uid 0x12-0x22 (16)
|
||||
0x20|6a 70 |jp |
|
||||
0x20| 61 62 61 62 61 62 61 62 61 62 61 62 61 62| ababababababab| [1]: raw bits uid 0x22-0x32 (16)
|
||||
0x30|61 62 |ab |
|
||||
| | | [1]{}: box 0x32-0x64 (50)
|
||||
0x30| 00 00 00 32 | ...2 | size: 50 0x32-0x36 (4)
|
||||
0x30| 75 72 6c 20 | url | type: "url" (A URL) 0x36-0x3a (4)
|
||||
0x30| 00 00 00 00 68 74| ....ht| data: raw bits 0x3a-0x64 (42)
|
||||
0x40|74 70 3a 2f 2f 77 77 77 2e 6f 70 65 6e 70 6c 61|tp://www.openpla|
|
||||
* |until 0x63.7 (end) (42) | |
|
12
format/mp4/testdata/vorbis.fqtest
vendored
@ -244,7 +244,7 @@ $ fq -d mp4 dv vorbis.mp4
|
||||
0x03d0| 10 | . | [1]: 16 lace 0x3d3-0x3d4 (1)
|
||||
| | | packets[0:3]: 0x3d4-0x10b1 (3293)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: packet (vorbis_packet) 0x3d4-0x3f2 (30)
|
||||
0x03d0| 01 | . | packet_type: "Identification" (1) 0x3d4-0x3d5 (1)
|
||||
0x03d0| 01 | . | packet_type: "identification" (1) 0x3d4-0x3d5 (1)
|
||||
0x03d0| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (valid) 0x3d5-0x3db (6)
|
||||
0x03d0| 00 00 00 00 | .... | vorbis_version: 0 (valid) 0x3db-0x3df (4)
|
||||
0x03d0| 02| .| audio_channels: 2 0x3df-0x3e0 (1)
|
||||
@ -257,7 +257,7 @@ $ fq -d mp4 dv vorbis.mp4
|
||||
0x03f0| 01 | . | padding0: raw bits (all zero) 0x3f1-0x3f1.7 (0.7)
|
||||
0x03f0| 01 | . | framing_flag: 1 (valid) 0x3f1.7-0x3f2 (0.1)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: packet (vorbis_packet) 0x3f2-0x402 (16)
|
||||
0x03f0| 03 | . | packet_type: "Comment" (3) 0x3f2-0x3f3 (1)
|
||||
0x03f0| 03 | . | packet_type: "comment" (3) 0x3f2-0x3f3 (1)
|
||||
0x03f0| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (valid) 0x3f3-0x3f9 (6)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| comment{}: (vorbis_comment) 0x3f9-0x401 (8)
|
||||
0x03f0| 00 00 00 00 | .... | vendor_length: 0 0x3f9-0x3fd (4)
|
||||
@ -268,7 +268,7 @@ $ fq -d mp4 dv vorbis.mp4
|
||||
0x0400| 01 | . | padding0: raw bits (all zero) 0x401-0x401.7 (0.7)
|
||||
0x0400| 01 | . | frame_bit: 1 (valid) 0x401.7-0x402 (0.1)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: packet (vorbis_packet) 0x402-0x10b1 (3247)
|
||||
0x0400| 05 | . | packet_type: "Setup" (5) 0x402-0x403 (1)
|
||||
0x0400| 05 | . | packet_type: "setup" (5) 0x402-0x403 (1)
|
||||
0x0400| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (valid) 0x403-0x409 (6)
|
||||
0x0400| 1c | . | vorbis_codebook_count: 29 0x409-0x40a (1)
|
||||
0x0400| 42 43 56 | BCV | codecooke_sync: 0x564342 (valid) 0x40a-0x40d (3)
|
||||
@ -373,17 +373,17 @@ $ fq -d mp4 dv vorbis.mp4
|
||||
| | | [0]{}: track 0x2c-0x1dd (433)
|
||||
| | | samples[0:3]: 0x2c-0x1dd (433)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: sample (vorbis_packet) 0x2c-0xe2 (182)
|
||||
0x0020| be | . | packet_type: "Audio" (0) 0x2c-0x2d (1)
|
||||
0x0020| be | . | packet_type: "audio" (0) 0x2c-0x2d (1)
|
||||
0x0020| b7 f2 81| ...| data: raw bits 0x2d-0xe2 (181)
|
||||
0x0030|46 74 15 42 0b 52 08 17 32 8e 43 08 65 84 84 f6|Ft.B.R..2.C.e...|
|
||||
* |until 0xe1.7 (181) | |
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: sample (vorbis_packet) 0xe2-0x12e (76)
|
||||
0x00e0| be | . | packet_type: "Audio" (0) 0xe2-0xe3 (1)
|
||||
0x00e0| be | . | packet_type: "audio" (0) 0xe2-0xe3 (1)
|
||||
0x00e0| 13 a2 9b 06 0a b6 ff 13 10 ff 25 62 ec| ..........%b.| data: raw bits 0xe3-0x12e (75)
|
||||
0x00f0|8f d9 f7 a2 11 72 ca 44 3b 21 ba 69 a0 60 fb 3f|.....r.D;!.i.`.?|
|
||||
* |until 0x12d.7 (75) | |
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: sample (vorbis_packet) 0x12e-0x1dd (175)
|
||||
0x0120| be | . | packet_type: "Audio" (0) 0x12e-0x12f (1)
|
||||
0x0120| be | . | packet_type: "audio" (0) 0x12e-0x12f (1)
|
||||
0x0120| a7| .| data: raw bits 0x12f-0x1dd (174)
|
||||
0x0130|f2 81 46 bb c2 48 52 08 27 b8 83 10 ca 08 b1 a7|..F..HR.'.......|
|
||||
* |until 0x1dc.7 (174) | |
|
||||
|
@ -4,7 +4,7 @@ package mpeg
|
||||
|
||||
import (
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/internal/mathex"
|
||||
"github.com/wader/fq/internal/mathx"
|
||||
"github.com/wader/fq/pkg/bitio"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
@ -50,7 +50,7 @@ func uEV(d *decode.D) uint64 { return expGolomb(d) }
|
||||
|
||||
func sEV(d *decode.D) int64 {
|
||||
v := expGolomb(d) + 1
|
||||
return mathex.ZigZag[uint64, int64](v) - -int64(v&1)
|
||||
return mathx.ZigZag[uint64, int64](v) - -int64(v&1)
|
||||
}
|
||||
|
||||
const (
|
||||
|
414
format/nes/nes.go
Normal file
@ -0,0 +1,414 @@
|
||||
package nes
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
)
|
||||
|
||||
//go:embed nes.jq
|
||||
//go:embed nes.md
|
||||
var nesFS embed.FS
|
||||
|
||||
func init() {
|
||||
interp.RegisterFormat(
|
||||
format.NES,
|
||||
&decode.Format{
|
||||
Description: "iNES/NES 2.0 cartridge ROM format",
|
||||
Groups: []*decode.Group{format.Probe},
|
||||
DecodeFn: decodeNES,
|
||||
})
|
||||
interp.RegisterFS(nesFS)
|
||||
}
|
||||
|
||||
type nesContext struct {
|
||||
nes20 bool
|
||||
trainerSize uint64
|
||||
prgROMSize uint64
|
||||
chrROMSize uint64
|
||||
miscROMs bool
|
||||
}
|
||||
|
||||
func iNESCHRRAMSize(mapper uint64, chrROMSize uint64) uint64 {
|
||||
switch mapper {
|
||||
case 74, 191, 194:
|
||||
return 2 * 1024
|
||||
case 192, 195:
|
||||
return 4 * 1024
|
||||
case 119, 176:
|
||||
return 8 * 1024
|
||||
}
|
||||
if chrROMSize == 0 {
|
||||
return 8 * 1024
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func romSize(lowerByte uint64, upperNibble uint64, kbs uint64) uint64 {
|
||||
if upperNibble < 0xf {
|
||||
return (lowerByte + (upperNibble << 8)) * kbs * 1024
|
||||
}
|
||||
|
||||
mm := (lowerByte << 6) >> 6
|
||||
exp := lowerByte >> 2
|
||||
return uint64(math.Pow(2, float64(exp))) * ((mm * 2) + 1)
|
||||
}
|
||||
|
||||
func getROMSizeMapper(kbs uint64) scalar.UintFn {
|
||||
return scalar.UintFn(func(s scalar.Uint) (scalar.Uint, error) {
|
||||
s.Sym = romSize(s.Actual, 0, kbs)
|
||||
return s, nil
|
||||
})
|
||||
}
|
||||
|
||||
func getFlagMapper(flag uint64, descMappers ...scalar.UintMap) scalar.UintFn {
|
||||
return scalar.UintFn(func(s scalar.Uint) (scalar.Uint, error) {
|
||||
s.Sym = s.Actual & flag
|
||||
|
||||
var ds scalar.Uint = s
|
||||
for _, dm := range descMappers {
|
||||
ds = dm[ds.SymUint()]
|
||||
}
|
||||
s.Description = ds.Description
|
||||
|
||||
return s, nil
|
||||
})
|
||||
}
|
||||
|
||||
var multiplyRAMSizeMapper = scalar.UintFn(func(s scalar.Uint) (scalar.Uint, error) {
|
||||
if s.Actual == 0 {
|
||||
s.Sym = 8 * 1024
|
||||
} else {
|
||||
s.Sym = s.Actual * 8 * 1024
|
||||
}
|
||||
|
||||
return s, nil
|
||||
})
|
||||
|
||||
var shiftRAMSizeMapper = scalar.UintFn(func(s scalar.Uint) (scalar.Uint, error) {
|
||||
if s.Actual > 0 {
|
||||
s.Sym = 64 << s.Actual
|
||||
}
|
||||
return s, nil
|
||||
})
|
||||
|
||||
var consoleTypeMapper = scalar.UintMap{
|
||||
0: {Sym: "nes", Description: "Nintendo Entertainment System/Family Computer"},
|
||||
1: {Sym: "vs", Description: "Nintendo Vs. System"},
|
||||
2: {Sym: "pc10", Description: "Nintendo Playchoice 10"},
|
||||
3: {Sym: "ext", Description: "Extended Console Type"},
|
||||
}
|
||||
|
||||
var timingModeMapper = scalar.UintMap{
|
||||
0: {Sym: "ntsc", Description: "RP2C02 (NTSC NES)"},
|
||||
1: {Sym: "pal", Description: "RP2C07 (Licensed PAL NES)"},
|
||||
2: {Sym: "multi", Description: "Multiple-region"},
|
||||
3: {Sym: "dendy", Description: "UA6538 (Dendy)"},
|
||||
}
|
||||
|
||||
var vsPPUMapper = scalar.UintMap{
|
||||
0: {Description: "RP2C03B"},
|
||||
1: {Description: "RP2C03G"},
|
||||
2: {Description: "RP2C04-0001"},
|
||||
3: {Description: "RP2C04-0002"},
|
||||
4: {Description: "RP2C04-0003"},
|
||||
5: {Description: "RP2C04-0004"},
|
||||
6: {Description: "RC2C03B"},
|
||||
7: {Description: "RC2C03C"},
|
||||
8: {Description: "RC2C05-01"},
|
||||
9: {Description: "RC2C05-02"},
|
||||
10: {Description: "RC2C05-03"},
|
||||
11: {Description: "RC2C05-04"},
|
||||
12: {Description: "RC2C05-05"},
|
||||
}
|
||||
|
||||
var vsHardwareMapper = scalar.UintMap{
|
||||
0: {Description: "Vs. Unisystem (normal)"},
|
||||
1: {Description: "Vs. Unisystem (RBI Baseball protection)"},
|
||||
2: {Description: "Vs. Unisystem (TKO Boxing protection)"},
|
||||
3: {Description: "Vs. Unisystem (Super Xevious protection)"},
|
||||
4: {Description: "Vs. Unisystem (Vs. Ice Climber Japan protection)"},
|
||||
5: {Description: "Vs. Dual System (normal)"},
|
||||
6: {Description: "Vs. Dual System (Raid on Bungeling Bay protection)"},
|
||||
}
|
||||
|
||||
var extConsoleMapper = scalar.UintMap{
|
||||
0: {Description: "[Regular NES/Famicom/Dendy]"},
|
||||
1: {Description: "[Nintendo Vs. System]"},
|
||||
2: {Description: "[Playchoice 10]"},
|
||||
3: {Description: "Regular Famiclone, but with CPU that supports Decimal Mode"},
|
||||
4: {Description: "Regular NES/Famicom with EPSM module or plug-through cartridge"},
|
||||
5: {Description: "V.R. Technology VT01 with red/cyan STN palette"},
|
||||
6: {Description: "V.R. Technology VT02"},
|
||||
7: {Description: "V.R. Technology VT03"},
|
||||
8: {Description: "V.R. Technology VT09"},
|
||||
9: {Description: "V.R. Technology VT32"},
|
||||
10: {Description: "V.R. Technology VT369"},
|
||||
11: {Description: "UMC UM6578"},
|
||||
12: {Description: "Famicom Network System"},
|
||||
}
|
||||
|
||||
var expDeviceMapper = scalar.UintMap{
|
||||
0: {Description: "Unspecified"},
|
||||
1: {Description: "Standard NES/Famicom controllers"},
|
||||
2: {Description: "NES Four Score/Satellite with two additional standard controllers"},
|
||||
3: {Description: "Famicom Four Players Adapter with two additional standard controllers using the 'simple' protocol"},
|
||||
4: {Description: "Vs. System (1P via $4016)"},
|
||||
5: {Description: "Vs. System (1P via $4017)"},
|
||||
6: {Description: "Reserved"},
|
||||
7: {Description: "Vs. Zapper"},
|
||||
8: {Description: "Zapper ($4017)"},
|
||||
9: {Description: "Two Zappers"},
|
||||
10: {Description: "Bandai Hyper Shot Lightgun"},
|
||||
11: {Description: "Power Pad Side A"},
|
||||
12: {Description: "Power Pad Side B"},
|
||||
13: {Description: "Family Trainer Side A"},
|
||||
14: {Description: "Family Trainer Side B"},
|
||||
15: {Description: "Arkanoid Vaus Controller (NES)"},
|
||||
16: {Description: "Arkanoid Vaus Controller (Famicom)"},
|
||||
17: {Description: "Two Vaus Controllers plus Famicom Data Recorder"},
|
||||
18: {Description: "Konami Hyper Shot Controller"},
|
||||
19: {Description: "Coconuts Pachinko Controller"},
|
||||
20: {Description: "Exciting Boxing Punching Bag (Blowup Doll)"},
|
||||
21: {Description: "Jissen Mahjong Controller"},
|
||||
22: {Description: "Party Tap "},
|
||||
23: {Description: "Oeka Kids Tablet"},
|
||||
24: {Description: "Sunsoft Barcode Battler"},
|
||||
25: {Description: "Miracle Piano Keyboard"},
|
||||
26: {Description: "Pokkun Moguraa (Whack-a-Mole Mat and Mallet)"},
|
||||
27: {Description: "Top Rider (Inflatable Bicycle)"},
|
||||
28: {Description: "Double-Fisted (Requires or allows use of two controllers by one player)"},
|
||||
29: {Description: "Famicom 3D System"},
|
||||
30: {Description: "Doremikko Keyboard"},
|
||||
31: {Description: "R.O.B. Gyro Set"},
|
||||
32: {Description: "Famicom Data Recorder ('silent' keyboard)"},
|
||||
33: {Description: "ASCII Turbo File"},
|
||||
34: {Description: "IGS Storage Battle Box"},
|
||||
35: {Description: "Family BASIC Keyboard plus Famicom Data Recorder"},
|
||||
36: {Description: "Dongda PEC-586 Keyboard"},
|
||||
37: {Description: "Bit Corp. Bit-79 Keyboard"},
|
||||
38: {Description: "Subor Keyboard"},
|
||||
39: {Description: "Subor Keyboard plus mouse (3x8-bit protocol)"},
|
||||
40: {Description: "Subor Keyboard plus mouse (24-bit protocol via $4016)"},
|
||||
41: {Description: "SNES Mouse ($4017.d0)"},
|
||||
42: {Description: "Multicart"},
|
||||
43: {Description: "Two SNES controllers replacing the two standard NES controllers"},
|
||||
44: {Description: "RacerMate Bicycle"},
|
||||
45: {Description: "U-Force"},
|
||||
46: {Description: "R.O.B. Stack-Up"},
|
||||
47: {Description: "City Patrolman Lightgun"},
|
||||
48: {Description: "Sharp C1 Cassette Interface"},
|
||||
49: {Description: "Standard Controller with swapped Left-Right/Up-Down/B-A"},
|
||||
50: {Description: "Excalibur Sudoku Pad"},
|
||||
51: {Description: "ABL Pinball"},
|
||||
52: {Description: "Golden Nugget Casino extra buttons"},
|
||||
53: {Description: "Unknown famiclone keyboard used by the 'Golden Key' educational cartridge"},
|
||||
54: {Description: "Subor Keyboard plus mouse (24-bit protocol via $4017)"},
|
||||
55: {Description: "Port test controller"},
|
||||
56: {Description: "Bandai Multi Game Player Gamepad buttons"},
|
||||
57: {Description: "Venom TV Dance Mat"},
|
||||
58: {Description: "LG TV Remote Control"},
|
||||
59: {Description: "Famicom Network Controller"},
|
||||
60: {Description: "King Fishing Controller"},
|
||||
}
|
||||
|
||||
func decodeFileHeader(d *decode.D, nc *nesContext) {
|
||||
// byte 0-3
|
||||
d.FieldRawLen("identifier", 4*8, d.AssertBitBuf([]byte{0x4e, 0x45, 0x53, 0x1a})) // NES<EOF>
|
||||
|
||||
// Peek nes20_identifier
|
||||
d.SeekRel(28)
|
||||
nes20 := d.PeekUintBits(2)
|
||||
d.SeekRel(-28)
|
||||
nc.nes20 = nes20 == 0b10
|
||||
|
||||
// byte 4-5
|
||||
var prgROMSize0, chrROMSize0 uint64
|
||||
if nes20 == 0b10 {
|
||||
prgROMSize0 = d.FieldU8("prg_rom_size0")
|
||||
chrROMSize0 = d.FieldU8("chr_rom_size0")
|
||||
} else {
|
||||
prgROMSize := d.FieldU8("prg_rom_size", getROMSizeMapper(16))
|
||||
chrROMSize := d.FieldU8("chr_rom_size", getROMSizeMapper(8))
|
||||
nc.prgROMSize = romSize(prgROMSize, 0, 16)
|
||||
nc.chrROMSize = romSize(chrROMSize, 0, 8)
|
||||
}
|
||||
|
||||
// byte 6
|
||||
mapper0 := d.FieldU4("mapper0")
|
||||
d.FieldU1("alternative_nametables", scalar.UintMapSymStr{0: "no", 1: "yes"})
|
||||
trainer := d.FieldU1("trainer", scalar.UintMapSymStr{0: "no", 1: "yes"})
|
||||
d.FieldU1("battery", scalar.UintMapSymStr{0: "no", 1: "yes"})
|
||||
d.FieldU1("nametable_layout", scalar.UintMapSymStr{0: "vertical", 1: "horizontal"})
|
||||
|
||||
// byte 7
|
||||
mapper1 := d.FieldU4("mapper1")
|
||||
d.FieldU2("nes20_identifier", scalar.UintMap{0b00: {Sym: "no", Description: "iNES"}, 0b10: {Sym: "yes", Description: "NES 2.0"}})
|
||||
consoleType := d.FieldU2("console_type", consoleTypeMapper)
|
||||
|
||||
if nc.nes20 { // NES 2.0
|
||||
// byte 8
|
||||
d.FieldU4("submapper")
|
||||
mapper2 := d.FieldU4("mapper2")
|
||||
d.FieldValueUint("mapper", mapper0+(mapper1<<4)+(mapper2<<8))
|
||||
|
||||
// byte 9
|
||||
chrROMSize1 := d.FieldU4("chr_rom_size1")
|
||||
prgROMSize1 := d.FieldU4("prg_rom_size1")
|
||||
nc.chrROMSize = romSize(chrROMSize0, chrROMSize1, 8)
|
||||
d.FieldValueUint("chr_rom_size", nc.chrROMSize)
|
||||
nc.prgROMSize = romSize(prgROMSize0, prgROMSize1, 16)
|
||||
d.FieldValueUint("prg_rom_size", nc.prgROMSize)
|
||||
|
||||
// byte 10
|
||||
d.FieldU4("prg_nvram_size", shiftRAMSizeMapper)
|
||||
d.FieldU4("prg_ram_size", shiftRAMSizeMapper)
|
||||
|
||||
// byte 11
|
||||
d.FieldU4("chr_nvram_size", shiftRAMSizeMapper)
|
||||
d.FieldU4("chr_ram_size", shiftRAMSizeMapper)
|
||||
|
||||
// byte 12
|
||||
d.FieldU8("cpu_ppu_timing_mode", getFlagMapper(0x3), timingModeMapper)
|
||||
|
||||
// byte 13
|
||||
switch consoleType {
|
||||
case 1:
|
||||
d.FieldU4("vs_hardware_type", vsHardwareMapper)
|
||||
d.FieldU4("vs_ppu_type", vsPPUMapper)
|
||||
case 3:
|
||||
d.FieldU8("ext_console_type", getFlagMapper(0xf, extConsoleMapper))
|
||||
default:
|
||||
d.FieldU8("byte_13")
|
||||
}
|
||||
|
||||
// byte 14
|
||||
miscROMs := d.FieldU8("misc_roms", getFlagMapper(0x3))
|
||||
nc.miscROMs = (miscROMs & 0x3) > 0
|
||||
|
||||
// byte 15
|
||||
d.FieldU8("default_exp_device", getFlagMapper(0x3f, expDeviceMapper))
|
||||
|
||||
} else { // iNES
|
||||
mapper := mapper0 + (mapper1 << 4)
|
||||
d.FieldValueUint("mapper", mapper)
|
||||
d.FieldValueUint("chr_ram_size", iNESCHRRAMSize(mapper, nc.chrROMSize))
|
||||
|
||||
// byte 8
|
||||
d.FieldU8("prg_ram_size", multiplyRAMSizeMapper)
|
||||
|
||||
// byte 9
|
||||
d.FieldU8("byte_9")
|
||||
|
||||
// byte 10
|
||||
d.FieldU8("byte_10")
|
||||
|
||||
// byte 11-15
|
||||
d.FieldRawLen("unused", 5*8, d.AssertBitBuf([]byte{0x00, 0x00, 0x00, 0x00, 0x00}))
|
||||
}
|
||||
|
||||
if trainer == 1 {
|
||||
nc.trainerSize = 512
|
||||
} else {
|
||||
nc.trainerSize = 0
|
||||
}
|
||||
}
|
||||
|
||||
func decodePRGROM(d *decode.D) {
|
||||
for !d.End() {
|
||||
peek := d.PeekUintBits(8)
|
||||
peekTyp := opMap[peek].Type
|
||||
peekArgL := ArgLength(peekTyp)
|
||||
|
||||
if d.BitsLeft() < int64(1+peekArgL)*8 {
|
||||
d.FieldRawLen("padding", d.BitsLeft())
|
||||
} else {
|
||||
d.FieldStruct("instruction", func(d *decode.D) {
|
||||
op := d.FieldU8("op_code", scalar.UintFn(func(s scalar.Uint) (scalar.Uint, error) {
|
||||
opLookup := opMap[s.Actual]
|
||||
s.Sym = opLookup.Name
|
||||
|
||||
return s, nil
|
||||
}))
|
||||
|
||||
typ := opMap[op].Type
|
||||
argL := ArgLength(typ)
|
||||
switch argL {
|
||||
case 1:
|
||||
d.FieldU8("args", GetArgFormatter(typ))
|
||||
case 2:
|
||||
d.FieldU16("args", GetArgFormatter(typ))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func decodeTilePart(d *decode.D) scalar.Uint {
|
||||
a := d.U64()
|
||||
sym := fmt.Sprintf("%064b", a)
|
||||
|
||||
return scalar.Uint{Actual: a, Sym: sym}
|
||||
}
|
||||
|
||||
func decodeCHRROM(d *decode.D) {
|
||||
d.Endian = decode.BigEndian
|
||||
for !d.End() {
|
||||
d.FieldStruct("tile", func(d *decode.D) {
|
||||
lsbsScalar := d.FieldScalarUintFn("pixels_lsb", decodeTilePart)
|
||||
msbsScalar := d.FieldScalarUintFn("pixels_msb", decodeTilePart)
|
||||
|
||||
final := make([]rune, 64*3)
|
||||
msbsStr := []rune(msbsScalar.SymStr())
|
||||
lsbsStr := []rune(lsbsScalar.SymStr())
|
||||
|
||||
for r := 0; r < 8; r++ {
|
||||
msbRow := msbsStr[r*8 : r*8+8]
|
||||
lsbRow := lsbsStr[r*8 : r*8+8]
|
||||
for c := 0; c < 8; c++ {
|
||||
final[r*24+c*3] = msbRow[c]
|
||||
final[r*24+c*3+1] = lsbRow[c]
|
||||
final[r*24+c*3+2] = rune(' ')
|
||||
}
|
||||
}
|
||||
|
||||
d.FieldValueStr("combined", string(final))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func decodeNES(d *decode.D) any {
|
||||
var nc nesContext
|
||||
|
||||
d.Endian = decode.LittleEndian
|
||||
|
||||
d.FramedFn(16*8, func(d *decode.D) {
|
||||
d.FieldStruct("header", func(d *decode.D) { decodeFileHeader(d, &nc) })
|
||||
})
|
||||
|
||||
if nc.trainerSize > 0 {
|
||||
d.FramedFn(int64(nc.trainerSize)*8, func(d *decode.D) {
|
||||
d.FieldArray("trainer", decodePRGROM)
|
||||
})
|
||||
}
|
||||
|
||||
d.FramedFn(int64(nc.prgROMSize)*8, func(d *decode.D) {
|
||||
d.FieldArray("prg_rom", decodePRGROM)
|
||||
})
|
||||
|
||||
d.FramedFn(int64(nc.chrROMSize)*8, func(d *decode.D) {
|
||||
d.FieldArray("chr_rom", decodeCHRROM)
|
||||
})
|
||||
|
||||
if nc.miscROMs {
|
||||
d.FieldRawLen("misc_roms", d.BitsLeft())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
15
format/nes/nes.jq
Normal file
@ -0,0 +1,15 @@
|
||||
def nes_toasm:
|
||||
select(.op_code and (.args // "")) | "\(.op_code) \(.args // "")";
|
||||
def nes_tokitty($size):
|
||||
def _sub:
|
||||
( gsub("00"; "\u0022\u0022\u0022")
|
||||
| gsub("01"; "\u007F\u0022\u0022")
|
||||
| gsub("10"; "\u0022\u007F\u0022")
|
||||
| gsub("11"; "\u0022\u0022\u007F")
|
||||
| gsub(" "; "")
|
||||
);
|
||||
( "\(.combined | _sub)"
|
||||
| "\\e_Ga=T,f=24,s=8,v=8,c=\(2*$size),r=\(1*$size);" + @base64 + "\\e\\\\\\n"
|
||||
);
|
||||
def nes_tokitty:
|
||||
nes_tokitty(1);
|
33
format/nes/nes.md
Normal file
@ -0,0 +1,33 @@
|
||||
### Limitations
|
||||
|
||||
- `prg_rom`, `chr_rom` and `trainer` fields may contain data that is just random
|
||||
junk from the memory chips, since they are of a fixed size.
|
||||
- The `nes_toasm` function outputs ALL opcodes, including the unofficial ones,
|
||||
which means that none of the regular assemblers can recompile it.
|
||||
- The `nes_tokitty` function works on tiles in `chr_rom` but only outputs a Kitty
|
||||
graphics compatible string. You need to manually `printf` that string to get
|
||||
Kitty (or another compatible terminal) to output the graphics.
|
||||
|
||||
### Decompile PRG ROM
|
||||
```
|
||||
$ fq -r '.prg_rom[] | nes_toasm' file.nes
|
||||
```
|
||||
|
||||
### Print out first CHR ROM tile in Kitty (or Konsole, wayst, WezTerm) at size 5
|
||||
```
|
||||
$ printf $(fq -r -d nes '.chr_rom[0] | nes_tokitty(5)' file.nes)
|
||||
```
|
||||
|
||||
### Print out all CHR ROM tiles in Kitty (with Bash) at size 5
|
||||
```
|
||||
$ for line in $(fq -r '.chr_rom[] | nes_tokitty(5)' file.nes);do printf "%b%s" "$line";done
|
||||
```
|
||||
|
||||
### Authors
|
||||
- Mikael Lofjärd mikael.lofjard@gmail.com, original author
|
||||
|
||||
### References
|
||||
- https://www.nesdev.org/wiki/INES
|
||||
- https://www.nesdev.org/wiki/NES_2.0
|
||||
- https://www.nesdev.org/wiki/CPU
|
||||
- https://bugzmanov.github.io/nes_ebook/chapter_6_3.html
|