» Content »pkg://afflib_3.6.6.orig.tar.gz:779495
/ info downloads
Information for compiling AFFLIB 3.4.2 under Windows / Microsoft
Visual C++. As of version 3.6.0 this information is obsolete since we
now compile under mingw.
This directory builds the following as a single library using
Microsoft Visual C++ that contains all of the following:
* All of LIBAFF
* LZMA compression system
* ZLIB compression system
* LIBEWF EnCase image reading system.
* AFFLIB3.0 encryption issues
On Unix systems the ZLIB and LIBEWF libraries must be separately
installed. However, copies of these libraries are included as
subdirectories to the win32 library. These copies are included solely
to make things easier for Windows users; these copies are not used by
the Unix AFFLIB installation.
Windows programs that are linked with this library can read files in
any of the following formats:
* RAW & Split raw
* AFF, AFM, AFD
* EnCase / Expert Witness
You can also use AFFLIB on Windows with Cygwin; details on that
appear in this file as well.
Compiling with Microsoft VC++
To compile this library, you need a copy of Microsoft Visual C++ 2008 Express.
(Libewf will not compile with any earlier version of Microsoft Visual C++.)
Installing VC++ 2008:
You can download a FREE copy of Visual C++ 2005 Express Edition from
1. Go to http://www.microsoft.com/express
2. Download Visual Studio C++ 2008 Express Edition.
(You will get vcsetup.exe; save it on the desktop and run it.)
3. Install in the default location,
C:\Program Files\Microsoft Visual Studio 9\
5. Follow the instructions:
- Run Visual Studio C++ 2008.
- Select "Register Product" from the help menu.
- Log into the Microsoft website with your Passport credentials.
- Get the registration key from Microsoft (after email answerback)
and paste it into the Help panel.
6. Run Microsoft Update to install the latest service packs.
- You MUST have the most recent .NET Framework.
- You should also have the Security Updates for the VC++ 2008
7. Now you must download and install the Microsoft Platform SDK so
that you will have the header files for the Microsoft Crypto API.
This can be confusing. I downloaded the Windows Server 2008
Platform SDK Web Install. I got it from this URL:
(Be careful not to download the x64 platform SDK unless you are
running on a 64-bit machine!)
- Be sure that you DO NOT chose the configuration option to
Register environment variables.
YOU CANNOT COMPILE AFFLIB UNLESS THE PLATFORM SDK IS INSTALLED.
- If possible, install the platform SDK as
C:\Program Files\Microsoft Platform SDK\.
If you can't do this, you will need to modify afflib.mak to
reflect the actual install location
8. Finally, you must download and install OpenSSL:
If you just want to run with openSSL, use this:
(In your win32/openssl directory)
If you want to compile, use this:
If you wish to compile, you will need to edit the file x509.h and
add this line:
/* Under Win32 these are defined in wincrypt.h */
#undef X509_EXTENSIONS /* added by SLG */
This is apparently a known bug in OpenSSL
(http://wso2.org/forum/thread/3861), but it hasn't been fixed yet.
1. Unpack the afflib distribution into a directory such as c:\afflib
2. From the Windows Start menu, run the Visual Studio 2005 Command Prompt
3. Change into the win32 subdirectory, e.g. "chdir c:\afflib\win32"
4. Type "make.bat" to run the makefile.
3. The command file "make.bat" will compile AFFLIB, LIBEWF, ZLIB and LZMA, and create a single .lib
file. Compilation options are specified in afflib.mak in this directory.
4. The following programs are ported:
TARGETS = afcompare.exe afconvert.exe afcopy.exe afdiskprint.exe affix.exe afinfo.exe afstats.exe afxml.exe
You can compile them all by typing:
Alternatively, you can compile a single executable with:
% make afcat.exe
5. To make the library alone:
* Open a VS2008 command prompt (run vcvars32.bat).
* Make sure you have OpenSSL and zlib installed.
* Add OpenSSL and zlib include paths to your INCLUDE path.
* Run "make.bat afflib.lib" (inside the win32 directory).
* Rename afflib.lib to afflibMT.lib
Repeat 3 more times with different COMPILER_MODE to produce 3 more
* Run "make.bat clean" before each build, just to be safe.
* COMPILER_MODE /MD /O2 /D NDEBUG => rename to afflibMD.lib
* COMPILER_MODE /MTd => rename to afflibMTd.lib
* COMPILER_MODE /MDd => rename to afflibMDd.lib
* Put libs in world/3rdparty/afflib/VER/lib/vs20XX/win32
Repeat 4 more times to build 64-bit libraries with same names:
* Run vcvars64.bat instead of vcvars32.bat to set up environment.
* May want to reset INCLUDE path for OpenSSL and zlib, just to be
* Don't forget to use /O2 /D NDEBUG when building release (MT and MD).
* Note: No need to specify /MACHINE:X64 linker option in afflib.mak
we're only building a static library, not linking to create any
* Run "make.bat clean" before each build, just to be safe.
* Put libs in world/3rdparty/afflib/VER/lib/vs20XX/x64
Once it is compiled:
1. To open a multi-file EnCase file, just specify the first .E01 file; the AFFLIB
implementation will automatically look for all of the other EnCase files.
2. Right now you should really use this library for READING AFF & E01
files, rather than WRITING them. Writing should work, but it's not
very well tested on Windows. S3 is currently not supported on Windows.
3. If you want to change the compile switches, feel free. They're in afflib.mak
Compiling AFFLIB with Cygwin
Cygwin is a Unix emulation system that allows standard Linux/Unix open
source software to be run on top of Windows through the use of a
special "cygwin" DLL.
To use Cygwin, follow these step-by-step instructions:
1. Go to http://www.cygwin.com/.
2. Click "Download Cygwin Now"; this will give you an executable file.
3. Run the Cygwin Net Release Setup Program.
4. Select "Install from Internet"
5. Install into the C:\cygwin directory for All Users. Select
"Unix/binary" as the default text file type.
6. Select a mirror site.
7. Click on the arrows next to "Devel" to change the word "Default" to
"Install". This will cause the entire Cygwin development system to
8. Click "Next" and come back in an hour.
9. When you get the "Installation Complete" message, start the cygwin
shell and type the following:
$ mkdir afflib
$ cd afflib
$ wget http://www.afflib.org/afflib.tar.gz
$ tar xfvz afflib.tar.gz
$ cd afflib*
$ make install
NOTE: EnCase support will NOT be compiled in unless you separately
download and install LIBEWF. libewf must be downloaded from
10. You should now have a working system.
# Local Variables:
# mode: flyspell
# mode: auto-fill
# LocalWords: AFFLIB