diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-10-17 16:26:34 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-10-17 18:40:39 +0200 |
commit | 2ddc37416416894bf085edc6ca4a0b3862fae2c2 (patch) | |
tree | f8e27a4d460299ef4a4b7012525a5418c0043887 /src/Common/BootEncryption.cpp | |
parent | 78d9e5fc3b75f438fa59d7df5bd69f225854b0c3 (diff) | |
download | VeraCrypt-2ddc37416416894bf085edc6ca4a0b3862fae2c2.tar.gz VeraCrypt-2ddc37416416894bf085edc6ca4a0b3862fae2c2.zip |
Windows: Remove VeraCrypt from EFI boot partition after decrypting the system
Diffstat (limited to 'src/Common/BootEncryption.cpp')
-rw-r--r-- | src/Common/BootEncryption.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp index 8aa40605..b1d55e01 100644 --- a/src/Common/BootEncryption.cpp +++ b/src/Common/BootEncryption.cpp @@ -2351,7 +2351,7 @@ namespace VeraCrypt } - void EfiBoot::SaveFile(wchar_t* name, byte* data, DWORD size) { + void EfiBoot::SaveFile(const wchar_t* name, byte* data, DWORD size) { wstring path = EfiBootPartPath; path += name; File f(path, false, true); @@ -2389,7 +2389,7 @@ namespace VeraCrypt throw_sys_if (!::CopyFileW (path.c_str(), targetPath.c_str(), FALSE)); } - BOOL EfiBoot::RenameFile(wchar_t* name, wchar_t* nameNew, BOOL bForce) { + BOOL EfiBoot::RenameFile(const wchar_t* name, wchar_t* nameNew, BOOL bForce) { wstring path = EfiBootPartPath; path += name; wstring pathNew = EfiBootPartPath; @@ -2397,13 +2397,13 @@ namespace VeraCrypt return MoveFileExW(path.c_str(), pathNew.c_str(), bForce? MOVEFILE_REPLACE_EXISTING : 0); } - BOOL EfiBoot::DelFile(wchar_t* name) { + BOOL EfiBoot::DelFile(const wchar_t* name) { wstring path = EfiBootPartPath; path += name; return DeleteFile(path.c_str()); } - BOOL EfiBoot::MkDir(wchar_t* name, bool& bAlreadyExists) { + BOOL EfiBoot::MkDir(const wchar_t* name, bool& bAlreadyExists) { wstring path = EfiBootPartPath; path += name; bAlreadyExists = false; @@ -2416,7 +2416,13 @@ namespace VeraCrypt return bRet; } - BOOL EfiBoot::ReadConfig (wchar_t* name, EfiBootConf& conf) + BOOL EfiBoot::DelDir(const wchar_t* name) { + wstring path = EfiBootPartPath; + path += name; + return DeleteDirectory (path.c_str()); + } + + BOOL EfiBoot::ReadConfig (const wchar_t* name, EfiBootConf& conf) { wstring path = EfiBootPartPath; path += name; @@ -2424,7 +2430,7 @@ namespace VeraCrypt return conf.Load (path.c_str()); } - BOOL EfiBoot::UpdateConfig (wchar_t* name, int pim, int hashAlgo, HWND hwndDlg) + BOOL EfiBoot::UpdateConfig (const wchar_t* name, int pim, int hashAlgo, HWND hwndDlg) { BOOL bRet = FALSE; EfiBootConf conf; @@ -2461,7 +2467,7 @@ namespace VeraCrypt return bRet; } - BOOL EfiBoot::WriteConfig (wchar_t* name, bool preserveUserConfig, int pim, int hashAlgo, const char* passPromptMsg, HWND hwndDlg) + BOOL EfiBoot::WriteConfig (const wchar_t* name, bool preserveUserConfig, int pim, int hashAlgo, const char* passPromptMsg, HWND hwndDlg) { EfiBootConf conf; wstring path = EfiBootPartPath; @@ -3483,6 +3489,7 @@ namespace VeraCrypt EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsBml.dcs"); EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsBoot"); EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsProp"); + EfiBootInst.DelDir (L"\\EFI\\VeraCrypt"); } else { |