所以目前我正在使用一個基本的 Http 請求從我的服務器 weblink.com/Program.exe 中提取 exe 資料,它以 .txt 形式回傳我的程式,但是當我將它放入檔案時它不會運行。我認為這是因為我需要元資料,但不知道如何找到該程序,甚至不知道如何用谷歌搜索特定的東西......所以我要么尋求解決方案(如何添加正確的 .exe 元資料),要么是否有是在 C 中下載類似檔案的更好方法
*注意我不能使用基本的 windows 功能,如 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();
uj5u.com熱心網友回復:
您需要以二進制模式打開檔案,否則換行符會破壞您的可執行檔案:
OutFile.open(XorStr("C:\\Users\\Program.exe").c_str(), std::ios::out | std::ios::binary);
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/493611.html
上一篇:Python檔案pdf重命名
