Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pe,pe_msdos_stub,coff: Add decoders #443

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions format/all/all.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $ fq -n _registry.groups.probe
"opentimestamps",
"pcap",
"pcapng",
"pe",
"png",
"tar",
"tiff",
Expand Down Expand Up @@ -80,6 +81,7 @@ bytes Raw bytes
bzip2 bzip2 compression
caff Live2D Cubism archive
cbor Concise Binary Object Representation
coff Common Object File Format
csv Comma separated values
dns DNS packet
dns_tcp DNS packet (TCP)
Expand Down Expand Up @@ -135,6 +137,7 @@ mpeg_pes MPEG Packetized elementary stream
mpeg_pes_packet MPEG Packetized elementary stream packet
mpeg_spu Sub Picture Unit (DVD subtitle)
mpeg_ts MPEG Transport Stream
msdos_stub MS-DOS Stub
msgpack MessagePack
nes iNES/NES 2.0 cartridge ROM format
ogg OGG file
Expand All @@ -143,6 +146,7 @@ opentimestamps OpenTimestamps file
opus_packet Opus packet
pcap PCAP packet capture
pcapng PCAPNG packet capture
pe Portable Executable
pg_btree PostgreSQL btree index file
pg_control PostgreSQL control file
pg_heap PostgreSQL heap file
Expand Down
1 change: 1 addition & 0 deletions format/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
_ "github.com/wader/fq/format/opentimestamps"
_ "github.com/wader/fq/format/opus"
_ "github.com/wader/fq/format/pcap"
_ "github.com/wader/fq/format/pe"
_ "github.com/wader/fq/format/png"
_ "github.com/wader/fq/format/postgres"
_ "github.com/wader/fq/format/prores"
Expand Down
13 changes: 12 additions & 1 deletion format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ var (
Bzip2 = &decode.Group{Name: "bzip2"}
CAFF = &decode.Group{Name: "caff"}
CBOR = &decode.Group{Name: "cbor"}
COFF = &decode.Group{Name: "coff"}
CSV = &decode.Group{Name: "csv"}
DNS = &decode.Group{Name: "dns"}
DNS_TCP = &decode.Group{Name: "dns_tcp"}
Expand Down Expand Up @@ -144,7 +145,8 @@ var (
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"}
MPEG_PES = &decode.Group{Name: "mpeg_pes"}
MSDOS_Stub = &decode.Group{Name: "msdos_stub"}
MsgPack = &decode.Group{Name: "msgpack"}
NES = &decode.Group{Name: "nes"}
Ogg = &decode.Group{Name: "ogg"}
Expand All @@ -153,6 +155,7 @@ var (
Opus_Packet = &decode.Group{Name: "opus_packet"}
PCAP = &decode.Group{Name: "pcap"}
PCAPNG = &decode.Group{Name: "pcapng"}
PE = &decode.Group{Name: "pe"}
Pg_BTree = &decode.Group{Name: "pg_btree"}
Pg_Control = &decode.Group{Name: "pg_control"}
Pg_Heap = &decode.Group{Name: "pg_heap"}
Expand Down Expand Up @@ -403,3 +406,11 @@ type Pg_Heap_In struct {
type Pg_BTree_In struct {
Page int `doc:"First page number in file, default is 0"`
}

type MS_DOS_Out struct {
LFANew int // logical file address for the New Executable header
}

type COFF_In struct {
FilePointerOffset int `doc:"File pointer offset"`
}
2 changes: 1 addition & 1 deletion format/mpeg/mpeg_pes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var mpegSpuGroup decode.Group

func init() {
interp.RegisterFormat(
format.MPES_PES,
format.MPEG_PES,
&decode.Format{
Description: "MPEG Packetized elementary stream",
DecodeFn: pesDecode,
Expand Down
Loading
Loading