├── .gitignore ├── FuckFileMonitor.sln ├── FuckFileMonitor ├── FuckFileMonitor.cpp ├── FuckFileMonitor.vcxproj ├── FuckFileMonitor.vcxproj.filters └── FuckFileMonitor.vcxproj.user ├── README.md └── sample ├── 7z.dll ├── 7z.exe ├── FuckFileMonitor.exe ├── done └── 占位文件.txt ├── pic ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png └── 6.png ├── readme.txt ├── zdecrypt.bat ├── zdecrypt └── 占位文件.txt ├── zencrypt.bat └── zencrypt └── 占位文件.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 3 | ################################################################################ 4 | 5 | /.vs/FuckFileMonitor/v16 6 | /bin 7 | /tmp/Win32/Debug/FuckFileMonitor 8 | /tmp/x64/Debug/FuckFileMonitor/FuckFileMonitor.tlog 9 | /tmp/x64/Debug/FuckFileMonitor 10 | -------------------------------------------------------------------------------- /FuckFileMonitor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29102.190 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FuckFileMonitor", "FuckFileMonitor\FuckFileMonitor.vcxproj", "{11E1879A-2135-46BD-B594-A14DA78B3DA2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Debug|x64.ActiveCfg = Debug|x64 17 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Debug|x64.Build.0 = Debug|x64 18 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Debug|x86.ActiveCfg = Debug|Win32 19 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Debug|x86.Build.0 = Debug|Win32 20 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Release|x64.ActiveCfg = Release|x64 21 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Release|x64.Build.0 = Release|x64 22 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Release|x86.ActiveCfg = Release|Win32 23 | {11E1879A-2135-46BD-B594-A14DA78B3DA2}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {50476C0D-87CB-4EDD-8B1E-C76D80B4D132} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /FuckFileMonitor/FuckFileMonitor.cpp: -------------------------------------------------------------------------------- 1 | // FuckFileMonitor.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 2 | // 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | struct FileInformation 14 | { 15 | size_t encSize; 16 | size_t picSize; 17 | char picName[64]; 18 | }; 19 | 20 | std::vector split(std::string srcStr, const std::string& delim) 21 | { 22 | int nPos = 0; 23 | std::vector vec; 24 | nPos = srcStr.find(delim.c_str()); 25 | while (-1 != nPos) 26 | { 27 | std::string temp = srcStr.substr(0, nPos); 28 | vec.push_back(temp); 29 | srcStr = srcStr.substr(nPos + 1); 30 | nPos = srcStr.find(delim.c_str()); 31 | } 32 | vec.push_back(srcStr); 33 | return vec; 34 | } 35 | 36 | std::string getCurrentDirectory() 37 | { 38 | char moduleFileName[MAX_PATH * 4] = { 0 }; 39 | GetModuleFileNameA(NULL, moduleFileName, MAX_PATH * 4); 40 | 41 | std::string workingFolder(moduleFileName); 42 | size_t pos = workingFolder.find_last_of("\\"); 43 | return workingFolder.substr(0, pos + 1); 44 | } 45 | 46 | std::string getPathFileName(const std::string& path) 47 | { 48 | std::string name(path); 49 | auto pos = name.rfind('\\'); 50 | if (std::string::npos != pos) 51 | { 52 | name = name.substr(pos + 1); 53 | } 54 | else 55 | { 56 | auto pos = name.rfind('/'); 57 | if (std::string::npos != pos) 58 | { 59 | name = name.substr(pos + 1); 60 | } 61 | } 62 | return name; 63 | } 64 | 65 | bool getDirectoryFiles(const std::string& dir, std::vector& files) 66 | { 67 | struct _finddata_t fileinfo; 68 | auto hFile = _findfirst((dir + "\\*.*").c_str(), &fileinfo); 69 | if (hFile != -1) 70 | { 71 | do 72 | { 73 | if (!(fileinfo.attrib & _A_SUBDIR)) 74 | { 75 | if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0) 76 | files.push_back(dir + "\\" + fileinfo.name); 77 | } 78 | } while (_findnext(hFile, &fileinfo) == 0); 79 | _findclose(hFile); 80 | } 81 | return !files.empty(); 82 | } 83 | 84 | bool getFileContent(const std::string& path, size_t offset, char** buffer, size_t* size) 85 | { 86 | std::ifstream in(path, std::ios::in | std::ios::binary | std::ios::ate); 87 | if (!in.is_open()) 88 | { 89 | printf("open file fail!\n"); 90 | return false; 91 | } 92 | auto fsize = in.tellg(); 93 | if (fsize >= ULONG_MAX || fsize <= offset) 94 | { 95 | printf("file size over memory! f:%d, o:%d\n", (size_t)fsize, offset); 96 | return false; 97 | } 98 | 99 | if (size) 100 | { 101 | *size = (size_t)fsize; 102 | } 103 | 104 | if (buffer) 105 | { 106 | auto s = (int)fsize - offset; 107 | auto b = new char[s]; 108 | in.seekg(offset, std::ios::beg); 109 | in.read(b, s); 110 | 111 | *buffer = b; 112 | if (size) 113 | { 114 | *size = s; 115 | } 116 | } 117 | 118 | in.close(); 119 | return true; 120 | } 121 | 122 | bool setFileContent(const std::string& path, char* buffer, size_t size) 123 | { 124 | if (!buffer || !size) 125 | { 126 | printf("parameter fail!\n"); 127 | return false; 128 | } 129 | std::ofstream out(path, std::ios::out | std::ios::binary | std::ios::app); 130 | if (!out.is_open()) 131 | { 132 | printf("open write file fail!\n"); 133 | return false; 134 | } 135 | out.write(buffer, size); 136 | out.close(); 137 | return true; 138 | } 139 | 140 | bool encrypt(const std::string& pic, const std::string& zip, const std::string& save) 141 | { 142 | size_t size = 0; 143 | char* buf = nullptr; 144 | bool result = false; 145 | do 146 | { 147 | FileInformation fileInfo = { 0 }; 148 | std::string name = getPathFileName(zip); 149 | int length = name.length() < sizeof(fileInfo.picName) ? name.length() : sizeof(fileInfo.picName); 150 | name.copy(fileInfo.picName, length); 151 | 152 | for (size_t i = 0; i < _countof(fileInfo.picName); i++) 153 | { 154 | if (fileInfo.picName[i]) 155 | { 156 | fileInfo.picName[i] ^= 'x'; 157 | } 158 | } 159 | 160 | if (!getFileContent(pic, 0, &buf, &size)) 161 | { 162 | printf("get file size fail!\n"); 163 | break; 164 | } 165 | 166 | fileInfo.picSize = size; 167 | if (!setFileContent(save, buf, size)) 168 | { 169 | printf("set file content fail!\n"); 170 | break; 171 | } 172 | 173 | if (buf) 174 | { 175 | size = 0; 176 | delete[] buf; 177 | } 178 | 179 | if (!getFileContent(zip, 0, &buf, &size)) 180 | { 181 | printf("get file size fail!\n"); 182 | break; 183 | } 184 | 185 | fileInfo.encSize = size; 186 | if (!setFileContent(save, buf, size)) 187 | { 188 | printf("set file content fail!\n"); 189 | break; 190 | } 191 | 192 | if (!setFileContent(save, (char*)&fileInfo, sizeof(fileInfo))) 193 | { 194 | printf("set file content fail!\n"); 195 | break; 196 | } 197 | 198 | result = true; 199 | 200 | } while (false); 201 | 202 | if (buf) 203 | { 204 | size = 0; 205 | delete[] buf; 206 | } 207 | return result; 208 | } 209 | 210 | bool decrypt(const std::string & zip, const std::string& saveDir) 211 | { 212 | size_t size = 0; 213 | char* buf = nullptr; 214 | bool result = false; 215 | do 216 | { 217 | FileInformation fileInfo = { 0 }; 218 | if (!getFileContent(zip, 0, &buf, &size)) 219 | { 220 | printf("get file content fail!\n"); 221 | return false; 222 | } 223 | 224 | auto pFileInfo = (FileInformation*)& buf[size - sizeof(fileInfo)]; 225 | if (!pFileInfo) 226 | { 227 | printf("get file information fail!\n"); 228 | return false; 229 | } 230 | 231 | if (pFileInfo->encSize >= size || pFileInfo->picSize >= size) 232 | { 233 | printf("analyze file information fail!\n"); 234 | return false; 235 | } 236 | 237 | std::string picName(pFileInfo->picName); 238 | if (picName.empty()) 239 | { 240 | printf("get file information name fail!\n"); 241 | return false; 242 | } 243 | 244 | for (size_t i = 0; i < picName.length(); i++) 245 | { 246 | picName[i] ^= 'x'; 247 | } 248 | 249 | auto path = saveDir + "\\" + picName; 250 | if (!setFileContent(path, &buf[pFileInfo->picSize], pFileInfo->encSize)) 251 | { 252 | printf("set file content fail!\n"); 253 | return false; 254 | } 255 | 256 | result = true; 257 | 258 | } while (false); 259 | 260 | if (buf) 261 | { 262 | size = 0; 263 | delete[] buf; 264 | } 265 | return result; 266 | } 267 | 268 | int main(int argv, char* argc[]) 269 | { 270 | if (argv < 4) 271 | { 272 | printf("parameter fail! - exe encrypt pic.png enc_files dec_files \n"); 273 | return 1; 274 | } 275 | bool enc = false; 276 | std::string type(argc[1]); 277 | if (type == "encrypt") 278 | { 279 | enc = true; 280 | } 281 | else if (type == "decrypt") 282 | { 283 | enc = false; 284 | } 285 | else 286 | { 287 | printf("parameter fail! - exe encrypt pic.png enc_files dec_files \n"); 288 | return 1; 289 | } 290 | 291 | std::string picDir(argc[2]); 292 | std::vector picfiles; 293 | if (enc) 294 | { 295 | if (!getDirectoryFiles(picDir, picfiles) || picfiles.empty()) 296 | { 297 | printf("get picfiles fail!\n"); 298 | return 1; 299 | } 300 | } 301 | 302 | std::string tmpDir(argc[3]); 303 | std::vector files; 304 | if (!getDirectoryFiles(tmpDir, files) || files.empty()) 305 | { 306 | printf("get files fail!\n"); 307 | return 1; 308 | } 309 | 310 | std::string doneDir(argc[4]); 311 | for (size_t i = 0, j = 0, k = 0; i < files.size(); i++, j++) 312 | { 313 | if (enc) 314 | { 315 | if (j >= picfiles.size()) 316 | { 317 | j = 0; 318 | k++; 319 | } 320 | auto tmp = split(getPathFileName(picfiles[j]), "."); 321 | if (tmp.empty() || tmp.size() < 2) 322 | { 323 | continue; 324 | } 325 | std::string name = doneDir + std::string("\\" + tmp[0] + std::to_string(k) + "." + tmp[1]); 326 | printf("encrypt %s - %s - %s\n", picfiles[j].c_str(), files[i].c_str(), name.c_str()); 327 | 328 | if (encrypt(picfiles[j], files[i], name)) 329 | { 330 | printf("encrypt %s - %s - %s done!\n", picfiles[j].c_str(), files[i].c_str(), name.c_str()); 331 | } 332 | } 333 | else 334 | { 335 | if (decrypt(files[i], doneDir)) 336 | { 337 | printf("decrypt %s - %s done!\n", files[i].c_str(), doneDir.c_str()); 338 | } 339 | } 340 | } 341 | 342 | return 0; 343 | } -------------------------------------------------------------------------------- /FuckFileMonitor/FuckFileMonitor.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | {11E1879A-2135-46BD-B594-A14DA78B3DA2} 24 | Win32Proj 25 | FuckFileMonitor 26 | 10.0.17763.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v141 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v141 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v141 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v141 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | $(SolutionDir)bin\$(Platform)\$(Configuration)\ 76 | $(SolutionDir)tmp\$(Platform)\$(Configuration)\$(ProjectName)\ 77 | 78 | 79 | true 80 | $(SolutionDir)bin\$(Platform)\$(Configuration)\ 81 | $(SolutionDir)tmp\$(Platform)\$(Configuration)\$(ProjectName)\ 82 | 83 | 84 | false 85 | $(SolutionDir)bin\$(Platform)\$(Configuration)\ 86 | $(SolutionDir)tmp\$(Platform)\$(Configuration)\$(ProjectName)\ 87 | 88 | 89 | false 90 | $(SolutionDir)bin\$(Platform)\$(Configuration)\ 91 | $(SolutionDir)tmp\$(Platform)\$(Configuration)\$(ProjectName)\ 92 | 93 | 94 | 95 | 96 | 97 | Level3 98 | Disabled 99 | true 100 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 101 | true 102 | $(SolutionDir)3rdparty\CxImage\CxImage 103 | MultiThreadedDebug 104 | 105 | 106 | Console 107 | true 108 | %(AdditionalLibraryDirectories) 109 | kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 110 | 111 | 112 | 113 | 114 | 115 | 116 | Level3 117 | Disabled 118 | true 119 | _CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | true 121 | $(SolutionDir)3rdparty\CxImage\CxImage 122 | 123 | 124 | Console 125 | true 126 | $(SolutionDir)3rdparty\CxImage\bin\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) 127 | kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 128 | 129 | 130 | 131 | 132 | 133 | 134 | Level3 135 | MaxSpeed 136 | true 137 | true 138 | true 139 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 140 | true 141 | MultiThreaded 142 | $(SolutionDir)3rdparty\CxImage\CxImage 143 | 144 | 145 | Console 146 | true 147 | true 148 | true 149 | %(AdditionalLibraryDirectories) 150 | kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 151 | 152 | 153 | 154 | 155 | 156 | 157 | Level3 158 | MaxSpeed 159 | true 160 | true 161 | true 162 | _CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 163 | true 164 | $(SolutionDir)3rdparty\CxImage\CxImage 165 | 166 | 167 | Console 168 | true 169 | true 170 | true 171 | $(SolutionDir)3rdparty\CxImage\bin\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) 172 | kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /FuckFileMonitor/FuckFileMonitor.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | -------------------------------------------------------------------------------- /FuckFileMonitor/FuckFileMonitor.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | decrypt .\zdecrypt .\tmp .\done 5 | WindowsLocalDebugger 6 | $(OutDir) 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FuckFileMonitor 2 | FuckFileMonitor 将文件加密伪装成图片,可以通过IM工具发送图片来pass内网文件监控.(其实就是蛋疼了一下写出来的东西) 3 | 4 | 原理: 5 | 1.通过7z加密分卷压缩 6 | 2.从pic文件夹获取图片文件,将图片文件和分卷压缩包合成一个文件 7 | 8 | 9 | 加密: 10 | 1.将需要加密的东西扔进zencrypt文件夹 11 | 2.双击zencrypt.bat 12 | 3.生成加密后的文件在done文件夹 13 | 14 | 15 | 解密: 16 | 1.将加密后的文件放在done文件夹 17 | 2.双击zdecrypt.bat 18 | 3.解密后的文件会在zdecrypt文件夹 -------------------------------------------------------------------------------- /sample/7z.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/7z.dll -------------------------------------------------------------------------------- /sample/7z.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/7z.exe -------------------------------------------------------------------------------- /sample/FuckFileMonitor.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/FuckFileMonitor.exe -------------------------------------------------------------------------------- /sample/done/占位文件.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/done/占位文件.txt -------------------------------------------------------------------------------- /sample/pic/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/pic/1.png -------------------------------------------------------------------------------- /sample/pic/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/pic/2.png -------------------------------------------------------------------------------- /sample/pic/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/pic/3.png -------------------------------------------------------------------------------- /sample/pic/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/pic/4.png -------------------------------------------------------------------------------- /sample/pic/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/pic/5.png -------------------------------------------------------------------------------- /sample/pic/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/pic/6.png -------------------------------------------------------------------------------- /sample/readme.txt: -------------------------------------------------------------------------------- 1 | 原理: 2 | 1.通过7z加密分卷压缩 3 | 2.从pic文件夹获取图片文件,将图片文件和分卷压缩包合成一个文件 4 | 5 | 6 | 加密: 7 | 1.将需要加密的东西扔进zencrypt文件夹 8 | 2.双击zencrypt.bat 9 | 3.生成加密后的文件在done文件夹 10 | 11 | 12 | 解密: 13 | 1.将加密后的文件放在done文件夹 14 | 2.双击zdecrypt.bat 15 | 3.解密后的文件会在zdecrypt文件夹 -------------------------------------------------------------------------------- /sample/zdecrypt.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/zdecrypt.bat -------------------------------------------------------------------------------- /sample/zdecrypt/占位文件.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/zdecrypt/占位文件.txt -------------------------------------------------------------------------------- /sample/zencrypt.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL ENABLEDELAYEDEXPANSION 3 | 4 | rem 需要加密的内容存放的目录 5 | set _enc_dir_=zencrypt 6 | 7 | if not "%1"=="" set _enc_dir_=%1 8 | 9 | rem 加密完成后的图片文件夹 10 | set _done_dir=done 11 | 12 | if not "%2"=="" set _enc_dir_=%2 13 | 14 | rem 用到加密的图片原图 15 | set _pic_img_=pic 16 | 17 | rem 分包大小(单位MB) 18 | set _file_size_=5 19 | 20 | rem 加密密码 21 | set _password_=123456 22 | 23 | del /Q done\*.* 24 | del /Q tmp\*.* 25 | 26 | mkdir %_enc_dir_% 27 | 28 | .\7z.exe a -mx9 -md64m -mfb=273 -slp -ssw -v%_file_size_%m -p%_password_% "tmp/tmp" %_enc_dir_% 29 | .\FuckFileMonitor.exe encrypt %_pic_img_% "tmp" %_done_dir% -------------------------------------------------------------------------------- /sample/zencrypt/占位文件.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobfly/FuckFileMonitor/0db29eed2d4b2527a3cfc28a06b450d79ee8b1d1/sample/zencrypt/占位文件.txt --------------------------------------------------------------------------------