libmspack 0.0.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.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.travis.yml +5 -0
  4. data/.yardopts +1 -0
  5. data/Gemfile +4 -0
  6. data/README.md +75 -0
  7. data/Rakefile +22 -0
  8. data/UNLICENSE +24 -0
  9. data/ext/Rakefile +16 -0
  10. data/ext/i386-windows/libmspack.dll +0 -0
  11. data/ext/libmspack/AUTHORS +12 -0
  12. data/ext/libmspack/COPYING.LIB +504 -0
  13. data/ext/libmspack/ChangeLog +491 -0
  14. data/ext/libmspack/Makefile.am +100 -0
  15. data/ext/libmspack/NEWS +0 -0
  16. data/ext/libmspack/README +130 -0
  17. data/ext/libmspack/TODO +8 -0
  18. data/ext/libmspack/cleanup.sh +9 -0
  19. data/ext/libmspack/configure.ac +50 -0
  20. data/ext/libmspack/debian/changelog +6 -0
  21. data/ext/libmspack/debian/control +14 -0
  22. data/ext/libmspack/debian/rules +101 -0
  23. data/ext/libmspack/doc/Doxyfile.in +22 -0
  24. data/ext/libmspack/doc/Makefile.in +14 -0
  25. data/ext/libmspack/doc/szdd_kwaj_format.html +331 -0
  26. data/ext/libmspack/libmspack.pc.in +10 -0
  27. data/ext/libmspack/mspack/cab.h +127 -0
  28. data/ext/libmspack/mspack/cabc.c +24 -0
  29. data/ext/libmspack/mspack/cabd.c +1444 -0
  30. data/ext/libmspack/mspack/chm.h +122 -0
  31. data/ext/libmspack/mspack/chmc.c +24 -0
  32. data/ext/libmspack/mspack/chmd.c +1392 -0
  33. data/ext/libmspack/mspack/crc32.c +95 -0
  34. data/ext/libmspack/mspack/crc32.h +17 -0
  35. data/ext/libmspack/mspack/des.h +15 -0
  36. data/ext/libmspack/mspack/hlp.h +33 -0
  37. data/ext/libmspack/mspack/hlpc.c +24 -0
  38. data/ext/libmspack/mspack/hlpd.c +24 -0
  39. data/ext/libmspack/mspack/kwaj.h +118 -0
  40. data/ext/libmspack/mspack/kwajc.c +24 -0
  41. data/ext/libmspack/mspack/kwajd.c +561 -0
  42. data/ext/libmspack/mspack/lit.h +35 -0
  43. data/ext/libmspack/mspack/litc.c +24 -0
  44. data/ext/libmspack/mspack/litd.c +24 -0
  45. data/ext/libmspack/mspack/lzss.h +66 -0
  46. data/ext/libmspack/mspack/lzssd.c +93 -0
  47. data/ext/libmspack/mspack/lzx.h +221 -0
  48. data/ext/libmspack/mspack/lzxc.c +18 -0
  49. data/ext/libmspack/mspack/lzxd.c +895 -0
  50. data/ext/libmspack/mspack/mspack.def +28 -0
  51. data/ext/libmspack/mspack/mspack.h +2353 -0
  52. data/ext/libmspack/mspack/mszip.h +126 -0
  53. data/ext/libmspack/mspack/mszipc.c +18 -0
  54. data/ext/libmspack/mspack/mszipd.c +514 -0
  55. data/ext/libmspack/mspack/oab.h +60 -0
  56. data/ext/libmspack/mspack/oabc.c +24 -0
  57. data/ext/libmspack/mspack/oabd.c +408 -0
  58. data/ext/libmspack/mspack/qtm.h +128 -0
  59. data/ext/libmspack/mspack/qtmc.c +18 -0
  60. data/ext/libmspack/mspack/qtmd.c +489 -0
  61. data/ext/libmspack/mspack/readbits.h +207 -0
  62. data/ext/libmspack/mspack/readhuff.h +173 -0
  63. data/ext/libmspack/mspack/sha.h +15 -0
  64. data/ext/libmspack/mspack/system.c +239 -0
  65. data/ext/libmspack/mspack/system.h +124 -0
  66. data/ext/libmspack/mspack/szdd.h +39 -0
  67. data/ext/libmspack/mspack/szddc.c +24 -0
  68. data/ext/libmspack/mspack/szddd.c +247 -0
  69. data/ext/libmspack/rebuild.sh +8 -0
  70. data/ext/libmspack/test/cabd_c10 +19 -0
  71. data/ext/libmspack/test/cabd_compare +34 -0
  72. data/ext/libmspack/test/cabd_md5.c +161 -0
  73. data/ext/libmspack/test/cabd_memory.c +179 -0
  74. data/ext/libmspack/test/cabd_test.c +386 -0
  75. data/ext/libmspack/test/cabrip.c +81 -0
  76. data/ext/libmspack/test/chmd_compare +38 -0
  77. data/ext/libmspack/test/chmd_find.c +95 -0
  78. data/ext/libmspack/test/chmd_md5.c +67 -0
  79. data/ext/libmspack/test/chmd_order.c +144 -0
  80. data/ext/libmspack/test/chminfo.c +284 -0
  81. data/ext/libmspack/test/chmx.c +216 -0
  82. data/ext/libmspack/test/error.h +22 -0
  83. data/ext/libmspack/test/expand.c +79 -0
  84. data/ext/libmspack/test/md5.c +457 -0
  85. data/ext/libmspack/test/md5.h +165 -0
  86. data/ext/libmspack/test/md5_fh.h +123 -0
  87. data/ext/libmspack/test/msdecompile_md5 +24 -0
  88. data/ext/libmspack/test/msexpand_md5 +39 -0
  89. data/ext/libmspack/test/multifh.c +435 -0
  90. data/ext/libmspack/test/oabx.c +41 -0
  91. data/ext/libmspack/test/test_files/cabd/1.pl +84 -0
  92. data/ext/libmspack/test/test_files/cabd/2.pl +75 -0
  93. data/ext/libmspack/test/test_files/cabd/bad_folderindex.cab +0 -0
  94. data/ext/libmspack/test/test_files/cabd/bad_nofiles.cab +0 -0
  95. data/ext/libmspack/test/test_files/cabd/bad_nofolders.cab +0 -0
  96. data/ext/libmspack/test/test_files/cabd/bad_signature.cab +0 -0
  97. data/ext/libmspack/test/test_files/cabd/multi_basic_pt1.cab +0 -0
  98. data/ext/libmspack/test/test_files/cabd/multi_basic_pt2.cab +0 -0
  99. data/ext/libmspack/test/test_files/cabd/multi_basic_pt3.cab +0 -0
  100. data/ext/libmspack/test/test_files/cabd/multi_basic_pt4.cab +0 -0
  101. data/ext/libmspack/test/test_files/cabd/multi_basic_pt5.cab +0 -0
  102. data/ext/libmspack/test/test_files/cabd/normal_255c_filename.cab +0 -0
  103. data/ext/libmspack/test/test_files/cabd/normal_2files_1folder.cab +0 -0
  104. data/ext/libmspack/test/test_files/cabd/partial_nodata.cab +0 -0
  105. data/ext/libmspack/test/test_files/cabd/partial_nofiles.cab +0 -0
  106. data/ext/libmspack/test/test_files/cabd/partial_nofolder.cab +0 -0
  107. data/ext/libmspack/test/test_files/cabd/partial_shortextheader.cab +0 -0
  108. data/ext/libmspack/test/test_files/cabd/partial_shortfile1.cab +0 -0
  109. data/ext/libmspack/test/test_files/cabd/partial_shortfile2.cab +0 -0
  110. data/ext/libmspack/test/test_files/cabd/partial_shortfolder.cab +0 -0
  111. data/ext/libmspack/test/test_files/cabd/partial_shortheader.cab +0 -0
  112. data/ext/libmspack/test/test_files/cabd/partial_str_nofname.cab +0 -0
  113. data/ext/libmspack/test/test_files/cabd/partial_str_noninfo.cab +0 -0
  114. data/ext/libmspack/test/test_files/cabd/partial_str_nonname.cab +0 -0
  115. data/ext/libmspack/test/test_files/cabd/partial_str_nopinfo.cab +0 -0
  116. data/ext/libmspack/test/test_files/cabd/partial_str_nopname.cab +0 -0
  117. data/ext/libmspack/test/test_files/cabd/partial_str_shortfname.cab +0 -0
  118. data/ext/libmspack/test/test_files/cabd/partial_str_shortninfo.cab +0 -0
  119. data/ext/libmspack/test/test_files/cabd/partial_str_shortnname.cab +0 -0
  120. data/ext/libmspack/test/test_files/cabd/partial_str_shortpinfo.cab +0 -0
  121. data/ext/libmspack/test/test_files/cabd/partial_str_shortpname.cab +0 -0
  122. data/ext/libmspack/test/test_files/cabd/reserve_---.cab +0 -0
  123. data/ext/libmspack/test/test_files/cabd/reserve_--D.cab +0 -0
  124. data/ext/libmspack/test/test_files/cabd/reserve_-F-.cab +0 -0
  125. data/ext/libmspack/test/test_files/cabd/reserve_-FD.cab +0 -0
  126. data/ext/libmspack/test/test_files/cabd/reserve_H--.cab +0 -0
  127. data/ext/libmspack/test/test_files/cabd/reserve_H-D.cab +0 -0
  128. data/ext/libmspack/test/test_files/cabd/reserve_HF-.cab +0 -0
  129. data/ext/libmspack/test/test_files/cabd/reserve_HFD.cab +0 -0
  130. data/ext/libmspack/test/test_files/cabd/search_basic.cab +0 -0
  131. data/ext/libmspack/test/test_files/cabd/search_tricky1.cab +0 -0
  132. data/ext/libmspack/winbuild.sh +26 -0
  133. data/ext/x86_64-windows/libmspack.dll +0 -0
  134. data/lib/libmspack/constants.rb +9 -0
  135. data/lib/libmspack/exceptions.rb +12 -0
  136. data/lib/libmspack/mscab.rb +722 -0
  137. data/lib/libmspack/mschm.rb +301 -0
  138. data/lib/libmspack/mshlp.rb +15 -0
  139. data/lib/libmspack/mskwaj.rb +124 -0
  140. data/lib/libmspack/mslit.rb +18 -0
  141. data/lib/libmspack/msoab.rb +36 -0
  142. data/lib/libmspack/mspack.rb +208 -0
  143. data/lib/libmspack/msszdd.rb +81 -0
  144. data/lib/libmspack/system.rb +84 -0
  145. data/lib/libmspack/version.rb +4 -0
  146. data/lib/libmspack.rb +121 -0
  147. data/libmspack.gemspec +33 -0
  148. data/spec/libmspack_spec.rb +26 -0
  149. data/spec/spec_helper.rb +5 -0
  150. metadata +309 -0
