diff --git a/etc/7zSD.cmd b/etc/7zSD.cmd deleted file mode 100644 index a44adda..0000000 --- a/etc/7zSD.cmd +++ /dev/null @@ -1,48 +0,0 @@ -@echo off -setlocal ENABLEDELAYEDEXPANSION - -REM Print help screen -if "%~4"=="" ( - echo 7-Zip SFX Builder - echo Usage: 7zSD.cmd ^ ^ ^ ^ - exit /b 1 -) - -REM Generate temp file names -set "SEVENZIP_SFX_CFG=%TMP%\~7zSD%RANDOM%%RANDOM%.cf" -set "SEVENZIP_SFX_ARC=%TMP%\~7zSD%RANDOM%%RANDOM%.7z" - -REM Create the configuration file -echo ;^^!@Install@^^!UTF-8^^!> "%SEVENZIP_SFX_CFG%" -echo Title="%~3">> "%SEVENZIP_SFX_CFG%" -echo ExecuteFile="%~n4.exe">> "%SEVENZIP_SFX_CFG%" -echo ;^^!@InstallEnd@^^!>> "%SEVENZIP_SFX_CFG%" - -REM Create the 7-Zip archive -"%~dp0\7za.exe" a -t7z "%SEVENZIP_SFX_ARC%" "%~1" -if %ERRORLEVEL% NEQ 0 ( - del "%SEVENZIP_SFX_CFG%" - del "%SEVENZIP_SFX_ARC%" - exit /b 1 -) - -REM Rename the embedded file -"%~dp0\7za.exe" rn "%SEVENZIP_SFX_ARC%" "%~nx1" "%~n4.exe" -if %ERRORLEVEL% NEQ 0 ( - del "%SEVENZIP_SFX_CFG%" - del "%SEVENZIP_SFX_ARC%" - exit /b 1 -) - -REM Actually build the SFX file -copy /b "%~dp0\7zSD.sfx" + "%SEVENZIP_SFX_CFG%" + "%SEVENZIP_SFX_ARC%" "%~2" -if %ERRORLEVEL% NEQ 0 ( - del "%SEVENZIP_SFX_CFG%" - del "%SEVENZIP_SFX_ARC%" - exit /b 1 -) - -REM Final clean-up -del "%SEVENZIP_SFX_CFG%" -del "%SEVENZIP_SFX_ARC%" -exit /b 0 diff --git a/etc/7zSD.diff b/etc/7zSD.diff deleted file mode 100644 index 8dc90da..0000000 --- a/etc/7zSD.diff +++ /dev/null @@ -1,387 +0,0 @@ - CPP/7zip/Bundles/SFXSetup/Compat.xml | 1 + - CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp | 51 +++++++++++++--- - CPP/7zip/Bundles/SFXSetup/resource.rc | 4 +- - CPP/7zip/UI/Explorer/MyMessages.cpp | 4 +- - CPP/7zip/UI/Explorer/MyMessages.h | 2 +- - CPP/7zip/UI/FileManager/FormatUtils.cpp | 2 +- - CPP/7zip/UI/FileManager/ProgressDialog.cpp | 4 +- - CPP/Common/MyWindows.h | 1 + - CPP/Windows/FileDir.cpp | 97 ++++++++++++++++++++++++++---- - CPP/Windows/FileDir.h | 1 + - 10 files changed, 137 insertions(+), 30 deletions(-) - -diff --git a/CPP/7zip/Bundles/SFXSetup/Compat.xml b/CPP/7zip/Bundles/SFXSetup/Compat.xml -new file mode 100644 -index 0000000..76fecef ---- /dev/null -+++ b/CPP/7zip/Bundles/SFXSetup/Compat.xml -@@ -0,0 +1 @@ -+ -\ No newline at end of file -diff --git a/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp b/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp -index aef2e19..53608cf 100644 ---- a/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp -+++ b/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp -@@ -37,6 +37,26 @@ static CFSTR kTempDirPrefix = FTEXT("7zS"); - - #define _SHELL_EXECUTE - -+static HWND GetCurrentHwnd(void) -+{ -+ HWND result = ::GetActiveWindow(); -+ if(!(result && IsWindowVisible(result))) -+ { -+ for (int i = 0; i < 256; ++i) -+ { -+ ::Sleep(1); /*some delay*/ -+ if(const HWND hwnd = ::GetForegroundWindow()) -+ { -+ if(IsWindowVisible(result = hwnd)) -+ { -+ break; /*success*/ -+ } -+ } -+ } -+ } -+ return result; -+} -+ - static bool ReadDataString(CFSTR fileName, LPCSTR startID, - LPCSTR endID, AString &stringResult) - { -@@ -145,7 +165,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, - - UString archiveName, switches; - #ifdef _SHELL_EXECUTE -- UString executeFile, executeParameters; -+ UString executeFile, executeParameters, executeErrorMsg; - #endif - NCommandLineParser::SplitCommandLine(GetCommandLineW(), archiveName, switches); - -@@ -191,7 +211,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, - dirPrefix = pairs[index].String; - if (!installPrompt.IsEmpty() && !assumeYes) - { -- if (MessageBoxW(0, installPrompt, friendlyName, MB_YESNO | -+ if (MessageBoxW(NULL, installPrompt, friendlyName, MB_YESNO | MB_SYSTEMMODAL | - MB_ICONQUESTION) != IDYES) - return 0; - } -@@ -200,6 +220,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, - #ifdef _SHELL_EXECUTE - executeFile = GetTextConfigValue(pairs, L"ExecuteFile"); - executeParameters = GetTextConfigValue(pairs, L"ExecuteParameters"); -+ executeErrorMsg = GetTextConfigValue(pairs, L"ExecuteErrorMsg"); - #endif - } - -@@ -243,7 +264,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, - { - if (errorMessage.IsEmpty()) - errorMessage = NError::MyFormatMessage(result); -- ::MessageBoxW(0, errorMessage, NWindows::MyLoadString(IDS_EXTRACTION_ERROR_TITLE), MB_ICONERROR); -+ ::MessageBoxW(NULL, errorMessage, NWindows::MyLoadString(IDS_EXTRACTION_ERROR_TITLE), MB_ICONERROR | MB_SYSTEMMODAL); - } - } - return 1; -@@ -287,13 +308,25 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, - execInfo.lpDirectory = NULL; - execInfo.nShow = SW_SHOWNORMAL; - execInfo.hProcess = 0; -- /* BOOL success = */ ::ShellExecuteEx(&execInfo); -- UINT32 result = (UINT32)(UINT_PTR)execInfo.hInstApp; -- if (result <= 32) -+ -+ for (;;) - { -- if (!assumeYes) -- ShowErrorMessage(L"Can not open file"); -- return 1; -+ execInfo.hwnd = GetCurrentHwnd(); /*prevent UAC dialog from appearing in the background!*/ -+ /* BOOL success = */ ::ShellExecuteEx(&execInfo); -+ UINT32 result = (UINT32)(UINT_PTR)execInfo.hInstApp; -+ if (result <= 32) -+ { -+ if (!assumeYes) -+ { -+ const wchar_t *const lpErrorMessage = executeErrorMsg.IsEmpty() ? L"Failed to launch installer. Please try again!" : executeErrorMsg; -+ if (MessageBoxW(NULL, lpErrorMessage, L"Setup", MB_SYSTEMMODAL | MB_ICONEXCLAMATION | MB_RETRYCANCEL) == IDRETRY) -+ { -+ continue; /*retry*/ -+ } -+ } -+ return 1; -+ } -+ break; /*success*/ - } - hProcess = execInfo.hProcess; - } -diff --git a/CPP/7zip/Bundles/SFXSetup/resource.rc b/CPP/7zip/Bundles/SFXSetup/resource.rc -index 47e1b76..c796e65 100644 ---- a/CPP/7zip/Bundles/SFXSetup/resource.rc -+++ b/CPP/7zip/Bundles/SFXSetup/resource.rc -@@ -1,14 +1,14 @@ - #include "../../MyVersionInfo.rc" - #include "resource.h" - --MY_VERSION_INFO_APP("7z Setup SFX", "7zS.sfx") -+MY_VERSION_INFO_APP("Setup SFX", "7zS.sfx") - - IDI_ICON ICON "setup.ico" - - STRINGTABLE - BEGIN - IDS_EXTRACTION_ERROR_TITLE "Extraction Failed" -- IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt" -+ IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt. Please download again!" - IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'" - IDS_PROGRESS_EXTRACTING "Extracting" - END -diff --git a/CPP/7zip/UI/Explorer/MyMessages.cpp b/CPP/7zip/UI/Explorer/MyMessages.cpp -index 70c2a46..84ac8f4 100644 ---- a/CPP/7zip/UI/Explorer/MyMessages.cpp -+++ b/CPP/7zip/UI/Explorer/MyMessages.cpp -@@ -1,6 +1,6 @@ - // MyMessages.cpp - --#include "StdAfx.h" -+//#include "StdAfx.h" - - #include "MyMessages.h" - -@@ -13,7 +13,7 @@ using namespace NWindows; - - void ShowErrorMessage(HWND window, LPCWSTR message) - { -- ::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP); -+ ::MessageBoxW(window, message, L"Setup", MB_OK | MB_SYSTEMMODAL | MB_ICONSTOP); - } - - void ShowErrorMessageHwndRes(HWND window, UINT resID) -diff --git a/CPP/7zip/UI/Explorer/MyMessages.h b/CPP/7zip/UI/Explorer/MyMessages.h -index d5822f4..3bd6e2e 100644 ---- a/CPP/7zip/UI/Explorer/MyMessages.h -+++ b/CPP/7zip/UI/Explorer/MyMessages.h -@@ -6,7 +6,7 @@ - #include "../../../Common/MyString.h" - - void ShowErrorMessage(HWND window, LPCWSTR message); --inline void ShowErrorMessage(LPCWSTR message) { ShowErrorMessage(0, message); } -+inline void ShowErrorMessage(LPCWSTR message) { ShowErrorMessage(NULL, message); } - - void ShowErrorMessageHwndRes(HWND window, UInt32 langID); - void ShowErrorMessageRes(UInt32 langID); -diff --git a/CPP/7zip/UI/FileManager/FormatUtils.cpp b/CPP/7zip/UI/FileManager/FormatUtils.cpp -index 2143c3f..3a18712 100644 ---- a/CPP/7zip/UI/FileManager/FormatUtils.cpp -+++ b/CPP/7zip/UI/FileManager/FormatUtils.cpp -@@ -1,6 +1,6 @@ - // FormatUtils.cpp - --#include "StdAfx.h" -+//#include "StdAfx.h" - - #include "../../../Common/IntToString.h" - -diff --git a/CPP/7zip/UI/FileManager/ProgressDialog.cpp b/CPP/7zip/UI/FileManager/ProgressDialog.cpp -index 65201a9..4d23499 100644 ---- a/CPP/7zip/UI/FileManager/ProgressDialog.cpp -+++ b/CPP/7zip/UI/FileManager/ProgressDialog.cpp -@@ -1,6 +1,6 @@ - // ProgressDialog.cpp - --#include "StdAfx.h" -+//#include "StdAfx.h" - - #include "../../../Common/IntToString.h" - -@@ -165,7 +165,7 @@ bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND) - bool paused = Sync.GetPaused(); - Sync.SetPaused(true); - _inCancelMessageBox = true; -- int res = ::MessageBoxW(*this, L"Are you sure you want to cancel?", _title, MB_YESNOCANCEL); -+ int res = ::MessageBoxW(*this, L"Are you sure you want to cancel?", _title, MB_YESNOCANCEL | MB_SYSTEMMODAL); - _inCancelMessageBox = false; - Sync.SetPaused(paused); - if (res == IDCANCEL || res == IDNO) -diff --git a/CPP/Common/MyWindows.h b/CPP/Common/MyWindows.h -index 139a4e8..c40767f 100644 ---- a/CPP/Common/MyWindows.h -+++ b/CPP/Common/MyWindows.h -@@ -6,6 +6,7 @@ - #ifdef _WIN32 - - #include -+#include - - #ifdef UNDER_CE - #undef VARIANT_TRUE -diff --git a/CPP/Windows/FileDir.cpp b/CPP/Windows/FileDir.cpp -index da71b71..dae9f93 100644 ---- a/CPP/Windows/FileDir.cpp -+++ b/CPP/Windows/FileDir.cpp -@@ -14,6 +14,8 @@ - extern bool g_IsNT; - #endif - -+static CFSTR kTempDirName = FTEXT("TEMP"); -+ - using namespace NWindows; - using namespace NFile; - using namespace NName; -@@ -67,6 +69,36 @@ bool GetSystemDir(FString &path) - } - return (needLength > 0 && needLength <= MAX_PATH); - } -+ -+bool GetAppDataDir(FString &path) -+{ -+ HRESULT hResult; -+ static const int FolderId[] = { CSIDL_LOCAL_APPDATA, CSIDL_APPDATA, CSIDL_PROFILE, NULL }; -+ for(size_t i = 0; i < 3; ++i) -+ { -+ #ifndef _UNICODE -+ if (!g_IsNT) -+ { -+ TCHAR s[MAX_PATH + 2]; -+ s[0] = 0; -+ hResult = ::SHGetFolderPath(NULL, FolderId[i] | CSIDL_FLAG_CREATE, NULL, 0, s); -+ path = fas2fs(s); -+ } -+ else -+ #endif -+ { -+ WCHAR s[MAX_PATH + 2]; -+ s[0] = 0; -+ hResult = ::SHGetFolderPathW(NULL, FolderId[i] | CSIDL_FLAG_CREATE, NULL, 0, s); -+ path = us2fs(s); -+ } -+ if(hResult == S_OK) -+ { -+ return true; /*success*/ -+ } -+ } -+ return false; -+} - #endif - - bool SetDirTime(CFSTR path, const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime) -@@ -566,7 +598,7 @@ bool MyGetTempPath(FString &path) - { - WCHAR s[MAX_PATH + 2]; - s[0] = 0; -- needLength = ::GetTempPathW(MAX_PATH + 1, s);; -+ needLength = ::GetTempPathW(MAX_PATH + 1, s); - path = us2fs(s); - } - return (needLength > 0 && needLength <= MAX_PATH); -@@ -625,6 +657,35 @@ static bool CreateTempFile(CFSTR prefix, bool addRandom, FString &path, NIO::COu - return false; - } - -+static bool CreateTempFileSafely(CFSTR prefix, bool addRandom, FString &path, NIO::COutFile *outFile) -+{ -+ FString tempPath; -+ if (MyGetTempPath(tempPath)) -+ { -+ if (CreateTempFile(tempPath + prefix, addRandom, path, outFile)) -+ { -+ return true; -+ } -+ } -+ for(Byte retry = 0; retry < 2; ++retry) -+ { -+ if (retry ? GetWindowsDir(tempPath) : GetAppDataDir(tempPath)) -+ { -+ tempPath.Add_PathSepar(); -+ tempPath += kTempDirName; -+ if(CreateComplexDir(tempPath)) -+ { -+ tempPath.Add_PathSepar(); -+ if (CreateTempFile(tempPath + prefix, addRandom, path, outFile)) -+ { -+ return true; -+ } -+ } -+ } -+ } -+ return false; -+} -+ - bool CTempFile::Create(CFSTR prefix, NIO::COutFile *outFile) - { - if (!Remove()) -@@ -639,10 +700,7 @@ bool CTempFile::CreateRandomInTempFolder(CFSTR namePrefix, NIO::COutFile *outFil - { - if (!Remove()) - return false; -- FString tempPath; -- if (!MyGetTempPath(tempPath)) -- return false; -- if (!CreateTempFile(tempPath + namePrefix, true, _path, outFile)) -+ if (!CreateTempFileSafely(namePrefix, true, _path, outFile)) - return false; - _mustBeDeleted = true; - return true; -@@ -652,8 +710,16 @@ bool CTempFile::Remove() - { - if (!_mustBeDeleted) - return true; -- _mustBeDeleted = !DeleteFileAlways(_path); -- return !_mustBeDeleted; -+ for(UInt32 i = 0; i < 256; ++i) -+ { -+ if(DeleteFileAlways(_path)) -+ { -+ _mustBeDeleted = false; -+ return true; -+ } -+ ::Sleep(1); -+ } -+ return false; - } - - bool CTempFile::MoveTo(CFSTR name, bool deleteDestBefore) -@@ -670,10 +736,7 @@ bool CTempDir::Create(CFSTR prefix) - { - if (!Remove()) - return false; -- FString tempPath; -- if (!MyGetTempPath(tempPath)) -- return false; -- if (!CreateTempFile(tempPath + prefix, true, _path, NULL)) -+ if (!CreateTempFileSafely(prefix, true, _path, NULL)) - return false; - _mustBeDeleted = true; - return true; -@@ -683,8 +746,16 @@ bool CTempDir::Remove() - { - if (!_mustBeDeleted) - return true; -- _mustBeDeleted = !RemoveDirWithSubItems(_path); -- return !_mustBeDeleted; -+ for(UInt32 i = 0; i < 256; ++i) -+ { -+ if(RemoveDirWithSubItems(_path)) -+ { -+ _mustBeDeleted = false; -+ return true; -+ } -+ ::Sleep(1); -+ } -+ return false; - } - - }}} -diff --git a/CPP/Windows/FileDir.h b/CPP/Windows/FileDir.h -index b13d1cc..1d87bbf 100644 ---- a/CPP/Windows/FileDir.h -+++ b/CPP/Windows/FileDir.h -@@ -13,6 +13,7 @@ namespace NDir { - - bool GetWindowsDir(FString &path); - bool GetSystemDir(FString &path); -+bool GetAppDataDir(FString &path); - - bool SetDirTime(CFSTR path, const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime); - bool SetFileAttrib(CFSTR path, DWORD attrib); diff --git a/etc/7zSD.sfx b/etc/7zSD.sfx deleted file mode 100644 index 44fbbc3..0000000 Binary files a/etc/7zSD.sfx and /dev/null differ diff --git a/etc/7za.exe b/etc/7za.exe deleted file mode 100644 index dd6cc75..0000000 Binary files a/etc/7za.exe and /dev/null differ diff --git a/etc/7za.license.txt b/etc/7za.license.txt deleted file mode 100644 index f1e7690..0000000 --- a/etc/7za.license.txt +++ /dev/null @@ -1,56 +0,0 @@ - 7-Zip - ~~~~~ - License for use and distribution - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - 7-Zip Copyright (C) 1999-2016 Igor Pavlov. - - Licenses for files are: - - 1) 7z.dll: GNU LGPL + unRAR restriction - 2) All other files: GNU LGPL - - The GNU LGPL + unRAR restriction means that you must follow both - GNU LGPL rules and unRAR restriction rules. - - - Note: - You can use 7-Zip on any computer, including a computer in a commercial - organization. You don't need to register or pay for 7-Zip. - - - GNU LGPL information - -------------------- - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You can receive a copy of the GNU Lesser General Public License from - http://www.gnu.org/ - - - unRAR restriction - ----------------- - - The decompression engine for RAR archives was developed using source - code of unRAR program. - All copyrights to original unRAR code are owned by Alexander Roshal. - - The license for original unRAR code has the following restriction: - - The unRAR sources cannot be used to re-create the RAR compression algorithm, - which is proprietary. Distribution of modified unRAR sources in separate form - or as a part of other software is permitted, provided that it is clearly - stated in the documentation and source comments that the code may - not be used to develop a RAR (WinRAR) compatible archiver. - - - -- - Igor Pavlov diff --git a/etc/7za.readme.txt b/etc/7za.readme.txt deleted file mode 100644 index 228e9a0..0000000 --- a/etc/7za.readme.txt +++ /dev/null @@ -1,51 +0,0 @@ -7-Zip 16.04 ------------ - -7-Zip is a file archiver for Windows NT / 2000 / 2003 / 2008 / 2012 / XP / Vista / 7 / 8 / 10. - -7-Zip Copyright (C) 1999-2016 Igor Pavlov. - -The main features of 7-Zip: - - - High compression ratio in the new 7z format - - Supported formats: - - Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM. - - Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, - IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, - RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z. - - Fast compression and decompression - - Self-extracting capability for 7z format - - Strong AES-256 encryption in 7z and ZIP formats - - Integration with Windows Shell - - Powerful File Manager - - Powerful command line version - - Localizations for 85 languages - - -7-Zip is free software distributed under the GNU LGPL (except for unRar code). -Read License.txt for more information about license. - - - This distribution package contains the following files: - - 7zFM.exe - 7-Zip File Manager - 7-zip.dll - Plugin for Windows Shell - 7-zip32.dll - Plugin for Windows Shell (32-bit plugin for 64-bit system) - 7zg.exe - GUI module - 7z.exe - Command line version - 7z.dll - 7-Zip engine module - 7z.sfx - SFX module (Windows version) - 7zCon.sfx - SFX module (Console version) - - License.txt - License information - readme.txt - This file - History.txt - History of 7-Zip - 7-zip.chm - User's Manual in HTML Help format - descript.ion - Description for files - - Lang\en.ttt - English (base) localization file - Lang\*.txt - Localization files - - ---- -End of document diff --git a/etc/auto_inc.exe b/etc/auto_inc.exe deleted file mode 100644 index dac6073..0000000 Binary files a/etc/auto_inc.exe and /dev/null differ diff --git a/etc/cat.exe b/etc/cat.exe deleted file mode 100644 index 33ee56f..0000000 Binary files a/etc/cat.exe and /dev/null differ diff --git a/etc/date.exe b/etc/date.exe deleted file mode 100644 index 069bae1..0000000 Binary files a/etc/date.exe and /dev/null differ diff --git a/etc/mt.exe b/etc/mt.exe deleted file mode 100644 index a8bf420..0000000 Binary files a/etc/mt.exe and /dev/null differ diff --git a/etc/mt.exe.config b/etc/mt.exe.config deleted file mode 100644 index 88376d8..0000000 --- a/etc/mt.exe.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/etc/rhash.exe b/etc/rhash.exe deleted file mode 100644 index 7770a57..0000000 Binary files a/etc/rhash.exe and /dev/null differ diff --git a/etc/rhash.readme.htm b/etc/rhash.readme.htm deleted file mode 100644 index bca87f4..0000000 --- a/etc/rhash.readme.htm +++ /dev/null @@ -1,470 +0,0 @@ - - - - - -RHASH(1) manual page - - -Table of Contents

