代码拉取完成,页面将自动刷新
同步操作将从 ccc1/ZHLT_UPack 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "stdafx.h"
#include "PackageFile.h"
#include "RWFile.h"
#include "FileUtils.h"
#include <io.h>
#include <direct.h>
#include <dbghelp.h>
#include <shlwapi.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
using namespace FileUtils;
#pragma comment(lib, "dbghelp")
#pragma comment(lib, "shlwapi")
int packdir(string& path)
{
if (path[path.length()-1] == '\\')
{
path.resize(path.length() - 1);
}
string packfileName = path + ".jzw";
CPackageFile kPackageFile;
if (!kPackageFile.Open(packfileName.c_str(), GL_FILE_OPEN_WRITE))
{
printf("packdir cannot create .jzw!");
return -1;
}
vector<file_t> files;
FileUtils::SearchFiles(path.c_str(), files);
string kBuff;
for (size_t i = 0; i < files.size(); i++)
{
file_t& file = files[i];
if (!file.isDir)
{
if (RWFile::LoadFile(file.fullpath, kBuff))
{
kPackageFile.AddFile(file.filename, kBuff.c_str(), kBuff.size(), NULL, 0, TRUE);
}
}
}
kPackageFile.Close();
printf("packdir OK!!!");
return 0;
}
int depack(string& path)
{
if (path.length() < 5)
{
printf("depack test.jzw");
return -1;
}
if (path.substr(path.length() - 4, 4) != ".jzw")
{
printf("depack test.jzw");
return -1;
}
CPackageFile kPackageFile;
if (!kPackageFile.Open(path.c_str(), GL_FILE_OPEN_READ))
{
printf("depack cannot open .jzw!");
return -1;
}
string dir = path;
dir.resize(dir.length()-4);
dir += "\\";
::MakeSureDirectoryPathExists(dir.c_str());
const FileIndexList& kIndexList = kPackageFile.GetFileIndexList();
ConFileIndex itLie = kIndexList.begin();
ConFileIndex itEnd = kIndexList.end();
for( ;itLie!=itEnd; ++itLie )
{
BYTE* byFileData = NULL;
UINT uFileLen = 0;
if (kPackageFile.GetFile(itLie->second->szFileName, &byFileData, &uFileLen))
{
RWFile::SaveFile(dir + itLie->second->szFileName, byFileData, uFileLen);
free(byFileData);
}
}
printf("depack OK!!!");
return 0;
}
int main(int argc, char **argv)
{
printf("uPackage.exe v1.0 by zhupf QQ:335264417\n");
printf("uPackage.exe for л!!!\n");
if (argc == 2)
{
string path = argv[1];
if (!PathFileExists(path.c_str()))
{
printf("file not found!!!");
return -1;
}
if (PathIsDirectory(path.c_str()))
{
return packdir(path);
}
else
{
return depack(path);
}
}
else
{
printf("uPackage.exe dir or jzw!!!\n");
}
::system("pause");
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。