From 758b2d0e3489cae2386bceb927f1f5141f0b5ba8 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Mon, 28 Feb 2022 10:28:21 +0100 Subject: [PATCH] doc: Regenerate after macho merge --- README.md | 2 +- doc/formats.md | 29 +- doc/formats.svg | 1216 +++++++++++++++++++++++------------------------ 3 files changed, 637 insertions(+), 610 deletions(-) diff --git a/README.md b/README.md index 6a5d9e45..568f8b4d 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ id3v2, ipv4_packet, jpeg, json, -macho, +[macho](doc/formats.md#macho), [matroska](doc/formats.md#matroska), mp3, mp3_frame, diff --git a/doc/formats.md b/doc/formats.md index 07b29b42..b7e925a3 100644 --- a/doc/formats.md +++ b/doc/formats.md @@ -51,7 +51,7 @@ |`ipv4_packet` |Internet protocol v4 packet |`udp_datagram` `tcp_segment` `icmp`| |`jpeg` |Joint Photographic Experts Group file |`exif` `icc_profile`| |`json` |JSON || -|`macho` |Mach-O macOS executable || +|[`macho`](#macho) |Mach-O macOS executable || |[`matroska`](#matroska) |Matroska file |`aac_frame` `av1_ccr` `av1_frame` `avc_au` `avc_dcr` `flac_frame` `flac_metadatablocks` `hevc_au` `hevc_dcr` `image` `mp3_frame` `mpeg_asc` `mpeg_pes_packet` `mpeg_spu` `opus_packet` `vorbis_packet` `vp8_frame` `vp9_cfm` `vp9_frame`| |`mp3` |MP3 file |`id3v2` `id3v1` `id3v11` `apev2` `mp3_frame`| |`mp3_frame` |MPEG audio layer 3 frame |`xing`| @@ -182,6 +182,33 @@ fq -d cbor 'torepr | .field' file.cbor fq -d cbor 'torepr | grep("abc")' file.cbor ``` +### macho + +Decodes vanilla and FAT Macho binaries + +## Examples + +To decode the MacOS build of `fq` + +``` +fq . -d macho fq +``` + +--- +**NOTE** +`-d macho` is usually not needed. + +--- + +Can be used to decode nested parts: + +``` +./fq '.load_commands[] | select(.cmd=="segment_64")' -d macho fq +``` + +## References: +- https://github.com/aidansteele/osx-abi-macho-file-format-reference + ### matroska Supports `matroska_path`: diff --git a/doc/formats.svg b/doc/formats.svg index eac21a7e..da58aee1 100644 --- a/doc/formats.svg +++ b/doc/formats.svg @@ -4,32 +4,32 @@ - + formats - + adts - -adts - -adts_frame + +adts + +adts_frame adts_frame - -adts_frame - -aac_frame + +adts_frame + +aac_frame adts:e->adts_frame:n - - + + @@ -40,206 +40,206 @@ adts_frame:e->aac_frame:n - - + + apev2 - -apev2 - -image + +apev2 + +image image - -image + +image apev2:e->image:n - - + + jpeg - -jpeg - -exif - -icc_profile + +jpeg + +exif + +icc_profile image->jpeg:n - - + + mp4 - -mp4 - -aac_frame - -av1_ccr - -av1_frame - -flac_frame - -flac_metadatablocks - -id3v2 - -image - -jpeg - -mp3_frame - -avc_au - -avc_dcr - -mpeg_es - -hevc_au - -hevc_dcr - -mpeg_pes_packet - -opus_packet - -protobuf_widevine - -pssh_playready - -vorbis_packet - -vp9_frame - -vpx_ccr + +mp4 + +aac_frame + +av1_ccr + +av1_frame + +flac_frame + +flac_metadatablocks + +id3v2 + +image + +jpeg + +mp3_frame + +avc_au + +avc_dcr + +mpeg_es + +hevc_au + +hevc_dcr + +mpeg_pes_packet + +opus_packet + +protobuf_widevine + +pssh_playready + +vorbis_packet + +vp9_frame + +vpx_ccr image->mp4:n - - + + png - -png - -icc_profile - -exif + +png + +icc_profile + +exif image->png:n - - + + tiff - -tiff - -icc_profile + +tiff + +icc_profile image->tiff:n - - + + webp - -webp - -vp8_frame + +webp + +vp8_frame image->webp:n - - + + gif - -gif + +gif image->gif:n - - + + ar - -ar - -probe + +ar + +probe probe - -probe + +probe ar:e->probe:n - - + + probe->adts:n - - + + probe->ar:n - - + + bzip2 - -bzip2 - -probe + +bzip2 + +probe probe->bzip2:n - - + + flac -flac +flac flac_metadatablocks @@ -248,488 +248,488 @@ probe->flac:n - - + + gzip - -gzip - -probe + +gzip + +probe probe->gzip:n - - + + probe->jpeg:n - - + + matroska - -matroska - -aac_frame - -av1_ccr - -av1_frame - -avc_au - -avc_dcr - -flac_frame - -flac_metadatablocks - -hevc_au - -hevc_dcr - -image - -mp3_frame - -mpeg_asc - -mpeg_pes_packet - -mpeg_spu - -opus_packet - -vorbis_packet - -vp8_frame - -vp9_cfm - -vp9_frame + +matroska + +aac_frame + +av1_ccr + +av1_frame + +avc_au + +avc_dcr + +flac_frame + +flac_metadatablocks + +hevc_au + +hevc_dcr + +image + +mp3_frame + +mpeg_asc + +mpeg_pes_packet + +mpeg_spu + +opus_packet + +vorbis_packet + +vp8_frame + +vp9_cfm + +vp9_frame probe->matroska:n - - + + mp3 - -mp3 - -id3v2 - -id3v1 - -id3v11 - -apev2 - -mp3_frame + +mp3 + +id3v2 + +id3v1 + +id3v11 + +apev2 + +mp3_frame probe->mp3:n - - + + probe->mp4:n - - + + ogg - -ogg - -ogg_page - -vorbis_packet - -opus_packet - -flac_metadatablock - -flac_frame + +ogg + +ogg_page + +vorbis_packet + +opus_packet + +flac_metadatablock + +flac_frame probe->ogg:n - - + + pcap - -pcap - -link_frame - -tcp_stream - -ipv4_packet + +pcap + +link_frame + +tcp_stream + +ipv4_packet probe->pcap:n - - + + pcapng - -pcapng - -link_frame - -tcp_stream - -ipv4_packet + +pcapng + +link_frame + +tcp_stream + +ipv4_packet probe->pcapng:n - - + + probe->png:n - - + + tar - -tar - -probe + +tar + +probe probe->tar:n - - + + probe->tiff:n - - + + wav - -wav - -id3v2 - -id3v1 - -id3v11 + +wav + +id3v2 + +id3v1 + +id3v11 probe->wav:n - - + + probe->webp:n - - + + zip - -zip - -probe + +zip + +probe probe->zip:n - - + + avro_ocf - -avro_ocf + +avro_ocf probe->avro_ocf:n - - + + elf - -elf + +elf probe->elf:n - - + + probe->gif:n - - + + json - -json + +json probe->json:n - - + + macho - -macho + +macho probe->macho:n - - + + mpeg_ts - -mpeg_ts + +mpeg_ts probe->mpeg_ts:n - - + + av1_frame - -av1_frame - -av1_obu + +av1_frame + +av1_obu av1_obu - -av1_obu + +av1_obu av1_frame:e->av1_obu:n - - + + avc_annexb - -avc_annexb - -avc_nalu + +avc_annexb + +avc_nalu avc_nalu - -avc_nalu - -avc_sps - -avc_pps - -avc_sei + +avc_nalu + +avc_sps + +avc_pps + +avc_sei avc_annexb:e->avc_nalu:n - - + + avc_sps - -avc_sps + +avc_sps avc_nalu:e->avc_sps:n - - + + avc_pps - -avc_pps + +avc_pps avc_nalu:e->avc_pps:n - - + + avc_sei - -avc_sei + +avc_sei avc_nalu:e->avc_sei:n - - + + avc_au - -avc_au - -avc_nalu + +avc_au + +avc_nalu avc_au:e->avc_nalu:n - - + + avc_dcr - -avc_dcr - -avc_nalu + +avc_dcr + +avc_nalu avc_dcr:e->avc_nalu:n - - + + bsd_loopback_frame - -bsd_loopback_frame - -ipv4_packet + +bsd_loopback_frame + +ipv4_packet ipv4_packet - -ipv4_packet - -udp_datagram - -tcp_segment - -icmp + +ipv4_packet + +udp_datagram + +tcp_segment + +icmp bsd_loopback_frame:e->ipv4_packet:n - - + + udp_datagram - -udp_datagram - -udp_payload + +udp_datagram + +udp_payload ipv4_packet:e->udp_datagram:n - - + + tcp_segment - -tcp_segment + +tcp_segment ipv4_packet:e->tcp_segment:n - - + + icmp - -icmp + +icmp ipv4_packet:e->icmp:n - - + + bzip2:e->probe:n - - + + ether8023_frame - -ether8023_frame - -ipv4_packet + +ether8023_frame + +ipv4_packet ether8023_frame:e->ipv4_packet:n - - + + @@ -742,14 +742,14 @@ flac:e->flac_metadatablocks:n - + flac_frame - -flac_frame + +flac_frame @@ -760,13 +760,13 @@ flac_metadatablock - + flac_metadatablock - + flac_streaminfo - + flac_picture - + vorbis_comment @@ -778,60 +778,60 @@ flac_streaminfo - + flac_streaminfo flac_metadatablock:e->flac_streaminfo:n - - + + flac_picture - -flac_picture - -image + +flac_picture + +image flac_metadatablock:e->flac_picture:n - - + + vorbis_comment - -vorbis_comment - -flac_picture + +vorbis_comment + +flac_picture flac_metadatablock:e->vorbis_comment:n - - + + flac_picture:e->image:n - - + + vorbis_comment:e->flac_picture:n - - + + gzip:e->probe:n - - + + @@ -892,20 +892,20 @@ id3v2:e->image:n - - + + udp_payload - -udp_payload + +udp_payload udp_datagram:e->udp_payload:n - - + + @@ -916,86 +916,86 @@ jpeg:e->exif:n - - + + icc_profile - -icc_profile + +icc_profile jpeg:e->icc_profile:n - - + + matroska:e->aac_frame:n - - + + matroska:e->image:n - - + + matroska:e->av1_frame:n - - + + matroska:e->avc_au:n - - + + matroska:e->avc_dcr:n - - + + matroska:e->flac_metadatablocks:n - - + + matroska:e->flac_frame:n - - + + matroska:e->hevc_au:n - - + + matroska:e->hevc_dcr:n - - + + av1_ccr - -av1_ccr + +av1_ccr matroska:e->av1_ccr:n - - + + @@ -1008,44 +1008,44 @@ matroska:e->mp3_frame:n - - + + mpeg_asc - -mpeg_asc + +mpeg_asc matroska:e->mpeg_asc:n - - + + mpeg_pes_packet - -mpeg_pes_packet + +mpeg_pes_packet matroska:e->mpeg_pes_packet:n - - + + mpeg_spu - -mpeg_spu + +mpeg_spu matroska:e->mpeg_spu:n - - + + @@ -1058,8 +1058,8 @@ matroska:e->opus_packet:n - - + + @@ -1072,8 +1072,8 @@ matroska:e->vorbis_packet:n - - + + @@ -1084,20 +1084,20 @@ matroska:e->vp8_frame:n - - + + vp9_cfm - -vp9_cfm + +vp9_cfm matroska:e->vp9_cfm:n - - + + @@ -1108,8 +1108,8 @@ matroska:e->vp9_frame:n - - + + @@ -1126,258 +1126,258 @@ opus_packet:e->vorbis_comment:n - - + + vorbis_packet:e->vorbis_comment:n - - + + mp3:e->apev2:n - - + + mp3:e->id3v2:n - - + + mp3:e->mp3_frame:n - - + + id3v1 - -id3v1 + +id3v1 mp3:e->id3v1:n - - + + id3v11 - -id3v11 + +id3v11 mp3:e->id3v11:n - - + + mp4:e->aac_frame:n - - + + mp4:e->image:n - - + + mp4:e->av1_frame:n - - + + mp4:e->avc_au:n - - + + mp4:e->avc_dcr:n - - + + mp4:e->flac_metadatablocks:n - - + + mp4:e->flac_frame:n - - + + mp4:e->hevc_au:n - - + + mp4:e->hevc_dcr:n - - + + mp4:e->id3v2:n - - + + mp4:e->jpeg:n - - + + mp4:e->av1_ccr:n - - + + mp4:e->mp3_frame:n - - + + mp4:e->mpeg_pes_packet:n - - + + mp4:e->opus_packet:n - - + + mp4:e->vorbis_packet:n - - + + mp4:e->vp9_frame:n - - + + mpeg_es - -mpeg_es - -mpeg_asc - -vorbis_packet + +mpeg_es + +mpeg_asc + +vorbis_packet mp4:e->mpeg_es:n - - + + protobuf_widevine - -protobuf_widevine - -protobuf + +protobuf_widevine + +protobuf mp4:e->protobuf_widevine:n - - + + pssh_playready - -pssh_playready + +pssh_playready mp4:e->pssh_playready:n - - + + vpx_ccr - -vpx_ccr + +vpx_ccr mp4:e->vpx_ccr:n - - + + mpeg_es:e->mpeg_asc:n - - + + mpeg_es:e->vorbis_packet:n - - + + protobuf - -protobuf + +protobuf protobuf_widevine:e->protobuf:n - - + + mpeg_pes - -mpeg_pes - -mpeg_pes_packet - -mpeg_spu + +mpeg_pes + +mpeg_pes_packet + +mpeg_spu mpeg_pes:e->mpeg_pes_packet:n - - + + mpeg_pes:e->mpeg_spu:n - - + + @@ -1418,216 +1418,216 @@ pcap:e->ipv4_packet:n - - + + link_frame - -link_frame + +link_frame pcap:e->link_frame:n - - + + tcp_stream - -tcp_stream + +tcp_stream pcap:e->tcp_stream:n - - + + link_frame->bsd_loopback_frame:n - - + + link_frame->ether8023_frame:n - - + + sll2_packet - -sll2_packet - -ether8023_frame + +sll2_packet + +ether8023_frame link_frame->sll2_packet:n - - + + sll_packet - -sll_packet - -ether8023_frame + +sll_packet + +ether8023_frame link_frame->sll_packet:n - - + + dns - -dns + +dns tcp_stream->dns:n - - + + pcapng:e->ipv4_packet:n - - + + pcapng:e->link_frame:n - - + + pcapng:e->tcp_stream:n - - + + png:e->exif:n - - + + png:e->icc_profile:n - - + + sll2_packet:e->ether8023_frame:n - - + + sll_packet:e->ether8023_frame:n - - + + tar:e->probe:n - - + + tiff:e->icc_profile:n - - + + udp_payload->dns:n - - + + wav:e->id3v2:n - - + + wav:e->id3v1:n - - + + wav:e->id3v11:n - - + + webp:e->vp8_frame:n - - + + zip:e->probe:n - - + + asn1_ber - -asn1_ber + +asn1_ber bencode - -bencode + +bencode bson - -bson + +bson cbor - -cbor + +cbor dns_tcp - -dns_tcp + +dns_tcp msgpack - -msgpack + +msgpack raw - -raw + +raw