设为首页 收藏本站
查看: 1273|回复: 0

[笔记]TrueCrypt7.0a代码编译流程 (已更新 TrueCrypt 7.2代码在Win8.1 64位下编译流程)

[复制链接]

尚未签到

发表于 2015-5-21 05:10:47 | 显示全部楼层 |阅读模式
  早期版本的TrueCrypt若要编译成功,的确需要做多项微调,但是对于7.0a版本的代码,只需按照如下流程,即可在WinXP 32位系统下成功编译。
  代码的ReadMe.txt是这么写的:

  I. Windows
==========
  Requirements for Building TrueCrypt for Windows:     
------------------------------------------------
  - Microsoft Visual C++ 2008 SP1 (Professional Edition or compatible)     
- Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads)      
- Microsoft Windows SDK for Windows 7 (configured for Visual C++)      
- Microsoft Windows Driver Kit 7.1.0 (build 7600.16385.1)      
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20      
  header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20)      
- NASM assembler 2.08 or compatible      
- gzip compressor
  IMPORTANT:
  The 64-bit editions of Windows Vista and later versions of Windows, and in     
some cases (e.g. playback of HD DVD content) also the 32-bit editions, do not      
allow the TrueCrypt driver to run without an appropriate digital signature.      
Therefore, all .sys files in official TrueCrypt binary packages are digitally      
signed with the digital certificate of the TrueCrypt Foundation, which was      
issued by a certification authority. At the end of each official .exe and      
.sys file, there are embedded digital signatures and all related certificates      
(i.e. all certificates in the relevant certification chain, such as the      
certification authority certificates, CA-MS cross-certificate, and the      
TrueCrypt Foundation certificate). Keep this in mind if you compile TrueCrypt      
and compare your binaries with the official binaries. If your binaries are      
unsigned, the sizes of the official binaries will usually be approximately      
10 KB greater than sizes of your binaries (there may be further differences      
if you use a different version of the compiler, or if you install a different      
or no service pack for Visual Studio, or different hotfixes for it, or if you      
use different versions of the required SDKs).
  Instructions for Building TrueCrypt for Windows:     
------------------------------------------------
  1) Create an environment variable 'MSVC16_ROOT' pointing to the installation     
   directory of MS Visual C++ 1.52.
  2) If you have installed the Windows Driver Development Kit in another     
   directory than '%SYSTEMDRIVE%\WinDDK', create an environment variable      
   'WINDDK_ROOT' pointing to the DDK installation directory.
  3) Copy the PKCS #11 header files to a standard include path or create an     
   environment variable 'PKCS11_INC' pointing to the directory where      
   the PKCS #11 header files are installed.
  4) Open the 'TrueCrypt.sln' solution in Microsoft Visual Studio 2008.
  5) Select 'All' as the active solution configuration.
  6) Build the solution.
  7) If successful, there should be newly built TrueCrypt binaries in the     
   'Release' folder.

  按照流程,环境配置如下:


  • Visual Studio 2008,我的版本是官方的90天评估版。
  • nasm,我用的版本是 nasm-2.09.08,我的微盘下载地址在这里。将 nasm.exe 文件解压出来, 放到 system32 目录里
  • gzip,我用的版本是 1.2.4,我的微盘下载地址在这里。将 gzip.exe 文件解压出来, 放到 system32 目录里
  • VC1.5,我的微盘下载地址在这里。创建一个环境变量 MSVC16_ROOT 指向其解压的目录
  • Windows Driver Kit Version 7.1.0,官方下载地址 GRMWDK_EN_7600_1.ISO (619.0 MB) ,安装时注意不要选择安装Device Simulation Framework(DSF)。创建环境变量 WINDDK_ROOT 指向WDK目录,如我的WDK目录是C:\WinDDK\7600.16385.1
  • 下载PKCS#11的头文件,为了省事,可将这里的目录全部下载到本地一个目录,然后创建环境变量 PKCS11_INC 指向该目录
  代码编译也需要微调:
  代码放置目录不要有中文或空格。
  使用 VS2008 打开 TrueCrypt.sln,配置选择ALL,开始生成解决方案吧。
  不出意外的话,会报一个错如下:
  6>.\Setup.c(135) : error C2065: “PKEY_AppUserModel_ID”: 未声明的标识符
  解决方案是在Setup.h中加入如下代码

#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 */
(DWORD)PID_FIRST_USABLE /* pid */
};
  再次生成,就OK了,东西都在 \Release\Setup Files\下。
  参考:


  • TrueCrypt 源码 相关资料
    http://www.iyunv.com/jecray/archive/2011/01/25/1944968.html
  • 如何编译TrueCrypt源码
    http://www.iyunv.com/jecray/archive/2011/01/25/1944971.html
  • Instructions for Building TrueCrypt 6.3a in Windows XP
    http://www.iyunv.com/jeffreyli/archive/2010/05/18/1738014.html
  • 工作笔记:TrueCrypt编译记录
    http://blog.iyunv.com/skyremember/article/details/4562090


Technorati 标签: TrueCrypt







[2014_11_17 更新] TrueCrypt 7.2代码在Win8.1 64位下编译流程



  除了上述配置之外,可能编译时会遇到 nasm 无法识别的问题,解决方案是将其拷入 "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" 目录下,这样就一切OK了。

  


[2014_12_04 更新] 参考文献




How I compiled TrueCrypt 7.1a for Win32 and matched the official binaries

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-68934-1-1.html 上篇帖子: win8 提示安装 .net framework 3.5解决办法 下篇帖子: [💯原]Javascript实现Win8磁帖UI(JQuery多功能包装,易用)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表