<<TrueCrypt简介、在VS2008下的编译过程>>
http://blog.csdn.net/chenyujing1234/article/details/7777369
编译环境: win7x64sp1, 中间遇到2个小问题:
* msvc1.5.2 需要在winxp下安装完(msvc1.52 + MSVCCDK), 拷贝过来用.
* gzip新版,在vs2010下编译不过. 在gzip主页上找的gzip1.4.2 编译成gzip.exe(vs2010建立空控制台工程, 加入gzip的.cpp, .h),
放到 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin 下.
整个工程按照x86编译, 驱动(x86,x64)都会被编译出来.
<2015-0108-1819>
昨天, hwn1026 和 sunqiyun111 在编译时,出现问题。
是编译gzip时,编译不过. 原因是:gzip build 前,需要先安装perl for windows, 使./configure可以执行。
如果只是看trueCrypt, 找个能用的gzip.exe. 配置好环境,直接就build过了.
我build好一份工程(带着gzip.exe, msvc152, trueCrpyt7.1a, 实验报告), 上传完了.
资料下载点 : how_to_build_TrueCrypt_7dot1a_Source.rar
<2015-0114>
今天sunqiyun111 说他在vs2008下没有编译通过.
发现纯的初始环境缺些编辑辅助工具,做完实验后,上传了一份,下载点 : pkcs11_gzip124_nasm.rar
缺的内容是 : pkcs11库, gzip能用的版本, nasm.exe.
真机上留存的那个gzip.exe, 在虚拟机win7x64sp1 + vs2008sp1下编译报错, 从www.gzip.org下载的编译好的低版本gzip1.24可用.
我还是用上传的资源包做了个实验。
虚拟机win7x64sp1 + vs2008.
* 将gzip.exe 放到vs2008/vc/bin中
* 将MSVC152环境变量配置好
* 安装WDK7600
* 将工程路径改成没有空格的名字
* 缺了一个nasm.exe, 找一个,放到vs2008/vc/bin中. 这个文件, 我的vs2010目录中有。忘了是不是我自己当时做实验,另外找的.
* PKCS11_INC=C:\PKCS11 增加PKCS11库, 这在真机上是有的,应该是我另外找的. 忘记出处了.
重启计算机,使环境变量生效.
编译中,发现gzip版本不对..., 从 http://www.gzip.org/#exe 下载一个编译好的 gzip124xN.zip.
这回编译,除了Setup, 其余的工程都编译过了.
Setup报错如下:
6>c:\truecrypt7_1a_source\setup\setup.c(135) : error C2065: 'PKEY_AppUserModel_ID' : undeclared identifier
我查了下真机上定义在 : C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\propkey.h 中
这是vs2010自带的SDK.
找到资料 :http://blog.csdn.net/chenyujing1234/article/details/7777369
按照资料,修改 PKEY_AppUserModel_ID 报错 。
- /*
- Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of Encryption for the Masses 2.02a, which is
- Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
- Agreement for Encryption for the Masses'. Modifications and additions to
- the original source code (contained in this file) and all other portions
- of this file are Copyright (c) 2003-2009 TrueCrypt Developers Association
- and are governed by the TrueCrypt License 3.0 the full text of which is
- contained in the file License.txt included in TrueCrypt binary and source
- code distribution packages. */
- #ifndef SETUP_H
- #define SETUP_H
- /*---region add by gc---*/
- #include "wtypes.h"
- const PROPERTYKEY PKEY_AppUserModel_ID = {
- {
- (unsigned long)2009,/*unsigned long Data1;*/
- (unsigned short)12,/*unsigned short Data2;*/
- (unsigned short)23,/*unsigned short Data3;*/
- 0x44,0x55,0x55,0x55,0x55,0x55,0x55,0x55
- },/*GUID fmtid;*/
- (DWORD)PID_FIRST_USABLE /*DWORD pid;*/
- };
- /*---endregion---*/
- #ifdef __cplusplus
- extern "C" {
- #endif
- // Specifies what files to install, where (determined by the prefix), and in what order
- static char *szFiles[]=
- {
编译的时候,全部编译过不了。
从上到下,一个一个编译, 就都编译过了.
将编译选项改成 "driver x64", 也可以编译通过.