Advertisement
Guest User

Validating TrueCrypt binary files

a guest
Sep 9th, 2013
582
0
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 Windows 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 **     and "Check2" sub-folders.
  23. rem **
  24. rem **********************************************************************************
  25.  
  26. rem ** For compatibility with 32-bit Windows
  27. if "%ProgramFiles(x86)%" equ "" set ProgramFiles(x86)=%ProgramFiles%
  28.  
  29. rem ** Set environment for Visual Studio 9.0 tools
  30. set HOME=%~dp0
  31. cd /d "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\"
  32. call vcvarsall.bat
  33.  
  34. rem ** Clean the "Check" and "Check2" sub-folders
  35. rd /s /q "%HOME%Check" 2>NUL
  36. md "%HOME%Check"
  37. rd /s /q "%HOME%Check2" 2>NUL
  38. md "%HOME%Check2"
  39.  
  40. rem ** Check the TrueCrypt binary files
  41. rem ** ("Driver" is temporarily renamed to prevent "dumpbin.exe" from finding any
  42. rem ** symbol names)
  43. call :check "TrueCrypt Setup.exe"
  44. call :check "TrueCrypt.exe"
  45. call :check "TrueCrypt Format.exe"
  46. move "%HOME%Driver" "%HOME%Driver.bak"
  47. call :check "truecrypt.sys"
  48. call :check "truecrypt-x64.sys"
  49. move "%HOME%Driver.bak" "%HOME%Driver"
  50. goto :eof
  51.  
  52. :check
  53. set F=%~1
  54. set R=%HOME%Check\%~1
  55. dumpbin /disasm "%HOME%TrueCrypt\%F%" >"%R%.org.txt"
  56. dumpbin /disasm "%HOME%Release\Setup Files\%F%" >"%R%.new.txt"
  57. fc "%R%.org.txt" "%R%.new.txt" >"%R%.cmp.txt"
  58. set R2=%HOME%Check2\%~1
  59. dumpbin /all /disasm "%HOME%TrueCrypt\%F%" >"%R2%.org.txt"
  60. dumpbin /all /disasm "%HOME%Release\Setup Files\%F%" >"%R2%.new.txt"
  61. fc "%R2%.org.txt" "%R2%.new.txt" >"%R2%.cmp.txt"
  62. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement