简体   繁体   English

C ++如何运行其内容存储在char数组中的.exe文件?

[英]c++ how to run an .exe file whose contents are stored in a char array?

I'm making a specific program and i just wondered if I could do this: run a file whose contents are stored in a char array ON WINDOWS. 我正在制作一个特定的程序,我只是想知道是否可以这样做:运行一个文件,其内容存储在WINDOWS上的char数组中。

this is the code that reads the executable and stores it in a char array: 这是读取可执行文件并将其存储在char数组中的代码:

filetoopen.open (C:\blahlbah.exe, ios::binary);
filetoopen.seekg (0, ios::end);
length = filetoopen.tellg();
filetoopen.seekg (0, ios::beg);
buffer = new char [length];
filetoopen.read (buffer, length);
filetoopen.close();

I heard something about RunPE and I did some searching, I haven't succeeded in finding any piece of C++ code to use. 我听到了有关RunPE的一些信息,并进行了一些搜索,但未能成功找到要使用的任何C ++代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM