将数据附加到exe [英] appending data to an exe

查看:102
本文介绍了将数据附加到exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题是我先前问题的答案之一的扩展:

This question extensions from one of the answers to my earlier question: how to save user registration in the exe... (C#).

这个想法本身对我来说还很新,但这似乎是合理的.我第一次尝试从其他应用程序内部将字符串附加到exe的第一次尝试没有用.然后变得更聪明,并尝试附加字节.仍然没有运气.

The idea itself is still very new to me, but it seems plausible. My first attempt of simply appending a string to the exe from inside a different application didn't work. Then got a little smarter and tried appending bytes. Still no luck.

我在Windows Portable可执行文件中找到了各种文档:

I've found various documentations on Windows Portable Executable files:

http://en.wikipedia.org/wiki/Portable_Executable

http://msdn.microsoft.com/en-us/magazine /bb985997.aspx

http://msdn.microsoft.com/en-us/windows /hardware/gg463125

坦白说,我了解得很少,以至于它们对我没有多大用处.更有用的是,我能够找到一个delphi教程,该教程描述了向可执行文件添加有效负载"的想法.继续说,要做到这一点,您需要让exe知道,并且还能够跟踪您放置它的位置……或类似的东西.除了我可以从代码本身中猜测的内容之外,我对delphi一无所知. http://www.delphidabbler.com/articles?article=7&part= 2

Frankly, I understand so little that they're not of much use to me. Of more use I was able to find a delphi tutorial that describes the idea of adding a "payload" to the executable. It goes on to say that to do this, you need to let the exe know and also be able to track where you put it... or something to that effect. I have no knowledge of delphi other than what I can guess from the code itself. http://www.delphidabbler.com/articles?article=7&part=2

最有用的只是一个示例或如何在可执行文件中添加一小段信息的链接.我要在Linux服务器上以php脚本的形式在C#Forms应用程序上执行此操作.我认为一个独立的C ++应用程序可以接受信息,因为参数应该可以解决问题.

What would be most useful is just an example or a link of how to add and retrieve a short piece of information onto the executable. I am going to want to have this operation performed on a C# Forms Application from a linux server ran as a php script.. I figure a standalone C++ application which accepts information as arguments should be able to do the trick.

我也欢迎其他想法.

谢谢.

推荐答案

这是我用来将数据附加到exe的一段代码的链接.这是专门用于在不破坏exe签名的情况下附加数据,但是该原理仅适用于附加到未签名的可执行文件.

Here is a link to a piece of code I've used to append data to an exe. This is specifically for appending data without breaking the signing of the exe, but the principle should hold for just appending to unsigned executables.

http://blog.barthe.ph/2009/02/22/change-签名可执行文件/

这篇关于将数据附加到exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