ClamAV is an open source (GPLv2) anti-virus toolkit.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
clamav/libclammspack
Micah Snyder 4010925608 Re-applying libmspack adjustments to extract and scan files from archives that are non-standard and may appear to be corrupted or may in fact be corrupted. Differences from previous implementation: Fewer debug log messages. No normalization of filenames found in CAB archives. Implemented new param that enabled the best-effort attempt to extract possibly malformed archives. Used set_param() to enabled the FIXMSZIP option where it was previously hardcoded. Opted to provide the -Wno-unused-parameter CFLAG to the compiler in place of explicitely indicating unused parameters in each function. Omitted changes to mszipd.c and also omitted quantum decompression (qtmd.c) infinite loop protection because it appears to have been fixed in the newer libmspack. 7 years ago
..
debian Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
doc Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
examples Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
m4 Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
mspack Re-applying libmspack adjustments to extract and scan files from archives that are non-standard and may appear to be corrupted or may in fact be corrupted. Differences from previous implementation: Fewer debug log messages. No normalization of filenames found in CAB archives. Implemented new param that enabled the best-effort attempt to extract possibly malformed archives. Used set_param() to enabled the FIXMSZIP option where it was previously hardcoded. Opted to provide the -Wno-unused-parameter CFLAG to the compiler in place of explicitely indicating unused parameters in each function. Omitted changes to mszipd.c and also omitted quantum decompression (qtmd.c) infinite loop protection because it appears to have been fixed in the newer libmspack. 7 years ago
src Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
test Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
AUTHORS Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
COPYING.LIB Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
ChangeLog Re-applying libmspack adjustments to extract and scan files from archives that are non-standard and may appear to be corrupted or may in fact be corrupted. Differences from previous implementation: Fewer debug log messages. No normalization of filenames found in CAB archives. Implemented new param that enabled the best-effort attempt to extract possibly malformed archives. Used set_param() to enabled the FIXMSZIP option where it was previously hardcoded. Opted to provide the -Wno-unused-parameter CFLAG to the compiler in place of explicitely indicating unused parameters in each function. Omitted changes to mszipd.c and also omitted quantum decompression (qtmd.c) infinite loop protection because it appears to have been fixed in the newer libmspack. 7 years ago
INSTALL Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
Makefile.am Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
Makefile.in Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
NEWS Moved libmspack-0.5alpha from libclamav to libclammspack, and restructured the build so that there should be no need to modify the libmspack build files in the future (i.e. libmspack autoconf and automake files aren't actually used). 7 years ago
README Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
TODO Moved libmspack-0.5alpha from libclamav to libclammspack, and restructured the build so that there should be no need to modify the libmspack build files in the future (i.e. libmspack autoconf and automake files aren't actually used). 7 years ago
acinclude.m4 Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
aclocal.m4 Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
ar-lib Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
compile Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
config.guess Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
config.h.in Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
config.sub Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
configure Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
configure.ac Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
depcomp Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
install-sh Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
libmspack.pc.in Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
ltmain.sh Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago
missing Replaced modified libmspack-0.5alpha with libmspack-0.7alpha (vanilla). 7 years ago

README

libmspack 0.7.1alpha

The purpose of libmspack is to provide compressors and decompressors,
archivers and dearchivers for Microsoft compression formats: CAB, CHM, WIM,
LIT, HLP, KWAJ and SZDD. It is also designed to be easily embeddable,
stable, robust and resource-efficient.

The library is not intended as a generalised "any archiver" interface.
Users of the library must explicitly choose the format they intend to work
with.

All special features of the above formats will be covered as fully as
possible -- for example, CAB's multi-part cabinet sets, or CHM's fast
lookup indices. All compression methods used by the formats will be
implemented as completely as possible.

However, other than what is required for access to these formats and their
features, no other functionality is intended. There is no file metadata
translation functionality. All file I/O is abstracted, although a default
implementation using the standard C library is provided.


DOCUMENTATION

The API documentation is stored in the doc/ directory. It is generated
automatically from mspack.h with doxygen. It is also available online at
https://www.cabextract.org.uk/libmspack/doc/


BUILDING / INSTALLING

./configure
make
make install

This will install the main libmspack library and mspack.h header file.
Some other libraries and executables are built, but not installed.

If building from the Subversion repository, running rebuild.sh will create
all the automatically generated files like the configure script, and will
then ./configure, make and make distcheck. Running cleanup.sh will perform
a thorough clean, deleting all automatically generated files.

In addition to gcc, you also need the following for building from Subversion:

- at least autoconf 2.57
- at least automake 1.7
- libtool

This is an alpha release. Unless you are in a position to package the
libmspack library for the environment you intend to run your application,
it is recommended that you do not rely on users of your software having
the binary library installed and instead you should include the libmspack
source files directly in your application's build environment.


LEGAL ISSUES

To the best of my knowledge, libmspack does not infringe on any
compression or decompression patents. However, this is not legal
advice, and it is recommended that you perform your own patent search.

libmspack is licensed under the LGPL - see COPYING.LIB in this directory.

The LGPL requires you to build libmspack as a stand alone library then link
your code to it using a linker. I personally grant you some extra rights:
you can incorporate libmspack's source code wholly or partially in your own
code, without having to build and link libmspack as an independent library,
provided you meet ALL of the following conditions:

1. ANY modifications to the existing libmspack source code are published and
distributed under the LGPL license.
2. You MUST NOT use libmspack function calls, structures or definitions unless
they are defined in the public library interface "mspack.h".
3. When distributing your code, you MUST make clear your code uses libmspack,
and either include the full libmspack distribution with your code, or
provide access to it as per clause 4 of the LGPL.

EXAMPLE CODE

libmspack is bundled with programs which demonstrate the library's features.

examples/cabd_memory.c - an mspack_system that can read and write to memory
examples/multifh.c - an mspack_system that can simultaneously work on
in-memory images, raw file descriptors, open file
handles and regular disk files

src/cabrip.c - extracts any CAB files embedded in another file
src/chmextract.c - extracts all files in a CHM file to disk
src/msexpand.c - expands an SZDD or KWAJ file
src/oabextract.c - extracts an Exchange Offline Address Book (.LZX) file

test/cabd_c10 - tests the CAB decompressor on the C10 collection
test/cabd_compare - compares libmspack with Microsoft's EXTRACT.EXE
test/cabd_md5 - shows MD5 checksums of all files in a CAB file/set
test/cabd_test.c - regression tests for libmspack's CAB decompression
test/chmd_compare - compares libmspack with Microsoft's HH.EXE
test/chmd_find.c - fast-finds a file within a CHM file.
test/chmd_md5.c - shows MD5 checksums of all files within a CHM file
test/chmd_order.c - extracts files in a CHM file in four different ways
test/chmd_test.c - regression tests for libmspack's CHM decompression
test/kwajd_test.c - regression tests for libmspack's KWAJ decompression
test/chminfo.c - prints verbose information about CHM file structures
test/msdecompile_md5 - runs Microsoft's HH.EXE -DECOMPILE via WINE
test/msextract_md5 - runs Microsoft's EXTRACT.EXE via WINE

Here is a simple example of usage, which will create a CAB decompressor,
then use that to open an existing Microsoft CAB file called "example.cab",
and list the names of all the files contained in that cab.

#include <stdio.h>
#include <unistd.h>
#include <mspack.h>

int main() {
struct mscab_decompressor *cabd;
struct mscabd_cabinet *cab;
struct mscabd_file *file;
int test;

MSPACK_SYS_SELFTEST(test);
if (test != MSPACK_ERR_OK) exit(0);

if ((cabd = mspack_create_cab_decompressor(NULL))) {
if ((cab = cabd->open(cabd, "example.cab"))) {
for (file = cab->files; file; file = file->next) {
printf("%s\n", file->filename);
}
cabd->close(cabd, cab);
}
mspack_destroy_cab_decompressor(cabd);
}
return 0;
}