SHARE
TWEET

Verification of TrueCrypt binary files

a guest Sep 8th, 2013 344 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. rem **********************************************************************************
  3. rem ** How to verify TrueCrypt binary files:
  4. rem **
  5. rem ** (1) Extract the TrueCrypt source code into the original folder which
  6. rem **     is "c:\truecrypt-7.1a" for TrueCrypt 7.1a
  7. rem **     Note: The original path can be looked-up from "truecrypt.sys" where
  8. rem **     the MS compiler has placed a reference to this location.
  9. rem **
  10. rem ** (2) Extract the original TrueCrypt binary files by executing
  11. rem **     "TrueCrypt Setup 7.1a.exe" (select "Extract" instead of "Install"
  12. rem **     and accept the extraction path). Then, the file "TrueCrypt Setup 7.1a.exe"
  13. rem **     must be moved to "TrueCrypt\TrueCrypt Setup.exe".
  14. rem **
  15. rem ** (3) Compile your own binary files by executing
  16. rem **     "c:\truecrypt-7.1a\TrueCrypt.sln" and by compiling for "All" and "Win32".
  17. rem **
  18. rem ** (4) Copy this batch file into "c:\truecrypt-7.1a\check.bat" and execute it.
  19. rem **
  20. rem ** (5) The comparison of the disassembler listings of self-compiled and original
  21. rem **     binary file can then be looked up in the ".cmp.txt"-files of the "Check"
  22. rem **     sub-folder.
  23. rem **
  24. rem **********************************************************************************
  25.  
  26. rem ** Backward compatibility to Windows 32-bit
  27. if "%ProgramFiles(x86)%" equ "" set ProgramFiles(x86)=%ProgramFiles%
  28.  
  29. rem ** Set environment for Visual Studio 9.0
  30. set HOME=%~dp0
  31. cd /d "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\"
  32. call vcvarsall.bat x86
  33.  
  34. rem ** Clean the "Check" sub-folder
  35. rd /s /q "%HOME%Check"
  36. md "%HOME%Check"
  37.  
  38. rem ** Check the TrueCrypt binary files
  39. call :check "TrueCrypt Setup.exe"
  40. call :check "TrueCrypt.exe"
  41. call :check "TrueCrypt Format.exe"
  42. move "%HOME%Driver" "%HOME%Driver.bak"
  43. call :check "truecrypt.sys"
  44. call :check "truecrypt-x64.sys"
  45. move "%HOME%Driver.bak" "%HOME%Driver"
  46. goto :eof
  47.  
  48. :check
  49. set F=%~1
  50. set R=%HOME%Check\%~1
  51. dumpbin /disasm "%HOME%TrueCrypt\%F%" >"%R%.org.txt"
  52. dumpbin /disasm "%HOME%Release\Setup Files\%F%" >"%R%.new.txt"
  53. fc "%R%.org.txt" "%R%.new.txt" >"%R%.cmp.txt"
  54. goto :eof
RAW Paste Data
Top