diff options
author | Ladislav Zezula <ladislav.zezula@avast.com> | 2022-10-31 18:33:10 +0100 |
---|---|---|
committer | Ladislav Zezula <ladislav.zezula@avast.com> | 2022-10-31 18:33:10 +0100 |
commit | 5dca772f3933338c0c14c082ad8781f55bf84141 (patch) | |
tree | a1a9a5bd73e24b0cd30c989350067a0488acaeec /storm_dll | |
parent | ccb5626d40dd76180a831c9f7f37278c18fa68c1 (diff) |
Build toolset updated
Diffstat (limited to 'storm_dll')
-rw-r--r-- | storm_dll/storm.vcxproj | 22 | ||||
-rw-r--r-- | storm_dll/storm_test.cpp | 93 | ||||
-rw-r--r-- | storm_dll/storm_test.vcxproj | 26 |
3 files changed, 51 insertions, 90 deletions
diff --git a/storm_dll/storm.vcxproj b/storm_dll/storm.vcxproj index ac64fd5..a8d4849 100644 --- a/storm_dll/storm.vcxproj +++ b/storm_dll/storm.vcxproj @@ -22,29 +22,29 @@ <ProjectGuid>{BD600973-C6FA-4CE3-8821-67F6418B7F9C}</ProjectGuid> <RootNamespace>storm</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> @@ -110,6 +110,9 @@ <TargetMachine>MachineX86</TargetMachine> <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> </Link> + <PostBuildEvent> + <Command>copy .\bin\dll\$(Platform)\$(Configuration)\storm.lib .\storm.lib</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Midl> @@ -135,6 +138,9 @@ <TargetMachine>MachineX64</TargetMachine> <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> </Link> + <PostBuildEvent> + <Command>copy .\bin\dll\$(Platform)\$(Configuration)\storm.lib .\storm.lib</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> @@ -156,6 +162,9 @@ <TargetMachine>MachineX86</TargetMachine> <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> </Link> + <PostBuildEvent> + <Command>copy .\bin\dll\$(Platform)\$(Configuration)\storm.lib .\storm.lib</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Midl> @@ -181,6 +190,9 @@ <TargetMachine>MachineX64</TargetMachine> <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> </Link> + <PostBuildEvent> + <Command>copy .\bin\dll\$(Platform)\$(Configuration)\storm.lib .\storm.lib</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="storm.cpp" /> diff --git a/storm_dll/storm_test.cpp b/storm_dll/storm_test.cpp index 0ac2c67..6bf7980 100644 --- a/storm_dll/storm_test.cpp +++ b/storm_dll/storm_test.cpp @@ -10,6 +10,7 @@ #define _CRT_NON_CONFORMING_SWPRINTFS #define _CRT_SECURE_NO_DEPRECATE +#include <tchar.h> #include <stdio.h> #include <windows.h> @@ -20,12 +21,14 @@ #define STORM_ALTERNATE_NAMES // Use Storm* prefix for functions #include "storm.h" // Header file for Storm.dll +#pragma comment(lib, "storm.lib") + //----------------------------------------------------------------------------- // List of files const char * IntToHexChar = "0123456789ABCDEF"; -LPCSTR ListFile[] = +LPCSTR DefFilesToOpen[] = { "music\\tdefeat.wav", "setupdat\\inst.vis", @@ -45,68 +48,6 @@ LPCSTR ListFile[] = "setupdat\\scr_main.vis", "music\\pvict.wav", "music\\zdefeat.wav", - "files\\font\\font16x.fnt", - "setupdat\\nt\\comctl32.dll", - "setupdat\\debug.ins", - "setupdat\\inst.ins", - "music\\pdefeat.wav", - "files\\smackw32.dll", - "music\\tvict.wav", - "setupdat\\optvox.vis", - "setupdat\\gen\\maps.lst", - "files\\font\\font8.fnt", - "files\\mvoice.vxp", - "files\\font\\font14.fnt", - "files\\battle.snp", - "files\\storm.dll", - "maps\\128x128_ash4.scm", - "files\\font\\font32.fnt", - "setupdat\\normal.ins", - "files\\font\\font16.fnt", - "setupdat\\mainplay.vis", - "setupdat\\gendefs.ins", - "setupdat\\audio\\installermusic.wav", - "setupdat\\templates.ins", - "music\\terran1.wav", - "maps\\96x96_ash4.scm", - "setupdat\\defaults.vis", - "music\\prdyroom.wav", - "setupdat\\scr_blizzard.vis", - "setupdat\\scr_isp.vis", - "setupdat\\95\\comctl32.dll", - "files\\font\\font10.fnt", - "files\\local.dll", - "music\\terran3.wav", - "music\\terran2.wav", - "setupdat\\audio\\battlenetclick.wav", - "music\\zrdyroom.wav", - "setupdat\\starunin.exe", - "files\\vct32150.dll", - "maps\\96x96_wasteland4.scm", - "setupdat\\inst_sys.ins", - "music\\zerg3.wav", - "setupdat\\license.txt", - "music\\protoss2.wav", - "files\\starcraft.exe", - "music\\trdyroom.wav", - "maps\\96x96_space4.scm", - "files\\vfonts.vxp", - "setupdat\\installed.ins", - "music\\protoss1.wav", - "files\\stardat.mpq", - "setupdat\\font\\font16.fnt", - "smk\\starintr.smk", - "files\\vadagc.vxp", - "setupdat\\strings.ins", - "music\\title.wav", - "setupdat\\font\\font32.fnt", - "setupdat\\inst_files.ins", - "setupdat\\images\\install.pcx", - "files\\report bugs.url", - "setupdat\\single.ins", - "maps\\128x128_space4.scm", - "setupdat\\audio\\mousedown.wav", - NULL }; //----------------------------------------------------------------------------- @@ -155,11 +96,9 @@ DWORD BinaryToString(XCHAR * szBuffer, size_t cchBuffer, LPCVOID pvBinary, size_ return ERROR_SUCCESS; } - int main(int argc, char * argv[]) { LPCSTR szArchiveName; - LPCSTR szFileName; LPCSTR szFormat; HANDLE hMpq = NULL; HANDLE hFile = NULL; @@ -171,16 +110,15 @@ int main(int argc, char * argv[]) char md5_string[0x40]; // Check parameters - if(argc != 3) + if(argc == 1) { - printf("Error: Missing MPQ or file name\n"); + printf("Error: Missing MPQ name\nUsage: storm_test.exe MpqName [FileName [FileName]]\n"); return 3; } // Get both arguments SetLastError(ERROR_SUCCESS); szArchiveName = argv[1]; - szFileName = argv[2]; // Break for kernel debugger //__debugbreak(); @@ -189,10 +127,21 @@ int main(int argc, char * argv[]) //printf("[*] Opening archive '%s' ...\n", szArchiveName); if(StormOpenArchive(szArchiveName, 0, 0, &hMpq)) { - for(size_t i = 0; ListFile[i] != NULL; i++) + LPCSTR * FilesToOpen = DefFilesToOpen; + size_t nFilesToOpen = _countof(DefFilesToOpen); + + // Set the list of files + if(argc > 2) + { + FilesToOpen = (LPCSTR *)(&argv[2]); + nFilesToOpen = argc - 2; + } + + // Attempt to open all files + for(size_t i = 0; i < nFilesToOpen; i++) { - //printf("[*] Opening file '%s' ...\n", ListFile[i]); - if(StormOpenFileEx(hMpq, ListFile[i], 0, &hFile)) + //printf("[*] Opening file '%s' ...\n", FilesToOpen[i]); + if(StormOpenFileEx(hMpq, FilesToOpen[i], 0, &hFile)) { //printf("[*] Retrieving file size ... "); dwFileSize = StormGetFileSize(hFile, NULL); @@ -214,7 +163,7 @@ int main(int argc, char * argv[]) //printf("[*] Calculating MD5 ... "); CalculateMD5(md5_digest, pbBuffer, dwFileSize); BinaryToString(md5_string, _countof(md5_string), md5_digest, sizeof(md5_digest)); - printf("%s *%s\n", md5_string, ListFile[i]); + printf("%s *%s\n", md5_string, FilesToOpen[i]); delete[] pbBuffer; } diff --git a/storm_dll/storm_test.vcxproj b/storm_dll/storm_test.vcxproj index 48058ff..fccd989 100644 --- a/storm_dll/storm_test.vcxproj +++ b/storm_dll/storm_test.vcxproj @@ -22,27 +22,27 @@ <ProjectGuid>{5B0E680A-EC4E-402E-AE0D-18ADD2DC6EBE}</ProjectGuid> <RootNamespace>storm_test</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v143</PlatformToolset> <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> @@ -69,23 +69,23 @@ <_ProjectFileVersion>16.0.31829.152</_ProjectFileVersion> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <OutDir>.\bin\$(Platform)\$(Configuration)\</OutDir> - <IntDir>.\bin\$(Platform)\$(Configuration)\</IntDir> + <OutDir>.\bin\exe\$(Platform)\$(Configuration)\</OutDir> + <IntDir>.\bin\exe\$(Platform)\$(Configuration)\</IntDir> <LinkIncremental>true</LinkIncremental> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <OutDir>.\bin\$(Platform)\$(Configuration)\</OutDir> - <IntDir>.\bin\$(Platform)\$(Configuration)\</IntDir> + <OutDir>.\bin\exe\$(Platform)\$(Configuration)\</OutDir> + <IntDir>.\bin\exe\$(Platform)\$(Configuration)\</IntDir> <LinkIncremental>true</LinkIncremental> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <OutDir>.\bin\$(Platform)\$(Configuration)\</OutDir> - <IntDir>.\bin\$(Platform)\$(Configuration)\</IntDir> + <OutDir>.\bin\exe\$(Platform)\$(Configuration)\</OutDir> + <IntDir>.\bin\exe\$(Platform)\$(Configuration)\</IntDir> <LinkIncremental>false</LinkIncremental> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <OutDir>.\bin\$(Platform)\$(Configuration)\</OutDir> - <IntDir>.\bin\$(Platform)\$(Configuration)\</IntDir> + <OutDir>.\bin\exe\$(Platform)\$(Configuration)\</OutDir> + <IntDir>.\bin\exe\$(Platform)\$(Configuration)\</IntDir> <LinkIncremental>false</LinkIncremental> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |