16 truecrypt
我正在尝试编译TrueCrypt.我使用的是https://github.com/syglug/truecrypt中的说明.
我设置了3个环境变量(pkcs,ddk,MSVC16_ROOT)和msvc2008开盘项目.这不在说明书中,但我需要安装NASM,所以我安装它并将NASM放入PATH.现在,当我建立时,我得到了以下内容.即使IDE具有取消构建可选择,编译器没有做任何事情并且系统空闲,它也会结束.
此步骤后确实存在Crypto.lib
1>------ Build started: Project: Crypto, Configuration: Release Win32 ------
2>------ Build started: Project: Boot, Configuration: Release Win32 ------
3>------ Build started: Project: Driver, Configuration: Release Win32 ------
2>Performing Makefile project actions
3>Performing Makefile project actions
1>Performing Custom Build Step
3>------ Building truecrypt.sys: Release x86 ------
1>Aes_hw_cpu.asm
2>Microsoft (R) C/C++ Optimizing Compiler Version 8.00c
2>Copyright (c) Microsoft Corp 1984-1993. All rights reserved.
3>The syntax of the command is incorrect.
3>Project : error PRJ0002 : Error result 255 returned from 'C:\Windows\SysWow64\cmd.exe'.
3>Build log was saved at "file://c:\unzipped\tc\Driver\Release\BuildLog.htm"
3>Driver - 1 error(s), 0 warning(s)
1>Performing Custom Build Step
1>Aes_x86.asm
1>Compiling...
1>Whirlpool.c
1>Twofish.c
1>Sha2.c
1>Sha1.c
1>Serpent.c
1>Rmd160.c
1>Des.c
1>Cast.c
1>Blowfish.c
1>Aestab.c
1>Aeskey.c
1>Generating Code...
1>Creating library...
1>Build log was saved at "file://c:\unzipped\tc\Crypto\Release\BuildLog.htm"
1>Crypto - 0 error(s), 0 warning(s)
Run Code Online (Sandbox Code Playgroud)
它只是挂起.它没有使用任何CPU,IDE似乎不知道它失败或停止.再次运行时,我得到了这个
1>------ Build started: Project: Boot, Configuration: Release Win32 ------
2>------ Build started: Project: Driver, Configuration: Release Win32 ------
1>Performing Makefile project actions
2>Performing Makefile project actions
2>------ Building truecrypt.sys: Release x86 ------
1>Microsoft (R) C/C++ Optimizing Compiler Version 8.00c
1>Copyright (c) Microsoft Corp 1984-1993. All rights reserved.
2>The syntax of the command is incorrect.
Run Code Online (Sandbox Code Playgroud)
我安装了msvc2012,所以我也试过了.我遇到了同样的问题
1>------ Build started: Project: Crypto, Configuration: Release Win32 ------
2>------ Build started: Project: Boot, Configuration: Release Win32 ------
3>------ Build started: Project: Driver, Configuration: Release Win32 ------
1> Performing Custom Build Tools
1> Aes_hw_cpu.asm
3> ------ Building truecrypt.sys: Release x86 ------
2> Microsoft (R) C/C++ Optimizing Compiler Version 8.00c
2> Copyright (c) Microsoft Corp 1984-1993. All rights reserved.
2>
3> The syntax of the command is incorrect.
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "echo ------ Building truecrypt.sys: Release x86 ------
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: cmd.exe /c BuildDriver.cmd -build -release -x86 "C:\unzipped\tc\\Common" "C:\unzipped\tc\\Crypto" "C:\unzipped\tc\Driver\"
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: if errorlevel 1 exit %errorlevel%
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: echo.
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: echo ------ Building truecrypt.sys: Release x64 ------
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: BuildDriver.cmd -build -release -x64 "C:\unzipped\tc\\Common" "C:\unzipped\tc\\Crypto" "C:\unzipped\tc\Driver\"" exited with code 255.
1> Performing Custom Build Tools
1> Aes_x86.asm
1> Aeskey.c
1> Aestab.c
1> Blowfish.c
1> Cast.c
1> Des.c
1> Rmd160.c
1> Serpent.c
1> Sha1.c
1> Sha2.c
1> Twofish.c
1> Whirlpool.c
1> Generating Code...
1> Crypto.vcxproj -> C:\unzipped\tc\Crypto\Release\Crypto.lib
Run Code Online (Sandbox Code Playgroud)
当我再次取消/建立时,我得到以下内容
1>------ Build started: Project: Boot, Configuration: Release Win32 ------
2>------ Build started: Project: Driver, Configuration: Release Win32 ------
2> ------ Building truecrypt.sys: Release x86 ------
2> The syntax of the command is incorrect.
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "echo ------ Building truecrypt.sys: Release x86 ------
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: cmd.exe /c BuildDriver.cmd -build -release -x86 "C:\unzipped\tc\\Common" "C:\unzipped\tc\\Crypto" "C:\unzipped\tc\Driver\"
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: if errorlevel 1 exit %errorlevel%
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: echo.
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: echo ------ Building truecrypt.sys: Release x64 ------
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: BuildDriver.cmd -build -release -x64 "C:\unzipped\tc\\Common" "C:\unzipped\tc\\Crypto" "C:\unzipped\tc\Driver\"" exited with code 255.
1> Microsoft (R) C/C++ Optimizing Compiler Version 8.00c
1> Copyright (c) Microsoft Corp 1984-1993. All rights reserved.
1>
Run Code Online (Sandbox Code Playgroud)
这有什么不对?我如何构建TrueCrypt?我正在运行Windows 7 64位
Ole*_*leg 30
我可以从https://github.com/syglug/truecrypt成功构建所有项目.我主要遵循readme.txt中的说明.由于指令不够详细,我在下面描述了我所做的所有步骤.如果您对某些步骤有其他问题,我会提供其他详细信息.
我使用了Windows 7 X64上安装的Visual Studio 2008.如果需要,我可以使用Visual Studio 2010或2012重现相同的内容.
MSVC15直接提取的目录名中没有空格C:\.所以我有例如16位VC编译器的旧二进制文件C:\MSVC15\BIN.C:\PKCS-11目录中.C:\PKCS-11\pkcs11.h与所有相关文件一样的文件将位于同一目录中C:\PKCS-11C:\nasm-2.10.05nasm.exeC:\nasm-2.10.05gzip-1.3.12-1-bin.zipC:\gzip-1.3.12-1-binC:\gzip-1.3.12-1-bin\bingzip.exeC:\WinDDK\7600.16385.1.C:\truecrypt-masterCrypto.vcprojC:\truecrypt-master\Crypto因为我不喜欢修改全局环境变量,所以我创建了以下批处理文件:
SET MSVC16_ROOT=C:\MSVC15
SET PKCS11_INC=C:\PKCS-11
PATH=C:\nasm-2.10.05;C:\gzip-1.3.12-1-bin\bin;%PATH%
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
Run Code Online (Sandbox Code Playgroud)
在批处理文件的最后一行中,将启动Visual Studio 2008(devenv.exe).它继承了CMD.EXE(启动Visual Studio 2008的父进程)中设置的所有环境变量.
自述文件中描述的解决方案文件'TrueCrypt.sln' 不包含在github上的源代码中.所以我打开了我在子目录中找到的每个Project文件C:\truecrypt-master并编译它.它是Crypto.vcproj(来自C:\truecrypt-master\Crypto),Boot.vcproj(来自C:\truecrypt-master\Boot\Windows),Driver.vcproj(来自C:\truecrypt-master\Driver),Format.vcproj(来自C:\truecrypt-master\Format)和Mount.vcproj(来自C:\truecrypt-master\Mount).
我可以成功编译所有项目.唯一的小问题是在建设Format.vcproj和建设期间Mount.sln.这些文件Format.tlb和Mount.tlb存在于子目录.所以我更正了TLB文件中引用的线条C:\truecrypt-master\Format\Format.rc和C:\truecrypt-master\Mount\Mount.rc以
IDR_FORMAT_TLB TYPELIB ".\\Format\\Format.tlb"
Run Code Online (Sandbox Code Playgroud)
和
IDR_MOUNT_TLB TYPELIB ".\\Mount\\Mount.tlb"
Run Code Online (Sandbox Code Playgroud)
我稍后会以Pull Request的形式将相应的修复发布到https://github.com/syglug/truecrypt.
更新:必须在文件中更改BuildDriver.cmd该行
set TC_BUILD_ARCH=x64 WNET
Run Code Online (Sandbox Code Playgroud)
至
set TC_BUILD_ARCH=x64
Run Code Online (Sandbox Code Playgroud)
能够构建驱动程序.
另外,应该构建行使用正确的pathes "$(SolutionDir)..\Crypto"和"$(SolutionDir)..\Common"(参见Visual Studio中的nmake选项).如果一个使用TrueCrypt.sln从C:\TrueCrypt7.1a不需要的话.
更新2:编译项目后,您将C:\TrueCrypt7.1a\Release\Setup Files在C:\truecrypt-master\Release\Setup Files文件中或文件中看到

该文件TrueCrypt Setup.exe仅存在于C:\TrueCrypt7.1a(您从稍后在评论中发布的链接www.truecrypt.org下载).正如我在评论中提到的,您需要配置Visual Studio 2008以使用Windows SDK 7而不是默认的6.0a才能成功编译安装项目.
将编译的驱动程序不使用Microsoft签名进行数字签名.因此,默认情况下,Windows 7不会信任驱动程序.因此,要验证驱动程序是否正常工作,您必须F8在启动计算机时按下并禁用驱动程序签名:

之后,您将能够执行TrueCrypt.exe(C:\TrueCrypt7.1a\Release\Setup Files例如,从目录).你会收到警告

但是TrueCrypt.exe意志确实有效,你会看到
