exiftool-vendored.pl 13.17.0 → 13.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/Changes +102 -7
- package/bin/MANIFEST +14 -0
- package/bin/META.json +1 -1
- package/bin/META.yml +1 -1
- package/bin/README +46 -46
- package/bin/config_files/example.config +1 -1
- package/bin/exiftool +211 -121
- package/bin/lib/Image/ExifTool/Apple.pm +12 -2
- package/bin/lib/Image/ExifTool/BuildTagLookup.pm +2 -2
- package/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
- package/bin/lib/Image/ExifTool/DJI.pm +190 -29
- package/bin/lib/Image/ExifTool/DarwinCore.pm +22 -11
- package/bin/lib/Image/ExifTool/EXE.pm +2 -9
- package/bin/lib/Image/ExifTool/GM.pm +1 -1
- package/bin/lib/Image/ExifTool/GPS.pm +3 -3
- package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
- package/bin/lib/Image/ExifTool/GoPro.pm +86 -48
- package/bin/lib/Image/ExifTool/ICO.pm +2 -2
- package/bin/lib/Image/ExifTool/JPEG.pm +5 -1
- package/bin/lib/Image/ExifTool/JSON.pm +5 -1
- package/bin/lib/Image/ExifTool/Kodak.pm +3 -2
- package/bin/lib/Image/ExifTool/Nikon.pm +943 -1237
- package/bin/lib/Image/ExifTool/Olympus.pm +2 -1
- package/bin/lib/Image/ExifTool/PCAP.pm +462 -0
- package/bin/lib/Image/ExifTool/PDF.pm +10 -1
- package/bin/lib/Image/ExifTool/PLIST.pm +92 -29
- package/bin/lib/Image/ExifTool/PNG.pm +7 -1
- package/bin/lib/Image/ExifTool/Photoshop.pm +2 -2
- package/bin/lib/Image/ExifTool/Plot.pm +713 -0
- package/bin/lib/Image/ExifTool/Protobuf.pm +24 -11
- package/bin/lib/Image/ExifTool/Qualcomm.pm +78 -1
- package/bin/lib/Image/ExifTool/QuickTime.pm +347 -318
- package/bin/lib/Image/ExifTool/QuickTimeStream.pl +75 -27
- package/bin/lib/Image/ExifTool/Sony.pm +33 -14
- package/bin/lib/Image/ExifTool/TagLookup.pm +5056 -4967
- package/bin/lib/Image/ExifTool/TagNames.pod +443 -334
- package/bin/lib/Image/ExifTool/Trailer.pm +3 -3
- package/bin/lib/Image/ExifTool/Validate.pm +4 -4
- package/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
- package/bin/lib/Image/ExifTool/WriteExif.pl +9 -4
- package/bin/lib/Image/ExifTool/WritePDF.pl +1 -1
- package/bin/lib/Image/ExifTool/WriteQuickTime.pl +58 -5
- package/bin/lib/Image/ExifTool/Writer.pl +14 -13
- package/bin/lib/Image/ExifTool/XMP.pm +34 -6
- package/bin/lib/Image/ExifTool/XMP2.pl +2 -0
- package/bin/lib/Image/ExifTool.pm +63 -29
- package/bin/lib/Image/ExifTool.pod +83 -86
- package/bin/perl-Image-ExifTool.spec +45 -45
- package/bin/windows_exiftool.txt +95 -71
- package/package.json +6 -3
|
@@ -40,7 +40,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
|
|
|
40
40
|
use Image::ExifTool::Exif;
|
|
41
41
|
use Image::ExifTool::APP12;
|
|
42
42
|
|
|
43
|
-
$VERSION = '2.
|
|
43
|
+
$VERSION = '2.84';
|
|
44
44
|
|
|
45
45
|
sub PrintLensInfo($$$);
|
|
46
46
|
|
|
@@ -442,6 +442,7 @@ my %olympusCameraTypes = (
|
|
|
442
442
|
S0089 => 'E-M5MarkIII',
|
|
443
443
|
S0092 => 'E-M1MarkIII', #IB
|
|
444
444
|
S0093 => 'E-P7', #IB
|
|
445
|
+
S0094 => 'E-M10MarkIIIS', #forum17050
|
|
445
446
|
S0095 => 'OM-1', #IB
|
|
446
447
|
S0101 => 'OM-5', #IB
|
|
447
448
|
S0121 => 'OM-1MarkII', #forum15652
|
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
#------------------------------------------------------------------------------
|
|
2
|
+
# File: PCAP.pm
|
|
3
|
+
#
|
|
4
|
+
# Description: Read CAP, PCAP and PCAPNG Packet Capture files
|
|
5
|
+
#
|
|
6
|
+
# Revisions: 2025-03-03 - P. Harvey Created
|
|
7
|
+
#
|
|
8
|
+
# References: 1) https://www.ietf.org/archive/id/draft-gharris-opsawg-pcap-01.html
|
|
9
|
+
# 2) https://www.ietf.org/archive/id/draft-ietf-opsawg-pcapng-02.html
|
|
10
|
+
# 3) https://formats.kaitai.io/microsoft_network_monitor_v2/
|
|
11
|
+
#------------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
package Image::ExifTool::PCAP;
|
|
14
|
+
|
|
15
|
+
use strict;
|
|
16
|
+
use vars qw($VERSION);
|
|
17
|
+
use Image::ExifTool qw(:DataAccess :Utils);
|
|
18
|
+
|
|
19
|
+
$VERSION = '1.00';
|
|
20
|
+
|
|
21
|
+
%Image::ExifTool::PCAP::Main = (
|
|
22
|
+
GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Other' },
|
|
23
|
+
VARS => { NO_LOOKUP => 1 }, # omit tags from lookup
|
|
24
|
+
NOTES => 'Tags extracted from CAP, PCAP and PCAPNG Packet Capture files.',
|
|
25
|
+
# (Note: All string values are UTF-8 but I'm going to be lazy and not bother decoding them)
|
|
26
|
+
ByteOrder => {
|
|
27
|
+
PrintConv => {
|
|
28
|
+
II => 'Little-endian (Intel, II)',
|
|
29
|
+
MM => 'Big-endian (Motorola, MM)',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
PCAPVersion => { },
|
|
33
|
+
LinkType => {
|
|
34
|
+
PrintConvColumns => 2,
|
|
35
|
+
PrintConv => {
|
|
36
|
+
# (see https://datatracker.ietf.org/doc/html/draft-richardson-opsawg-pcaplinktype-01 for a full list)
|
|
37
|
+
0 => 'BSD Loopback',
|
|
38
|
+
1 => 'IEEE 802.3 Ethernet',
|
|
39
|
+
2 => 'Experimental 4Mb Ethernet',
|
|
40
|
+
3 => 'AX.25',
|
|
41
|
+
4 => 'PRONET',
|
|
42
|
+
5 => 'MIT CHAOSNET',
|
|
43
|
+
6 => 'IEEE 802.5',
|
|
44
|
+
7 => 'ARCNET BSD',
|
|
45
|
+
8 => 'SLIP',
|
|
46
|
+
9 => 'PPP',
|
|
47
|
+
10 => 'fddI',
|
|
48
|
+
# 11-49 not to be used
|
|
49
|
+
50 => 'PPP HDLC',
|
|
50
|
+
51 => 'PPP Ethernet',
|
|
51
|
+
# 52-98 not to be used
|
|
52
|
+
99 => 'Symantec Firewall',
|
|
53
|
+
100 => 'ATM RFC 1483',
|
|
54
|
+
101 => 'Raw',
|
|
55
|
+
102 => 'SLIP BSD/OS',
|
|
56
|
+
103 => 'PPP BSD/OS',
|
|
57
|
+
104 => 'Cisco PPP with HDLC',
|
|
58
|
+
105 => 'IEEE 802.11',
|
|
59
|
+
106 => 'ATM Classical IP',
|
|
60
|
+
107 => 'Frame Relay',
|
|
61
|
+
108 => 'OpenBSD Loopback',
|
|
62
|
+
109 => 'OpenBSD IPSEC',
|
|
63
|
+
110 => 'ATM LANE 802.3',
|
|
64
|
+
111 => 'NetBSD HIPPI',
|
|
65
|
+
112 => 'NetBSD HDLC',
|
|
66
|
+
113 => 'Linux SLL',
|
|
67
|
+
114 => 'Apple LocalTalk',
|
|
68
|
+
115 => 'Acorn Econet',
|
|
69
|
+
116 => 'OpenBSD ipfilter',
|
|
70
|
+
117 => 'OpenBSD pflog',
|
|
71
|
+
118 => 'Cisco IOS',
|
|
72
|
+
119 => 'IEEE 802.11 Prism',
|
|
73
|
+
120 => 'IEEE 802.11 Aironet',
|
|
74
|
+
121 => 'Siemens HiPath HDLC',
|
|
75
|
+
122 => 'IP-over-Fibre',
|
|
76
|
+
123 => 'SunATM',
|
|
77
|
+
124 => 'RapidIO',
|
|
78
|
+
125 => 'PCI Express',
|
|
79
|
+
126 => 'Xilinx Aurora',
|
|
80
|
+
127 => 'IEEE 802.11 Radiotap',
|
|
81
|
+
128 => 'Tazmen Sniffer',
|
|
82
|
+
129 => 'ARCNET Linux',
|
|
83
|
+
130 => 'Juniper MLPPP',
|
|
84
|
+
131 => 'Juniper MLFR',
|
|
85
|
+
132 => 'Juniper ES',
|
|
86
|
+
133 => 'Juniper GGSN',
|
|
87
|
+
134 => 'Juniper MFR',
|
|
88
|
+
135 => 'Juniper ATM2',
|
|
89
|
+
136 => 'Juniper Services',
|
|
90
|
+
137 => 'Juniper ATM1',
|
|
91
|
+
138 => 'Apple IP-over-IEEE 1394',
|
|
92
|
+
139 => 'MTP2 with PHDR',
|
|
93
|
+
140 => 'MTP2',
|
|
94
|
+
141 => 'MTP3',
|
|
95
|
+
142 => 'SCCP',
|
|
96
|
+
143 => 'DOCSIS',
|
|
97
|
+
144 => 'Linux IrDA',
|
|
98
|
+
145 => 'IBM SP',
|
|
99
|
+
146 => 'IBM SN',
|
|
100
|
+
# 147-162 - reserved
|
|
101
|
+
163 => 'IEEE 802.11 AVS',
|
|
102
|
+
164 => 'Juniper Monitor',
|
|
103
|
+
165 => 'BACnet MS/TP',
|
|
104
|
+
166 => 'PPP PPPD',
|
|
105
|
+
167 => 'Juniper PPPOE',
|
|
106
|
+
168 => 'Juniper PPPOE ATM',
|
|
107
|
+
169 => 'GPRS LLC',
|
|
108
|
+
170 => 'GPF-T',
|
|
109
|
+
171 => 'GPF-F',
|
|
110
|
+
172 => 'Gcom T1/E1',
|
|
111
|
+
173 => 'Gcom Serial',
|
|
112
|
+
174 => 'Juniper PIC Peer',
|
|
113
|
+
175 => 'ERF ETH',
|
|
114
|
+
176 => 'ERF POS',
|
|
115
|
+
177 => 'Linux LAPD',
|
|
116
|
+
178 => 'Juniper Ether',
|
|
117
|
+
179 => 'Juniper PPP',
|
|
118
|
+
180 => 'Juniper Frame Relay',
|
|
119
|
+
181 => 'Juniper CHDLC',
|
|
120
|
+
182 => 'MFR',
|
|
121
|
+
182 => 'Juniper VP',
|
|
122
|
+
185 => 'A653 ICM',
|
|
123
|
+
186 => 'USB FreeBSD',
|
|
124
|
+
187 => 'Bluetooth HCI H4',
|
|
125
|
+
188 => 'IEEE 802.16 MAC CPS',
|
|
126
|
+
189 => 'USB Linux',
|
|
127
|
+
190 => 'CAN 2.0B',
|
|
128
|
+
191 => 'IEEE 802.15.4 Linux',
|
|
129
|
+
192 => 'PPI',
|
|
130
|
+
193 => 'IEEE 802.16 MAC CPS Radio',
|
|
131
|
+
194 => 'Juniper ISM',
|
|
132
|
+
195 => 'IEEE 802.15.4 with FCS',
|
|
133
|
+
196 => 'SITA',
|
|
134
|
+
197 => 'ERF',
|
|
135
|
+
198 => 'RAIF1',
|
|
136
|
+
199 => 'IPMB Kontron',
|
|
137
|
+
200 => 'Juniper ST',
|
|
138
|
+
201 => 'Bluetooth HCI H4 with PHDR',
|
|
139
|
+
202 => 'AX.25 KISS',
|
|
140
|
+
203 => 'LAPD',
|
|
141
|
+
204 => 'PPP with DIR',
|
|
142
|
+
205 => 'Cisco HDLC with DIR',
|
|
143
|
+
206 => 'Frame Relay with DIR',
|
|
144
|
+
207 => 'LAPB with DIR',
|
|
145
|
+
# 208 reserved
|
|
146
|
+
209 => 'IPMB Linux',
|
|
147
|
+
210 => 'FlexRay',
|
|
148
|
+
211 => 'MOST',
|
|
149
|
+
212 => 'LIN',
|
|
150
|
+
213 => 'X2E Serial',
|
|
151
|
+
214 => 'X2E Xoraya',
|
|
152
|
+
215 => 'IEEE 802.15.4 Nonask PHY',
|
|
153
|
+
216 => 'Linux evdev',
|
|
154
|
+
217 => 'GSMtap Um',
|
|
155
|
+
218 => 'GSMtap Abis',
|
|
156
|
+
219 => 'MPLS',
|
|
157
|
+
220 => 'USB Linux MMapped',
|
|
158
|
+
221 => 'DECT',
|
|
159
|
+
222 => 'AOS',
|
|
160
|
+
223 => 'Wireless HART',
|
|
161
|
+
224 => 'FC-2',
|
|
162
|
+
225 => 'FC-2 with Frame Delims',
|
|
163
|
+
226 => 'IPNET',
|
|
164
|
+
227 => 'CAN Socketcan',
|
|
165
|
+
228 => 'IPv4',
|
|
166
|
+
229 => 'IPv6',
|
|
167
|
+
230 => 'IEEE 802.15.4 No FCS',
|
|
168
|
+
231 => 'D-Bus',
|
|
169
|
+
232 => 'Juniper VS',
|
|
170
|
+
233 => 'Juniper SRX E2E',
|
|
171
|
+
234 => 'Juniper Fibre Channel',
|
|
172
|
+
235 => 'DVB-CI',
|
|
173
|
+
236 => 'Mux 27.010',
|
|
174
|
+
237 => 'STANAG 5066 D_PDU',
|
|
175
|
+
238 => 'Juniper ATM Cemic',
|
|
176
|
+
239 => 'NFLOG',
|
|
177
|
+
240 => 'Netanalyzer',
|
|
178
|
+
241 => 'Netanalyzer Transparent',
|
|
179
|
+
242 => 'IP-over-InfiniBand',
|
|
180
|
+
243 => 'MPEG-2 TS',
|
|
181
|
+
244 => 'NG40',
|
|
182
|
+
245 => 'NFC LLCP',
|
|
183
|
+
246 => 'Pfsync',
|
|
184
|
+
247 => 'InfiniBand',
|
|
185
|
+
248 => 'SCTP',
|
|
186
|
+
249 => 'USBPcap',
|
|
187
|
+
250 => 'RTAC Serial',
|
|
188
|
+
251 => 'Bluetooth LE LL',
|
|
189
|
+
252 => 'Wireshark Upper PDU',
|
|
190
|
+
253 => 'Netlink',
|
|
191
|
+
254 => 'Bluetooth Linux Monitor',
|
|
192
|
+
255 => 'Bluetooth BREDR BB',
|
|
193
|
+
256 => 'Bluetooth LE LL with PHDR',
|
|
194
|
+
257 => 'PROFIBUS Data Link',
|
|
195
|
+
258 => 'Apple PKTAP',
|
|
196
|
+
259 => 'EPON',
|
|
197
|
+
260 => 'IPMI HPM.2',
|
|
198
|
+
261 => 'Z-Wave R1/R2',
|
|
199
|
+
262 => 'Z-Wave R3',
|
|
200
|
+
263 => 'WattStopper DLM',
|
|
201
|
+
264 => 'ISO 14443',
|
|
202
|
+
265 => 'RDS',
|
|
203
|
+
266 => 'USB Darwin',
|
|
204
|
+
267 => 'Openflow',
|
|
205
|
+
268 => 'SDLC',
|
|
206
|
+
269 => 'TI LLN Sniffer',
|
|
207
|
+
270 => 'LoRaTap',
|
|
208
|
+
271 => 'Vsock',
|
|
209
|
+
272 => 'Nordic BLE',
|
|
210
|
+
273 => 'DOCSIS 31 XRA31',
|
|
211
|
+
274 => 'Ethernet MPacket',
|
|
212
|
+
275 => 'DisplayPort AUX',
|
|
213
|
+
276 => 'Linux SLL2',
|
|
214
|
+
277 => 'Sercos Monitor',
|
|
215
|
+
278 => 'Openvizsla',
|
|
216
|
+
279 => 'Elektrobit EBHSR',
|
|
217
|
+
280 => 'VPP Dispatch',
|
|
218
|
+
281 => 'DSA Tag BRCM',
|
|
219
|
+
282 => 'DSA Tag BRCM Prepend',
|
|
220
|
+
283 => 'IEEE 802.15.4 Tap',
|
|
221
|
+
284 => 'DSA Tag DSA',
|
|
222
|
+
285 => 'DSA Tag EDSA',
|
|
223
|
+
286 => 'ELEE',
|
|
224
|
+
287 => 'Z-Wave Serial',
|
|
225
|
+
288 => 'USB 2.0',
|
|
226
|
+
289 => 'ATSC ALP',
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
TimeStamp => {
|
|
230
|
+
Groups => { 2 => 'Time' },
|
|
231
|
+
ValueConv => q{
|
|
232
|
+
return $val if $$self{WindowsTS};
|
|
233
|
+
return ConvertUnixTime($val, 1, $$self{TSResol} < 1e-7 ? 9 : 6);
|
|
234
|
+
},
|
|
235
|
+
PrintConv => '$self->ConvertDateTime($val)',
|
|
236
|
+
},
|
|
237
|
+
#
|
|
238
|
+
# "options" tags common to all blocks
|
|
239
|
+
#
|
|
240
|
+
1 => 'Comment',
|
|
241
|
+
2988 => {
|
|
242
|
+
Name => 'CustomOption1',
|
|
243
|
+
ValueConv => q{
|
|
244
|
+
return undef unless length($val) > 4;
|
|
245
|
+
my $len = Get16u(\$val, 2);
|
|
246
|
+
return undef unless $len > 4 and $len <= length($val) - 4;
|
|
247
|
+
my $str = 'Type='.Get16u(\$val,0).' PEN='.Get32u(\$val,4). ' Val='.substr($val, 8, $len-4);
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
2989 => {
|
|
251
|
+
Name => 'CustomOption2',
|
|
252
|
+
Binary => 1,
|
|
253
|
+
},
|
|
254
|
+
19372 => {
|
|
255
|
+
Name => 'CustomOption3',
|
|
256
|
+
ValueConv => q{
|
|
257
|
+
return undef unless length($val) > 4;
|
|
258
|
+
my $len = Get16u(\$val, 2);
|
|
259
|
+
return undef unless $len > 4 and $len <= length($val) - 4;
|
|
260
|
+
my $str = 'Type='.Get16u(\$val,0).' PEN='.Get32u(\$val,4). ' Val='.substr($val, 8, $len-4);
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
19373 => {
|
|
264
|
+
Name => 'CustomOption3',
|
|
265
|
+
Binary => 1,
|
|
266
|
+
},
|
|
267
|
+
#
|
|
268
|
+
# "options" tags in Section Header Block
|
|
269
|
+
#
|
|
270
|
+
'SHB-2' => 'Hardware',
|
|
271
|
+
'SHB-3' => 'OperatingSytem',
|
|
272
|
+
'SHB-4' => 'UserApplication',
|
|
273
|
+
#
|
|
274
|
+
# "options" tags in Interface Description Block
|
|
275
|
+
#
|
|
276
|
+
'IDB-2' => 'DeviceName',
|
|
277
|
+
'IDB-3' => 'Description',
|
|
278
|
+
'IDB-4' => {
|
|
279
|
+
Name => 'IPv4Addr',
|
|
280
|
+
Description => 'IPv4 Addr',
|
|
281
|
+
# IP address and net mask
|
|
282
|
+
ValueConv => '$_=join(".", unpack("C*", $val))); s/(:.*?:.*?:.*?):/$1 /; $_',
|
|
283
|
+
},
|
|
284
|
+
'IDB-5' => {
|
|
285
|
+
Name => 'IPv6Addr',
|
|
286
|
+
Description => 'IPv6 Addr',
|
|
287
|
+
ValueConv => 'join(":", unpack("(H4)8", $val)) . "/" . unpack("x16C",$val)',
|
|
288
|
+
},
|
|
289
|
+
'IDB-6' => {
|
|
290
|
+
Name => 'MACAddr',
|
|
291
|
+
ValueConv => 'join("-", unpack("(H2)6", $val))',
|
|
292
|
+
},
|
|
293
|
+
'IDB-7' => {
|
|
294
|
+
Name => 'EUIAddr',
|
|
295
|
+
ValueConv => 'join(":", unpack("(H4)4", $val))',
|
|
296
|
+
},
|
|
297
|
+
'IDB-8' => {
|
|
298
|
+
Name => 'Speed',
|
|
299
|
+
Format => 'int64u',
|
|
300
|
+
},
|
|
301
|
+
'IDB-9' => {
|
|
302
|
+
Name => 'TimeStampResolution',
|
|
303
|
+
Format => 'int8u',
|
|
304
|
+
RawConv => '$$self{TSResol} = ($val & 0x80 ? 2 ** -($val & 0x7f) : 10 ** -$val)',
|
|
305
|
+
},
|
|
306
|
+
'IDB-10' => 'TimeZone',
|
|
307
|
+
'IDB-11' => {
|
|
308
|
+
Name => 'Filter',
|
|
309
|
+
ValueConv => 'Get8u(\$val,0) . ": " . substr($val, 1)',
|
|
310
|
+
},
|
|
311
|
+
'IDB-12' => 'OperatingSytem',
|
|
312
|
+
'IDB-13' => { Name => 'FCSLen', Format => 'int8u' },
|
|
313
|
+
'IDB-14' => {
|
|
314
|
+
Name => 'TimeStampOffset',
|
|
315
|
+
Format => 'int64u',
|
|
316
|
+
RawConv => '$$self{TSOff} = $val',
|
|
317
|
+
},
|
|
318
|
+
'IDB-15' => 'Hardware',
|
|
319
|
+
'IDB-16' => { Name => 'TXSpeed', Format => 'int64u' },
|
|
320
|
+
'IDB-17' => { Name => 'RXSpeed', Format => 'int64u' },
|
|
321
|
+
'IDB-18' => 'TimezoneName',
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
#------------------------------------------------------------------------------
|
|
325
|
+
# Extract metadata from a PCAP file
|
|
326
|
+
# Inputs: 0) ExifTool ref, 1) dirInfo ref
|
|
327
|
+
# Returns: 1 on success, 0 if this wasn't a valid PCAP file
|
|
328
|
+
sub ProcessPCAP($$)
|
|
329
|
+
{
|
|
330
|
+
my ($et, $dirInfo) = @_;
|
|
331
|
+
my $raf = $$dirInfo{RAF};
|
|
332
|
+
my ($buff, $tagTablePtr, $type, $ts, $byteOrder, $verPos);
|
|
333
|
+
|
|
334
|
+
# verify this is a valid PCAP file
|
|
335
|
+
return 0 unless $raf->Read($buff, 24) == 24;
|
|
336
|
+
|
|
337
|
+
if ($buff =~ /^\xa1\xb2(\xc3\xd4|\x3c\x4d)\0.\0.|(\xd4\xc3|\x4d\x3c)\xb2\xa1.\0.\0/s) {
|
|
338
|
+
$type = 'PCAP';
|
|
339
|
+
my $tmp = $1 || $2;
|
|
340
|
+
$$et{TSResol} = ($tmp eq "\xc3\xd4" or $tmp eq "\xd4\xc3") ? 1e-6 : 1e-9;
|
|
341
|
+
$byteOrder = $buff =~ /^\xa1/ ? 'MM' : 'II';
|
|
342
|
+
$verPos = 4;
|
|
343
|
+
} elsif ($buff =~ /^\x0a\x0d\x0d\x0a.{4}(\x1a\x2b\x3c\x4d|\x4d\x3c\x2b\x1a)/s) {
|
|
344
|
+
$type = 'PCAPNG';
|
|
345
|
+
$byteOrder = $1 eq "\x1a\x2b\x3c\x4d" ? 'MM' : 'II';
|
|
346
|
+
$verPos = 12;
|
|
347
|
+
} elsif ($buff =~ /^GMBU\0\x02/) {
|
|
348
|
+
# handle Windows Network Monitor 2.0 CAP files
|
|
349
|
+
# http://web.archive.org/web/20240430011527/https://learn.microsoft.com/en-us/windows/win32/netmon2/capturefile-header-values
|
|
350
|
+
$Image::ExifTool::static_vars{OverrideFileDescription}{CAP} = 'Microsoft Network Monitor Capture';
|
|
351
|
+
$et->SetFileType('CAP', 'application/octet-stream', 'cap');
|
|
352
|
+
$type = 'CAP';
|
|
353
|
+
$tagTablePtr = GetTagTable('Image::ExifTool::PCAP::Main');
|
|
354
|
+
my @a = unpack('x6v*', $buff);
|
|
355
|
+
$$et{WindowsTS} = 1;
|
|
356
|
+
my $val = sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d.%.3d',@a[1,2,4..8]);
|
|
357
|
+
$et->HandleTag($tagTablePtr, LinkType => $a[0]);
|
|
358
|
+
$et->HandleTag($tagTablePtr, TimeStamp => $val);
|
|
359
|
+
if ($raf->Seek(40,0) and $raf->Read($buff,8)==8) {
|
|
360
|
+
my ($off, $len) = unpack('V2', $buff);
|
|
361
|
+
# extract comment
|
|
362
|
+
if ($len < 1024 and $raf->Seek($off,0) and $raf->Read($buff,$len) == $len) {
|
|
363
|
+
$et->HandleTag($tagTablePtr, 1 => $buff); # (NC) null terminated? Unicode?
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return 1;
|
|
367
|
+
} else {
|
|
368
|
+
return 0;
|
|
369
|
+
}
|
|
370
|
+
$et->SetFileType($type);
|
|
371
|
+
SetByteOrder($byteOrder);
|
|
372
|
+
$tagTablePtr = GetTagTable('Image::ExifTool::PCAP::Main');
|
|
373
|
+
my $ver = Get16u(\$buff, $verPos) . '.' . Get16u(\$buff, $verPos+2);
|
|
374
|
+
$et->HandleTag($tagTablePtr, PCAPVersion => "$type $ver");
|
|
375
|
+
$et->HandleTag($tagTablePtr, ByteOrder => $byteOrder);
|
|
376
|
+
|
|
377
|
+
if ($type eq 'PCAP') {
|
|
378
|
+
$et->HandleTag($tagTablePtr, LinkType => Get16u(\$buff, 22));
|
|
379
|
+
$raf->Read($buff, 8) == 8 or $et->Warn('Truncated PCAP file'), return 1;
|
|
380
|
+
$ts = Get32u(\$buff, 0) + Get32u(\$buff, 4) * $$et{TSResol};
|
|
381
|
+
$et->HandleTag($tagTablePtr, TimeStamp => $ts);
|
|
382
|
+
return 1;
|
|
383
|
+
}
|
|
384
|
+
# read through PCAPNG options for the SHB, IDB and get the timestamp from the first EPD
|
|
385
|
+
my $dir = 'SHB'; # Section Header Block
|
|
386
|
+
for (;;) {
|
|
387
|
+
$raf->Read($buff, 4) == 4 or last;
|
|
388
|
+
my $opt = Get16u(\$buff, 0);
|
|
389
|
+
my $len = Get16u(\$buff, 2);
|
|
390
|
+
if ($opt == 0) { # (end of options?)
|
|
391
|
+
last unless $raf->Read($buff, 20) == 20;
|
|
392
|
+
my $dirNum = Get32u(\$buff, 4);
|
|
393
|
+
if ($dirNum == 1) {
|
|
394
|
+
$et->HandleTag($tagTablePtr, LinkType => Get16u(\$buff, 12));
|
|
395
|
+
$dir = 'IDB'; # Interface Description Block
|
|
396
|
+
next; # continue with IDB options
|
|
397
|
+
} elsif ($dirNum == 6) { # EPD (Enhanced Packet Data)
|
|
398
|
+
my $ts = 4294967296 * Get32u(\$buff, 16);
|
|
399
|
+
$raf->Read(\$buff, 4) == 4 or last;
|
|
400
|
+
if ($$et{TSResol}) {
|
|
401
|
+
$ts = ($ts + Get32u(\$buff, 0)) * $$et{TSResol} + ($$et{TSOff} || 0);
|
|
402
|
+
$et->HandleTag($tagTablePtr, TimeStamp => $ts);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
last;
|
|
406
|
+
}
|
|
407
|
+
my $n = ($len + 3) & 0xfffc; # round to an even 4 bytes
|
|
408
|
+
$raf->Read($buff, $n) == $n or $et->Warn("Error reading $dir options"), last;
|
|
409
|
+
my $id = $$tagTablePtr{$opt} ? $opt : "$dir-$opt";
|
|
410
|
+
$et->HandleTag($tagTablePtr, $id, undef,
|
|
411
|
+
DataPt => \$buff,
|
|
412
|
+
DataPos => $raf->Tell() - $n,
|
|
413
|
+
Size => $len,
|
|
414
|
+
MakeTagInfo => 1,
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
return 1;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
1; # end
|
|
421
|
+
|
|
422
|
+
__END__
|
|
423
|
+
|
|
424
|
+
=head1 NAME
|
|
425
|
+
|
|
426
|
+
Image::ExifTool::PCAP - Read CAP, PCAP and PCAPNG Packet Capture files
|
|
427
|
+
|
|
428
|
+
=head1 SYNOPSIS
|
|
429
|
+
|
|
430
|
+
This module is used by Image::ExifTool
|
|
431
|
+
|
|
432
|
+
=head1 DESCRIPTION
|
|
433
|
+
|
|
434
|
+
This module contains definitions required by Image::ExifTool to read
|
|
435
|
+
metadata from CAP, PCAP and PCAPNG Packet Capture files.
|
|
436
|
+
|
|
437
|
+
=head1 AUTHOR
|
|
438
|
+
|
|
439
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
440
|
+
|
|
441
|
+
This library is free software; you can redistribute it and/or modify it
|
|
442
|
+
under the same terms as Perl itself.
|
|
443
|
+
|
|
444
|
+
=head1 REFERENCES
|
|
445
|
+
|
|
446
|
+
=over 4
|
|
447
|
+
|
|
448
|
+
=item L<https://www.ietf.org/archive/id/draft-gharris-opsawg-pcap-01.html>
|
|
449
|
+
|
|
450
|
+
=item L<https://www.ietf.org/archive/id/draft-ietf-opsawg-pcapng-02.html>
|
|
451
|
+
|
|
452
|
+
=item L<https://formats.kaitai.io/microsoft_network_monitor_v2/>
|
|
453
|
+
|
|
454
|
+
=back
|
|
455
|
+
|
|
456
|
+
=head1 SEE ALSO
|
|
457
|
+
|
|
458
|
+
L<Image::ExifTool::TagNames/PCAP Tags>,
|
|
459
|
+
L<Image::ExifTool(3pm)|Image::ExifTool>
|
|
460
|
+
|
|
461
|
+
=cut
|
|
462
|
+
|
|
@@ -21,7 +21,7 @@ use vars qw($VERSION $AUTOLOAD $lastFetched);
|
|
|
21
21
|
use Image::ExifTool qw(:DataAccess :Utils);
|
|
22
22
|
require Exporter;
|
|
23
23
|
|
|
24
|
-
$VERSION = '1.
|
|
24
|
+
$VERSION = '1.61';
|
|
25
25
|
|
|
26
26
|
sub FetchObject($$$$);
|
|
27
27
|
sub ExtractObject($$;$$);
|
|
@@ -141,6 +141,15 @@ my %supportedFilter = (
|
|
|
141
141
|
PrintConv => '$self->ConvertDateTime($val)',
|
|
142
142
|
PrintConvInv => '$self->InverseDateTime($val)',
|
|
143
143
|
},
|
|
144
|
+
SourceModified => {
|
|
145
|
+
Name => 'SourceModified',
|
|
146
|
+
Writable => 'date',
|
|
147
|
+
PDF2 => 1,
|
|
148
|
+
Groups => { 2 => 'Time' },
|
|
149
|
+
Shift => 'Time',
|
|
150
|
+
PrintConv => '$self->ConvertDateTime($val)',
|
|
151
|
+
PrintConvInv => '$self->InverseDateTime($val)',
|
|
152
|
+
},
|
|
144
153
|
Trapped => {
|
|
145
154
|
Protected => 1,
|
|
146
155
|
# remove leading '/' from '/True' or '/False'
|
|
@@ -21,7 +21,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
|
|
|
21
21
|
use Image::ExifTool::XMP;
|
|
22
22
|
use Image::ExifTool::GPS;
|
|
23
23
|
|
|
24
|
-
$VERSION = '1.
|
|
24
|
+
$VERSION = '1.15';
|
|
25
25
|
|
|
26
26
|
sub ExtractObject($$;$);
|
|
27
27
|
sub Get24u($$);
|
|
@@ -46,7 +46,7 @@ my %plistType = (
|
|
|
46
46
|
%Image::ExifTool::PLIST::Main = (
|
|
47
47
|
PROCESS_PROC => \&ProcessPLIST,
|
|
48
48
|
GROUPS => { 0 => 'PLIST', 1 => 'XML', 2 => 'Document' },
|
|
49
|
-
VARS => { LONG_TAGS =>
|
|
49
|
+
VARS => { LONG_TAGS => 12 },
|
|
50
50
|
NOTES => q{
|
|
51
51
|
Apple Property List tags. ExifTool reads both XML and binary-format PLIST
|
|
52
52
|
files, and will extract any existing tags even if they aren't listed below.
|
|
@@ -92,6 +92,35 @@ my %plistType = (
|
|
|
92
92
|
Name => 'GPSMapDatum',
|
|
93
93
|
Groups => { 2 => 'Location' },
|
|
94
94
|
},
|
|
95
|
+
# slow motion stuff found in AAE files
|
|
96
|
+
'slowMotion/regions/timeRange/start/flags' => {
|
|
97
|
+
Name => 'SlowMotionRegionsStartTimeFlags',
|
|
98
|
+
PrintConv => { BITMASK => {
|
|
99
|
+
0 => 'Valid',
|
|
100
|
+
1 => 'Has been rounded',
|
|
101
|
+
2 => 'Positive infinity',
|
|
102
|
+
3 => 'Negative infinity',
|
|
103
|
+
4 => 'Indefinite',
|
|
104
|
+
}},
|
|
105
|
+
},
|
|
106
|
+
'slowMotion/regions/timeRange/start/value' => 'SlowMotionRegionsStartTimeValue',
|
|
107
|
+
'slowMotion/regions/timeRange/start/timescale' => 'SlowMotionRegionsStartTimeScale',
|
|
108
|
+
'slowMotion/regions/timeRange/start/epoch' => 'SlowMotionRegionsStartTimeEpoch',
|
|
109
|
+
'slowMotion/regions/timeRange/duration/flags' => {
|
|
110
|
+
Name => 'SlowMotionRegionsDurationFlags',
|
|
111
|
+
PrintConv => { BITMASK => {
|
|
112
|
+
0 => 'Valid',
|
|
113
|
+
1 => 'Has been rounded',
|
|
114
|
+
2 => 'Positive infinity',
|
|
115
|
+
3 => 'Negative infinity',
|
|
116
|
+
4 => 'Indefinite',
|
|
117
|
+
}},
|
|
118
|
+
},
|
|
119
|
+
'slowMotion/regions/timeRange/duration/value' => 'SlowMotionRegionsDurationValue',
|
|
120
|
+
'slowMotion/regions/timeRange/duration/timescale' => 'SlowMotionRegionsDurationTimeScale',
|
|
121
|
+
'slowMotion/regions/timeRange/duration/epoch' => 'SlowMotionRegionsDurationEpoch',
|
|
122
|
+
'slowMotion/regions' => 'SlowMotionRegions',
|
|
123
|
+
'slowMotion/rate' => 'SlowMotionRate',
|
|
95
124
|
XMLFileType => {
|
|
96
125
|
# recognize MODD files by their content
|
|
97
126
|
RawConv => q{
|
|
@@ -101,6 +130,11 @@ my %plistType = (
|
|
|
101
130
|
return $val;
|
|
102
131
|
},
|
|
103
132
|
},
|
|
133
|
+
adjustmentData => { # AAE file
|
|
134
|
+
Name => 'AdjustmentData',
|
|
135
|
+
CompressedPLIST => 1,
|
|
136
|
+
SubDirectory => { TagTable => 'Image::ExifTool::PLIST::Main' },
|
|
137
|
+
},
|
|
104
138
|
);
|
|
105
139
|
|
|
106
140
|
#------------------------------------------------------------------------------
|
|
@@ -180,8 +214,22 @@ sub FoundTag($$$$;$)
|
|
|
180
214
|
$$et{LastPListTag} = $tagInfo;
|
|
181
215
|
# override file type if applicable
|
|
182
216
|
$et->OverrideFileType($plistType{$tag}) if $plistType{$tag} and $$et{FILE_TYPE} eq 'XMP';
|
|
217
|
+
# handle compressed PLIST/JSON data
|
|
218
|
+
my $proc;
|
|
219
|
+
if ($$tagInfo{CompressedPLIST} and ref $val eq 'SCALAR' and $$val !~ /^bplist00/) {
|
|
220
|
+
if (eval { require IO::Uncompress::RawInflate }) {
|
|
221
|
+
my $inflated;
|
|
222
|
+
if (IO::Uncompress::RawInflate::rawinflate($val => \$inflated)) {
|
|
223
|
+
$val = \$inflated;
|
|
224
|
+
} else {
|
|
225
|
+
$et->Warn("Error inflating PLIST::$$tagInfo{Name}");
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
$et->Warn('Install IO::Uncompress to decode compressed PLIST data');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
183
231
|
# save the tag
|
|
184
|
-
$et->HandleTag($tagTablePtr, $tag, $val);
|
|
232
|
+
$et->HandleTag($tagTablePtr, $tag, $val, ProcessProc => $proc);
|
|
185
233
|
|
|
186
234
|
return 1;
|
|
187
235
|
}
|
|
@@ -304,7 +352,7 @@ sub ExtractObject($$;$)
|
|
|
304
352
|
my $name = $tag;
|
|
305
353
|
$name =~ s/([^A-Za-z])([a-z])/$1\u$2/g; # capitalize words
|
|
306
354
|
$name =~ tr/-_a-zA-Z0-9//dc; # remove illegal characters
|
|
307
|
-
$name =
|
|
355
|
+
$name = 'Tag'.ucfirst($name) if length($name) < 2 or $name =~ /^[-0-9]/;
|
|
308
356
|
$tagInfo = { Name => ucfirst($name), List => 1 };
|
|
309
357
|
if ($$plistInfo{DateFormat}) {
|
|
310
358
|
$$tagInfo{Groups}{2} = 'Time';
|
|
@@ -390,39 +438,54 @@ sub ProcessBinaryPLIST($$;$)
|
|
|
390
438
|
}
|
|
391
439
|
|
|
392
440
|
#------------------------------------------------------------------------------
|
|
393
|
-
# Extract information from a PLIST file
|
|
441
|
+
# Extract information from a PLIST file (binary, XML or JSON format)
|
|
394
442
|
# Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
|
|
395
443
|
# Returns: 1 on success, 0 if this wasn't valid PLIST
|
|
396
444
|
sub ProcessPLIST($$;$)
|
|
397
445
|
{
|
|
398
446
|
my ($et, $dirInfo, $tagTablePtr) = @_;
|
|
447
|
+
my $dataPt = $$dirInfo{DataPt};
|
|
448
|
+
my ($result, $notXML);
|
|
399
449
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
450
|
+
if ($dataPt) {
|
|
451
|
+
pos($$dataPt) = $$dirInfo{DirStart} || 0;
|
|
452
|
+
$notXML = 1 unless $$dataPt =~ /\G</g;
|
|
453
|
+
}
|
|
454
|
+
unless ($notXML) {
|
|
455
|
+
# process XML PLIST data using the XMP module
|
|
456
|
+
$$dirInfo{XMPParseOpts}{FoundProc} = \&FoundTag;
|
|
457
|
+
$result = Image::ExifTool::XMP::ProcessXMP($et, $dirInfo, $tagTablePtr);
|
|
458
|
+
delete $$dirInfo{XMPParseOpts};
|
|
459
|
+
return $result if $result;
|
|
460
|
+
}
|
|
461
|
+
my $buff;
|
|
462
|
+
my $raf = $$dirInfo{RAF};
|
|
463
|
+
if ($raf) {
|
|
408
464
|
$raf->Seek(0,0) and $raf->Read($buff, 64) or return 0;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
$buff =~ /^\xfe\xff\x00/)
|
|
421
|
-
{
|
|
422
|
-
# (have seen very old PLIST files encoded as UCS-2BE with leading BOM)
|
|
423
|
-
$et->Error('Old PLIST format currently not supported');
|
|
424
|
-
$result = 1;
|
|
465
|
+
$dataPt = \$buff;
|
|
466
|
+
} else {
|
|
467
|
+
return 0 unless $dataPt;
|
|
468
|
+
}
|
|
469
|
+
if ($$dataPt =~ /^bplist0/) { # binary PLIST
|
|
470
|
+
# binary PLIST file
|
|
471
|
+
my $tagTablePtr = GetTagTable('Image::ExifTool::PLIST::Main');
|
|
472
|
+
$et->SetFileType('PLIST', 'application/x-plist');
|
|
473
|
+
$$et{SET_GROUP1} = 'PLIST';
|
|
474
|
+
unless (ProcessBinaryPLIST($et, $dirInfo, $tagTablePtr)) {
|
|
475
|
+
$et->Error('Error reading binary PLIST file');
|
|
425
476
|
}
|
|
477
|
+
delete $$et{SET_GROUP1};
|
|
478
|
+
$result = 1;
|
|
479
|
+
} elsif ($$dataPt =~ /^\{"/) { # JSON PLIST
|
|
480
|
+
$raf and $raf->Seek(0);
|
|
481
|
+
require Image::ExifTool::JSON;
|
|
482
|
+
$result = Image::ExifTool::JSON::ProcessJSON($et, $dirInfo);
|
|
483
|
+
} elsif ($$et{FILE_EXT} and $$et{FILE_EXT} eq 'PLIST' and
|
|
484
|
+
$$dataPt =~ /^\xfe\xff\x00/)
|
|
485
|
+
{
|
|
486
|
+
# (have seen very old PLIST files encoded as UCS-2BE with leading BOM)
|
|
487
|
+
$et->Error('Old PLIST format currently not supported');
|
|
488
|
+
$result = 1;
|
|
426
489
|
}
|
|
427
490
|
return $result;
|
|
428
491
|
}
|