- -

Name

-rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other hash -sums. -

Synopsis

-rhash [ option ]... [ file ]... -

Description

-RHash (Recursive Hasher) -computes and verifies various message digests (hash sums) of files. Supported -message digests include CRC32, MD4, MD5, SHA1, SHA256, SHA512, SHA3, Tiger, -DC++ TTH, BitTorrent BTIH, AICH, ED2K, GOST R 34.11-94, RIPEMD-160, HAS-160, -EDON-R 256/512, Whirlpool, Snefru-128/256. -

The program can create and verify -Magnet links and eDonkey ed2k:// links, see --magnet and --ed2k-link options. - -

A dash string parameter ‘-’ is interpreted as stdin file. -

By default rhash -prints sums in SFV format with CRC32 hash sum only. The format can be changed -by options --bsd, --magnet, --simple, --printf, --template. To output all sums use -the ‘-a’ option. -

The default output format can also be changed by renaming -the program or placing a hardlink/symlink to it with a name containing -strings ‘crc32’, ‘md4’, ‘md5’, ‘sha1’, ‘sha256’ ‘sha512’, ‘tiger’, ‘tth’, ‘btih’, ‘aich’, ‘ed2k’, -‘ed2k-link’, ‘gost’, ‘gost-cryptopro’, ‘ripemd160’, ‘has160’, ‘whirlpool’, ‘edonr256’, -‘edonr512’, ‘snefru128’, ‘snefru256’, ‘sfv’ or ‘magnet’. -

