From 24145e7d9f52544f6b30072b683c010eb7d147eb Mon Sep 17 00:00:00 2001 From: blipvert Date: Fri, 19 Oct 2018 17:28:20 -0400 Subject: [PATCH 01/12] added paths to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 508c3dc..8c08897 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ tests/*.res tests/SampleExports.cpp tests/SampleExports.h + +x64/ +Debug/ +*.vcxproj.user From 5c3b050cf5a9f1f521ec2b4bd005674a705aa1f0 Mon Sep 17 00:00:00 2001 From: Craig Lennox Date: Sat, 20 Oct 2018 14:11:01 -0400 Subject: [PATCH 02/12] Allow DLL_FILE to be overridden. --- example/DllLoader/DllLoader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/DllLoader/DllLoader.cpp b/example/DllLoader/DllLoader.cpp index 4355ea8..3688b2a 100644 --- a/example/DllLoader/DllLoader.cpp +++ b/example/DllLoader/DllLoader.cpp @@ -13,7 +13,9 @@ typedef int (*addNumberProc)(int, int); +#ifndef DLL_FILE #define DLL_FILE TEXT("..\\SampleDLL\\SampleDLL.dll") +#endif void LoadFromFile(void) { From f9ab5f1f02a1813d4f9874eb2255409ac7d5c1e5 Mon Sep 17 00:00:00 2001 From: blipvert Date: Fri, 19 Oct 2018 17:30:14 -0400 Subject: [PATCH 03/12] Created Visual Studio project for MemoryModule library --- MemoryModule.vcxproj | 158 +++++++++++++++++++++++++++++++++++ MemoryModule.vcxproj.filters | 27 ++++++ 2 files changed, 185 insertions(+) create mode 100644 MemoryModule.vcxproj create mode 100644 MemoryModule.vcxproj.filters diff --git a/MemoryModule.vcxproj b/MemoryModule.vcxproj new file mode 100644 index 0000000..c79c7bc --- /dev/null +++ b/MemoryModule.vcxproj @@ -0,0 +1,158 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {FDD2A9C1-46F7-4CC6-A659-A6F75483CE87} + Win32Proj + MemoryModule + 10.0.17763.0 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + NotUsing + Level3 + Disabled + true + _DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + NotUsing + Level3 + Disabled + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/MemoryModule.vcxproj.filters b/MemoryModule.vcxproj.filters new file mode 100644 index 0000000..cbe3a7d --- /dev/null +++ b/MemoryModule.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + \ No newline at end of file From 9b7533964ab2158e850764c309b4e916c4e99184 Mon Sep 17 00:00:00 2001 From: blipvert Date: Fri, 19 Oct 2018 17:30:41 -0400 Subject: [PATCH 04/12] use wcsncpy_s function instead of wcsncpy --- MemoryModule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MemoryModule.c b/MemoryModule.c index 9f95a70..e08dcf0 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -1131,7 +1131,7 @@ MemoryLoadStringEx(HMEMORYMODULE module, UINT id, LPTSTR buffer, int maxsize, WO buffer[size] = 0; } #if defined(UNICODE) - wcsncpy(buffer, data->NameString, size); + wcsncpy_s(buffer, size, data->NameString, _TRUNCATE); #else wcstombs(buffer, data->NameString, size); #endif From b20f6e399f474e831afd5376ac3597cb53c13ae0 Mon Sep 17 00:00:00 2001 From: blipvert Date: Sat, 20 Oct 2018 09:13:22 -0400 Subject: [PATCH 05/12] Added names to anonymous structs --- MemoryModule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MemoryModule.c b/MemoryModule.c index e08dcf0..1230ca8 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -77,7 +77,7 @@ typedef struct POINTER_LIST { } POINTER_LIST; #endif -typedef struct { +typedef struct MEMORYMODULE { PIMAGE_NT_HEADERS headers; unsigned char *codeBase; HCUSTOMMODULE *modules; @@ -99,7 +99,7 @@ typedef struct { #endif } MEMORYMODULE, *PMEMORYMODULE; -typedef struct { +typedef struct SECTIONFINALIZEDATA { LPVOID address; LPVOID alignedAddress; SIZE_T size; From 5fb3a891d4dd0e69d1039159de4970c8dd70a9f8 Mon Sep 17 00:00:00 2001 From: Craig Lennox Date: Sat, 20 Oct 2018 12:46:58 -0400 Subject: [PATCH 06/12] Avoid using unsafe mb conversion functions. --- MemoryModule.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MemoryModule.c b/MemoryModule.c index 1230ca8..ed09978 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -963,8 +963,8 @@ static PIMAGE_RESOURCE_DIRECTORY_ENTRY _MemorySearchResourceEntry( // using a pre-allocated array. wchar_t _searchKeySpace[MAX_LOCAL_KEY_LENGTH+1]; LPWSTR _searchKey; + size_t _searchKeySize = (searchKeyLen + 1) * sizeof(wchar_t); if (searchKeyLen > MAX_LOCAL_KEY_LENGTH) { - size_t _searchKeySize = (searchKeyLen + 1) * sizeof(wchar_t); _searchKey = (LPWSTR) malloc(_searchKeySize); if (_searchKey == NULL) { SetLastError(ERROR_OUTOFMEMORY); @@ -974,8 +974,8 @@ static PIMAGE_RESOURCE_DIRECTORY_ENTRY _MemorySearchResourceEntry( _searchKey = &_searchKeySpace[0]; } - mbstowcs(_searchKey, key, searchKeyLen); - _searchKey[searchKeyLen] = 0; + if (mbstowcs_s(&_searchKeySize, _searchKey, searchKeyLen + 1, key, searchKeyLen)) + return NULL; searchKey = _searchKey; #endif start = 0; @@ -1102,7 +1102,7 @@ MemoryLoadStringEx(HMEMORYMODULE module, UINT id, LPTSTR buffer, int maxsize, WO { HMEMORYRSRC resource; PIMAGE_RESOURCE_DIR_STRING_U data; - DWORD size; + size_t size; if (maxsize == 0) { return 0; } @@ -1124,18 +1124,18 @@ MemoryLoadStringEx(HMEMORYMODULE module, UINT id, LPTSTR buffer, int maxsize, WO return 0; } - size = data->Length; - if (size >= (DWORD) maxsize) { - size = maxsize; + size = (size_t)data->Length; + if (size >= (size_t) maxsize) { + size = (size_t)maxsize; } else { buffer[size] = 0; } #if defined(UNICODE) wcsncpy_s(buffer, size, data->NameString, _TRUNCATE); #else - wcstombs(buffer, data->NameString, size); + wcstombs_s(&size, buffer, maxsize, data->NameString, size); #endif - return size; + return (int)size; } #ifdef TESTSUITE From 5df62f3b03b27a9f6e04cd68c49ba83c124d0ae8 Mon Sep 17 00:00:00 2001 From: Craig Lennox Date: Sat, 20 Oct 2018 12:52:00 -0400 Subject: [PATCH 07/12] Support loading library to specific address provided. MemoryLoadLibrary and MemoryLoadLibraryEx now take additional parameter `imageBase' which, if nonzero, cause these functions to ignore the base address in the library's PE header in favor of `imageBase'. --- MemoryModule.c | 11 +++++++---- MemoryModule.h | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/MemoryModule.c b/MemoryModule.c index ed09978..67863ff 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -536,12 +536,12 @@ void MemoryDefaultFreeLibrary(HCUSTOMMODULE module, void *userdata) FreeLibrary((HMODULE) module); } -HMEMORYMODULE MemoryLoadLibrary(const void *data, size_t size) +HMEMORYMODULE MemoryLoadLibrary(const void *data, size_t size, LPVOID imageBase) { - return MemoryLoadLibraryEx(data, size, MemoryDefaultAlloc, MemoryDefaultFree, MemoryDefaultLoadLibrary, MemoryDefaultGetProcAddress, MemoryDefaultFreeLibrary, NULL); + return MemoryLoadLibraryEx(data, size, imageBase, MemoryDefaultAlloc, MemoryDefaultFree, MemoryDefaultLoadLibrary, MemoryDefaultGetProcAddress, MemoryDefaultFreeLibrary, NULL); } -HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size, +HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size, LPVOID imageBase, CustomAllocFunc allocMemory, CustomFreeFunc freeMemory, CustomLoadLibraryFunc loadLibrary, @@ -616,10 +616,13 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size, return NULL; } + if (!imageBase) + imageBase = (LPVOID)old_header->OptionalHeader.ImageBase; + // reserve memory for image of library // XXX: is it correct to commit the complete memory region at once? // calling DllEntry raises an exception if we don't... - code = (unsigned char *)allocMemory((LPVOID)(old_header->OptionalHeader.ImageBase), + code = (unsigned char *)allocMemory(imageBase, alignedImageSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE, diff --git a/MemoryModule.h b/MemoryModule.h index a728f6b..db01c4f 100644 --- a/MemoryModule.h +++ b/MemoryModule.h @@ -51,7 +51,7 @@ typedef void (*CustomFreeLibraryFunc)(HCUSTOMMODULE, void *); * All dependencies are resolved using default LoadLibrary/GetProcAddress * calls through the Windows API. */ -HMEMORYMODULE MemoryLoadLibrary(const void *, size_t); +HMEMORYMODULE MemoryLoadLibrary(const void *, size_t, LPVOID); /** * Load EXE/DLL from memory location with the given size using custom dependency @@ -59,7 +59,7 @@ HMEMORYMODULE MemoryLoadLibrary(const void *, size_t); * * Dependencies will be resolved using passed callback methods. */ -HMEMORYMODULE MemoryLoadLibraryEx(const void *, size_t, +HMEMORYMODULE MemoryLoadLibraryEx(const void *, size_t, LPVOID, CustomAllocFunc, CustomFreeFunc, CustomLoadLibraryFunc, From 2912bb4eb4b25a262f70bd0c2a099a66709d9407 Mon Sep 17 00:00:00 2001 From: Craig Lennox Date: Sat, 20 Oct 2018 13:06:47 -0400 Subject: [PATCH 08/12] Added MemoryLoadLibraryFile and MemoryLoadLibraryFileEx functions. --- MemoryModule.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ MemoryModule.h | 10 ++++++++ 2 files changed, 74 insertions(+) diff --git a/MemoryModule.c b/MemoryModule.c index 67863ff..c774101 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -1141,6 +1141,70 @@ MemoryLoadStringEx(HMEMORYMODULE module, UINT id, LPTSTR buffer, int maxsize, WO return (int)size; } +static LPVOID ReadLibraryFile(LPCSTR lpszFileName, PDWORD pdwSize) +{ + DWORD dwBytesRead = 0; + BOOL bResult = FALSE; + + HANDLE hFile = CreateFileA(lpszFileName, + GENERIC_READ, // open for reading + FILE_SHARE_READ, // share for reading + NULL, // default security + OPEN_EXISTING, // existing file only + FILE_ATTRIBUTE_NORMAL, // normal file + NULL // no attr. template + ); + + if (hFile != INVALID_HANDLE_VALUE) { + DWORD dwSize = GetFileSize(hFile, NULL); + void *mem = dwSize ? + HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MEMORYMODULE)) : NULL; + BOOL bResult = mem && ReadFile(hFile, mem, dwSize, &dwBytesRead, NULL); + CloseHandle(hFile); + + if (mem) { + if (bResult) { + if (dwBytesRead == dwSize) { + if (pdwSize) + *pdwSize = dwSize; + return mem; + } + } + + free(mem); + } + } + + return NULL; +} + +HMEMORYMODULE MemoryLoadLibraryFile(LPCSTR lpszFileName, LPVOID imageBase) +{ + return MemoryLoadLibraryFileEx(lpszFileName, imageBase, MemoryDefaultAlloc, MemoryDefaultFree, MemoryDefaultLoadLibrary, MemoryDefaultGetProcAddress, MemoryDefaultFreeLibrary, NULL); +} + +HMEMORYMODULE MemoryLoadLibraryFileEx(LPCSTR lpszFileName, + LPVOID imageBase, + CustomAllocFunc allocMemory, + CustomFreeFunc freeMemory, + CustomLoadLibraryFunc loadLibrary, + CustomGetProcAddressFunc getProcAddress, + CustomFreeLibraryFunc freeLibrary, + void *userdata) +{ + DWORD dwSize = 0; + LPVOID lpData = ReadLibraryFile(lpszFileName, &dwSize); + HMEMORYMODULE hModule = NULL; + + if (lpData) { + hModule = MemoryLoadLibraryEx(lpData, (size_t)dwSize, imageBase, + allocMemory, freeMemory, loadLibrary, getProcAddress, freeLibrary, + userdata); + HeapFree(GetProcessHeap(), 0, lpData); + } + return hModule; +} + #ifdef TESTSUITE #include diff --git a/MemoryModule.h b/MemoryModule.h index db01c4f..43b00e3 100644 --- a/MemoryModule.h +++ b/MemoryModule.h @@ -161,6 +161,16 @@ FARPROC MemoryDefaultGetProcAddress(HCUSTOMMODULE, LPCSTR, void *); */ void MemoryDefaultFreeLibrary(HCUSTOMMODULE, void *); +HMEMORYMODULE MemoryLoadLibraryFile(LPCSTR, LPVOID); + +HMEMORYMODULE MemoryLoadLibraryFileEx(LPCSTR, LPVOID, + CustomAllocFunc, + CustomFreeFunc, + CustomLoadLibraryFunc, + CustomGetProcAddressFunc, + CustomFreeLibraryFunc, + void *); + #ifdef __cplusplus } #endif From 8c23df6c2d7afb13f8482e8cf2a39d5bdfbf00f8 Mon Sep 17 00:00:00 2001 From: blipvert Date: Sat, 20 Oct 2018 13:51:28 -0400 Subject: [PATCH 09/12] Fixed RuntimeLibrary to be /MT not /MD --- MemoryModule.vcxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MemoryModule.vcxproj b/MemoryModule.vcxproj index c79c7bc..37b5681 100644 --- a/MemoryModule.vcxproj +++ b/MemoryModule.vcxproj @@ -90,6 +90,7 @@ true _DEBUG;_LIB;%(PreprocessorDefinitions) true + MultiThreadedDebug Windows @@ -104,6 +105,7 @@ true WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) true + MultiThreadedDebug Windows @@ -120,6 +122,7 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) true + MultiThreaded Windows @@ -138,6 +141,7 @@ true NDEBUG;_LIB;%(PreprocessorDefinitions) true + MultiThreaded Windows From 01600a195d8bce7c3b278e0f7a278584dcb5d18f Mon Sep 17 00:00:00 2001 From: Craig Lennox Date: Sat, 20 Oct 2018 14:23:54 -0400 Subject: [PATCH 10/12] Migrated solution DllMemory.sln --- example/DllMemory.sln | 54 +++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/example/DllMemory.sln b/example/DllMemory.sln index 812654b..a2c30be 100644 --- a/example/DllMemory.sln +++ b/example/DllMemory.sln @@ -1,30 +1,40 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleDLL", "SampleDLL\SampleDLL.vcproj", "{B293DAC4-5BCA-4413-9B7B-92CB56459875}" - ProjectSection(ProjectDependencies) = postProject - {D0226BB5-3A02-4C91-893A-F36567AED5C5} = {D0226BB5-3A02-4C91-893A-F36567AED5C5} - EndProjectSection +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2046 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleDLL", "SampleDLL\SampleDLL.vcxproj", "{B293DAC4-5BCA-4413-9B7B-92CB56459875}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DllLoader", "DllLoader\DllLoader.vcproj", "{D0226BB5-3A02-4C91-893A-F36567AED5C5}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DllLoader", "DllLoader\DllLoader.vcxproj", "{D0226BB5-3A02-4C91-893A-F36567AED5C5}" EndProject Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Debug.ActiveCfg = Debug|Win32 - {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Debug.Build.0 = Debug|Win32 - {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Release.ActiveCfg = Release|Win32 - {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Release.Build.0 = Release|Win32 - {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Debug.ActiveCfg = Debug|Win32 - {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Debug.Build.0 = Debug|Win32 - {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Release.ActiveCfg = Release|Win32 - {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Release.Build.0 = Release|Win32 + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Debug|x64.ActiveCfg = Debug|x64 + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Debug|x64.Build.0 = Debug|x64 + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Debug|x86.ActiveCfg = Debug|Win32 + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Debug|x86.Build.0 = Debug|Win32 + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Release|x64.ActiveCfg = Release|x64 + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Release|x64.Build.0 = Release|x64 + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Release|x86.ActiveCfg = Release|Win32 + {B293DAC4-5BCA-4413-9B7B-92CB56459875}.Release|x86.Build.0 = Release|Win32 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Debug|x64.ActiveCfg = Debug|x64 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Debug|x64.Build.0 = Debug|x64 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Debug|x86.ActiveCfg = Debug|Win32 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Debug|x86.Build.0 = Debug|Win32 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Release|x64.ActiveCfg = Release|x64 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Release|x64.Build.0 = Release|x64 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Release|x86.ActiveCfg = Release|Win32 + {D0226BB5-3A02-4C91-893A-F36567AED5C5}.Release|x86.Build.0 = Release|Win32 EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {81506740-6F93-4E79-AC07-7B39C2C9B215} EndGlobalSection EndGlobal From bd657c17274f2e205b3d715387d0e91545f5c9d6 Mon Sep 17 00:00:00 2001 From: Craig Lennox Date: Sat, 20 Oct 2018 14:25:59 -0400 Subject: [PATCH 11/12] Added vcxproj files for DllLoader and SampleDLL --- example/DllLoader/DllLoader.vcxproj | 175 +++++++++++++++++++ example/DllLoader/DllLoader.vcxproj.filters | 30 ++++ example/SampleDLL/SampleDLL.vcxproj | 184 ++++++++++++++++++++ example/SampleDLL/SampleDLL.vcxproj.filters | 27 +++ 4 files changed, 416 insertions(+) create mode 100644 example/DllLoader/DllLoader.vcxproj create mode 100644 example/DllLoader/DllLoader.vcxproj.filters create mode 100644 example/SampleDLL/SampleDLL.vcxproj create mode 100644 example/SampleDLL/SampleDLL.vcxproj.filters diff --git a/example/DllLoader/DllLoader.vcxproj b/example/DllLoader/DllLoader.vcxproj new file mode 100644 index 0000000..9ef3400 --- /dev/null +++ b/example/DllLoader/DllLoader.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D0226BB5-3A02-4C91-893A-F36567AED5C5} + Win32Proj + 10.0.17763.0 + + + + Application + v141 + MultiByte + + + Application + v141 + MultiByte + + + Application + v141 + MultiByte + + + Application + v141 + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.27924.0 + + + Debug\ + Debug\ + true + MinimumRecommendedRules.ruleset + + + + + true + MinimumRecommendedRules.ruleset + + + + + Release\ + Release\ + false + MinimumRecommendedRules.ruleset + + + + + false + MinimumRecommendedRules.ruleset + + + + + + Disabled + WIN32;DLL_FILE="SampleDLL.dll";_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + Level3 + EditAndContinue + + + $(OutDir)DllLoader.exe + true + $(OutDir)DllLoader.pdb + Console + MachineX86 + + + + + Disabled + WIN32;DLL_FILE="SampleDLL.dll";_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir)DllLoader.exe + true + $(OutDir)DllLoader.pdb + Console + + + + + WIN32;DLL_FILE="SampleDLL.dll";NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + Level3 + ProgramDatabase + + + $(OutDir)DllLoader.exe + true + Console + true + true + MachineX86 + + + + + WIN32;DLL_FILE="SampleDLL.dll";NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir)DllLoader.exe + true + Console + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/DllLoader/DllLoader.vcxproj.filters b/example/DllLoader/DllLoader.vcxproj.filters new file mode 100644 index 0000000..2d59ad2 --- /dev/null +++ b/example/DllLoader/DllLoader.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + + + Source files + + + Source files + + + + + Header files + + + \ No newline at end of file diff --git a/example/SampleDLL/SampleDLL.vcxproj b/example/SampleDLL/SampleDLL.vcxproj new file mode 100644 index 0000000..fd719c7 --- /dev/null +++ b/example/SampleDLL/SampleDLL.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B293DAC4-5BCA-4413-9B7B-92CB56459875} + Win32Proj + 10.0.17763.0 + + + + DynamicLibrary + v141 + MultiByte + + + DynamicLibrary + v141 + MultiByte + + + DynamicLibrary + v141 + MultiByte + + + DynamicLibrary + v141 + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.27924.0 + + + Debug\ + Debug\ + true + MinimumRecommendedRules.ruleset + + + + + true + MinimumRecommendedRules.ruleset + + + + + Release\ + Release\ + false + MinimumRecommendedRules.ruleset + + + + + false + MinimumRecommendedRules.ruleset + + + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLEDLL_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + Level3 + EditAndContinue + + + $(OutDir)SampleDLL.dll + true + $(OutDir)SampleDLL.pdb + Windows + $(OutDir)SampleDLL.lib + MachineX86 + + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SAMPLEDLL_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir)SampleDLL.dll + true + $(OutDir)SampleDLL.pdb + Windows + $(OutDir)SampleDLL.lib + + + + + WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLEDLL_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + + Level3 + ProgramDatabase + + + $(OutDir)SampleDLL.dll + true + Windows + true + true + $(OutDir)SampleDLL.lib + MachineX86 + + + + + WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLEDLL_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir)SampleDLL.dll + true + Windows + true + true + $(OutDir)SampleDLL.lib + + + + + + + + + + + {d0226bb5-3a02-4c91-893a-f36567aed5c5} + false + + + + + + \ No newline at end of file diff --git a/example/SampleDLL/SampleDLL.vcxproj.filters b/example/SampleDLL/SampleDLL.vcxproj.filters new file mode 100644 index 0000000..a40c1b5 --- /dev/null +++ b/example/SampleDLL/SampleDLL.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + + + Source files + + + + + Header files + + + \ No newline at end of file From adc752d67378342ca585feb257d683877d5d966a Mon Sep 17 00:00:00 2001 From: Craig Lennox Date: Sat, 20 Oct 2018 14:30:22 -0400 Subject: [PATCH 12/12] Added patterns to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 8c08897..a24e076 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ tests/SampleExports.h x64/ Debug/ *.vcxproj.user +.vs/ +CMakeSettings.json