Updated GNU Wget binary to v1.18 (2016-06-09) with HTTPS support.
[LameXP.git] / src / Tools.h
blob86260604d1c4f7d9676153ac08e6654255b8fb84
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
23 #include <stdlib.h>
25 #ifndef LAMEXP_INC_TOOLS
26 #error Please do *not* include TOOLS.H directly!
27 #endif
29 ////////////////////////////////////////////////////////////
30 // CPU FLags
31 ////////////////////////////////////////////////////////////
33 /* CPU_TYPE_<ARCH>_<TYPE> */
34 #define CPU_TYPE_X86_GEN 0x00000001UL //x86, generic
35 #define CPU_TYPE_X86_SSE 0x00000002UL //x86, with SSE and SSE2 support - Intel only!
36 #define CPU_TYPE_X86_AVX 0x00000004UL //x86, with AVX support
37 #define CPU_TYPE_X64_GEN 0x00000008UL //x64, generic
38 #define CPU_TYPE_X64_SSE 0x00000010UL //x64, with SSE and SSE2 support - Intel only!
39 #define CPU_TYPE_X64_AVX 0x00000020UL //x64, with AVX support
41 /* combined CPU types */
42 #define CPU_TYPE_X86_NVX (CPU_TYPE_X86_GEN|CPU_TYPE_X86_SSE)
43 #define CPU_TYPE_X86_SSX (CPU_TYPE_X86_SSE|CPU_TYPE_X86_AVX)
44 #define CPU_TYPE_X86_ALL (CPU_TYPE_X86_GEN|CPU_TYPE_X86_SSX)
45 #define CPU_TYPE_X64_NVX (CPU_TYPE_X64_GEN|CPU_TYPE_X64_SSE)
46 #define CPU_TYPE_X64_SSX (CPU_TYPE_X64_SSE|CPU_TYPE_X64_AVX)
47 #define CPU_TYPE_X64_ALL (CPU_TYPE_X64_GEN|CPU_TYPE_X64_SSX)
48 #define CPU_TYPE_ALL_GEN (CPU_TYPE_X86_GEN|CPU_TYPE_X64_GEN)
49 #define CPU_TYPE_ALL_SSE (CPU_TYPE_X86_SSE|CPU_TYPE_X64_SSE)
50 #define CPU_TYPE_ALL_SSX (CPU_TYPE_X86_SSX|CPU_TYPE_X64_SSX)
51 #define CPU_TYPE_ALL_AVX (CPU_TYPE_X86_AVX|CPU_TYPE_X64_AVX)
52 #define CPU_TYPE_ALL_ALL (CPU_TYPE_X86_ALL|CPU_TYPE_X64_ALL)
54 ////////////////////////////////////////////////////////////
55 // TOOLS
56 ////////////////////////////////////////////////////////////
58 static const struct
60 const char *pcHash;
61 const unsigned int uiCpuType;
62 const char *pcName;
63 const unsigned int uiVersion;
64 const char *pcVersTag;
66 g_lamexp_tools[] =
68 {"4870d7abbc3995dc5ca82147ee33f28c3ee7dc1986fbb0131912effe10c1a209d3f983c5dffd963c31707a5ce39611b4", CPU_TYPE_X86_GEN, "aften.i386.exe", 8, ""},
69 {"fc4e38b11a0f52b68cca79aa2d71c02180b70eb0e592923dee4f0ccf766f1006642369b2178f6a61d1c2506446cc442d", CPU_TYPE_X86_SSX, "aften.sse2.exe", 8, ""},
70 {"b44b1c0e1a8f4633c9bc2e43d0a83ea5edc890e1cccc0054c812d0e64170e5292dc1dfd7430da61b73150831aa16e9c4", CPU_TYPE_X64_ALL, "aften.x64.exe", 8, ""},
71 {"4558728999a05f12fe88566e8308cba0ada200814c2a1bfe2507f49faf8f3994b0d52a829148f5c6321d24faa2718439", CPU_TYPE_ALL_ALL, "avs2wav.exe", 13, ""},
72 {"07834b1b8ecac2f3db79ad048005eca3a284cb759e15d399eb1a560a403122e20db5f08e60319759b8463aeef2410d02", CPU_TYPE_ALL_ALL, "dcaenc.exe", 20120419, ""},
73 {"7c249f507b96967bedabdd7e631638807a7595ebff58eaaadf63530783d515eda9660bc2b1a0457fddae7e3eaef8a074", CPU_TYPE_ALL_ALL, "elevator.exe", UINT_MAX, ""},
74 {"bbc262cfe9c48633e5f1780d30347d7663075cfd7bdc76347cce3b1191d62f788d9b91bc63dffae2f66d1759d5849e92", CPU_TYPE_ALL_ALL, "faad.exe", 27, ""},
75 {"16146a44fc5de63b1fbe4f2ba0b063acb243af2dbb5ea4ec1556669a026400bec5ef176689d5eb2ac03d9daf6053d39d", CPU_TYPE_X86_GEN, "flac.x86-i386.exe", 131, ""},
76 {"4ffb7341498b18cc826407b3511598b65b612150eeb87fad328ed9cb0b0857b07b9e6a0977c2bd377360db709fb87eee", CPU_TYPE_X86_SSX, "flac.x86-sse2.exe", 131, ""},
77 {"d609529d82368c22c11cc1f3a9285d7cfab84568f45ccebd1bf94b3669acc15ee93220d39f23d38943fcbb9df85708a2", CPU_TYPE_X64_NVX, "flac.x64-sse2.exe", 131, ""},
78 {"fa311f94bf92686326251af96c9391cdf8a7dc089184ed9312c0bd513936771935b92cb1646f8308025da3e01129d298", CPU_TYPE_X64_AVX, "flac.x64-avx.exe", 131, ""},
79 {"f63e97413e3b3ab23fd690fcd11d27ae104333d0201f34f2445a410b4a50dcf505a744ee7cabec66d9415c27261f175a", CPU_TYPE_ALL_ALL, "gpgv.exe", 1421, ""},
80 {"c66992384b6388a7b68f2659624c150b33ff1cacb0c28c0ab2a3249eca4c31e204953f325403f78c077d1735b275ac12", CPU_TYPE_ALL_ALL, "keyring.gpg", UINT_MAX, ""},
81 {"1dd342ca0aaaa5f84afbf657991d9829fbb4a2794fee36cd60014e1b9028120a8d3577b8a031482e207c4dd266c6b4c3", CPU_TYPE_X86_GEN, "lame.x86-i386.exe", 31002, "Alpha"},
82 {"afb30a68e12ab2647f9694eb51d3b22d0f3cef95deda811c714556203dcc0adbe4b18c406c6af67b0d4af09f5033c77b", CPU_TYPE_X86_SSX, "lame.x86-sse2.exe", 31002, "Alpha"},
83 {"84b66be0c17ff9b642fdb7f04f26c6621381a02b6297d17b36c9c6afa308b72f1dacb3831b41affe56db6b7fb5dbe9ae", CPU_TYPE_X64_NVX, "lame.x64-sse2.exe", 31002, "Alpha" },
84 {"7c8ff93f3c3d89abd36770066c6f2b44f4aecc672e24406991f4035720a42aee2838b4625f9838e088ba05e3cda42d77", CPU_TYPE_X64_AVX, "lame.x64-avx.exe", 31002, "Alpha" },
85 {"51af33a33bd9bde6ca6e9c612346b9c138584de59a92bc14a680729066fd849fd83fe668f79e2a06ffe117f39993d10a", CPU_TYPE_ALL_GEN, "mac.i386.exe", 416, ""},
86 {"117e60cf4445cec0a777d2636091a13c50be5c6ed28afaa75ab09ab4576942f1a8584b36d3abac9db7595dfb0d90207e", CPU_TYPE_ALL_SSX, "mac.sse2.exe", 416, ""},
87 {"d77bbbae80a1374458ee75f162f94352b5e2d781e44a53f30883efb21014f3154482c9bb2bc71b91afcb549d3f7908f7", CPU_TYPE_X86_ALL, "mediainfo.i386.exe", 788, ""},
88 {"91b52e79ebaf29c1d12d1d45fc32ab7c36b8ea2b32e10bc1a96c88bc39c5866967635e7a868e97ac6af2def3b30bf866", CPU_TYPE_X64_ALL, "mediainfo.x64.exe", 788, ""},
89 {"7e6346a057634ff07b2e1f427035324f7f02100cc996425990f87f71d767fce4c7b101588c7d944ba49cb2d7e51c9bdb", CPU_TYPE_ALL_ALL, "mpcdec.exe", 475, ""},
90 {"d08097c7d310529b5b29268c3ecec436f8a55a28a8a524f09c1f94d6d47792f3aeae810353d0387352c2a487c5fd9225", CPU_TYPE_ALL_GEN, "mpg123.i386.exe", 1238, ""},
91 {"1af626aaaacd67c4c5e4e1bc17dff298ba41b3d1466427b329a9850dee2455c35ca65d650b9abf5f87a93f8b7cf3348c", CPU_TYPE_ALL_SSE, "mpg123.sse2.exe", 1238, "" },
92 {"ed1ad3df06f0de2924a63042901780e4055ed2963a3a348268aef711dfaa423e48bedbd6ba59bb798d1a1bb5c9384eaa", CPU_TYPE_ALL_AVX, "mpg123.avx.exe", 1238, "" },
93 {"1bfc01052abc76d492541f26bdc347f14ece180092e7128438f8f0f58879a7ed2aa66186c23429811ff5587b997cbeb7", CPU_TYPE_X86_ALL, "nc.i386.exe", 112, "" },
94 {"e7b19ec88fe025fd907a5ad85ed9c0b13cd33bd7cd04226d4f2944352f11d4026f558a30989f984e3e1d802552d05908", CPU_TYPE_X64_ALL, "nc.x64.exe", 112, "" },
95 {"f1f2ea5c9e5539620b706e7af68e543bf7a731afb06ccce3815ab34dad64d697e4d6ffcd187a396619b8b52efe7edf88", CPU_TYPE_ALL_ALL, "oggdec.exe", 1101, ""},
96 {"245181321625445ac42fce31d64bf03872e77e2d0dd3c19d6c17ca2771354f096a6040827dd6d00ffd7342c7dd26168e", CPU_TYPE_X86_GEN, "oggenc2.i386.exe", 288135603, "2015"},
97 {"512b8efcd1003a0f67220a450d6ea4466194e8fd49fc090a69b15a858db11499acbf98f984530cd5d37b4b6abdd1c6d8", CPU_TYPE_X86_SSX, "oggenc2.sse2.exe", 288135603, "2015"},
98 {"a07ef67cba5a00d335d07372baf76d4d0573b425afce71a19c1e04eaabbe3f55e60bdd40af5e428224c91df1823eda08", CPU_TYPE_X64_ALL, "oggenc2.x64.exe", 288135603, "2015"},
99 {"19a899d806202b90c195accbf83c78f88874d3881e8bbb1dffb820ee2b15fa2cf8ed8f36827c60738eb3cf47c97796cf", CPU_TYPE_ALL_GEN, "opusdec.i386.exe", 20161016, "v1.1.3"},
100 {"2ab18d9f0cb7ab97d499c7d0efde0926d97cca86fbc6426e27d2232858132dda1324bcd97198a9327c1046ef5f5af8d2", CPU_TYPE_ALL_SSE, "opusdec.sse2.exe", 20161016, "v1.1.3"},
101 {"b8d35eedea15945f6b889d54d8999d44c25c6be0e279ee5ed4b8c64b1bace224313a8d8055ea932c6cbfbfc3a88eb9ae", CPU_TYPE_ALL_AVX, "opusdec.avx.exe", 20161016, "v1.1.3"},
102 {"81e8c725043cf8b52b699c5939447b762216274527e49149827c5723a84d24dad099cc00cf8a7ad33ac4a4f14f173fe9", CPU_TYPE_ALL_GEN, "opusenc.i386.exe", 20161016, "v1.1.3"},
103 {"af37f33dcec556714820c7d5ad0ef0e51664542dbe80de70bfb4b9da6f982a25233380c6b56bb545c89c9c61777aae5d", CPU_TYPE_ALL_SSE, "opusenc.sse2.exe", 20161016, "v1.1.3"},
104 {"45c93ff42003a029cf570287f5d83c022d4b704822ae083825d77a2089978412798fc217f685215b5722608f7b2fac7c", CPU_TYPE_ALL_AVX, "opusenc.avx.exe", 20161016, "v1.1.3"},
105 {"37745174e146fedbc62671ab86ffddd3edfc9aa0ebfcfd4bff3331a95b6dda50621478c63f7a0ddf9a365e916758b6d4", CPU_TYPE_X86_ALL, "refalac.i386.exe", 161, ""},
106 {"b368f0490cefb80b6ff7eaaf8d6e29f253442375caf11a9405b5b21580ee3a9739fa3f406f69de5ef344fa038b1cbe72", CPU_TYPE_X64_ALL, "refalac.x64.exe", 161, ""},
107 {"d041b60de6c5c6e77cbad84440db57bbeb021af59dd0f7bebd3ede047d9e2ddc2a0c14179472687ba91063743d23e337", CPU_TYPE_ALL_ALL, "shorten.exe", 361, ""},
108 {"6e3f86cc464d84b0039139c9688e3097d0f42b794a5db10954d24fe77929585a0d0dba16cb677cc1b390392c39cdefad", CPU_TYPE_ALL_ALL, "sox.exe", 1442, ""},
109 {"5a4261e1b41a59d1a5bc92e1d2766422a67454d77e06ea29af392811b7b4704e0f3e494ab9cb6375ce9e39257867c5ed", CPU_TYPE_ALL_ALL, "speexdec.exe", 12, ""},
110 {"75d4c18dbb74e2dbf7342698428248d45cc4070d5f95da8831ef755e63dcd7ff9c3a760f289e8ef8b5c06b82548edbd8", CPU_TYPE_ALL_ALL, "tag.exe", 100, ""},
111 {"a83628880da0b7519ec368a74a92da5a5099d8d46aa0583131f92d7321f47c9e16a1841b2a3fb8ffcca7205ef4b1bb0a", CPU_TYPE_ALL_ALL, "tta.exe", 21, ""},
112 {"9e1ade2137ea5cee0ad4657971c314a372df3068594fbe4f77d45b9eb65fa7c69e55027b0df81b6fe072a220e9a8ba8a", CPU_TYPE_ALL_ALL, "valdec.exe", 100, "a"},
113 {"0a2c8afb50aac35b80f34be2e2286bbb4f0876c1ad53fed8dc2f679786671eafdc1a244378abcc2c229fc110bb5cdf79", CPU_TYPE_ALL_ALL, "wget.exe", 1180, ""},
114 {"572b9448bf4a338ecb9727951fdfcc5a219cc69896695cc96b9f6b083690e339910e41558968264a38992e45f2be152c", CPU_TYPE_ALL_ALL, "wma2wav.exe", 20111001, ""},
115 {"3d86b30395fba4aa45b529f46940d1757336a518512e24591bfc044e63feea751b47474966e46ac6302cb1b6f27e3cc5", CPU_TYPE_ALL_ALL, "wupdate.exe", 20161016, ""},
116 {"9c742cff64c726b6d9abafcf222c24a7e41d4fa0e44ea962917a91e09c15e52aebc859c1ea028c1c1806702850460e2c", CPU_TYPE_X86_ALL, "wvunpack.i386.exe", 4800, ""},
117 {"70382b0a9431ec35f419126a5561252e7d5bc05a8a7912c49c54382a3642309372374977ef9186ccd9b733c64a3428bd", CPU_TYPE_X64_ALL, "wvunpack.x64.exe", 4800, ""},
118 {NULL, NULL, NULL, NULL, NULL}
121 ////////////////////////////////////////////////////////////
122 // AAC ENCODERS
123 ////////////////////////////////////////////////////////////
125 typedef struct
127 const char *const toolName;
128 const char *const fileNames[8];
129 const char *const checkArgs;
130 const quint32 toolMinVersion;
131 const quint32 verDigits;
132 const quint32 verShift;
133 const char *const verStr;
134 const char *const regExpVer;
135 const char *const regExpSig;
137 aac_encoder_t;
139 static const aac_encoder_t g_lamexp_aacenc[] =
141 { "NeroAAC", { "neroAacEnc.exe", "neroAacDec.exe", "neroAacTag.exe", NULL }, "-help", lamexp_toolver_neroaac(), 4, 10, "v?.?.?.?", "Package\\s+version:\\s+(\\d)\\.(\\d)\\.(\\d)\\.(\\d)", "Nero\\s+AAC\\s+Encoder" },
142 { "FhgAacEnc", { "fhgaacenc.exe", "enc_fhgaac.dll", "nsutil.dll", "libmp4v2.dll", NULL }, NULL, lamexp_toolver_fhgaacenc(), 2, 0, "????-??-??", "fhgaacenc version (\\d+) by tmkk. Modified by Case (\\d+).", NULL },
143 { "FdkAacEnc", { "fdkaac.exe", NULL }, "--help", lamexp_toolver_fdkaacenc(), 3, 10, "v?.?.?", "fdkaac\\s+(\\d)\\.(\\d)\\.(\\d)", NULL },
144 { "QAAC", { "qaac.exe", "libsoxr.dll", "libsoxconvolver.dll", NULL }, "--check", lamexp_toolver_qaacenc(), 2, 100, "v?.??", "qaac (\\d)\\.(\\d+)", NULL },
145 { "QAACx64", { "qaac64.exe", "libsoxr64.dll", "libsoxconvolver64.dll", NULL }, "--check", lamexp_toolver_qaacenc(), 2, 100, "v?.??", "qaac (\\d)\\.(\\d+)", NULL },
146 { NULL, { NULL }, NULL, 0, 0, 0, NULL, NULL, NULL }