-

Program Mode Options

-The -default mode is to print hash sums for all files and directory trees specified -by command line. The mode can be set by the following options. -
- -
-c, --check
-
Check -hash files specified by command line. RHash can verify hash files in SFV -and BSD formats, standard MD5 and SHA1 files, and text files containing -magnet or ed2k links (one link per line). Empty lines and lines starting -with ‘;’ or ‘#’ are skipped. In fact RHash can verify most hash files generated -by itself without formating options --printf and --template.
- -
-u, --update
-
Update -hash files specified by command line. The program calculates and appends -hashes to the updated hash file in the format specified by formating options. -Hashes are calculated for those files from the same directory as the hash -file, which are yet not present in it.
- -
-k, --check-embedded
-
Verify files by crc32 -sum embedded in their names.
- -
--torrent
-
Create a torrent file for each processed -file.
- -
-h, --help
-
Help: print help screen and exit.
- -
-V, --version
-
Version: print version -and exit.
- -
-B, --benchmark
-
Run benchmark for selected algorithm(s). -

-
- -

Hash Sums -Options

- -
- -
-C, --crc32
-
CRC32: calculate and print CRC32 hash sum.
- -
--md4
-
MD4: calculate -and print MD4 hash sum.
- -
-M, --md5
-
MD5: calculate and print MD5 hash sum.
- -
-H, --sha1
-
SHA1: -calculate and print SHA1 hash sum.
- -
--sha224, --sha256, --sha384, --sha512
-
Calculate -specified SHA2 hash sum.
- -
--sha3-224, --sha3-256, --sha3-384, --sha3-512
-
Calculate specified -SHA3 hash sum.
- -
--tiger
-
Tiger: calculate and print Tiger hash sum.
- -
-T, --tth
-
TTH: -calculate and print DC++ TTH sum.
- -
--btih
-
BTIH: calculate and print BitTorrent -Info Hash.
- -
-A, --aich
-
AICH: calculate and print AICH hash.
- -
-E, --ed2k
-
ED2K: calculate -and print eDonkey 2000 hash sum.
- -
-L, --ed2k-link
-
eDonkey link: calculate and -print eDonkey link.
- -
-W, --whirlpool
-
Whirlpool: calculate and print Whirlpool -hash sum.
- -
-G, --gost
-
GOST: calculate and print GOST R 34.11-94 hash, the Russian -GOST standard hash function.
- -
--gost-cryptopro
-
GOST-CRYPTOPRO: calculate and print -CryptoPro version of the GOST R 34.11-94 hash function.
- -
--ripemd160
-
RIPEMD-160: -calculate and print RIPEMD-160 hash sum.
- -
--has160
-
HAS-160: calculate and print -HAS-160 hash sum.
- -
--snefru128, --snefru256
-
SNEFRU: calculate and print SNEFRU-128/256 -hash sums.
- -
--edonr256, --edonr512
-
EDON-R: calculate and print EDON-R 256/512 hash -sums. -

