libmspack 0.10.1.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/ext/libmspack/ChangeLog +145 -0
- data/ext/libmspack/INSTALL +3 -3
- data/ext/libmspack/Makefile.am +7 -4
- data/ext/libmspack/Makefile.in +265 -147
- data/ext/libmspack/README +3 -2
- data/ext/libmspack/aclocal.m4 +111 -113
- data/ext/libmspack/ar-lib +10 -9
- data/ext/libmspack/compile +9 -8
- data/ext/libmspack/config.guess +887 -613
- data/ext/libmspack/config.h.in +6 -9
- data/ext/libmspack/config.sub +1349 -1260
- data/ext/libmspack/configure +3035 -2490
- data/ext/libmspack/configure.ac +3 -3
- data/ext/libmspack/depcomp +4 -4
- data/ext/libmspack/install-sh +107 -74
- data/ext/libmspack/libmscabd.la +1 -1
- data/ext/libmspack/libmschmd.la +1 -1
- data/ext/libmspack/libmspack.la +1 -1
- data/ext/libmspack/ltmain.sh +156 -61
- data/ext/libmspack/m4/libtool.m4 +19 -12
- data/ext/libmspack/missing +8 -8
- data/ext/libmspack/mspack/cabd.c +21 -19
- data/ext/libmspack/mspack/chm.h +3 -2
- data/ext/libmspack/mspack/chmd.c +137 -57
- data/ext/libmspack/mspack/kwajd.c +29 -29
- data/ext/libmspack/mspack/lzx.h +0 -1
- data/ext/libmspack/mspack/lzxd.c +30 -154
- data/ext/libmspack/mspack/macros.h +64 -0
- data/ext/libmspack/mspack/mszipd.c +7 -18
- data/ext/libmspack/mspack/qtmd.c +3 -5
- data/ext/libmspack/mspack/readbits.h +14 -5
- data/ext/libmspack/mspack/readhuff.h +26 -21
- data/ext/libmspack/mspack/system.c +0 -5
- data/ext/libmspack/mspack/system.h +20 -67
- data/ext/libmspack/test-driver +16 -11
- data/ext/x86_64-linux/libmspack.so +0 -0
- data/ext/x86_64-windows/mspack.dll +0 -0
- data/lib/libmspack/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16c138dab348d9129240a06938de054771418d7895024ba81711623269f2c7fb
|
4
|
+
data.tar.gz: b2293589029da6c90b3a268a14df1db7198dc731f4600b2b532b389d04206c08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c81de40e4ea80a47c6624c475cf5830374a82de98637f6d2e3275be1a9fe1825e5b9a9b4c78a575bff9dd8b219118fcfa518077a4432f5508942ef05bcd02f72
|
7
|
+
data.tar.gz: 17f1372cc12cf52168fff3141275706f3920693339137211d6cf2a58ea3564e208ae3e72f534ec84f87f105ae1e0504c403aa5fb4780512c4892b3bc064550ff
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ end
|
|
15
15
|
desc 'Download libmspack source code'
|
16
16
|
task :libmspack do
|
17
17
|
require 'open-uri'
|
18
|
-
version = '0.
|
18
|
+
version = '0.11alpha'
|
19
19
|
source = "https://www.cabextract.org.uk/libmspack/libmspack-#{version}.tar.gz"
|
20
20
|
target = './ext/'
|
21
21
|
archivedir = 'libmspack-' + version
|
data/ext/libmspack/ChangeLog
CHANGED
@@ -1,3 +1,148 @@
|
|
1
|
+
2023-02-03 Stuart Caie <kyzer@cabextract.org.uk>
|
2
|
+
|
3
|
+
* configure.ac: do AC_CHECK_SIZEOF([off_t]) test only after
|
4
|
+
AC_SYS_LARGEFILE, because the latter can alter the size of off_t.
|
5
|
+
|
6
|
+
* cabd_extract(): file->offset and file->length are unsigned ints,
|
7
|
+
both of them and their sum are checked to be <= CAB_LENGTHMAX. But
|
8
|
+
recent code stuffs file->length into an off_t and checks that instead.
|
9
|
+
On 32-bit architectures, if file->length > 2GiB then the off_t is
|
10
|
+
negative, evading the check. Ultimately this causes the decompression
|
11
|
+
functions to return MSPACK_ERR_ARGS as they already guard against
|
12
|
+
being asked to decompress a negative number of bytes.
|
13
|
+
|
14
|
+
2023-02-01 Stuart Caie <kyzer@cabextract.org.uk>
|
15
|
+
|
16
|
+
* readbits.h, readhuff.h, cabd.c, kwajd.c, lzxd.c, mszipd.c, qtmd.c:
|
17
|
+
ensure bit operations (including intermediary ones) are considered
|
18
|
+
as unsigned int, so UBSan is happy.
|
19
|
+
|
20
|
+
2023-01-31 Stuart Caie <kyzer@cabextract.org.uk>
|
21
|
+
|
22
|
+
* chmd.c: replace READ_ENCINT() macro with stricter read_encint()
|
23
|
+
function that reads no more than 63 or 31 bits so ENCINTs can never
|
24
|
+
be negative.
|
25
|
+
|
26
|
+
I'd prefer to use unsigned types, but off_t is used for file offsets
|
27
|
+
and lengths to match the environment's file I/O, so changing it is
|
28
|
+
tricky and would change the current public API.
|
29
|
+
|
30
|
+
Additionally, UBSan complains about shifting a 1 into a signed
|
31
|
+
type's MSB. https://www.cs.utah.edu/~regehr/papers/tosem15.pdf
|
32
|
+
notes that this is legal in ANSI C and "fairly benign (and well-
|
33
|
+
defined until C99)", but C99 made it undefined for no good reason.
|
34
|
+
I don't agree with this, but I don't want someone else using a C99
|
35
|
+
compiler to end up miscompiling the code.
|
36
|
+
|
37
|
+
* chmd_read_headers(): the CHM's internally declared file length is
|
38
|
+
compared against its actual file length and a warning is printed if
|
39
|
+
they don't match.
|
40
|
+
|
41
|
+
* chmd_extract(): files in the uncompressed section will print a
|
42
|
+
warning if their declared length goes beyond the declared end of the
|
43
|
+
CHM file. This may not match the actual CHM file length. You will
|
44
|
+
still get seek or read errors if a file's offset or length go beyond
|
45
|
+
the actual CHM file length.
|
46
|
+
|
47
|
+
Files in the compressed section will now cause a decrunch error if
|
48
|
+
their declared offset goes beyond the uncompressed length of the
|
49
|
+
section. If their offset is OK but their declared length goes beyond
|
50
|
+
the end, they will print a warning and then decompress as much as
|
51
|
+
possible before causing an error.
|
52
|
+
|
53
|
+
2023-01-02 Stuart Caie <kyzer@cabextract.org.uk>
|
54
|
+
|
55
|
+
* kwajd_extract(): KWAJ compression method #2 is the QBasic variant
|
56
|
+
of the SZDD compression algorithm. Thanks to Jason Summers for finding
|
57
|
+
this and providing examples.
|
58
|
+
|
59
|
+
2021-07-20 Stuart Caie <kyzer@cabextract.org.uk>
|
60
|
+
|
61
|
+
* lzxd_decompress(): simplified the code that decodes match_offset.
|
62
|
+
Thanks to Jasper St. Pierre for prompting me to look at it.
|
63
|
+
|
64
|
+
2020-12-30 Stuart Caie <kyzer@cabextract.org.uk>
|
65
|
+
|
66
|
+
* cabd_read_string(): libmspack no longer rejects CAB files with
|
67
|
+
empty previnfo/nextinfo strings. Thanks to Simon Tatham for the
|
68
|
+
patch, and for noting that WiX v4 currently generates such files.
|
69
|
+
|
70
|
+
2020-08-10 Stuart Caie <kyzer@cabextract.org.uk>
|
71
|
+
|
72
|
+
* lzxd_decompress(): merged the code for decoding aligned and
|
73
|
+
verbatim blocks, also verified there is no significant performance
|
74
|
+
penalty.
|
75
|
+
|
76
|
+
2020-08-07 Stuart Caie <kyzer@cabextract.org.uk>
|
77
|
+
|
78
|
+
* read_sys_file(): in a CHM file, the ControlData and ResetTable
|
79
|
+
files are loaded entirely into memory, regardless of file size.
|
80
|
+
This is not in the spirit of letting users control memory usage.
|
81
|
+
|
82
|
+
ControlData previously had to be at least 28 bytes (in case a new,
|
83
|
+
larger version of the file ever appeared), but is now rejected
|
84
|
+
if not exactly 28 bytes.
|
85
|
+
|
86
|
+
ResetTable can theoretically be huge; the longest LZX stream of
|
87
|
+
16 exabytes could have a 4 petabyte ResetTable. Practically, the
|
88
|
+
largest seen in the wild is 46 kilobytes (PHP manuals). I picked
|
89
|
+
an arbitrary upper limit of 1MB; please get in contact if you
|
90
|
+
know of any CHM files in the wild that are largest than this.
|
91
|
+
|
92
|
+
Thanks to seviezhou on Github for reporting this.
|
93
|
+
|
94
|
+
2020-04-13 Stuart Caie <kyzer@cabextract.org.uk>
|
95
|
+
|
96
|
+
* system.h: clear up libmspack's large file support.
|
97
|
+
|
98
|
+
To support large files, do this:
|
99
|
+
|
100
|
+
1. add any defines that your compiler needs to enable large file
|
101
|
+
support. It may be supported by default.
|
102
|
+
2. Define HAVE_FSEEKO if fseeko() and ftello() are available.
|
103
|
+
3. Define SIZEOF_OFF_T to the value of sizeof(off_t); it must be a
|
104
|
+
literal value because sizeof() can't be used in preprocessor tests.
|
105
|
+
|
106
|
+
libmspack uses the off_t datatype for all file offsets. If off_t is
|
107
|
+
less than 64 bits, libmspack will return an error when processing
|
108
|
+
CHM files with offsets beyond 2GB, and won't search for CAB headers
|
109
|
+
beyond 2GB into a file. In both cases, it prints a warning message
|
110
|
+
that the library doesn't support large files.
|
111
|
+
|
112
|
+
2020-04-13 Stuart Caie <kyzer@cabextract.org.uk>
|
113
|
+
|
114
|
+
* macros.h: new header for the D(), LD/LU and EndGet???() macros.
|
115
|
+
Use this instead of system.h.
|
116
|
+
|
117
|
+
* system.h: if MSPACK_NO_DEFAULT_SYSTEM is defined, define
|
118
|
+
inline versions of the only standard C functions used in
|
119
|
+
mspack (strlen, memcmp, memset), so that no standard C library
|
120
|
+
functions are needed at all.
|
121
|
+
|
122
|
+
2020-01-08 Stuart Caie <kyzer@cabextract.org.uk>
|
123
|
+
|
124
|
+
* lzxd_decompress(): do not apply the E8 transformation on the
|
125
|
+
32769th LZX frame! Thanks to Cezary Sliwa for discovering this
|
126
|
+
bug and providing an example cab file (which is
|
127
|
+
http://download.windowsupdate.com/d/msdownload/update/driver/
|
128
|
+
drvs/2019/11/016c7f3e-809d-4720-893b-
|
129
|
+
e0d74f10c39d_35e12507628e8dc8ae5fb3332835f4253d2dab23.cab)
|
130
|
+
|
131
|
+
* cabd_compare: use EXPAND.EXE instead of EXTRACT.EXE when
|
132
|
+
testing files in a directory called 'expand'. The example
|
133
|
+
cab file above is extracted wrongly by EXTRACT.EXE, but
|
134
|
+
correctly by EXPAND.EXE because they take different approaches
|
135
|
+
to E8 transformations:
|
136
|
+
|
137
|
+
- EXTRACT.EXE writes "E8E8E8E8E8E8' to the last 6 bytes of
|
138
|
+
frame, looks for E8 bytes up to the last 6 bytes, then restores
|
139
|
+
the last 6 bytes, leaving partial transforms of 1-3 bytes if
|
140
|
+
E8 byte is found near the end of the frame
|
141
|
+
|
142
|
+
- EXPAND.EXE looks for E8 bytes up to the last 10 bytes of a
|
143
|
+
frame, therefore the last 6 bytes are never altered and all
|
144
|
+
transforms are 4 bytes
|
145
|
+
|
1
146
|
2019-02-18 Stuart Caie <kyzer@cabextract.org.uk>
|
2
147
|
|
3
148
|
* chmd_read_headers(): a CHM file name beginning "::" but shorter
|
data/ext/libmspack/INSTALL
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Installation Instructions
|
2
2
|
*************************
|
3
3
|
|
4
|
-
Copyright (C) 1994-1996, 1999-2002, 2004-
|
5
|
-
Foundation, Inc.
|
4
|
+
Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free
|
5
|
+
Software Foundation, Inc.
|
6
6
|
|
7
7
|
Copying and distribution of this file, with or without modification,
|
8
8
|
are permitted in any medium without royalty provided the copyright
|
@@ -225,7 +225,7 @@ order to use an ANSI C compiler:
|
|
225
225
|
|
226
226
|
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
227
227
|
|
228
|
-
HP-UX 'make' updates targets which have the same
|
228
|
+
HP-UX 'make' updates targets which have the same timestamps as their
|
229
229
|
prerequisites, which makes it generally unusable when shipped generated
|
230
230
|
files such as 'configure' are involved. Use GNU 'make' instead.
|
231
231
|
|
data/ext/libmspack/Makefile.am
CHANGED
@@ -5,7 +5,10 @@ TESTS = $(check_PROGRAMS)
|
|
5
5
|
|
6
6
|
ACLOCAL_AMFLAGS = -I m4
|
7
7
|
AM_CFLAGS =
|
8
|
-
# add "-DMSPACK_NO_DEFAULT_SYSTEM" to remove default mspack_system
|
8
|
+
# add "-DMSPACK_NO_DEFAULT_SYSTEM" to remove default mspack_system.
|
9
|
+
# however, note that many of the tests and examples provided DO rely on the
|
10
|
+
# default mspack_system and will fail without it -- any program with a call
|
11
|
+
# like "mspack_create_...(NULL)" expects a default mspack_system.
|
9
12
|
if GCC
|
10
13
|
AM_CFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-unused-result
|
11
14
|
endif
|
@@ -34,7 +37,7 @@ libmspack_la_SOURCES = mspack/mspack.h \
|
|
34
37
|
mspack/lzx.h mspack/lzxc.c mspack/lzxd.c \
|
35
38
|
mspack/mszip.h mspack/mszipc.c mspack/mszipd.c \
|
36
39
|
mspack/qtm.h mspack/qtmd.c \
|
37
|
-
mspack/readbits.h mspack/readhuff.h \
|
40
|
+
mspack/macros.h mspack/readbits.h mspack/readhuff.h \
|
38
41
|
mspack/lzss.h mspack/lzssd.c \
|
39
42
|
mspack/des.h mspack/sha.h \
|
40
43
|
mspack/crc32.c mspack/crc32.h
|
@@ -46,14 +49,14 @@ libmscabd_la_SOURCES = mspack/mspack.h \
|
|
46
49
|
mspack/lzx.h mspack/lzxd.c \
|
47
50
|
mspack/mszip.h mspack/mszipd.c \
|
48
51
|
mspack/qtm.h mspack/qtmd.c \
|
49
|
-
mspack/readbits.h mspack/readhuff.h
|
52
|
+
mspack/macros.h mspack/readbits.h mspack/readhuff.h
|
50
53
|
libmscabd_la_LDFLAGS = -export-symbols-regex '^mspack_'
|
51
54
|
|
52
55
|
libmschmd_la_SOURCES = mspack/mspack.h \
|
53
56
|
mspack/system.h mspack/system.c \
|
54
57
|
mspack/chm.h mspack/chmd.c \
|
55
58
|
mspack/lzx.h mspack/lzxd.c \
|
56
|
-
mspack/readbits.h mspack/readhuff.h
|
59
|
+
mspack/macros.h mspack/readbits.h mspack/readhuff.h
|
57
60
|
libmschmd_la_LDFLAGS = -export-symbols-regex '^mspack_'
|
58
61
|
|
59
62
|
examples_cabd_memory_SOURCES = examples/cabd_memory.c libmscabd.la
|