Building FreeOTFE

FreeOTFE comes in three parts:
  1. A frontend GUI, written in Delphi
  2. A number of kernel drivers, written in C
  3. A number of command line decryption utilities, also written in C

Building the GUI

This is a description for Delphi newbies of the basic steps involved in compiling the FreeOTFE GUI.

To build the GUI, the following software is required:
The binary release of this software was built with Delphi v5 (to ensure compatibility with older Delphi's), but you should well be able to use any version later than this.
  1. With each of the packages in the SDeanComponents archive,
    1. Build each package
    2. Install each package
    3. Ensure that the correct path to each package is added to your Delphi environment ("Tools | Environment Options...", "Library" tab)
  2. Open the FreeOTFE project ("FreeOTFE.dpr")
  3. Build the application.
  4. You should now find a file called "FreeOTFE.exe" in the directory above the "src" directory
You have now successfully built the GUI frontend!

If required, the compiler definition "FREEOTFE_TIME_CDB_DUMP" may be set, in which case the time take to dump a CDB ("Tools | Critical data block | Dump to human readable file...") will be shown after the dump completes.


Building the Kernel Drivers

The kernel mode drivers implement the actual hash, encryption/decryption and main FreeOTFE drivers.

To build these drivers, the following software is required:
At time of writing, the MS Windows SDK can be downloaded from the Microsoft WWW site. The MS Windows DDK is not available as a download, but can be ordered from the Microsoft WWW site as a free CD, for the cost of delivery.

It should be noted that if you are unable to source the exact versions listed above, earlier versions may well be substituted, although I cannot guarantee success. Later versions should operate correctly. The above list describes the development environment as used to build the binary release of FreeOTFE.

Setting up the Build Environment

Installation and Configuration of 3rd Party Software
The following list comprehensively describes the configuration used to build the binary release of FreeOTFE. Feel free to adjust according to taste - a number of the options listed are not necessary, and are only included for completeness...
  1. Install VC++ .NET
  2. Put a copy of "vcvars32.bat" into one of the directories in your path
  3. Configure the VC++ editor:
  4. Install the MS Windows SDK with the following options:
  5. Install the MS Windows DDK with the following options:
FreeOTFE Build Configuration
  1. Edit "setup_env_common.bat" (located under src\drivers\Common\bin), and ensure that the following variables are set appropriately:

  2. Variable
    Description
    Default value
    FREEOTFE_DEBUG
    Build type flag; set to 1 for debug build, or 0 for release
    0
    PROJECT_DRIVE The drive on which you have stored the FreeOTFE source D:
    PROJECT_DIR The full drive and path where the "drivers" directory is located
    MSSDK_DIR The directory in which you installed the MS SDK
    C:\MSSDK
    MSDDK_DIR The directory in which you installed the MS DDK
    C:\WINDDK\3790

  3. Edit "setup_env_driver.bat" (in the same directory), and ensure that "SETENV.BAT" is called with the parameters appropriate to the type of build you wish to create, and that "FREEOTFE_OUTPUT_DIR" is set to the appropriate directory under the src dirs where the build executable places the files it creates
3rd Party Source Code
Some of the FreeOTFE drivers (the hash/encryptions drivers in particular) are dependant on certain 3rd party software being installed. FreeOTFE's source code comes complete with 3rd party included in the"src\3rd_party" directory and should be preconfigured, ready for use.

Alternatively, you may wish to download this 3rd party source from the original authors in order to verify the integrity of this software. For this reason, details of where this software was obtained from are included in the above directory.

Please note that should choose the latter option, it is important that you review the individual driver notes (see separate driver directories; "_notes.txt" files) to ensure that this software is configured correctly. Additionally, you may well have to modify the "my_build_sys.bat" files, directing them to the location where you installed said 3rd party source code, as the build process requires that certain files are copied over into the FreeOTFE src directories. (Annoying, but this is a requirement of the MS "build.exe" command)
Building the FreeOTFE Drivers
Either:
  1. Open "FreeOTFE.sln" using Visual C++
  2. Rightclick on each project in turn, and select "Build"
or:
  1. Enter each of the separate driver directories in turn and launch each project's "my_build_sys.bat"
In either case, a copy of the binary which is built will be copied into the directory above your "src" directory.

After reaching this stage, you should have successfully built your own version of the FreeOTFE drivers!


Building the Command Line Decryption Utilities

To build the command line decryption utilities, the following software is required:
Please follow the following steps:
  1. Install and configure up the build environment, as described as per building the backend drivers, you may omit the SDK and DDK.
  2. Modify the software as appropriate for your test
  3. Launch the relevant "my_build_exe.bat" file
The executable should be built in the same directory.