- -
-a, --all
-
Calculate all supported hash sums.
- -
--list-hashes
-
List names of all -supported hashes, one per line. -

-
- -

Miscellaneous Options

- -
- -
-r, --recursive
-
Process -directories recursively.
- -
-v, --verbose
-
Be verbose.
- -
--percents
-
Show percents, while -calculating or checking sums
- -
--skip-ok
-
Don’t print OK messages for successfully -verified files.
- -
-i, --ignore-case
-
Ignore case of filenames when updating crc -files.
- -
--speed
-
Print per-file and the total processing speed.
- -
-e, --embed-crc
-
Rename -files by inserting crc32 sum into name.
- -
--embed-crc-delimiter=<delimiter>
-
Insert -specified <delimiter> before a crc sum in the --embed-crc mode, default is -white space. The <delimiter> can be a character or empty string.
- -
--path-separator=<separator>
-
Use -specified path separator to display paths.
- -
-q, --accept=<list>
-
Set a comma-delimited -list of extensions of the files to process.
- -
--exclude=<list>
-
Set a comma-delimited -list of extensions of the files to exclude from processing.
- -
-t, --crc-accept=<list>
-
Set -a comma-delimited list of extensions of the hash files to verify.
- -
--maxdepth=<levels>
-
Descend -at most <levels> (a non-negative integer) levels of directories below the -command line arguments. ‘--maxdepth 0’ means only apply the tests and actions -to the command line arguments.
- -
-o, --output=<file-path>
-
Set the file to output -calculated hashes and verification results to.
- -
-l, --log=<file-path>
-
Set the file -to log errors and verbose information to.
- -
--openssl=<list>
-
Specify which hash -functions should be calculated using the OpenSSL library. The <list> is a -comma delimited list of hash names, but only those supported by openssl -are allowed, e.g. md4, md5, sha1, sha256, ripemd160. See openssl documentation -for the full list.
- -
--gost-reverse
-
Reverse bytes in hexadecimal output of the -GOST hash sum. The most significant bytes of the hash will be printed first. -Default order is the least significant bytes first.
- -
--bt-batch=<file-path>
-
Turn -on torrent batch mode (implies torrent mode). Calculates batch-torrent for -the files specified at command line and saves the torrent file to the file-path. -The option -r <directory> can be useful in this mode.
- -
--bt-private
-
Generate BTIH -for a private BitTorrent tracker.
- -
--bt-piece-length
-
Set the piece length value -for torrent file.
- -
--bt-announce=<announce-url>
-
Add a tracker announce URL to the -created torrent file(s). Several URLs can be passed by specifying the option -mutltiple times. This option doesn’t change the BTIH hash.
- -
--benchmark-raw
-
Switch -benchmark output format to be a machine-readable tab-delimited text with -hash function name, speed, cpu clocks per byte. This option works only if -the --benchmark option was specified.
- -
-- (double dash)
-
Mark the end of command -line options. All parameters following the double dash are interpreted as -files or directories. It is typically used to process filenames starting -with a dash ‘-’. Alternatively you can specify ’./’ or full path before such files, -so they will not look like options anymore. -

-
- -

Output Format Options

- -
- -
--ansi
-
Use -Windows codepage for output.
- -
--oem
-
Use DOS (OEM) codepage for output.
- -
--utf8
-
Use -UTF-8 codepage for output.
- -
--sfv
-
Print hash sums in the SFV (Simple File Verification) -output format (default). But unlike common SFV file, not only CRC32, but -any hash sums specified by options can be printed.
- -
-m, --magnet
-
Print hash sums -formatted as magnet links.
- -
--bsd
-
Use BSD output format. Each hash sum is printed -on separate line after hash name and file’s path, enclosed in parentheses. -
- -
--simple
-
Use simple output format. Each line will consist of filename and hash -sums specified by options.
- -
--uppercase
-
Print hash sums in upper case.
- -
--lowercase
-
Print -hash sums in lower case.
- -
--template=<file>
-
Read printf-like template from given -<file>. See the --printf option.
- -
-p, --printf=<format>
-
Format: print format string -the standard output, interpreting ‘\’ escapes and ‘%’ directives. The escapes -and directives are:
- -
\n
-
Newline.
- -
\r
-
Carriage return.
- -
\t
-
Horizontal tab.
- -
\\
-
A literal -backslash (‘\’).
- -
\0
-
ASCII NUL.
- -
\NNN
-
The character which octal ASCII code is NNN. -
- -
\xNN
-
The character which hexadecimal ASCII code is NN.
-
-

-A ‘\’ character followed -by any other character is treated as an ordinary character, so they both -are printed. -

- -
%%
-
A literal percent sign.
- -
%p
-
File’s path.
- -
%f
-
File’s name.
- -
%u
-
URL-encoded -filename.
- -
%s
-
File’s size in bytes.
- -
%{mtime}
-
File’s last modification time.
- -
%a -or %A
-
AICH hash sum.
- -
%c or %C
-
CRC32 hash sum. Use %c for lowercase and %C -for uppercase characters.
- -
%g or %G
-
GOST R 34.11-94 hash.
- -
%h or %H
-
SHA1 hash.
- -
%e -or %E
-
ED2K hash sum.
- -
%l or %L
-
EDonkey ed2k://... link.
- -
%m or %M
-
MD5 hash.
- -
%r or -%R
-
RIPEMD-160 hash.
- -
%t or %T
-
TTH sum.
- -
%w or %W
-
Whirlpool hash.
- -
%{md4}, %{sha-224}, -%{sha-256}, %{sha-384}, %{sha-512}, %{sha3-224},
-
%{sha3-256}, %{sha3-384}, %{sha3-512} -%{tiger}, %{btih}, %{gost-cryptopro},
- %{has160}, %{snefru128}, %{snefru256}, %{edon-r256}, %{edon-r512}"
- Print specified hash sum. Actually the %{<hash sum>} directive can print -any supported hash sum. If a hash sum name starts with a capital letter -then the hash is printed in uppercase, e.g. %{TTH}, %{Sha-512}.
- -
%x<hash>, %b<hash>, -%B<hash>, %@<hash>
-
Use one of these prefixes to output a hash sum in hexadecimal, -base32, base64 or raw (binary) format respectively, e.g. %b{md4}, %BH or -%xT.
-
- - -

-

Config File

