1
1
mirror of https://github.com/wader/fq.git synced 2024-11-26 10:33:53 +03:00
Commit Graph

64 Commits

Author SHA1 Message Date
Mattias Wadman
a7a101ca67 doc,help: Nicer format help and move help tests into each format
Also add authors to avro and macho decoders

Generated with:
for i in $(go run . -r -n '_registry | [([([.files[][].name | split(".")[0]] | unique[]), (.formats[].name)] | count[] | select(.[1] == 2)[0]), (.formats[] | select(.decode_in_arg).name)] | unique[]'); do DIR=$(dirname $(find format -name $i.go)); echo "$ fq -h $i" > "$DIR/testdata/help_$i.fqtest" ; done
2022-09-22 23:07:58 +02:00
Mattias Wadman
abd19ed89b doc: Fix format sections a bit 2022-09-11 09:55:56 +02:00
Mattias Wadman
87b2c6c10c help,doc: Use markdown for format documentation again
Markdown is used as is in online documentation and in cli the markdown decoder
is used to decode and the some jq code massages it into something cli friendly.

Was just too much of a mess to have doc in jq.
2022-09-11 00:53:29 +02:00
Mattias Wadman
29005c70bf interp,dump: Show address bar for root, nested roots and on format change
Also increase indent for nested roots a bit.

Makes it a bit easier to read i think.
2022-08-09 18:09:41 +02:00
Mattias Wadman
4dec7ff64b
Merge pull request #364 from wader/decode-refactor-scalar-type-assert
decode: Refactor to use scalar type assert helper
2022-08-08 18:17:51 +02:00
Mattias Wadman
502f451cc3 decode: Refactor to use scalar type assert helper 2022-08-08 18:09:49 +02:00
Mattias Wadman
b2d4e6d94d macho: Decode cmd symtab symbols 2022-08-08 18:02:59 +02:00
Mattias Wadman
725c8e83ab macho: Split into macho/macho_fat, fix offset issue and add string decoding
Split fat macho into own decoder macho_fat. This also fixes issue with section
offset etc not being correct as they are from the start of each embedded file.

Make all address and offset field be in hex.

Decode __cstring, __ustring and __cfstring sections.

Fix LC_ENCRYPTION_INFO_64 missing pading issue.

Skip ranging for __bss and __common as they dont have any data in the file.

Simplifed magic handling a bit and add symbols.

Simplified state struct field, had redudant struct.
2022-08-02 14:36:53 +02:00
Mattias Wadman
840292ba6e decode: Simplify compound range sort behaviour
Doing it thru a propery in the decode fn feels a bit hidden and will
also not get set on failed decoding.

Now array is not range sorted, logic is you care about index number and ordering.
Struct is range sorted as you will prefer to fields by name.
2022-08-01 17:17:54 +02:00
Mattias Wadman
9e447c9af1 interp: Use RegisterFS instead of format files 2022-07-27 13:22:59 +02:00
Mattias Wadman
342612eb7e dev: Cleanup linters and fix some unused args 2022-07-19 18:33:50 +02:00
Mattias Wadman
1ddea1ada3 interp,format: Refactor registry usage and use function helpers
Move registry to interp and add support for functions and filesystems.
This will be used later for allow formats to add own functions and fq code.

Add gojqextra function helpers to have more comfortable API to add functions.
Takes care of argument type casting and JQValue:s and some more things.

Refactor interp package to use new function helper and registry. Probably
fixes a bunch of JQValue bugs and other type errors.

Refactor out some mpeg nal things to mpeg format.

Refactor interp jq code into display.q and init.jq.

