From 4a8f068ba559ceb597fb8b417a08c8fc96088aa4 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 8 Sep 2024 17:14:31 +0200 Subject: Windows: Add support for x86 and x64 build for driver and binaries using Visual Studio 2019 We also enable Control Flow Guard and Spectre Mitigation --- src/Driver/veracrypt_vs2019.vcxproj | 226 ++++++++++++++++++---------- src/Driver/veracrypt_vs2019.vcxproj.filters | 3 + 2 files changed, 153 insertions(+), 76 deletions(-) (limited to 'src/Driver') diff --git a/src/Driver/veracrypt_vs2019.vcxproj b/src/Driver/veracrypt_vs2019.vcxproj index e956bcb0..8a360525 100644 --- a/src/Driver/veracrypt_vs2019.vcxproj +++ b/src/Driver/veracrypt_vs2019.vcxproj @@ -29,7 +29,10 @@ - + + StdCall + StdCall + @@ -38,7 +41,12 @@ - + + true + true + true + true + @@ -54,30 +62,33 @@ true - true - true + false + false true - true - true + false + false true - true - true + false + false true - true - true + false + false true - true - true + false + false true - true - true + false + false + + + StdCall + StdCall - @@ -170,34 +181,45 @@ DbgengKernelDebugger - $(SolutionDir)$(Platform)\$(ConfigurationName)\ + $(ProjectDir)$(Platform)\$(ConfigurationName)\ veracrypt + $(ProjectDir)$(Platform)\$(ConfigurationName)\ veracrypt DbgengKernelDebugger + $(ProjectDir)$(Platform)\$(ConfigurationName)\ + $(ProjectDir)$(Platform)\$(ConfigurationName)\ veracrypt DbgengKernelDebugger + $(ProjectDir)$(ConfigurationName)\ + $(ProjectDir)$(ConfigurationName)\ DbgengKernelDebugger $(ProjectDir)$(Platform)\$(ConfigurationName)\ veracrypt + $(ProjectDir)$(Platform)\$(ConfigurationName)\ veracrypt DbgengKernelDebugger + $(ProjectDir)$(Platform)\$(ConfigurationName)\ + $(ProjectDir)$(Platform)\$(ConfigurationName)\ veracrypt DbgengKernelDebugger + $(ProjectDir)$(ConfigurationName)\ + $(ProjectDir)$(ConfigurationName)\ fltmgr.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) + true $(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories) @@ -215,14 +237,16 @@ fltmgr.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) + true $(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories) TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;DEBUG;_DEBUG;%(PreprocessorDefinitions) 4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings) + Cdecl - copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-arm64.sys" + copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.sys" false @@ -232,14 +256,16 @@ fltmgr.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) + true $(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories) TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;DEBUG;_DEBUG;%(PreprocessorDefinitions) 4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings) + StdCall - copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-arm64.sys" + copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt.sys" false @@ -249,6 +275,7 @@ fltmgr.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) + true $(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories) @@ -267,14 +294,16 @@ fltmgr.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) + true $(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories) TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;%(PreprocessorDefinitions) 4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings) + Cdecl - copy $(TargetPath) "..\Release\Setup Files\VeraCrypt-arm64.sys" + copy $(TargetPath) "..\Release\Setup Files\VeraCrypt-x64.sys" true @@ -285,14 +314,16 @@ fltmgr.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) + true $(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories) TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;%(PreprocessorDefinitions) 4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings) + StdCall - copy $(TargetPath) "..\Release\Setup Files\VeraCrypt-arm64.sys" + copy $(TargetPath) "..\Release\Setup Files\VeraCrypt.sys" true @@ -303,6 +334,7 @@ + @@ -343,16 +375,12 @@ echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - - echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - - echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) @@ -360,21 +388,25 @@ $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) true - true - true + false + false true - true - true + false + false true - true + false true true - true + false true + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) @@ -383,14 +415,12 @@ echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)" - + echo %(Filename)%(Extension) & nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) @@ -399,81 +429,109 @@ $(TargetDir)\%(Filename).obj;%(Outputs) true true - true + false true true - true + false Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -p gas -D WINABI -D __YASM__ -f win64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -p gas -D WINABI -D __YASM__ -f win64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -p gas -D WINABI -D __YASM__ -f win64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -p gas -D WINABI -D __YASM__ -f win64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -p gas -D WINABI -D __YASM__ -f win64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -p gas -D WINABI -D __YASM__ -f win64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document + echo %(Filename)%(Extension) & vsyasm.exe -Xvc -p gas -D WINABI -D __YASM__ -f win32 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & vsyasm.exe -Xvc -p gas -D WINABI -D __YASM__ -f win32 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) @@ -485,50 +543,70 @@ true true false + echo %(Filename)%(Extension) & vsyasm.exe -Xvc -p gas -D WINABI -D __YASM__ -f win32 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & vsyasm.exe -Xvc -p gas -D WINABI -D __YASM__ -f win32 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -Xvc -p gas -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -Xvc -p gas -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) Document true - true + false true true - true + false true + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + echo %(Filename)%(Extension) & yasm.exe -D WINABI -D __YASM__ -f x64 -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)" + $(TargetDir)\%(Filename).obj;%(Outputs) + $(TargetDir)\%(Filename).obj;%(Outputs) @@ -538,14 +616,12 @@ echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - + echo %(Filename)%(Extension) & ml.exe /nologo /D_M_X86 /W3 /Cx /Zi /safeseh /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - + echo %(Filename)%(Extension) & ml.exe /nologo /D_M_X86 /W3 /Cx /Zi /safeseh /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) @@ -553,11 +629,11 @@ $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) true - true - true + false + false true - true - true + false + false @@ -567,14 +643,12 @@ echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - + echo %(Filename)%(Extension) & ml.exe /nologo /D_M_X86 /W3 /Cx /Zi /safeseh /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - echo %(Filename)%(Extension) & ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" - + echo %(Filename)%(Extension) & ml.exe /nologo /D_M_X86 /W3 /Cx /Zi /safeseh /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)" $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) @@ -582,11 +656,11 @@ $(TargetDir)\%(Filename).obj;%(Outputs) $(TargetDir)\%(Filename).obj;%(Outputs) true - true - true + false + false true - true - true + false + false diff --git a/src/Driver/veracrypt_vs2019.vcxproj.filters b/src/Driver/veracrypt_vs2019.vcxproj.filters index f0c7d0e3..43a1a222 100644 --- a/src/Driver/veracrypt_vs2019.vcxproj.filters +++ b/src/Driver/veracrypt_vs2019.vcxproj.filters @@ -264,6 +264,9 @@ Crypto\Header Files + + Common + -- cgit v1.2.3