-RHash looks for a config file on Windows at %APPDATA%\RHash\rhashrc, - -

%HOMEDRIVE%%HOMEPATH%\rhashrc -

and on Linux/Unix at $HOME/.rhashrc and /etc/rhashrc. - -

The config file consists of lines formatted as

variable = value
- -

where -the variable can be a name of any command line option, like magnet, printf, -percents, etc. A boolean variable can be set to true by a value ‘on’, ‘yes’ -or ‘true’, any other value sets the variable to false. -

Empty lines and lines -starting with ‘#’ or ‘;’ are ignored. -

Example config file:
-

# This is a comment line
-percents = on
-crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet
-
-

-

Author

-Aleksey Kravchenko <rhash.admin@gmail.com> -

See Also

-md5sum(1) cksfv(1) -ed2k_hash(1) -

Bugs

-Bug reports are welcome! Send them by email or post to -the SourceForge Bug Tracking System http://sourceforge.net/projects/rhash/ -

- -


-Table of Contents

-

- - diff --git a/etc/sha1.exe b/etc/sha1.exe deleted file mode 100644 index 95cb0d6..0000000 Binary files a/etc/sha1.exe and /dev/null differ diff --git a/etc/upx.exe b/etc/upx.exe deleted file mode 100644 index d38c9f6..0000000 Binary files a/etc/upx.exe and /dev/null differ diff --git a/etc/upx.license.txt b/etc/upx.license.txt deleted file mode 100644 index 444ded8..0000000 --- a/etc/upx.license.txt +++ /dev/null @@ -1,138 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- - - - ooooo ooo ooooooooo. ooooooo ooooo - `888' `8' `888 `Y88. `8888 d8' - 888 8 888 .d88' Y888..8P - 888 8 888ooo88P' `8888' - 888 8 888 .8PY888. - `88. .8' 888 d8' `888b - `YbodP' o888o o888o o88888o - - - The Ultimate Packer for eXecutables - Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar - http://wildsau.idv.uni-linz.ac.at/mfx/upx.html - http://www.nexus.hu/upx - http://upx.tsx.org - - -PLEASE CAREFULLY READ THIS LICENSE AGREEMENT, ESPECIALLY IF YOU PLAN -TO MODIFY THE UPX SOURCE CODE OR USE A MODIFIED UPX VERSION. - - -ABSTRACT -======== - - UPX and UCL are copyrighted software distributed under the terms - of the GNU General Public License (hereinafter the "GPL"). - - The stub which is imbedded in each UPX compressed program is part - of UPX and UCL, and contains code that is under our copyright. The - terms of the GNU General Public License still apply as compressing - a program is a special form of linking with our stub. - - As a special exception we grant the free usage of UPX for all - executables, including commercial programs. - See below for details and restrictions. - - -COPYRIGHT -========= - - UPX and UCL are copyrighted software. All rights remain with the authors. - - UPX is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer - UPX is Copyright (C) 1996-2000 Laszlo Molnar - - UCL is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer - - -GNU GENERAL PUBLIC LICENSE -========================== - - UPX and the UCL library are free software; you can redistribute them - and/or modify them under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - UPX and UCL are distributed in the hope that they will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - - -SPECIAL EXCEPTION FOR COMPRESSED EXECUTABLES -============================================ - - The stub which is imbedded in each UPX compressed program is part - of UPX and UCL, and contains code that is under our copyright. The - terms of the GNU General Public License still apply as compressing - a program is a special form of linking with our stub. - - Hereby Markus F.X.J. Oberhumer and Laszlo Molnar grant you special - permission to freely use and distribute all UPX compressed programs - (including commercial ones), subject to the following restrictions: - - 1. You must compress your program with a completely unmodified UPX - version; either with our precompiled version, or (at your option) - with a self compiled version of the unmodified UPX sources as - distributed by us. - 2. This also implies that the UPX stub must be completely unmodfied, i.e. - the stub imbedded in your compressed program must be byte-identical - to the stub that is produced by the official unmodified UPX version. - 3. The decompressor and any other code from the stub must exclusively get - used by the unmodified UPX stub for decompressing your program at - program startup. No portion of the stub may get read, copied, - called or otherwise get used or accessed by your program. - - -ANNOTATIONS -=========== - - - You can use a modified UPX version or modified UPX stub only for - programs that are compatible with the GNU General Public License. - - - We grant you special permission to freely use and distribute all UPX - compressed programs. But any modification of the UPX stub (such as, - but not limited to, removing our copyright string or making your - program non-decompressible) will immediately revoke your right to - use and distribute a UPX compressed program. - - - UPX is not a software protection tool; by requiring that you use - the unmodified UPX version for your proprietary programs we - make sure that any user can decompress your program. This protects - both you and your users as nobody can hide malicious code - - any program that cannot be decompressed is highly suspicious - by definition. - - - You can integrate all or part of UPX and UCL into projects that - are compatible with the GNU GPL, but obviously you cannot grant - any special exceptions beyond the GPL for our code in your project. - - - We want to actively support manufacturers of virus scanners and - similar security software. Please contact us if you would like to - incorporate parts of UPX or UCL into such a product. - - - -Markus F.X.J. Oberhumer Laszlo Molnar -markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu - -Linz, Austria, 25 Feb 2000 - - - ------BEGIN PGP SIGNATURE----- -Version: 2.6.3ia -Charset: noconv - -iQCVAwUBOLaLS210fyLu8beJAQFYVAP/ShzENWKLTvedLCjZbDcwaBEHfUVcrGMI -wE7frMkbWT2zmkdv9hW90WmjMhOBu7yhUplvN8BKOtLiolEnZmLCYu8AGCwr5wBf -dfLoClxnzfTtgQv5axF1awp4RwCUH3hf4cDrOVqmAsWXKPHtm4hx96jF6L4oHhjx -OO03+ojZdO8= -=CS52 ------END PGP SIGNATURE----- diff --git a/etc/upx.readme.txt b/etc/upx.readme.txt deleted file mode 100644 index e8a16bc..0000000 --- a/etc/upx.readme.txt +++ /dev/null @@ -1,139 +0,0 @@ - ooooo ooo ooooooooo. ooooooo ooooo - `888' `8' `888 `Y88. `8888 d8' - 888 8 888 .d88' Y888..8P - 888 8 888ooo88P' `8888' - 888 8 888 .8PY888. - `88. .8' 888 d8' `888b - `YbodP' o888o o888o o88888o - - - The Ultimate Packer for eXecutables - Copyright (c) 1996-2016 Markus Oberhumer, Laszlo Molnar & John Reiser - https://upx.github.io - - - -WELCOME -======= - -Welcome to UPX ! - -Please don't forget to read the file LICENSE - UPX is distributed -under the GNU General Public License (GPL) with special exceptions -allowing the distribution of all compressed executables, including -commercial programs. - - -INTRODUCTION -============ - -UPX is an advanced executable file compressor. UPX will typically -reduce the file size of programs and DLLs by around 50%-70%, thus -reducing disk space, network load times, download times and -other distribution and storage costs. - -Programs and libraries compressed by UPX are completely self-contained -and run exactly as before, with no runtime or memory penalty for most -of the supported formats. - -UPX supports a number of different executable formats, including -Windows 95/98/ME/NT/2000/XP/CE programs and DLLs, DOS programs, -and Linux executables and kernels. - -UPX is free software distributed under the term of the GNU General -Public License. Full source code is available. - -UPX may be distributed and used freely, even with commercial applications. -See the UPX License Agreement for details. - -UPX is rated number one in the well known Archive Comparison Test. Visit -http://compression.ca/ . - -UPX aims to be Commercial Quality Freeware. - - -SHORT DOCUMENTATION -=================== - -'upx program.exe' will compress a program or DLL. For best compression -results try 'upx --brute program.exe'. - -Please see the file UPX.DOC for the full documentation. The files -NEWS and BUGS also contain various tidbits of information. - - -DISCLAIMER -========== - -UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE. - -Having said that, we think that UPX is quite stable now. Indeed we -have compressed lots of files without any problems. Also, the -current version has undergone several months of beta testing - -actually it's almost 8 years since our first public beta. - -This is the first production quality release, and we plan that future -releases will be backward compatible with this version. - -Please report all problems or suggestions to the authors. Thanks. - - -THE FUTURE -========== - - - AArch64 (64-bit ARM) for Linux and iOS. - - - The Linux approach could probably get ported to a lot of other Unix - variants, at least for other i386 architectures it shouldn't be too - much work. If someone sends me a fresh hard disk and an official - FreeBSD/OpenBSD/NetBSD/Solaris/BeOS... CD I might take a look at it ;-) - - - We will *NOT* add any sort of protection and/or encryption. - This only gives people a false feeling of security because - by definition all protectors/compressors can be broken. - And don't trust any advertisement of authors of other executable - compressors about this topic - just do a websearch on "unpackers"... - - - Fix all remaining bugs - keep your reports coming ;-) - - - See the file PROJECTS in the source code distribution if you want - to contribute. - - -COPYRIGHT -========= - -Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer -Copyright (C) 1996-2016 Laszlo Molnar -Copyright (C) 2000-2016 John F. Reiser - -This program may be used freely, and you are welcome to -redistribute it under certain conditions. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -UPX License Agreement for more details. - -You should have received a copy of the UPX License Agreement along -with this program; see the file LICENSE. If not, visit the UPX home page. - - -Share and enjoy, -Markus & Laszlo & John - - - Markus F.X.J. Oberhumer Laszlo Molnar - - - John F. Reiser - - - -[ The term UPX is a shorthand for the Ultimate Packer for eXecutables - and holds no connection with potential owners of registered trademarks - or other rights. ] - -[ Feel free to contact us if you have commercial compression requirements - or interesting job offers. ] - diff --git a/etc/verpatch.exe b/etc/verpatch.exe deleted file mode 100644 index 9e4c42c..0000000 Binary files a/etc/verpatch.exe and /dev/null differ diff --git a/etc/verpatch.readme.txt b/etc/verpatch.readme.txt deleted file mode 100644 index 33bb098..0000000 --- a/etc/verpatch.readme.txt +++ /dev/null @@ -1,290 +0,0 @@ - -Verpatch - a tool to patch win32 version resources on .exe or .dll files, - -Version: 1.0.15 (25-Oct-2016) - -Verpatch is a command line tool for adding and editing the version information -of Windows executable files (applications, DLLs, kernel drivers) -without rebuilding the executable. - -It can also add or replace Win32 (native) resources, and do some other -modifications of executable files. - -Verpatch sets ERRORLEVEL 0 on success, otherwise errorlevel is non-zero. -Verpatch modifies files in place, so please make copies of precious files. - - -Command line syntax -=================== - -verpatch filename [version] [/options] - -Where - - filename : any Windows PE file (exe, dll, sys, ocx...) that can have version resource - - version : one to four decimal numbers, separated by dots, ex.: 1.2.3.4 - Additional text can follow the numbers; see examples below. Ex.: "1.2.3.4 extra text" - -Common Options: - -/va - creates a version resource. Use when the file has no version resource at all, - or existing version resource should be replaced. - If this option not specified, verpatch will read version resourse from the file. -/s name "value" - add a version resource string attribute - The name can be either a full attribute name or alias; see below. -/sc "comment" - add or replace Comments string (shortcut for /s Comments "comment") -/pv - specify Product version - where arg has same form as the file version (1.2.3.4 or "1.2.3.4 text") -/high - when less than 4 version numbers, these are higher numbers. - The string representation will have as many components as specified. - -Other options: - -/fn - preserves Original filename, Internal name in the existing version resource of the file. -/langid - language id for new version resource. - Use with /va. Default is Language Neutral. - is combination of primary and sublanguage IDs. ENU is 1033 or 0x409. -/vo - outputs the version info in RC format to stdout. - This can be used with /xi to dump a version resource without modification. - Output of /vo can be pasted to a .rc file and compiled with rc. -/xi- test mode. does all operations in memory but does not modify the file -/xlb - test mode. Re-parses the version resource after modification. -/rpdb - removes path to the .pdb file in debug information; leaves only file name. -/rf #id file - add or replace a raw binary resource from file (see below) -/noed - do not check for extra data appended to exe file -/vft2 num - specify driver subtype (VFT2_xxx value, see winver.h) - The application type (VFT_xxx) is retained from the existing version resource of the file, - or filled automatically, based on the filename extension (.exe->app, .sys->driver, anything else->dll) - - -Examples -======== - -verpatch d:\foo.dll 1.2.33.44 - - Sets the file version to 1.2.33.44 - The Original file name and Internal name strings are set to "foo.dll". - File foo.dll should already have a version resource (since /va not specified) - -verpatch d:\foo.dll 1.2.33 /high - - Sets three higher 3 numbers of the file version. - The 4th number is not changed in the binary version struct, - and the version as string will have three components. - File foo.dll should already have a version resource. - -verpatch d:\foo.dll 33.44 /s comment "a comment" - - Replaces only two last numbers of the file version and adds a comment. - File foo.dll should already have a version resource. - -verpatch d:\foo.dll "33.44 special release" /pv 1.2.3.4 - - same as previous, with additional text in the version argument. - - Product version is also specified - -verpatch d:\foo.dll "1.2.33.44" /va /s description "foo.dll" - /s company "My Company" /s copyright "(c) 2009" - - creates or replaces version resource to foo.dll, with several string values. - ( all options should be one line) - -verpatch d:\foo.dll /vo /xi - - dumps the version resource in RC format, does not update the file. - -Misc. functions -================ - -* Add resource from a file - -The /rf switch adds a resource from a file, or replaces a resource with same type and id. - -The argument "#id" is a 32-bit hex number, prefixed with #. -Low 16 bits of this value are resource id; can not be 0. -Next 8 bits are resource type: one of RT_xxx symbols in winuser.h, or user defined. -If the type value is 0, RT_RCDATA (10) is assumed. -High 8 bits of the #id arg are reserved0. -The language code of resources added by this switch is 0 (Neutral). -Named resource types and ids are not implemented. -The file is added as opaque binary chunk; the resource size is rounded up to 4 bytes -and padded with zero bytes. - -* Handling appended data - -The program detects extra data appended to executable files, saves it and appends -again after modifying resources. -Command switch /noed disables checking for extra data. - -Such extra data is used by some installers, self-extracting archives and other applications. -However, the way we restore the data may be not compatible with these applications. -Please, verify that executable files that contain extra data work correctly after modification. -Make backup of valuable files before modification. - -* Remove the path from debug info (.PDB) string - -Use switch /rpdb to remove the path to the .pdb file in debug information; leave only file name. - -Remarks -======= - -In "patch" mode (no /va option), verpatch replaces the version number in existing file -version info resource with the values given on the command line. -The version resource in the file is parsed, then parameters specified on the command line are applied. - -If the file has no version resource, or you want to discard the existing resource, use /va switch. - -Quotes surrounding arguments are needed for the command shell (cmd.exe), -for any argument that contains spaces. -Also, other characters should be escaped (ex. &, |, and ^ for cmd.exe). -Null values can be specified as empty string (""). - -The command line can become very long, so you may want to use a batch file or script. -See the example batch files. - -Verpatch can be run on same PE file any number of times. - -The Version argument can be specified as 1 to 4 dot separated decimal numbers. -Additional suffix can follow the version numbers, separated by a dash (-) or space. -If the separator is space, the whole version argument must be enclosed in quotes. - -If the switch /high not specified and less than 4 numbers are given, -they are considered as minor numbers. -The higher version parts are retained from existing version resource. -For example, if the existing version info block has version number 1.2.3.4 -and 55.66 specified on the command line, the result will be 1.2.55.66. - -If the switch /high is specified and less than 4 numbers are given, -they are considered as higher numbers. -For example, if the existing version info has version number 1.2.3.4 -and 55.66 /high specified on the command line, the result will be 55.66.3.4. - -The /high switch has been added to support the "Semantic Versioning" syntax -as described here: http://semver.org -The "Semantic versioning", however, specifies only 3 parts for the version number, -while Windows version numbers have 4 parts. -Switch /high allows 3-part version numbers with optional "tail" separated by '-' or '+' -but the text representation will not be displayed by Windows Explorer in Vista or newer. -The file version displayed will always have 4 parts. - - -Verpatch ensures that the version numbers in the binary part -of the version structure and in the string part (as text) are same, -or the text string begins with the same numbers as in the binary part. - -By default, Original File Name and Internal File Name are replaced to the actual filename. -Use /fn to preserve existing values in the version resource. - -String attribute names for option /s must be language-neutral, -not translations (example: PrivateBuild, not "Private Build Description"). -See below for the list of known attrbute names and their aliases. -The examples above use the aliases. - -String arguments for File version and Product version parameters are handled - in a special way, the /s switch should not be used to set these: - - The File version can be specified as the 2nd positional argument only - - The Product version can be specified using /pv switch - - -==================================================================== -Known string keys in VS_VERSION_INFO resource -==================================================================== - -The aliases in the right column can be used with /s switch, -in place of language-neutral (LN) attribute names. -Attribute names are not case sensitive. - --------------------+----+-------------------------------+------------ - Lang.Neutral name |note| English translation | Aliases --------------------+----+-------------------------------+------------ -Comments Comments comment -CompanyName Company company -FileDescription E Description description, desc -FileVersion *1 File Version -InternalName Internal Name title - *2 Language -LegalCopyright E Copyright copyright, (c) -LegalTrademarks E Legal Trademarks tm, (tm) -OriginalFilename Original File Name -ProductName Product Name product -ProductVersion *3 Product Version productversion (*) -PrivateBuild Private Build Description pb, private -SpecialBuild Special Build Description sb, build -OleSelfRegister A - -AssemblyVersion N - -Notes -*1: FileVersion, ProductVersion should not be specified with /s switch. -See the command line parameters above. -The string values normally begin with same 1.2.3.4 version number as in the binary header, -but can be any text. Explorer of WinXP also displays File Version text in the strings box. -In Win7 or newer, Explorer displays the version numbers from the binary header only. - -*2: The "Language" value is the name of the language code specified in the header of the - string block of VS_VERSION_INFO resource (or taken from VarFileInfo block?) -It is displayed by Windows XP Explorer. - -*3 When Productversion is specified as a string attribute (/s productversion) - rather than with /pv, the argument string will be put literally. - This can be used to specify leading zeros in version numbers. - -E: Displayed by Windows Explorer in Vista+ -A: Intended for some API (OleSelfRegister is used in COM object registration) -N: Added by some .NET compilers. This version number is not contained in the - binary part of the version struct and can differ from the file version. - To change it, use switch /s AssemblyVersion [value]. Note: this will not - change the actual .NET assembly version. -==================================================================== - - - -Known issues and TO DO's: -========================= - - - Does not work on old PE files that have link version 5.x (before VC6?) - No known workaround; this seems to be limitation of Windows UpdateResource API. - Since the UpdateResource API is part of Windows, its behaviour may differ on - different Windows releases. On Win7 SP1 you may get better results than on WinXP. - - - Import of version resource does not work if it is not encoded in UTF-16. - - - Does not work on files signed with digital certificates (TO DO: warn and remove certificate) - Until we do this, certificates can be removed with 3rd party delcert tool. - - - A second version resource may be added to a file that already has a version resource - in other language. Switch /va won't help. - TO DO: ensure that a file has only one version resource! - - - When verpatch is invoked from command prompt, or batch file, the string - arguments can contain only ANSI characters, because cmd.exe batch files cannot be - in Unicode format. If you need to include characters not in current locale, - use other shell languages that fully support Unicode (Powershell, vbs, js). - - - TO DO: In RC source output (/vo), special characters in strings are not quoted; - so /vo may produce invalid RC input. - - - The parser of binary version resources handles only the most common type of structure. - If the parser breaks because of unhandled structure format, try /va switch to - skip reading existing version resource and re-create it from scratch. - Consider using WINE or other open source implementations? - - - option to add extra 0 after version strings : "string\0" - (tentative, requested by a reader for some old VB code) - - - For files with extra data appended, checksum is not re-calculated. - Such files usually implement their own integrity check. - - - Switch /va does not prevent import of existing version resource. Revise. - - - When existing version string contains "tail" but the command line parameter does not, - the tail is removed. In previous versions the tail was preserved. - - - Running verpatch on certain executables (esp. built with GNU) produce corrupt file - when run on WinXP SP3, but same binaries give good result when run on Win7 or 2008R2. - (Improvement of UpdateResource API?) - - -Source code -============ -The source is provided as a Visual C++ 2013 project, it can be compiled with VC 2008, 2010, 2012 Express and newer. -(The VC 2008 compatible project is in verpatch(vs2008).sln, verpatch.vcproj files. verpatch.sln, .vcxproj are for VC++ 2013). -It demonstrates use of the UpdateResource and imagehlp.dll API. -It does not demonstrate good use of C++, coding style or anything else. -Dependencies on VC features available only in paid versions (before Community editions) have been removed. - -UAC note: Verpatch does not require any administrator rights and may not work correctly if run elevated. - -~~ diff --git a/etc/zip.exe b/etc/zip.exe deleted file mode 100644 index 55be81d..0000000 Binary files a/etc/zip.exe and /dev/null differ diff --git a/src/version.h b/src/version.h index 87bf536..24f93e6 100644 --- a/src/version.h +++ b/src/version.h @@ -26,7 +26,7 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 7 #define VER_X264_PATCH 7 -#define VER_X264_BUILD 1070 +#define VER_X264_BUILD 1072 #define VER_X264_PORTABLE_EDITION (0) diff --git a/x264_launcher_MSVC2010.vcxproj b/x264_launcher_MSVC2010.vcxproj index b116d0a..898958a 100644 --- a/x264_launcher_MSVC2010.vcxproj +++ b/x264_launcher_MSVC2010.vcxproj @@ -105,7 +105,7 @@ copy /Y "$(SolutionDir)etc\vld\lib\$(Platform)\$(Configuration)\*.manifest" "$(T Copy Toolset - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 Update Build Number @@ -143,7 +143,7 @@ copy /Y "$(SolutionDir)etc\vld\lib\$(Platform)\$(Configuration)\*.manifest" "$(T x264_entry_point - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 Update Build Number diff --git a/x264_launcher_MSVC2012.vcxproj b/x264_launcher_MSVC2012.vcxproj index fb9d520..43bfda6 100644 --- a/x264_launcher_MSVC2012.vcxproj +++ b/x264_launcher_MSVC2012.vcxproj @@ -97,7 +97,7 @@ copy /Y "$(SolutionDir)etc\vld\bin\Win32\*.manifest" "$(TargetDir)" Copy Toolset - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 5 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 5 Update Build Number @@ -135,7 +135,7 @@ copy /Y "$(SolutionDir)etc\vld\bin\Win32\*.manifest" "$(TargetDir)" x264_entry_point - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 5 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 5 Update Build Number diff --git a/x264_launcher_MSVC2013.vcxproj b/x264_launcher_MSVC2013.vcxproj index 079f08e..0b05928 100644 --- a/x264_launcher_MSVC2013.vcxproj +++ b/x264_launcher_MSVC2013.vcxproj @@ -104,7 +104,7 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\$(Platform)\*.ma Copy Toolset - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 Update Build Number @@ -142,7 +142,7 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\$(Platform)\*.ma x264_entry_point - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 Update Build Number diff --git a/x264_launcher_MSVC2015.sln b/x264_launcher_MSVC2015.sln index 508bddf..36b9093 100644 --- a/x264_launcher_MSVC2015.sln +++ b/x264_launcher_MSVC2015.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x264_launcher", "x264_launcher_MSVC2015.vcxproj", "{563D953B-CBC3-4C75-AFC2-5BD87531C332}" ProjectSection(ProjectDependencies) = postProject diff --git a/x264_launcher_MSVC2015.vcxproj b/x264_launcher_MSVC2015.vcxproj index 0f73867..423cbd7 100644 --- a/x264_launcher_MSVC2015.vcxproj +++ b/x264_launcher_MSVC2015.vcxproj @@ -104,7 +104,7 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\$(Platform)\*.ma Copy Toolset - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 Update Build Number @@ -142,7 +142,7 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\$(Platform)\*.ma x264_entry_point - "$(SolutionDir)etc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 + "$(SolutionDir)..\Prerequisites\AutoInc\auto_inc.exe" VER_X264_BUILD "$(SolutionDir)src\version.h" 30 Update Build Number diff --git a/z_build.bat b/z_build.bat index c6f3741..00d57b2 100644 --- a/z_build.bat +++ b/z_build.bat @@ -3,9 +3,6 @@ REM /////////////////////////////////////////////////////////////////////////// REM // Set Paths REM /////////////////////////////////////////////////////////////////////////// set "MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" -set "WSDK_PATH=C:\Program Files (x86)\Windows Kits\10" -set "NSIS_PATH=C:\Program Files\NSIS\Unicode" -set "PDOC_PATH=C:\Program Files\Pandoc" set "TOOLS_VER=140" REM ############################################### @@ -24,16 +21,16 @@ if "%VCINSTALLDIR%"=="" ( echo %%VCINSTALLDIR%% not specified. Please check your MSVC_PATH var! goto BuildError ) -if "%QTDIR%"=="" ( - echo %%QTDIR%% not specified. Please check your MSVC_PATH var! - goto BuildError -) if not exist "%VCINSTALLDIR%\bin\cl.exe" ( echo C++ compiler not found. Please check your MSVC_PATH var! goto BuildError ) -if not exist "%PDOC_PATH%\pandoc.exe" ( - echo Pandoc binary could not be found. Please check your PDOC_PATH var! +if "%QTDIR%"=="" ( + echo %%QTDIR%% not specified. Please check your QTDIR var! + goto BuildError +) +if not exist "%QTDIR%\include\QtCore\qglobal.h" ( + echo %%QTDIR%% header files not found. Please check your QTDIR var! goto BuildError ) @@ -42,11 +39,11 @@ REM // Get current date and time (in ISO format) REM /////////////////////////////////////////////////////////////////////////// set "ISO_DATE=" set "ISO_TIME=" -if not exist "%~dp0\etc\date.exe" BuildError -for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISODATE:%%Y-%%m-%%d') do ( +if not exist "%~dp0\..\Prerequisites\GnuWin32\date.exe" BuildError +for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\..\Prerequisites\GnuWin32\date.exe" +ISODATE:%%Y-%%m-%%d') do ( if "%%a"=="ISODATE" set "ISO_DATE=%%b" ) -for /F "tokens=1,2,3,4 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISOTIME:%%T') do ( +for /F "tokens=1,2,3,4 delims=:" %%a in ('"%~dp0\..\Prerequisites\GnuWin32\date.exe" +ISOTIME:%%T') do ( if "%%a"=="ISOTIME" set "ISO_TIME=%%b:%%c:%%d" ) if "%ISO_DATE%"=="" goto BuildError @@ -119,20 +116,20 @@ copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\bin\QtXml4.dll" copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\plugins\imageformats\*.dll" "%PACK_PATH%\imageformats" del "%PACK_PATH%\imageformats\*d4.dll" 2> NUL if %TOOLS_VER% GEQ 140 ( - copy "%WSDK_PATH%\Redist\ucrt\DLLs\x86\*.dll" "%PACK_PATH%" + copy "%~dp0\..\Prerequisites\MSVC\redist\ucrt\DLLs\x86\*.dll" "%PACK_PATH%" ) REM /////////////////////////////////////////////////////////////////////////// REM // Generate Docs REM /////////////////////////////////////////////////////////////////////////// -"%PDOC_PATH%\pandoc.exe" --from markdown_github+pandoc_title_block+header_attributes+implicit_figures --to html5 --toc -N --standalone -H "%~dp0\etc\css\style.inc" --output "%PACK_PATH%\README.html" "%~dp0\README.md" +"%~dp0\..\Prerequisites\Pandoc\pandoc.exe" --from markdown_github+pandoc_title_block+header_attributes+implicit_figures --to html5 --toc -N --standalone -H "%~dp0\etc\css\style.inc" --output "%PACK_PATH%\README.html" "%~dp0\README.md" REM /////////////////////////////////////////////////////////////////////////// REM // Compress REM /////////////////////////////////////////////////////////////////////////// -"%~dp0\etc\upx.exe" --brute "%PACK_PATH%\*.exe" -"%~dp0\etc\upx.exe" --brute "%PACK_PATH%\MUtils32-?.dll -"%~dp0\etc\upx.exe" --best "%PACK_PATH%\Qt*.dll" +"%~dp0\..\Prerequisites\UPX\upx.exe" --brute "%PACK_PATH%\*.exe" +"%~dp0\..\Prerequisites\UPX\upx.exe" --brute "%PACK_PATH%\MUtils32-?.dll +"%~dp0\..\Prerequisites\UPX\upx.exe" --best "%PACK_PATH%\Qt*.dll" REM /////////////////////////////////////////////////////////////////////////// REM // Attributes @@ -170,20 +167,20 @@ echo. >> "%PACK_PATH%\BUILD_TAG.txt" echo Build #%BUILD_NO%, created on %ISO_DATE% at %ISO_TIME% >> "%PACK_PATH%\BUILD_TAG.txt" echo. >> "%PACK_PATH%\BUILD_TAG.txt" echo. >> "%PACK_PATH%\BUILD_TAG.txt" -"%~dp0\etc\cat.exe" "%~dp0\etc\setup\build.nfo" >> "%PACK_PATH%\BUILD_TAG.txt" +"%~dp0\..\Prerequisites\GnuWin32\cat.exe" "%~dp0\etc\setup\build.nfo" >> "%PACK_PATH%\BUILD_TAG.txt" REM /////////////////////////////////////////////////////////////////////////// REM // Build the installer REM /////////////////////////////////////////////////////////////////////////// -"%NSIS_PATH%\makensis.exe" "/DX264_UPX_PATH=%~dp0\etc\upx.exe" "/DX264_DATE=%ISO_DATE%" "/DX264_BUILD=%BUILD_NO%" "/DX264_OUTPUT_FILE=%OUT_PATH%.sfx" "/DX264_SOURCE_PATH=%PACK_PATH%" "%~dp0\etc\setup\setup.nsi" +"%~dp0\..\Prerequisites\NSIS\makensis.exe" "/DX264_UPX_PATH=%~dp0\..\Prerequisites\UPX\upx.exe" "/DX264_DATE=%ISO_DATE%" "/DX264_BUILD=%BUILD_NO%" "/DX264_OUTPUT_FILE=%OUT_PATH%.sfx" "/DX264_SOURCE_PATH=%PACK_PATH%" "%~dp0\etc\setup\setup.nsi" if not "%ERRORLEVEL%"=="0" goto BuildError -call "%~dp0\etc\7zSD.cmd" "%OUT_PATH%.sfx" "%OUT_PATH%.exe" "Simple x264/x265 Launcher" "x264_launcher-setup-r%BUILD_NO%" +call "%~dp0\..\Prerequisites\SevenZip\7zSD.cmd" "%OUT_PATH%.sfx" "%OUT_PATH%.exe" "Simple x264/x265 Launcher" "x264_launcher-setup-r%BUILD_NO%" if not "%ERRORLEVEL%"=="0" goto BuildError set "VERPATCH_PRODUCT=Simple x264/x265 Launcher (Setup)" set "VERPATCH_FILEVER=%ISO_DATE:-=.%.%BUILD_NO%" -"%~dp0\etc\verpatch.exe" "%OUT_PATH%.exe" "%VERPATCH_FILEVER%" /pv "%VERPATCH_FILEVER%" /fn /s desc "%VERPATCH_PRODUCT%" /s product "%VERPATCH_PRODUCT%" /s title "x264 Launcher Installer SFX" /s copyright "Copyright (C) 2004-2016 LoRd_MuldeR" /s company "Free Software Foundation" +"%~dp0\..\Prerequisites\VerPatch\verpatch.exe" "%OUT_PATH%.exe" "%VERPATCH_FILEVER%" /pv "%VERPATCH_FILEVER%" /fn /s desc "%VERPATCH_PRODUCT%" /s product "%VERPATCH_PRODUCT%" /s title "x264 Launcher Installer SFX" /s copyright "Copyright (C) 2004-2016 LoRd_MuldeR" /s company "Free Software Foundation" if not "%ERRORLEVEL%"=="0" goto BuildError attrib +R "%OUT_PATH%.exe" @@ -193,7 +190,7 @@ REM /////////////////////////////////////////////////////////////////////////// REM // Build ZIP package REM /////////////////////////////////////////////////////////////////////////// pushd "%PACK_PATH%" -"%~dp0\etc\zip.exe" -r -9 -z "%OUT_PATH%.zip" "*.*" < "%PACK_PATH%\BUILD_TAG.txt" +"%~dp0\..\Prerequisites\GnuWin32\zip.exe" -r -9 -z "%OUT_PATH%.zip" "*.*" < "%PACK_PATH%\BUILD_TAG.txt" popd if not "%ERRORLEVEL%"=="0" goto BuildError