更改exe文件中的值并将其保存? [英] change value in an exe file.and save it ?

查看:86
本文介绍了更改exe文件中的值并将其保存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个程序作为控制台应用程序.我想从控制台获取参数,例如consoleapplication.exe value1 value2,但我想使其保持静态,因此我将这些值输入到控制台应用程序中.我想将其保存到exe.我看到一些使用此方法的应用程序.木马等.

对不起,我的英语.

感谢您的帮助.

I want to make a program as console application. I want to get parameters from console like consoleapplication.exe value1 value2 but I want to make this static so then I enter this values into console application. I want to save this to exe. I saw some applications using this methods. Trojans etc..

Sorry for My English.

Thanks for help.

推荐答案

我恐怕对此不满意-我不喜欢被认为是为成功的发展做出贡献的人.破坏性木马.请记住,即使您的动机一点也不险恶-我们在这里所做的一切都是开放供所有人阅读和学习的.

当您使用c#标记此帖子时,建议您调查 System.Configuration 提供的可能性[ ^ ]

最好的问候
Espen Harlinn
I''m afraid that''s somewhat frowned upon - I would not enjoy being quoted as somebody who contributed to the development of a succesful destructive trojan. Remember that even if your motives aren''t sinister at all - everything we do here is open for all to read and learn from.

As you tagged this post with c# I suggest you investigate the possibilities provided with System.Configuration[^]

Best regards
Espen Harlinn


您需要做相反的事情.您(和每个人)都需要对所有程序集进行签名(至少对于工业/商业应用程序而言),因此没有人能够(以或多或少的简便方式)修改任何程序集.

修改代码的唯一有效方法是重建项目.修改现有软件产品的行为的唯一有效方法是数据(包括插件:即使它们以可执行模块的形式出现,在加载之前也被视为数据,但选择和加载是由驱动的)数据,即使此数据是简单的命令行字符串也是如此.

不仅您的代码容易出错,而且被反病毒/反间谍软件工具视为病毒,这也是对技术的滥用.您实际上不需要修改和可执行文件(更确切地说,是任何PE文件,包括任何.NET程序集模块).它的好处是可疑的或微不足道的(如果有的话),缺点是非常讨厌.

要了解这种情况的理论基础,您需要了解冯·诺依曼的体系结构, http://en.wikipedia.org/wiki /Von_Neumann_architecture [ ^ ],此体系结构又,实现了通用图灵机 http://en.wikipedia.org/wiki/Universal_Turing_machine [
You need to do just the opposite. You (and everyone) need to sign all the assemblies (at least for industrial/commercial applications) so no one would be able to modify any (in a more or less easy way).

The only valid way of modification of the code is re-build of the projects; the only valid way to modify the behavior of the existing software product is the data (including plug-ins: even though they are appear as executable modules, they are considered as data before they are loaded, the selection and loading of them is driven by data, even if this data is a simple command-line string).

Not only you code will be error prone and considered as a virus by a anti-viral/anti-spyware tools, this is the abuse of the technology. You never really need to modify and executable files (more exactly any PE file, including any .NET assembly modules). The benefits of it are questionable or insignificant (if any), the down-side is extremely nasty.

To read about theoretical grounds of this situation, you need to be aware of Von Neumann architecture, http://en.wikipedia.org/wiki/Von_Neumann_architecture[^], this architecture, in turn, implements the Universal Turing machine, http://en.wikipedia.org/wiki/Universal_Turing_machine[^].

Von Neumann architecture goes back to 40th, when the principles of isolation of code and data were recognized and used as a solid fundamental base for all real-life architectures implemented later. One of the purposes of resources embedded in the executable files was making them unmodifiable by putting them under the same umbrella as the code. Violation of these principles always leads to some dead end, at best.

—SA


There is the "simple" way and the hard way. Basically, you create a resource then modify it at runtime, creating a new EXE in the process.


这篇关于更改exe文件中的值并将其保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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