Skip to content

Commit 317ad69

Browse files
committed
pe,pe_msdos_stub,coff: Add decoders
1 parent b67ce02 commit 317ad69

19 files changed

+3191
-0
lines changed

format/all/all.fqtest

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ $ fq -n _registry.groups.probe
2727
"opentimestamps",
2828
"pcap",
2929
"pcapng",
30+
"pe",
3031
"png",
3132
"tar",
3233
"tiff",
@@ -80,6 +81,7 @@ bytes Raw bytes
8081
bzip2 bzip2 compression
8182
caff Live2D Cubism archive
8283
cbor Concise Binary Object Representation
84+
coff Common Object File Format
8385
csv Comma separated values
8486
dns DNS packet
8587
dns_tcp DNS packet (TCP)
@@ -135,6 +137,7 @@ mpeg_pes MPEG Packetized elementary stream
135137
mpeg_pes_packet MPEG Packetized elementary stream packet
136138
mpeg_spu Sub Picture Unit (DVD subtitle)
137139
mpeg_ts MPEG Transport Stream
140+
msdos_stub MS-DOS Stub
138141
msgpack MessagePack
139142
nes iNES/NES 2.0 cartridge ROM format
140143
ogg OGG file
@@ -143,6 +146,7 @@ opentimestamps OpenTimestamps file
143146
opus_packet Opus packet
144147
pcap PCAP packet capture
145148
pcapng PCAPNG packet capture
149+
pe Portable Executable
146150
pg_btree PostgreSQL btree index file
147151
pg_control PostgreSQL control file
148152
pg_heap PostgreSQL heap file

format/all/all.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import (
4646
_ "github.com/wader/fq/format/opentimestamps"
4747
_ "github.com/wader/fq/format/opus"
4848
_ "github.com/wader/fq/format/pcap"
49+
_ "github.com/wader/fq/format/pe"
4950
_ "github.com/wader/fq/format/png"
5051
_ "github.com/wader/fq/format/postgres"
5152
_ "github.com/wader/fq/format/prores"

format/format.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ var (
8989
Bzip2 = &decode.Group{Name: "bzip2"}
9090
CAFF = &decode.Group{Name: "caff"}
9191
CBOR = &decode.Group{Name: "cbor"}
92+
COFF = &decode.Group{Name: "coff"}
9293
CSV = &decode.Group{Name: "csv"}
9394
DNS = &decode.Group{Name: "dns"}
9495
DNS_TCP = &decode.Group{Name: "dns_tcp"}
@@ -145,6 +146,7 @@ var (
145146
MPEG_SPU = &decode.Group{Name: "mpeg_spu"}
146147
MPEG_TS = &decode.Group{Name: "mpeg_ts"}
147148
MPES_PES = &decode.Group{Name: "mpeg_pes"}
149+
MSDOS_Stub = &decode.Group{Name: "msdos_stub"}
148150
MsgPack = &decode.Group{Name: "msgpack"}
149151
NES = &decode.Group{Name: "nes"}
150152
Ogg = &decode.Group{Name: "ogg"}
@@ -153,6 +155,7 @@ var (
153155
Opus_Packet = &decode.Group{Name: "opus_packet"}
154156
PCAP = &decode.Group{Name: "pcap"}
155157
PCAPNG = &decode.Group{Name: "pcapng"}
158+
PE = &decode.Group{Name: "pe"}
156159
Pg_BTree = &decode.Group{Name: "pg_btree"}
157160
Pg_Control = &decode.Group{Name: "pg_control"}
158161
Pg_Heap = &decode.Group{Name: "pg_heap"}
@@ -403,3 +406,11 @@ type Pg_Heap_In struct {
403406
type Pg_BTree_In struct {
404407
Page int `doc:"First page number in file, default is 0"`
405408
}
409+
410+
type MS_DOS_Out struct {
411+
LFANew int // logical file address for the New Executable header
412+
}
413+
414+
type COFF_In struct {
415+
FilePointerOffset int `doc:"File pointer offset"`
416+
}

0 commit comments

Comments
 (0)