Skip to content

Commit 13822cc

Browse files
committed
First source commit (v1.03)
1 parent e74bb0e commit 13822cc

35 files changed

+12168
-0
lines changed

doc/cmdpack.txt

+366
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,366 @@
1+
--------------------------------------------------------------------------------
2+
Command-Line Pack v1.03
3+
Copyright (C) 1996-2011 Neill Corlett
4+
http://www.neillcorlett.com/cmdpack/
5+
--------------------------------------------------------------------------------
6+
7+
This is a collection of command-line tools I've written over the years that I
8+
decided to clean up and repackage. All of the tools are released under the
9+
terms of the GNU General Public License version 3.
10+
11+
--------------------------------------------------------------------------------
12+
Contents
13+
--------------------------------------------------------------------------------
14+
15+
bin2iso - Convert CD .BIN to .ISO
16+
---------------------------------
17+
18+
Converts CD-ROM .BIN images (including full 2352-byte sectors) into .ISO format
19+
(2048-byte sectors). Automatically detects mode 1 or 2. Will warn if there are
20+
any form 2 sectors, which are not convertible.
21+
22+
Usage: bin2iso [-f] input_file output_file
23+
-f: Force conversion and bypass checks
24+
25+
26+
bincomp - Compare binary files
27+
------------------------------
28+
29+
Similar to the old DOS "FC /B" command. The default output is a side-by-side
30+
table showing 16 bytes per line. The "-l" flag will show one byte per line.
31+
32+
Usage: bincomp file1 file2 [-l]
33+
-l Use long format
34+
35+
36+
brrrip - Rip SNES BRR sound samples
37+
-----------------------------------
38+
39+
Automatically detects and rips sound samples from SNES ROMs. Works great with
40+
uncompressed .SPC files too.
41+
42+
Usage: brrrip romfile [samplerate [minblocks]]
43+
44+
"samplerate" should be given in Hz. Samples will only be detected if they are at
45+
least "minblocks" long (default=50). The output files will be named
46+
(hex address).wav.
47+
48+
49+
byteshuf - Shuffle or unshuffle bytes in a file
50+
-----------------------------------------------
51+
52+
Divides a file into its interleaved even/odd bytes, or recombines them. Can also
53+
divide every 3rd, 4th, etc. byte, depending on how many subfiles you specify.
54+
Useful for dealing with certain types of ROM images.
55+
56+
Usage:
57+
To unshuffle: byteshuf [-o] -u source [subfiles...]
58+
To shuffle: byteshuf [-o] -s destination [subfiles...]
59+
60+
Options:
61+
-o Force overwrite
62+
63+
For example, "byteshuf -u abc def0 def1" will split all the even bytes from
64+
"abc" into "def0", and the odd bytes into "def1".
65+
66+
67+
byteswap - Swap byte order of files
68+
-----------------------------------
69+
70+
Swaps the byte order of each record in a file, in place. If the record size is
71+
2, this means every even and odd byte is swapped, but the record size can also
72+
be larger than 2. Useful for dealing with certain types of ROM images.
73+
74+
Usage: byteswap [-q] [-s recordsize] files...
75+
-q: Quiet
76+
-s: Size, in bytes, of each record to swap (default: 2)
77+
78+
79+
cdpatch - CD-XA image insert/extract utility
80+
--------------------------------------------
81+
82+
Inserts or extracts files in-place into CD-ROM images in either .BIN or .ISO
83+
format. Properly handles CD-XA streams from Mode 2 CDs (Video CDs, PlayStation
84+
movie files, etc.) and patches ECC/EDC data as appropriate.
85+
86+
Usage:
87+
To insert: cdpatch -i bin_or_iso [options] [files...]
88+
To extract: cdpatch -x bin_or_iso [options] [files...]
89+
90+
Options:
91+
-be Favor big-endian values in ISO9660 metadata
92+
-boot Insert or extract boot area
93+
-d dir Set the base directory for inserted or extracted files
94+
(defaults to .)
95+
-f Skip filesystem consistency checks
96+
-le Favor little-endian values in ISO9660 metadata
97+
-o Force overwrite when extracting files
98+
-r Recurse into subdirectories
99+
-v Verbose
100+
101+
By default, cdpatch will attempt to insert or extract every file in the CD
102+
image, the same as if you'd specified "-r ." The "-boot" option will insert or
103+
extract the 32KiB boot sector area to a file named "boot".
104+
105+
Some CD images may have conflicting sets big- and little-endian metadata as a
106+
platform-specific quirk or copy protection scheme; the "-be" and "-le" options
107+
can be used to override this.
108+
109+
Specifying both -f and -v will list all filesystem errors, while still ignoring
110+
them for extraction purposes.
111+
112+
When extracting files via -x, cdpatch preserves file modification times when
113+
possible.
114+
115+
116+
ecm - Encoder/decoder for Error Code Modeler format
117+
---------------------------------------------------
118+
119+
ECM is a compression format for CD images which removes ECC/EDC data where it's
120+
possible to do so losslessly. Compressing a CD image with ECM first, then
121+
compressing the ECM file with a general-purpose compressor such as 7z or RAR,
122+
can result in better compression than 7z or RAR alone.
123+
124+
See http://www.neillcorlett.com/ecm/ for more details.
125+
126+
Usage:
127+
128+
To encode:
129+
ecm cdimagefile
130+
ecm cdimagefile ecmfile
131+
ecm e cdimagefile ecmfile
132+
133+
To decode:
134+
unecm ecmfile
135+
unecm ecmfile cdimagefile
136+
ecm d ecmfile cdimagefile
137+
138+
139+
fakecrc - Fake the CRC32 of a file
140+
----------------------------------
141+
142+
Modifies a file to force it to have a particular CRC32 checksum, by patching 4
143+
consecutive bytes anywhere in the file. Can also obtain the CRC32 checksum of a
144+
file.
145+
146+
Usage:
147+
To obtain the CRC32 of a file:
148+
fakecrc file
149+
To modify the CRC32 of a file:
150+
fakecrc file desired_crc [offset]
151+
152+
The 4 bytes at "offset" will be modified. If no offset is given, the last 4
153+
bytes of the file are used.
154+
155+
156+
hax65816 - Simple 65816 disassembler
157+
------------------------------------
158+
159+
A simple 65c816 disassembler with basic flag following. This is the disassembler
160+
I used for the Seiken Densetsu 3 project, among others.
161+
162+
Usage: hax65816 imagefile start address [length] [options]
163+
Output is written to stdout. All values must be given in hex.
164+
If no length is given, disassembly will stop at the end of the bank.
165+
Options:
166+
-m0 Assume M flag = 0
167+
-m1 Assume M flag = 1 (default)
168+
-x0 Assume X flag = 0 (default)
169+
-x1 Assume X flag = 1
170+
-noreturn Disable flag reset after RTS/RTL/RTI
171+
-noguess Disable flag guess on BRK/COP/WDM/STP
172+
-nofollow Disable REP/SEP following (not recommended)
173+
174+
175+
id3point - Pointless ID3v1 Tagger
176+
---------------------------------
177+
178+
A basic ID3v1 tagger for MP3 files. Probably superseded by newer tools, but
179+
included here nonetheless.
180+
181+
Usage: id3point [options] mp3file(s)
182+
183+
Options:
184+
-t title Set ID3 title -t- Clear ID3 title
185+
-a artist Set ID3 artist -a- Clear ID3 artist
186+
-m album Set ID3 album -m- Clear ID3 album
187+
-y year Set ID3 year -y- Clear ID3 year
188+
-c comment Set ID3 comment -c- Clear ID3 comment
189+
-k track# Set ID3 track # -k- Clear ID3 track #
190+
-g genre# Set ID3 genre # -g- Clear ID3 genre #
191+
-tf Set ID3 title based on the filename
192+
193+
Notes:
194+
- Only ID3v1 tags are supported.
195+
- The track number increments automatically for each additional file.
196+
- The -tf option will turn "Artist - Title.mp3" into "Title", but
197+
be sure to check the titles by hand in case it gets confused.
198+
199+
200+
pecompat - Maximize compatibility of a Win32 PE file
201+
----------------------------------------------------
202+
203+
Patches a Windows 32-bit PE executable file to maximize its compatibility with
204+
older versions of Windows.
205+
206+
- Clears the linker timestamp
207+
- Sets the required OS version and subsystem version to "4.00"
208+
- Recalculates the PE file checksum
209+
- Warns if any Unicode import functions are used
210+
211+
Usage: pecompat pe_exe_file(s)
212+
213+
214+
rels - Relative Searcher
215+
------------------------
216+
217+
Searches for a string in a group of files by comparing the relative difference
218+
between each letter. This allows finding strings in non-ASCII character sets.
219+
Also attempts double values (e.g. 00=A, 02=B, 04=C) and wide values (every other
220+
byte, as in UCS-2). A staple ROM hacking tool.
221+
222+
Usage: rels string files
223+
224+
Search strings may include '.' characters as wildcards, but must include at
225+
least two non-wildcard characters.
226+
227+
228+
screamf - .AMF to .S3M converter
229+
--------------------------------
230+
231+
Converts AMF music files to S3M. AMF was a format used exclusively by Otto
232+
Chrons' DOS Sound and Music Interface (DSMI) library and Dual Module Player.
233+
Various DOS games and demos in the 1990s used this format. AMF files were the
234+
result of running MOD2AMF on an existing S3M or other module; screamf does the
235+
opposite. It's round-trippable for the most part.
236+
237+
Usage: screamf inputfile.amf outputfile.s3m
238+
239+
240+
subfile - Extract a portion of a file
241+
-------------------------------------
242+
243+
Extracts a portion of a file, given a starting offset and length, in bytes.
244+
Offset and length may be specified in C style "0x123" or "0123" notation for
245+
hexadecimal or octal.
246+
247+
Usage: subfile infile offset length outfile
248+
249+
250+
uips - Universal IPS patch create/apply utility
251+
-----------------------------------------------
252+
253+
UIPS is a command-line utility for creating and applying IPS patches. IPS is an
254+
old patch format for binary files, limited to 16 MiB in size, and not to be
255+
confused with the newer UPS format. Multiple source files and IPS v2 truncation
256+
are supported.
257+
258+
Usage:
259+
To create an IPS patch:
260+
uips c patch_file source_file(s) target_file
261+
To apply an IPS patch:
262+
uips a patch_file target_file
263+
264+
For example, "uips c patch.ips file1 file2 file3 file4" will create a patch file
265+
capable of transforming any of file1, file2, or file3 to file4.
266+
267+
268+
usfv - Universal SFV create/verify utility
269+
------------------------------------------
270+
271+
USFV is a utility for creating and verifying SFV (Simple File Verification)
272+
files, such as those created by Win-SFV32. A SFV file contains a list of
273+
filenames and their corresponding CRC32 checksums.
274+
275+
Caveat: CRC32 is not a cryptographic hash and cannot be used to ensure that a
276+
file was not maliciously modified (see fakecrc, above).
277+
278+
Usage:
279+
To create a SFV file: usfv c sfvfile filenames
280+
To verify a SFV file: usfv v sfvfile
281+
282+
283+
vb2rip - VB2 sound format ripping utility
284+
-----------------------------------------
285+
286+
Rips music in .VB2 and various similar formats found in PlayStation and
287+
PlayStation 2 games.
288+
289+
See http://www.neillcorlett.com/vb2rip/ for more details.
290+
291+
Usage: vb2rip [options] inputfile(s)
292+
293+
Options:
294+
-fmt format Specify the input file format
295+
-o path Specify the output filename (if one input file is given)
296+
or specify the output directory (if several are given)
297+
-mono Treat input file as monaural
298+
-stereo Treat input file as stereo
299+
-rate n Specify the sample rate
300+
-interleave n Specify the block interleave size
301+
-skip n Skip this many bytes after each block
302+
-offset n Start at the given offset in the input file
303+
-endflag Stop decoding when the sample end flag is reached
304+
-noendflag Ignore the sample end flag
305+
-maxbytes n Set the maximum number of input bytes to decode
306+
307+
Supported input formats:
308+
Format Description
309+
------------------------------------------------------------
310+
raw Raw data (for experimentation)
311+
vb2 Konami multi-song .BIN/.VB2 file (Dance Dance Revolution, etc.)
312+
8 .8 file (Suikoden)
313+
msa .MSA file (Psyvariar, possibly other PS2 games)
314+
xa2 .XA2 file (Extreme-G 3, possibly other PS2 games)
315+
316+
317+
wordadd - Addition word puzzle solver
318+
-------------------------------------
319+
320+
Finds solutions to letter/digit substitution puzzles of the "WORD + WORD =
321+
OTHER" variety. Supports multiple addends and digits mixed in with letters.
322+
323+
Usage: wordadd words... sum
324+
Examples:
325+
wordadd BEEF BACON MEATS
326+
327+
328+
zerofill - Create a large, empty file
329+
-------------------------------------
330+
331+
Creates a file filled with bytes of value zero. Similar to "dd if=/dev/zero",
332+
except not all platforms have dd, and there's a progress indicator.
333+
334+
Inside a virtual machine, zerofill can be used to create a large dummy file in
335+
order to zero out all the unused sectors before compressing the drive image.
336+
(zerofill is also useful for creating drive images in the first place.)
337+
338+
Usage: zerofill [-f] [-q] size filename
339+
-f: Force overwrite
340+
-q: Quiet
341+
342+
"size" may be specified in C style "0x123" or "0123" notation for hexadecimal or
343+
octal.
344+
345+
346+
--------------------------------------------------------------------------------
347+
Terms of use
348+
--------------------------------------------------------------------------------
349+
350+
All of the programs included in Command-Line Pack are subject to the following
351+
terms of use:
352+
353+
This program is free software: you can redistribute it and/or modify
354+
it under the terms of the GNU General Public License as published by
355+
the Free Software Foundation, either version 3 of the License, or
356+
(at your option) any later version.
357+
358+
This program is distributed in the hope that it will be useful,
359+
but WITHOUT ANY WARRANTY; without even the implied warranty of
360+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
361+
GNU General Public License for more details.
362+
363+
You should have received a copy of the GNU General Public License
364+
along with this program. If not, see <http://www.gnu.org/licenses/>.
365+
366+
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)