从Web服务器下载我的程序数据(基本上只是.EXE变成.txt),但是当我将其放入.exe中时,它不会运行吗?
因此,目前我正在使用基本的HTTP请求来从我的服务器weblink.com/program.exe中提取EXE数据 它以.txt表单返回我的程序,但是当我将其放入文件中时,它将无法运行。 我认为这是因为我需要元数据,但不知道如何找到该过程,甚至不知道如何搜索像这样的特定内容...所以我要么要求解决方案(如何添加适当的.EXE元数据),要么在是在C ++ *中下载类似文件的更好方法
*注意i 不能使用基本的窗口功能,例如DownloadTofilea或外部库(例如libcurl/curl)
OutFile.open(XorStr("C:\\Users\\Program.exe").c_str(), std::ios::out);
if (OutFile.is_open())
{
OutFile << Output;
//Initialize .exe Meta Data???
}
OutFile.close();
So currently I am using a basic Http request to pull the exe data from my server weblink.com/Program.exe
it returns my program in .txt form but when I put it into a file it will not run.
I assume this is because I need metadata but have no clue how to find that process or even how to google something as specific as that... So I am either asking for a solution (how to add proper .exe metadata) or if there is a better way to download files like that in C++
*Note I cannot use basic windows functions such as DownloadToFileA or External Library's (Like LibCurl/Curl)
OutFile.open(XorStr("C:\\Users\\Program.exe").c_str(), std::ios::out);
if (OutFile.is_open())
{
OutFile << Output;
//Initialize .exe Meta Data???
}
OutFile.close();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在二进制模式下打开文件,否则newline翻译将搞砸您的可执行文件:
You need to open your file in binary mode otherwise newline translation will screw up your executable: