From c41b93b6b4e8632c5c686ccb0ba4d10612a285eb Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Mon, 13 May 2024 04:43:55 +0300 Subject: [PATCH] ep_setup_patch: Supply custom hash as argument 1 (useful in `ep_make`) --- ep_setup_patch/ep_setup_patch.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ep_setup_patch/ep_setup_patch.c b/ep_setup_patch/ep_setup_patch.c index 0638a06..dbe2ba4 100644 --- a/ep_setup_patch/ep_setup_patch.c +++ b/ep_setup_patch/ep_setup_patch.c @@ -18,8 +18,18 @@ int WINAPI wWinMain( CHAR hash[100]; ZeroMemory(hash, 100); - ComputeFileHash2(hModule, wszPath, hash, 100); - FreeLibrary(hModule); + if (__argc > 1) + { + for (size_t i = 0; i < MIN(wcslen(__wargv[1]), 32); ++i) + { + hash[i] = __wargv[1][i]; + } + } + else + { + ComputeFileHash2(hModule, wszPath, hash, 100); + FreeLibrary(hModule); + } PathRemoveFileSpecW(wszPath); wcscat_s(wszPath, MAX_PATH, L"\\" _T(SETUP_UTILITY_NAME));