Remove undocumented aes_ctr funciton, was a test. Hopefully will add more crypto things laster.
2022-07-16 19:24:13 +02:00
Mattias Wadman
e9d9f8aef9 fq: Use go 1.18
Rename s/interface{}/any/g
Preparation for using generics in decode API and native jq funcations etc
Remove some unused linter ignores as linter has been fixed
2022-05-20 15:23:16 +02:00
Mattias Wadman
9133f0e527 scalar: Add *Fn type to map value and clearer naming
Should replace most of this with generics at some point
2022-05-07 12:46:34 +02:00
Mattias Wadman
c4dd518e04 decode: Make compound range sort optional
Some formats might want to control child order
mp4: Keep tracks in track id order
dns: Keep label component order
elf: Keep seciton order
macho: Keep command and section order
2022-05-03 16:16:09 +02:00
Mattias Wadman
f4480c6fe5 decode,interp: Support for format specific options
interp: Refactor format help and also include options
interp: Add -o name=@path to load file content as value (not documented yet, might change)
interp,decode: Expose decode out value as _out (might change)
interp: Refactor foramts.jq into format_{decode,func,include}.jq
interp: Refactor torepr into _format_func for generic format function overloading
interp: Refactor -o options parsing to be more generic and collect unknowns options to be used as format options
decode of decode alises
func for format overloaded functions
include for format specific jq functions (also _help, torepr etc)
flac_frame: Add bits_per_sample option
mp3: Add max_unique_header_config and max_sync_seek options
mp4: Add decode_samples and allow_truncate options
avc_au: Has length_size option
hevc_au: Has length_size option
aac_frame: Has object_typee option
doc: Rewrite format doc generation, less hack more jq
2022-05-01 17:08:30 +02:00
Mattias Wadman
d6c31dac2b macho: Add section and encryption_info raw data fields 2022-04-25 20:26:35 +02:00
Mattias Wadman
5424eed703 macho: Cleanup syms and remove redundant fat_arch struct 2022-04-11 22:09:51 +02:00
Mattias Wadman
f8fd6b7f48 mp4: Add more HEIF boxes
Add scalar.*ToDesceription mapper and refactor to use it
2022-04-07 19:11:49 +02:00
Mattias Wadman
5ff67e4cfe formats: Sym and field name cleanup to be more jq friendly 2022-04-05 13:59:57 +02:00
Mattias Wadman
920629f5fd doc: Regenerate and fix macho section size
Make macho format documentaion a bit more consistent.
2022-03-03 09:55:53 +01:00
siddik.acil
b0911af204 macho: docs review changes 2022-02-27 19:31:18 +01:00
siddik.acil
04eae939eb macho: add basic docs 2022-02-26 19:58:40 +01:00
siddik.acil
228757b92a macho: review fixes 2022-02-21 20:32:18 +01:00
siddik.acil
78699f3ace macho: parse flags individually 2022-02-21 20:32:18 +01:00
siddik.acil
3991c51ab5 macho: handle unknown lc_commands better 2022-02-21 20:32:18 +01:00
siddik.acil
ef2919b300 macho: introduce arm and fat tests 2022-02-21 20:32:18 +01:00
siddik.acil
d1f093ce80 macho: fix fat header decode bug 2022-02-21 20:32:18 +01:00
siddik.acil
d47e04c494 fixup! macho: CPU_SUBTYPE_MULTIPLE and TYPE_ALL are 0xff_ff_ff_ff 2022-02-21 20:32:18 +01:00
siddik.acil
c5918d234b macho: CPU_SUBTYPE_MULTIPLE and TYPE_ALL are 0xff_ff_ff_ff 2022-02-21 20:32:18 +01:00
siddik.acil
5ee9a23c14 macho: review fixes 2022-02-21 20:32:18 +01:00
siddik.acil
5c97420989 macho: TS string to UTC 2022-02-21 20:32:18 +01:00
siddik.acil
2ccb8087b0 macho: update test cases v to dv 2022-02-21 20:32:18 +01:00
siddik.acil
e3daee7d94 macho: simplify thread state decoder 2022-02-21 20:32:18 +01:00
siddik.acil
70c9d5196c macho: thread state visualization 2022-02-21 20:32:18 +01:00
siddik.acil
a4789dc18f macho: timestamp mapper 2022-02-21 20:32:18 +01:00
siddik.acil
66feebc565 macho: change parseFlags impl for ordered results 2022-02-21 20:32:18 +01:00
siddik.acil
74abe99095 macho: update tests
parseFlags reorders flags every time the program is executed which is non-deterministic as golang maps are unordered.
2022-02-21 20:32:18 +01:00
siddik.acil
a86e704310 macho: add section type parsing 2022-02-21 20:32:18 +01:00
siddik.acil
20e5be3f57 macho: delete ar decoder code 2022-02-21 20:32:18 +01:00
siddik.acil
5a48cb30a6 macho: refactor prebound_dylib 2022-02-21 20:32:18 +01:00
siddik.acil
4016ad0ba3 macho: parse segment section flags 2022-02-21 20:32:18 +01:00
siddik.acil
a29bfca5ad macho: expand filetypes and header flags 2022-02-21 20:32:17 +01:00
siddik.acil
98c9840d52 macho: linting changes for ar parse 2022-02-21 20:32:17 +01:00
siddik.acil
3334750328 macho: reuse ar decoder 2022-02-21 20:32:17 +01:00
siddik.acil
e199d2190f macho: basic impl for ar and fat file parsing
untested
2022-02-21 20:32:17 +01:00
siddik.acil
5c5bd87914 macho: add fqtest actualization
leave libbbb.a out
2022-02-21 20:32:17 +01:00
siddik.acil
0d648928ce macho: fix null in segname sectname
add OPCODE_DECODER comment for future
2022-02-21 20:32:17 +01:00
siddik.acil
141a8e84be macho: mach_header_X to header
arch_bits as value fields
2022-02-21 20:32:17 +01:00
siddik.acil
2638f419eb macho: add darwin_amd64 tests 2022-02-21 20:32:17 +01:00