-
Notifications
You must be signed in to change notification settings - Fork 0
/
unarj.txt
290 lines (195 loc) · 10.9 KB
/
unarj.txt
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
UNARJ.TXT, UNARJ 2.65 June 2002
UNARJ software and manual copyright (c) 1990-2002 ARJ Software, Inc.
All rights reserved.
UNARJ version 2.65 release
This documents new or updated information since UNARJ 2.10.
** IMPORTANT NEWS ****************************************************
At 2.65, a fix to DECODE.C make_table() calls was made to help UNARJ
handle damaged archives.
At ARJ 2.60, there are new chapter fields and a data encryption field.
The ARJ archive format at 2.39 and above supports an archive
date-time modified field.
A new data check has been added to make_table() in DECODE.C to
account for badly corrupted data.
There is a newly defined flag bit in the ARJ flags. See TECHNOTE.DOC
for details. UNARJ only supports this flag bit with the "l" command.
There is an extended header bug in older versions of ARJ, AV.C and
UNARJ.C. The extended header processing in read_header() should skip
4 bytes for the extended header CRC and not 2 bytes. This is NOT a
current problem as no versions of ARJ use the extended header.
The following source line in DECODE.C is AMBIGUOUS and has been
corrected.
weight[i++] = 1 << (16 - i);
**********************************************************************
Here is the C source code for a simple UNARJ extractor program. It
has been portabilized courtesy of Mark Adler for platforms that do not
support ANSI C. This UNARJ is NOT meant for use as a production
quality ARJ extractor. It is meant for the use of 3rd party
developers who want to build file readers, etc, for ARJ. The UNARJ
source code has been built and tested under Turbo C++ 1.0, Quick C
2.5, Borland C++ 3.1, Borland C++ 1.0 for OS/2 and Coherent 3.2.0.
It has none of the program protection and other fancy features of
ARJ 2.41. It is also VERY SLOW compared to ARJ. In ARJ, all of
the critical routines are written in assembly language.
COMMAND SYNTAX:
UNARJ has been modified to support the four commands: "e", "l", "t",
and "x". These are similar to the ARJ version of these commands.
However, UNARJ does not create directories when using the "x" command.
Usage: UNARJ archive[.arj] (list archive)
UNARJ e archive (extract archive)
UNARJ l archive (list archive)
UNARJ t archive (test archive)
UNARJ x archive (extract with pathnames)
UNARJ does not accept any other commands or options. You cannot
specify a base directory or select individual files to extract. UNARJ
does not support empty directories or volume labels. UNARJ is much
slower than ARJ because ARJ is highly optimized using assembly
language.
"e" extract command
This command extracts the contents of the ARJ archive to the current
directory. Files in the archive that already exist in the current
directory will not be extracted.
"l" list command
This command lists the contents of the archive to the screen. The
UNARJ l command replaces the old AV.EXE program.
The last field on the display BTPMGVX stands for:
B -> file has been marked as a backup
T -> text/binary/directory/volume label type
P -> path information available in "V" listing
M -> compression method used
G -> file has been garbled (encrypted)
V -> archive has been continued to another volume
X -> this file is an extended portion of a larger file
"t" test command
This command tests the contents of the archive by extracting the files
to the NUL device (no data will be written to disk). If the contents
of a file is corrupted, UNARJ will display "CRC error!". If the
contents are valid, UNARJ will display "CRC OK".
You can use this command to see if an archive contains pathnames.
"x" extract with pathnames command
This command extracts the contents of the ARJ archive to the pathnames
stored in the archive. If only filespecs are stored in the archive,
then the files will be extracted to the current directory. UNARJ will
not create missing directories in the pathnames. You must create them
manually. Use the UNARJ t command to see the full pathnames stored in
the archive.
PROGRESS INDICATOR
UNARJ uses a small spinning bar to indicate extraction/testing
progress. For some systems that have buffered output, the progress
indicator may not work.
BUILDING THE UNARJ PROGRAM
Source files: UNARJ.C, DECODE.C, ENVIRON.C, UNARJ.H, UNARJ.DEF,
TCCUNARJ.MAK, QCLUNARJ.MAK, OS2UNARJ.MAK, BCC32.MAK.
For Turbo C/C++, type MAKE /ftccunarj.mak
For Borland C++, type MAKE /fbcc32.mak
For QuickC, type NMAKE /F qclunarj.mak
For OS/2 BC++, type MAKE /fos2unarj.mak
For Coherent, type
cc -DUNIX -DCOHERENT -o unarj unarj.c decode.c environ.c
For UNIX type cc -DUNIX -o unarj unarj.c decode.c environ.c
If you use a compiler other than listed above, the resulting UNARJ.EXE
will not support restoring file date-time stamps. You can modify the
ENVIRON.C file to add these functions for your particular
implementation environment.
If you send us your implementations, we will try to incorporate them
into the next version of UNARJ.
ACKNOWLEDGEMENTS:
We wish to thank Haruhiko Okumura for providing the ideas for ARJ and
UNARJ. His AR001 and AR002 provided the basic compression algorithms
for ARJ 1.0. At ARJ 2.0, ARJ uses only the secondary Huffman
compressor from AR002.
We wish to thank Mark Adler for helping make UNARJ more portable.
We also wish to acknowledge the use of the file date-time stamping
routines in Rahul Dhesi's ZOO archiver.
And to those who have contributed bug reports and porting information,
we extend our thanks.
UNARJ LICENSE POLICY FOR ALL USERS:
The UNARJ program, source code, and the associated documentation
are copyright (c) 1990-2002 ARJ Software, Inc. all rights reserved.
If you distribute this software to others, you are required to
distribute the ENTIRE package consisting of the following files:
README.DOC
UNARJ.EXE
UNARJ.DOC
UNARJ.C
DECODE.C
ENVIRON.C
UNARJ.H
UNARJ.DEF
TCCUNARJ.MAK
BCCUNARJ.MAK
BCC32.MAK
QCLUNARJ.MAK
OS2UNARJ.MAK
TECHNOTE.DOC
We strongly prefer that the files be distributed in the format
originally released: UNARJ265.EXE with the ARJ-SECURITY envelope as
created by the author. If you must distribute the UNARJ archive in
another archive format, please archive the UNARJ265.EXE as one file
inside the other archive. Re-archival of the software as separate
files means losing the ARJ security envelope.
You may freely use the UNARJ C source code. If you wish to
distribute a modified version of UNARJ.EXE, you MUST indicate that it
is a modified version both in the program and source code.
We are holding the copyright on the source code, so please do not
delete our name from the program files or the documentation.
The UNARJ.EXE program is built from this source using Borland C++ 3.1.
You may freely use, copy, and distribute UNARJ.EXE, provided that no
fee is charged for such use, copying or distribution.
You may use UNARJ.EXE in a commercial software package provided that
no additional fee is charged for using UNARJ.EXE and provided that
the user fully understands that NO warranty or support is provided
for UNARJ.EXE by ARJ Software. Moreover, the user must fully
understand that UNARJ does not have the long usage history that ARJ
does.
This source code is intended to promote the building of utilities to
support the use of ARJ and ARJ archives.
TECHNICAL SUPPORT:
Please report any bugs. We will try to fix them. If you have made
portability improvements, we would appreciate receiving a copy of them.
We can be reached at:
Internet address: [email protected]
Web site: www.arjsoftware.com
ARJ Software, Inc.
P.O. Box 249
Norwood, MA 02062 USA
Fax: 781-769-4893
DISCLAIMER:
This software UNARJ is provided on an "as is" basis without warranty
of any kind, expressed or implied, including but not limited to the
implied warranties of merchantability and fitness for a particular
purpose. The person using the software bears all risk as to the
quality and performance of the software. Should the software prove
defective, the user assumes the entire cost of all necessary repair,
servicing, or correction. ARJ Software, Inc. will not be liable
for any special, incidental, consequential, indirect or similar
damages due to loss of data or any other reason, even if ARJ
Software, Inc. or its agents have been advised of the possibility
of such damages.
HISTORY:
UNARJ 2.65 - Fixed table boundaries per suggestion of
UNARJ 2.63 - Added additional header data checks.
UNARJ 2.61 - Added chapter and encryption information.
UNARJ 2.43 - Added "/" to list of valid path separators.
UNARJ 2.42 - Changed copyright messages.
UNARJ 2.41 - Added ARCHIMEDES support. Added archive date-time
modified field support. Added data check to
make_table(). Updated ARJ header descriptions.
UNARJ 2.30 - Added new header arj flag (BACKUP_FLAG).
Updated information in TECHNOTE.DOC.
UNARJ 2.22 - Added missing semicolon to unarj.c for THINK_C.
Modified text mode processing to include test for
host_os in fwrite_txt_crc().
Added more error checking to unarj.c.
UNARJ 2.21 - Changed uint ratio() to static uint ratio().
Added #ifdef VMS to unarj.c.
Tested unarj on COHERENT (UNIX clone).
Fixed use of _chmod to handle directories.
Modified unarj.c to support the MAC THINK_C compiler.
Added #include <stdlib.h> to vanilla section of environ.c.
Added file date-time stamping to UNIX section of environ.c.
UNARJ 2.20 - Changed arguments in get_mode_str() and set_ftime_mode() to
at least int size.
Added default_case_path() for convenience in UNIX.
Added two missing %c from printf statement in list_arc().
end document