@@ -0,0 +1,491 @@
1
+ 2013-05-27 Stuart Caie <kyzer@4u.net>
2
+
3
+ * test/oabx.c: added new example command for unpacking OAB files.
4
+
5
+ 2013-05-17 Stuart Caie <kyzer@4u.net>
6
+
7
+ * mspack.h: Support for decompressing a new file format, the Exchange
8
+ Offline Address Book (OAB). Thanks to David Woodhouse for writing
9
+ the implementation. I've bumped the version to 0.4alpha in celebration.
10
+
11
+ 2012-04-15 Stuart Caie <kyzer@4u.net>
12
+
13
+ * chmd_read_headers(): More thorough validation of CHM header values.
14
+ Thanks to Sergei Trofimovich for finding sample files.
15
+
16
+ * read_reset_table(): Better test for overflow. Thanks again to
17
+ Sergei Trofimovich for generating a good example.
18
+
19
+ * test/chminfo.c: this test program reads the reset table by itself
20
+ and was also susceptible to the same overflow problems.
21
+
22
+ 2012-03-16 Stuart Caie <kyzer@4u.net>
23
+
24
+ * Makefile.am, configure.ac: make the GCC warning flags conditional
25
+ on using the GCC compiler. Thanks to Dagobert Michelsen for letting
26
+ me know.
27
+
28
+ 2011-11-25 Stuart Caie <kyzer@4u.net>
29
+
30
+ * lzxd_decompress(): Prevent matches that go beyond the start
31
+ of the LZX stream. Thanks to Sergei Trofimovich for testing
32
+ with valgrind and finding a corrupt sample file that exercises
33
+ this scenario.
34
+
35
+ 2011-11-23 Stuart Caie <kyzer@4u.net>
36
+
37
+ * chmd_fast_find(): add a simple check against infinite PGML
38
+ loops. Thanks to Sergei Trofimovich for finding sample files.
39
+ Multi-step PGML or PGMI infinite loops remain possible.
40
+
41
+ 2011-06-17 Stuart Caie <kyzer@4u.net>
42
+
43
+ * read_reset_table(): wasn't reading the right offset for getting
44
+ the LZX uncompressed length. Thanks to Sergei Trofimovich for
45
+ finding the bug.
46
+
47
+ 2011-05-31 Stuart Caie <kyzer@4u.net>
48
+
49
+ * kwajd.c, mszipd.c: KWAJ type 4 files (MSZIP) are now supported.
50
+ Thanks to Clive Turvey for sending me the format details.
51
+
52
+ * doc/szdd_kwaj_format.html: Updated documentation to cover
53
+ KWAJ's MSZIP compression.
54
+
55
+ 2011-05-11 Stuart Caie <kyzer@4u.net>
56
+
57
+ * cabd_find(): rethought how large vs small file support is
58
+ handled, as users were getting "library not compiled to support
59
+ large files" message on some small files. Now checks for actual
60
+ off_t overflow, rather than trying to preempt it.
61
+
62
+ 2011-05-10: Stuart Caie <kyzer@4u.net>
63
+
64
+ * chmd.c: implemented fast_find()
65
+
66
+ * test/chmx.c: removed the multiple extraction orders, now it just
67
+ extracts in the fastest order
68
+
69
+ * test/chmd_order.c: new program added to test that different
70
+ extraction orders don't affect the results of extraction
71
+
72
+ * test/chmd_find.c: new program to test that fast_find() works.
73
+ Either supply your own filename to find, or it will try finding
74
+ every file in the CHM.
75
+
76
+ * configure.ac: because CHM fast find requires case-insensitive
77
+ comparisons, tolower() or towlower() are used where possible.
78
+ These functions and their headers are checked for.
79
+
80
+ * mspack.h: exposed struct mschmd_sec_mscompressed's spaninfo
81
+ and struct mschmd_header's first_pmgl, last_pmgl and chunk_cache
82
+ to the world. Check that the CHM decoder version is v2 or higher
83
+ before using them.
84
+
85
+ * system.c: set CHM decoder version to v2
86
+
87
+ 2011-04-27: Stuart Caie <kyzer@4u.net>
88
+
89
+ * many files: Made C++ compilers much happier with libmspack.
90
+ Changed char * to const char * where possible.
91
+
92
+ * mspack.h: Changed user-supplied char * to const char *.
93
+ Unless you've written your own mspack_system implementation,
94
+ you will likely be unaffected.
95
+ If you have written your own mspack_system implementation:
96
+ 1: change open() so it takes a const char *filename
97
+ 2: change message() so it takes a const char *format
98
+ If you cast your function into the mspack_system struct,
99
+ you can change the cast instead of the function.
100
+
101
+ 2011-04-27: Stuart Caie <kyzer@4u.net>
102
+
103
+ * Makefile.am: changed CFLAGS from "-Wsign-compare -Wconversion
104
+ -pedantic" to "-W -Wno-unused". This enables more warnings, and
105
+ disables these specific warnings which are now a hinderance.
106
+
107
+ 2011-04-27: Stuart Caie <kyzer@4u.net>
108
+
109
+ * test/cabrip.c, test/chminfo.c: used macros from system.h for
110
+ printing offsets and reading 64-bit values, rather than
111
+ reinvent the wheel.
112
+
113
+ * cabd_can_merge_folders(): declare variables at the start of
114
+ a block so older C compilers won't choke.
115
+
116
+ * cabd_find(): avoid compiler complaints about non-initialised
117
+ variables. We know they'll get initialised before use, but the
118
+ compiler can't reverse a state machine to draw the same conclusion.
119
+
120
+ 2011-04-26: Stuart Caie <kyzer@4u.net>
121
+
122
+ * configure.ac, mspack/system.h: Added a configure test to get
123
+ the size of off_t. If off_t is 8 bytes or more, we presume this
124
+ system has large file support. This fixes LFS detection for Fedora
125
+ x86_64 and Darwin/Mac OS X, neither of which declare FILESIZEBITS in
126
+ <limits.h>. It's not against the POSIX standard to do this: "A
127
+ definition of [FILESIZEBITS] shall be omitted from the <limits.h>
128
+ header on specific implementations where the corresponding value is
129
+ equal to or greater than the stated minimum, but where the value can
130
+ vary depending on the file to which it is applied."
131
+ (http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html)
132
+ Thanks to Edward Sheldrake for the patch.
133
+
134
+ 2011-04-26: Stuart Caie <kyzer@4u.net>
135
+
136
+ * chmd.c: all 64-bit integer reads are now consolidated into
137
+ the read_off64() function
138
+
139
+ * chmd_read_headers(): this function has been made resilient
140
+ against accessing memory past the end of a chunk. Thanks to
141
+ Sergei Trofimovich for sending me examples and analysis.
142
+
143
+ * chmd_init_decomp(): this function now reads the SpanInfo file
144
+ if the ResetTable file isn't available, it also checks that each
145
+ system file it needs is large enough before accessing it, and
146
+ some of its code has been split into several new functions:
147
+ find_sys_file(), read_reset_table() and read_spaninfo()
148
+
149
+ 2011-04-26: Stuart Caie <kyzer@4u.net>
150
+
151
+ * mspack.h, chmd.c: now reads the SpanInfo system file if the
152
+ ResetTable file isn't available. This adds a new spaninfo pointer
153
+ into struct mschmd_sec_mscompressed
154
+
155
+ 2011-04-26: Stuart Caie <kyzer@4u.net>
156
+
157
+ * test/chminfo.c: more sanity checks for corrupted CHM files where
158
+ entries go past the end of a PGML/PGMI chunk, thanks to
159
+ Sergei Trofimovich for sending me examples and analysis.
160
+
161
+ 2011-04-25: Stuart Caie <kyzer@4u.net>
162
+
163
+ * cabd_merge(): Drew D'Addesio showed me spanning cabinets which
164
+ don't have all the CFFILE entries they should, but otherwise have
165
+ all necessary data for extraction. Changed the merging folders
166
+ test to be less strict; if folders don't exactly match, warn which
167
+ files are missing, but allow merging if at least one necessary
168
+ file is present.
169
+
170
+ 2010-09-24: Stuart Caie <kyzer@4u.net>
171
+
172
+ * readhuff.h: Don't let build_decode_table() allow empty trees.
173
+ It's meant to be special case just for the LZX length tree, so
174
+ move that logic out to the LZX code. Thanks to Danny Kroshin for
175
+ discovering the bug.
176
+
177
+ * lzxd.c: Allow empty length trees, but not other trees. If
178
+ the length tree is empty, fail if asked to decode a length symbol.
179
+ Again, thanks to Danny Kroshin for discovering the bug.
180
+
181
+ 2010-09-20: Stuart Caie <kyzer@4u.net>
182
+
183
+ * Makefile.am: Set EXTRA_DIST so it doesn't include .svn
184
+ directories in the distribution, but does include docs.
185
+
186
+ 2010-09-20: Stuart Caie <kyzer@4u.net>
187
+
188
+ * Makefile.am, configure.ac: Use modern auto* practises; turn on
189
+ automake silent rules where possible, use "m4" directory for libtool
190
+ macros, use LT_INIT instead of AC_PROG_LIBTOOL and use AM_CPPFLAGS
191
+ instead of INCLUDES. Thanks to Sergei Trofimovich for the patch.
192
+
193
+ 2010-09-15: Stuart Caie <kyzer@4u.net>
194
+
195
+ * many files: Made the code compile with C++
196
+ - Renamed all 'this' variables/parameters to 'self'
197
+ - Added casts to all memory allocations.
198
+ - Added extern "C" to header files with extern declarations.
199
+ - Made system.c include system.h.
200
+ - Changed the K&R-style headers to ANSI-style headers in md5.c
201
+
202
+ 2010-08-04: Stuart Caie <kyzer@4u.net>
203
+
204
+ * many files: removed unnecessary <unistd.h> include
205
+
206
+ 2010-07-19: Stuart Caie <kyzer@4u.net>
207
+
208
+ * cabd_md5.c, chmd_md5.c: Replace writing files to disk then
209
+ MD5summing them, with an MD5summer built into mspack_system.
210
+ Much, much faster results.
211
+
212
+ * qtmd_decompress(): Robert Riebisch pointed out a Quantum
213
+ data integrity check that could never be tripped, because
214
+ frame_todo is unsigned, so it will never be decremented
215
+ below zero. Replaced the check with one that assumes that
216
+ decrementing past zero wraps frame_todo round to a number
217
+ more than its maximum value (QTM_FRAME_SIZE).
218
+
219
+ 2010-07-18: Stuart Caie <kyzer@4u.net>
220
+
221
+ * cabd.c: Special logic to pass cabd_sys_read() errors back
222
+ to cabd_extract() wasn't compatible with the decompressor
223
+ logic of returning the same error repeatedly once unpacking
224
+ fails. This meant that if decompressing failed because of
225
+ a read error, then the next file in the same folder would
226
+ come back as "no error", but the decompressed wouldn't have
227
+ even attempted to decompress the file. Added a new state
228
+ variable, read_error, with the same lifespan as a decompressor,
229
+ to pass the underlying reason for MSPACK_ERR_READ errors back.
230
+
231
+ * mszipd.c: improve MS-ZIP recovery by saving all the bytes
232
+ decoded prior to a block failing. This requires remembering
233
+ how far we got through the block, so the code has been made
234
+ slightly slower (about 0.003 seconds slower per gigabyte
235
+ unpacked) by removing the local variable window_posn
236
+ and keeping it in the state structure instead.
237
+
238
+ 2010-07-16: Stuart Caie <kyzer@4u.net>
239
+
240
+ * Makefile.am: strange interactions. When -std=c99 is used,
241
+ my Ubuntu's <stdio.h> (libc6-dev 2.11.1-0ubuntu7.2) does NOT
242
+ define fseeko() unless _LARGEFILE_SOURCE is also defined. But
243
+ configure always uses -std=gnu99, not -std=c99, so its test
244
+ determines _LARGEFILE_SOURCE isn't needed but HAVE_FSEEKO is
245
+ true. The implicit fseeko definition has a 32-bit rather than
246
+ 64-bit offset, which means the mode parameter is interpreted
247
+ as part of the offset, and the mode is taken from the stack,
248
+ which is generally 0 (SEEK_SET). This breaks all SEEK_CURs.
249
+ The code works fine when -std=c99 is not set, so just remove
250
+ it for the time being.
251
+
252
+ 2010-07-12: Stuart Caie <kyzer@4u.net>
253
+
254
+ * system.c: Reject reading/writing a negative number of bytes.
255
+
256
+ * chmd.c: allow zero-length files to be seen. Previously they were
257
+ skipped because they were mistaken for directory entries.
258
+
259
+ 2010-07-08: Stuart Caie <kyzer@4u.net>
260
+
261
+ * qtmd.c: Larry Frieson found an important bug in the Quantum
262
+ decoder. Window wraps flush all unwritten data to disk.
263
+ However, sometimes less data is needed, which makes
264
+ out_bytes negative, which is then passed to write(). Some
265
+ write() implementations treat negative sizes it as a large
266
+ positive integer and segfault trying to write the buffer.
267
+
268
+ * Makefile.am, test/*.c: fixed automake file so that the
269
+ package passes a "make distcheck".
270
+
271
+ 2010-07-07: Stuart Caie <kyzer@4u.net>
272
+
273
+ * doc/szdd_kwaj_format.html: explain SZDD/KWAJ file format.
274
+
275
+ * lzssd.c: fixed SZDD decompression bugs.
276
+
277
+ * test/chmd_compare: Add scripts for comparing chmd_md5 against
278
+ Microsoft's own code.
279
+
280
+ * test/chmd_md5.c: remove the need to decompress everything
281
+ twice, as this is already in chmx.c if needed.
282
+
283
+ 2010-07-06: Stuart Caie <kyzer@4u.net>
284
+
285
+ * many files: added SZDD and KWAJ decompression support.
286
+
287
+ 2010-06-18: Stuart Caie <kyzer@4u.net>
288
+
289
+ * system.h: expanded the test for 64-bit largefile support so
290
+ it also works on 64-bit native operating systems where you
291
+ don't have to define _FILE_OFFSET_BITS.
292
+
293
+ 2010-06-17: Stuart Caie <kyzer@4u.net>
294
+
295
+ * libmspack.pc.in: Added pkg-config support. Thanks to
296
+ Patrice Dumas for the patch.
297
+
298
+ 2010-06-14: Stuart Caie <kyzer@4u.net>
299
+
300
+ * qtmd.c, lzxd.c, mszipd.c: created new headers, readbits.h and
301
+ readhuff.h, which bundle up the bit-reading and huffman-reading
302
+ code found in the MSZIP, LZX and Quantum decoders.
303
+
304
+ 2010-06-11: Stuart Caie <kyzer@4u.net>
305
+
306
+ * qtmd_static_init(): Removed function in favour of static const
307
+ tables, same rationale as for lzxd_static_init().
308
+
309
+ * qtmd_read_input(), zipd_read_input(): After testing against my
310
+ set of CABs from the wild, I've found both these functions _need_
311
+ an extra EOF flag, like lzxd_read_input() has. So I've added
312
+ it. This means CABs get decoded properly AND there's no reading
313
+ fictional bytes.
314
+
315
+ 2010-06-03: Stuart Caie <kyzer@4u.net>
316
+
317
+ * test/cabd_md5.c: updated this so it has better output and
318
+ doesn't need to be in the same directory as the files for multi-
319
+ part sets.
320
+
321
+ 2010-05-20: Stuart Caie <kyzer@4u.net>
322
+
323
+ * qtmd_read_input(), zipd_read_input(): Both these functions are
324
+ essentially copies of lzxd_read_input(), but that has a feature
325
+ they don't have - an extra EOF flag. So if EOF is
326
+ encountered (sys->read() returns 0 bytes), these don't pass on the
327
+ error. Their respective bit-reading functions that called them
328
+ then go on to access at least one byte of the input buffer, which
329
+ doesn't exist as sys->read() returned 0. Thanks to Michael
330
+ Vidrevich for spotting this and providing a test case.
331
+
332
+ 2010-05-20: Stuart Caie <kyzer@4u.net>
333
+
334
+ * system.h: It turns out no configure.ac tests are needed to
335
+ decide between __func__ and __FUNCTION__, so I put the standard
336
+ one (__func__) back into the D() macro, along with some
337
+ special-case ifdefs for old versions of GCC.
338
+
339
+ * lzxd_static_init(): Removed function in favour of static const
340
+ tables. Jorge Lodos thinks it causes multithreading problems, I
341
+ disagree. However, there are speed benefits to declaring the
342
+ tables as static const.
343
+
344
+ * cabd_init_decomp(): Fixed code which never runs but would write
345
+ to a null pointer if it could. Changed it to an assert() as it
346
+ will only trip if someone rewrites the internals of cabd.c. Thanks
347
+ to Jorge Lodos for finding it.
348
+
349
+ * inflate(): Fixed an off-by-one error: if the LITERAL table
350
+ emitted code 286, this would read one byte past the end of
351
+ lit_extrabits[]. Thanks to Jorge Lodos for finding it.
352
+
353
+ 2010-05-06: Stuart Caie <kyzer@4u.net>
354
+
355
+ * test/cabrip.c, test/chminfo.c: add fseeko() support
356
+
357
+ 2009-06-01: Stuart Caie <kyzer@4u.net>
358
+
359
+ * README: clarify the extended license terms
360
+
361
+ * doc, Makefile.am: make the doxygen makefile work when using
362
+ an alternate build directory
363
+
364
+ 2006-09-20: Stuart Caie <kyzer@4u.net>
365
+
366
+ * system.h: I had a choice of adding more to configure.ac to
367
+ test for __func__ and __FUNCTION__, or just removing __FUNCTION__
368
+ from the D() macro. I chose the latter.
369
+
370
+ * Makefile.am: Now the --enable-debug in configure will actually
371
+ apply -DDEBUG to the sources.
372
+
373
+ 2006-09-20: Stuart Caie <kyzer@4u.net>
374
+
375
+ * qtmd_decompress(): Fixed a major bug in the QTM decoder, as
376
+ reported by Tomasz Kojm last year. Removed the restriction on
377
+ window sizes as a result. Correctly decodes the XLVIEW cabinets.
378
+
379
+ 2006-08-31: Stuart Caie <kyzer@4u.net>
380
+
381
+ * lzxd_decompress(): Two major bugs fixed. Firstly, the R0/R1/R2
382
+ local variables weren't set to 1 after lzxd_reset_state().
383
+ Secondly, the LZX decompression stream can sometimes become
384
+ odd-aligned (after an uncompressed block) and the next 16 bit
385
+ fetch needs to be split across two input buffers, ENSURE_BITS()
386
+ didn't cover this case. Many thanks to Igor Glucksmann for
387
+ discovering both these bugs.
388
+
389
+ 2005-06-30: Stuart Caie <kyzer@4u.net>
390
+
391
+ * cabd_search(): fixed problems with searching files > 4GB for
392
+ cabinets.
393
+
394
+ 2005-06-23: Stuart Caie <kyzer@4u.net>
395
+
396
+ * qtmd_init(): The QTM decoder is broken for QTM streams with a
397
+ window size less than the frame size. Until this is fixed, fail
398
+ to initialise QTM window sizes less than 15. Thanks to Tomasz Kojm
399
+ for finding the bug.
400
+
401
+ 2005-03-22: Stuart Caie <kyzer@4u.net>
402
+
403
+ * system.h: now undefs "read", as the latest glibc defines read()
404
+ as a macro which messes everything up. Thanks to Ville Skytt� for
405
+ the update.
406
+
407
+ 2005-03-14: Stuart Caie <kyzer@4u.net>
408
+
409
+ * test/multifh.c: write an mspack_system implementation that can
410
+ handle normal disk files, open file handles, open file descriptors
411
+ and raw memory all at the same time.
412
+
413
+ 2005-02-24: Stuart Caie <kyzer@4u.net>
414
+
415
+ * chmd_read_headers(): avoid infinite loop when chmhs1_ChunkSize is
416
+ zero. Thanks to Serge Semashko for the research and discovery.
417
+
418
+ 2005-02-18: Stuart Caie <kyzer@4u.net>
419
+
420
+ * mspack.h: renamed the "interface" parameter of mspack_version() to
421
+ "entity", as interface is a reserved word in C++. Thanks to Yuriy Z
422
+ for the discovery.
423
+
424
+ 2004-12-09: Stuart Caie <kyzer@4u.net>
425
+
426
+ * lzss.h, szdd.h, szddd.h: more work on the SZDD/LZSS design.
427
+
428
+ 2004-06-12: Stuart Caie <kyzer@4u.net>
429
+
430
+ * lzxd_static_init(): removed write to lzxd_extra_bits[52], thanks
431
+ to Nigel Horne from the ClamAV project.
432
+
433
+ 2004-04-23: Stuart Caie <kyzer@4u.net>
434
+
435
+ * mspack.h: changed 'this' parameters to 'self' to allow compiling in
436
+ C++ compilers, thanks to Michal Cihar for the suggestion.
437
+
438
+ * mspack.h, system.h, mspack.def, winbuild.sh: integrated some changes
439
+ from Petr Blahos to let libmspack build as a Win32 DLL.
440
+
441
+ * chmd_fast_find(): added the first part of this code, and comments
442
+ sufficient to finish it :)
443
+
444
+ 2004-04-08 Stuart Caie <kyzer@4u.net>
445
+
446
+ * test/chminfo.c: added a program for dumping useful data from CHM
447
+ files, e.g. index entries and reset tables. I wrote this a while ago
448
+ for investigating a corrupt cabinet, but I never committed it.
449
+
450
+ 2004-03-26 Stuart Caie <kyzer@4u.net>
451
+
452
+ * test/cabd_memory.c: added a new test example which shows an
453
+ mspack_system implementation that reads and writes from memory only,
454
+ no file I/O. Even the source code has a little cab file embedded in it.
455
+
456
+ 2004-03-10 Stuart Caie <kyzer@4u.net>
457
+
458
+ * cabd.c: updated the location of the CAB SDK.
459
+
460
+ * cabd.c: changed a couple of MSPACK_ERR_READ errors not based on
461
+ read() failures into MSPACK_ERR_DATAFORMAT errors.
462
+
463
+ * mszipd_decompress(): repair mode now aborts after writing a
464
+ repaired block if the error was a hard error (e.g. read error, out
465
+ of blocks, etc)
466
+
467
+ 2004-03-08 Stuart Caie <kyzer@4u.net>
468
+
469
+ * Makefile.am: now builds and installs a versioned library.
470
+
471
+ * mszipd.c: completed a new MS-ZIP and inflate implementation.
472
+
473
+ * system.c: added mspack_version() and committed to a versioned
474
+ ABI for the library.
475
+
476
+ * cabd.c: made mszip repair functionality work correctly.
477
+
478
+ * cabd.c: now identifies invalid block headers
479
+
480
+ * doc/: API documentation is now included with the library, not
481
+ just on the web.
482
+
483
+ * chmd.c: fixed error messages and 64-bit debug output.
484
+
485
+ * chmd.c: now also catches NULL files in section 1.
486
+
487
+ * test/chmx.c: now acts more like cabextract.
488
+
489
+ 2003-08-29 Stuart Caie <kyzer@4u.net>
490
+
491
+ * ChangeLog: started keeping a ChangeLog :)
@@ -0,0 +1,100 @@
1
+ EXTRA_DIST = $(srcdir)/debian/* $(srcdir)/doc/* $(srcdir)/test/test_files/*/*
2
+ pkgconfigdir = $(libdir)/pkgconfig
3
+ pkgconfig_DATA = libmspack.pc
4
+
5
+ dist-hook:
6
+ -rm -f $(distdir)/*.la
7
+
8
+ ACLOCAL_AMFLAGS = -I m4
9
+ AM_CFLAGS =
10
+ # add "-DMSPACK_NO_DEFAULT_SYSTEM" to remove default mspack_system
11
+ if DEBUG
12
+ AM_CFLAGS += -DDEBUG
13
+ endif
14
+ if GCC
15
+ AM_CFLAGS += -Wall -W -Wno-unused
16
+ endif
17
+ AM_CPPFLAGS = -I$(top_srcdir)/mspack -I$(top_srcdir)/test
18
+
19
+ lib_LTLIBRARIES = libmspack.la
20
+ include_HEADERS = mspack/mspack.h
21
+
22
+ noinst_LTLIBRARIES = libmscabd.la libmschmd.la
23
+ noinst_PROGRAMS = test/cabd_md5 test/cabd_memory test/cabd_test \
24
+ test/cabrip test/chmd_md5 test/chmx test/chminfo \
25
+ test/multifh test/expand test/chmd_find \
26
+ test/chmd_order test/oabx
27
+
28
+ libmspack_la_SOURCES = mspack/mspack.h \
29
+ mspack/system.h mspack/system.c \
30
+ mspack/cab.h mspack/cabc.c mspack/cabd.c \
31
+ mspack/chm.h mspack/chmc.c mspack/chmd.c \
32
+ mspack/hlp.h mspack/hlpc.c mspack/hlpd.c \
33
+ mspack/lit.h mspack/litc.c mspack/litd.c \
34
+ mspack/kwaj.h mspack/kwajc.c mspack/kwajd.c \
35
+ mspack/szdd.h mspack/szddc.c mspack/szddd.c \
36
+ mspack/oab.h mspack/oabc.c mspack/oabd.c \
37
+ mspack/lzx.h mspack/lzxc.c mspack/lzxd.c \
38
+ mspack/mszip.h mspack/mszipc.c mspack/mszipd.c \
39
+ mspack/qtm.h mspack/qtmd.c \
40
+ mspack/readbits.h mspack/readhuff.h \
41
+ mspack/lzss.h mspack/lzssd.c \
42
+ mspack/des.h mspack/sha.h \
43
+ mspack/crc32.c mspack/crc32.h
44
+ libmspack_la_LDFLAGS = -export-symbols-regex '^mspack_' -version-info 1:0:1
45
+
46
+ libmscabd_la_SOURCES = mspack/mspack.h \
47
+ mspack/system.h mspack/system.c \
48
+ mspack/cab.h mspack/cabd.c \
49
+ mspack/lzx.h mspack/lzxd.c \
50
+ mspack/mszip.h mspack/mszipd.c \
51
+ mspack/qtm.h mspack/qtmd.c \
52
+ mspack/readbits.h mspack/readhuff.h
53
+ libmscabd_la_LDFLAGS = -export-symbols-regex '^mspack_'
54
+
55
+ libmschmd_la_SOURCES = mspack/mspack.h \
56
+ mspack/system.h mspack/system.c \
57
+ mspack/chm.h mspack/chmd.c \
58
+ mspack/lzx.h mspack/lzxd.c \
59
+ mspack/readbits.h mspack/readhuff.h
60
+ libmschmd_la_LDFLAGS = -export-symbols-regex '^mspack_'
61
+
62
+ test_chmx_SOURCES = test/chmx.c test/error.h libmschmd.la
63
+ test_chmx_LDADD = libmschmd.la
64
+
65
+ test_chmd_md5_SOURCES = test/chmd_md5.c test/md5.c test/md5.h test/md5_fh.h \
66
+ test/error.h libmschmd.la
67
+ test_chmd_md5_LDADD = libmschmd.la
68
+
69
+ test_cabd_md5_SOURCES = test/cabd_md5.c test/md5.c test/md5.h test/md5_fh.h \
70
+ test/error.h libmscabd.la
71
+ test_cabd_md5_LDADD = libmscabd.la
72
+
73
+ test_cabd_test_SOURCES= test/cabd_test.c libmscabd.la
74
+ test_cabd_test_LDADD = libmscabd.la
75
+
76
+ test_cabrip_SOURCES = test/cabrip.c libmscabd.la
77
+ test_cabrip_LDADD = libmscabd.la
78
+
79
+ test_cabd_memory_SOURCES = test/cabd_memory.c libmscabd.la
80
+ test_cabd_memory_LDADD = libmscabd.la
81
+
82
+ test_chminfo_SOURCES = test/chminfo.c libmschmd.la
83
+ test_chminfo_LDADD = libmschmd.la
84
+
85
+ test_multifh_SOURCES = test/multifh.c libmscabd.la
86
+ test_multifh_LDADD = libmscabd.la
87
+
88
+ test_expand_SOURCES = test/expand.c test/error.h libmspack.la
89
+ test_expand_LDADD = libmspack.la
90
+
91
+ test_chmd_find_SOURCES = test/chmd_find.c test/error.h libmschmd.la
92
+ test_chmd_find_LDADD = libmschmd.la
93
+
94
+ test_chmd_order_SOURCES = test/chmd_order.c test/md5.c test/md5.h test/md5_fh.h \
95
+ test/error.h libmschmd.la
96
+ test_chmd_order_LDADD = libmschmd.la
97
+
98
+ test_oabx_SOURCES = test/oabx.c test/md5.c test/md5.h test/md5_fh.h \
99
+ test/error.h libmspack.la
100
+ test_oabx_LDADD = libmspack.la
File without changes