VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/SelfExtract.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-15 22:32:27 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-23 14:59:28 (GMT)
commit2dc39a7c7e085d77a5b3505b15fd00111a6fff5e (patch)
treed49daa73ab4a8094ca689497c881ed27ea9b1242 /src/Setup/SelfExtract.c
parent0a737c8c87fded05a74cad5232c9c973b3037d61 (diff)
downloadVeraCrypt-2dc39a7c7e085d77a5b3505b15fd00111a6fff5e.zip
VeraCrypt-2dc39a7c7e085d77a5b3505b15fd00111a6fff5e.tar.gz
Windows: simplify installer logic by copying only binaries for the current architecture.
Diffstat (limited to 'src/Setup/SelfExtract.c')
-rw-r--r--src/Setup/SelfExtract.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/Setup/SelfExtract.c b/src/Setup/SelfExtract.c
index 7b3fb4f..2a3a8b2 100644
--- a/src/Setup/SelfExtract.c
+++ b/src/Setup/SelfExtract.c
@@ -34,8 +34,8 @@
#else
#define OutputPackageFile L"VeraCrypt Setup " _T(VERSION_STRING) L".exe"
#endif
-#define MAG_START_MARKER "TCINSTRT"
-#define MAG_END_MARKER_OBFUSCATED "T/C/I/N/S/C/R/C"
+#define MAG_START_MARKER "VCINSTRT"
+#define MAG_END_MARKER_OBFUSCATED "V/C/I/N/S/C/R/C"
#define PIPE_BUFFER_LEN (4 * BYTES_PER_KB)
unsigned char MagEndMarker [sizeof (MAG_END_MARKER_OBFUSCATED)];
@@ -57,7 +57,7 @@ void SelfExtractStartupInit (void)
// The end marker must be included in the self-extracting exe only once, not twice (used e.g.
// by IsSelfExtractingPackage()) and that's why MAG_END_MARKER_OBFUSCATED is obfuscated and
// needs to be deobfuscated using this function at startup.
-static void DeobfuscateMagEndMarker (void)
+void DeobfuscateMagEndMarker (void)
{
int i;
@@ -385,16 +385,21 @@ err:
// Verifies the CRC-32 of the whole self-extracting package (except the digital signature areas, if present)
-BOOL VerifyPackageIntegrity (void)
+BOOL VerifySelfPackageIntegrity ()
+{
+ wchar_t path [TC_MAX_PATH];
+
+ GetModuleFileName (NULL, path, ARRAYSIZE (path));
+ return VerifyPackageIntegrity (path);
+}
+
+BOOL VerifyPackageIntegrity (const wchar_t *path)
{
int fileDataEndPos = 0;
int fileDataStartPos = 0;
unsigned __int32 crc = 0;
unsigned char *tmpBuffer;
int tmpFileSize;
- wchar_t path [TC_MAX_PATH];
-
- GetModuleFileName (NULL, path, ARRAYSIZE (path));
#ifdef NDEBUG
// verify Authenticode digital signature of the exe file
@@ -464,7 +469,7 @@ BOOL IsSelfExtractingPackage (void)
}
-static void FreeAllFileBuffers (void)
+void FreeAllFileBuffers (void)
{
int fileNo;
@@ -619,7 +624,7 @@ sem_end:
return FALSE;
}
-
+#ifdef SETUP
void __cdecl ExtractAllFilesThread (void *hwndDlg)
{
int fileNo;
@@ -704,4 +709,4 @@ eaf_end:
else
PostMessage (MainDlg, TC_APPMSG_EXTRACTION_FAILURE, 0, 0);
}
-
+#endif