void ModifyPEVersion(const std::string& strFilePath,const std::string& strFileShortName,const std::string& strVersion,\
const std::string& strOriginalFileName)
{
PEVersion the_version;
the_version.setVersion(strVersion.c_str());
//the_version.setComments("testcomment");
the_version.setCompanyName("xxx公司");
the_version.setFileDescription(strFileShortName.c_str());
the_version.setInternalName(strOriginalFileName.c_str());
the_version.setLegalCopyright("Copyright (C) 2016 xxx公司");
the_version.setOriginalFilename(strOriginalFileName.c_str());
the_version.setProductName(strFileShortName.c_str());
std::string str;
BYTE* pBuffer = the_version.GenVSVersionInfo();
ushort nLen = *(ushort*)pBuffer;
str.append((const char*)pBuffer,nLen);
CString strFilePathEx(strFilePath.c_str());
if (NULL != pBuffer)
{
delete[] pBuffer;
pBuffer = NULL;
}
SetPEResource(strFilePathEx, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), str, 0);
}
没有合适的资源?快使用搜索试试~ 我知道了~
更改PE文件版本、描述等
共2个文件
h:1个
cpp:1个
需积分: 15 15 下载量 195 浏览量
2016-11-18
15:22:58
上传
评论
收藏 3KB ZIP 举报
温馨提示
自己写的C++版的修改PE文件版本、描述等信息。我的Language是 中文(简体,中国)。
资源推荐
资源详情
资源评论
收起资源包目录
PEVersion.zip (2个子文件)
main.cpp 986B
PEVersion.h 10KB
共 2 条
- 1
资源评论
ygq1126
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功