1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
|
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "MEDIAEXTRACT" 1 "2022-01-03" "1.1.1" "SlackBuilds.org"
.SH NAME
mediaextract \- extracts media files that are embedded within other files
.\" RST source for mediaextract(1) man page. Convert with:
.
.\" rst2man.py mediaextract.rst > mediaextract.1
.
.\" rst2man.py comes from the SBo development/docutils package.
.
.SH SYNOPSIS
.sp
mediaextract [\fI\-options\fP] \fIfilename\fP [\fIfilename\fP ...]
.SH DESCRIPTION
.sp
\fBmediaextract\fP extracts known media types such as RIFF, Ogg, etc,
from various \(aqresource\(aq or \(aqarchive\(aq format files. files. It works
by looking for \(aqmagic\(aq byte sequences (like the \fBfile(1)\fP command
does). A typical use case would be extracting resources from a
game. \fBmediaextract\fP does not support compression (zip/rar/7z/etc), so
uncompress the file first, if necessary.
.SH OPTIONS
.INDENT 0.0
.TP
.B \-h\fP,\fB \-\-help
Print this help message.
.TP
.B \-q\fP,\fB \-\-quiet
Do not print status messages.
.TP
.B \-s\fP,\fB \-\-simulate
Don\(aqt write any output files.
.TP
.BI \-o\fP,\fB \-\-output\fB= DIR
Directory where extracted files should be written. (default: ".")
.TP
.BI \-a\fP,\fB \-\-filename\fB= FORMAT
Format string for the file names. (default: "{filename}_{offset}.{ext}")
.INDENT 7.0
.TP
.B Supported variables:
.INDENT 7.0
.TP
.B filename
Filename of the extracted archive.
.TP
.B offset
Offset within the archive, in hexadecimal.
.TP
.B index
0\-based index of the extracted file in decimal.
.TP
.B size
Size of the extracted file in decimal.
.TP
.B ext
Extension associated with the filetype of the extracted file.
.UNINDENT
.UNINDENT
.TP
.BI \-i\fP,\fB \-\-offset\fB= OFFSET
Start processing at byte OFFSET. (default: 0)
.TP
.BI \-n\fP,\fB \-\-length\fB= LENGTH
Only process LENGTH bytes. (default and maximum: 8 EB)
.TP
.BI \-m\fP,\fB \-\-min\-size\fB= SIZE
Minumum size of extracted files (skip smaller). (default: 0)
.TP
.BI \-x\fP,\fB \-\-max\-size\fB= SIZE
Maximum size of extracted files (skip larger). Default and maximum: 16 EB.
.sp
The last character of OFFSET, LENGTH and SIZE may be one of the following:
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
B (or none) for Bytes
.IP \(bu 2
k for Kilobytes (units of 1024 Bytes)
.IP \(bu 2
M for Megabytes (units of 1024 Kilobytes)
.IP \(bu 2
G for Gigabytes (units of 1024 Megabytes)
.IP \(bu 2
T for Terabytes (units of 1024 Gigabytes)
.IP \(bu 2
P for Petabytes (units of 1024 Terabytes)
.IP \(bu 2
E for Exabytes (units of 1024 Petabytes)
.UNINDENT
.UNINDENT
.UNINDENT
.sp
The special value "max" selects the maximum alowed value.
.TP
.BI \-f\fP,\fB \-\-formats\fB= FORMATS
Comma separated list of formats (file magics) to extract.
.INDENT 7.0
.TP
.B Supported formats:
.INDENT 7.0
.TP
.B all
all supported formats
.TP
.B default
the default set of formats (AIFF, ASF, AU, BINK, BMP, GIF, ID3v2, IT, JPEG, MPEG 1, MPEG PS, MIDI, MP4, Ogg, PNG, RIFF, S3M, SMK, XM, XMIDI)
.TP
.B audio
all audio files (AIFF, ASF, AU, ID3v2, IT, MIDI, MP4, Ogg, RIFF, S3M, XM, XMIDI)
.TP
.B text
all text files (ASCII, UTF\-8, UTF\-16LE, UTF\-16BE, UTF\-32LE, UTF\-32BE)
.TP
.B image
all image files (BMP, PNG, JPEG, GIF)
.TP
.B mpeg
all safe mpeg files (MPEG 1, MPEG PS, ID3v2)
.TP
.B tracker
all tracker files (MOD, S3M, IT, XM)
.TP
.B video
all video files (ASF, BINK, MP4, RIFF, SMK)
.TP
.B aiff
big\-endian (Apple) wave files
.TP
.B ascii
7\-bit ASCII files (only printable characters)
.TP
.B asf
Advanced Systems Format files (also WMA and WMV)
.TP
.B au
Sun Microsystems audio file format (.au or .snd)
.TP
.B bink
BINK files
.TP
.B bmp
Windows Bitmap files
.TP
.B gif
Graphics Interchange Format files
.TP
.B id3v2
MPEG layer 1/2/3 files with ID3v2 tags
.TP
.B it
ImpulseTracker files
.TP
.B jpeg
JPEG Interchange Format files
.TP
.B midi
MIDI files
.TP
.B mod \fI[1]\fP
Noisetracker/Soundtracker/Protracker Module files
.TP
.B mpg123 \fI[1]\fP \fI[2]\fP
MPEG layer 1/2/3 files (MP1, MP2, MP3)
.TP
.B mpeg1
MPEG 1 System Streams
.TP
.B mpegps
MPEG 2 Program Streams
.TP
.B mpegts \fI[1]\fP
MPEG 2 Transport Streams
.TP
.B mp4
MP4 files (M4A, M4V, 3GPP etc.)
.TP
.B ogg
Ogg files (Vorbis, Opus, Theora, etc.)
.TP
.B png
Portable Network Graphics files
.TP
.B riff
Resource Interchange File Format files (ANI, AVI, MMM, PAL, RDI, RMI, SGT, STY, WAV, WEBP and more)
.TP
.B s3m
ScreamTracker III files
.TP
.B smk
Smaker files
.TP
.B utf\-8
7\-bit ASCII and UTF\-8 files (only printable code points)
.TP
.B utf\-16be
big\-endian UTF\-16 files (only printable code points)
.TP
.B utf\-16le
little\-endian UTF\-16 files (only printable code points)
.TP
.B utf\-32be
big\-endian UTF\-32 files (only printable code points)
.TP
.B utf\-32le
little\-endian UTF\-32 files (only printable code points)
.TP
.B xm
Extended Module files
.TP
.B xmidi
XMIDI files
.UNINDENT
.UNINDENT
.UNINDENT
.sp
If \(aq\-\(aq is written before a format name, that format will be removed
from the set of formats to extract. E.g. extract everything except
tracker files:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
mediaextract \-\-formats=all,\-tracker data.bin
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fI[1]\fP WARNING: Because MP1/2/3 files do not have a nice file magic, using
the \(aqmpg123\(aq format may cause \fIa lot\fP of false positives. Nowadays
MP3 files usually have an ID3v2 tag at the start, so using the \(aqid3v2\(aq
format is the better option anyway.
.sp
The detection accuracy of MOD files is not much better and of MPEG TS
it is even worse and thus the \(aqmpg123\(aq, \(aqmpegts\(aq and \(aqmod\(aq formats are
per default disabled.
.sp
\fI[2]\fP NOTE: When using only the \(aqmpg123\(aq format but not \(aqid3v2\(aq, any ID3v2
tag will be stripped. ID3v1 tags will still be kept.
.SH EXAMPLES
.sp
Extract .wav, .aif and .ogg (might actually be .ogg, .opus or .ogm) files from
the file \fBdata.bin\fP and store them in the \fB~/Music\fP directory:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
mediaextract \-f riff,aiff,ogg \-o ~/Music data.bin
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This will then write files like such into \fB~/Music\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
data.bin_00000000.ogg
data.bin_00FFB2E3.wav
data.bin_01F3CD45.aif
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The hexadecimal number in the written file names gives the offset where the audio
file was found, within the data file.
.sp
Extract .mp3, .mp2 and .mp1 files (with or without ID3v2 tags). The \fBmpg123\fP
option yields a lot of false positives because there is no nice way to
unambigiously detect MPEG files. These false positives are however usually very
small, so using the \fB\-\-min\-size\fP option one can hopefully extract only real MPEG
files:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
mediaextract \-f id3v2,mpg123 \-\-min\-size=100k \-o ~/Music data.bin
.ft P
.fi
.UNINDENT
.UNINDENT
.SH COPYRIGHT
.sp
See the file /usr/doc/mediaextract\-1.1.1/LICENSE.txt for license information.
.SH AUTHOR
.sp
mediaextract was written by Mathias Panzenböck.
.sp
This man page written for the SlackBuilds.org project
by B. Watson, and is licensed under the WTFPL.
.\" Generated by docutils manpage writer.
.
|