c++如何运行内容存储在字符数组中的.exe文件?

发布于 2024-12-24 17:54:19 字数 413 浏览 4 评论 0原文

我正在制作一个特定的程序,我只是想知道我是否可以这样做: 运行一个文件,其内容存储在 WINDOWS 上的字符数组中。

这是读取可执行文件并将其存储在 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();

我听说过一些有关 RunPE 的信息,并且做了一些搜索,但我没有成功找到任何可以使用的 C++ 代码。

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.

this is the code that reads the executable and stores it in a char array:

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文