修改EXE文件 [英] Modify EXE file

查看:129
本文介绍了修改EXE文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不好意思,我是VB的初学者,有个问题.
是否可以编译一个EXE文件,该文件在第一次运行时会在某个位置(在HD上,而不是在内存中)对其自身进行修改? (例如,将正在运行的PC的CPU ID放在某处?).

目前,我必须解决的第一个问题是,如果我的程序try.exe包含代码

Excuse me, I''m a beginner in VB and have a question.
Is it possible to compile an EXE file which, at first run, modifies itself (on HD, not in memory) in some location? (for example to put somewhere CPU ID of running PC ?).

At the moment the first problem I must solve is that if my program try.exe contain the code

Open App.Path & "\try.exe" For Binary Access Write As FreeFile()


我收到错误消息:运行时错误"70":权限被拒绝
我该如何解决这个问题?

事实是我要修改的exe文件正在运行.如果我在读取模式下打开它,但不在写入模式下打开它,就可以了.

对于克里斯蒂安·格劳斯(Christian Graus):这不是另一个问题,而是同一个问题.当然,我是PC的管理员,并且是XP上的管理员.


I get the Error message: Run-time error-‘70’: Permission denied
How can I solve the question?

The fact is that the exe file I''m trying to modify is the same which is running. It''s OK if i open it in Read mode but not in Write mode.

For Christian Graus: It''s not another question, it''s the same question. Of course I''m Admin of my PC and I''m on XP

推荐答案

是的,有可能(并且执行该exe很有可能使防病毒软件崩溃(如果有的话).


顺便说一句,桑德罗会选择卢卡"昵称来欺骗敌人吗?
:)
Yes, it is possible (and doing it, the exe has good chances to upset the antivirus, if any).


BTW Does Sandro choose ''luca'' nick to fool the enemy?
:)


感谢CPallini,请问我在哪里可以找到一段代码?


我叫卢卡(Luca),我签下了桑德罗(Sandro)来愚弄敌人:-O
Thanks CPallini, and where can have I a piece of code, please?


My name is Luca and i signed Sandro to fool the enemy :-O


除非您非常清楚PE的格式,否则这是非常危险的事情文件.看看(通过Google)描述此类文件内容的文档,然后看看您是否能找到解决方法.但是,如果您的程序开始以奇怪的方式运行,请不要感到惊讶.
更为明智的解决方案是在运行时从OS获取系统信息.
A very dangerous thing to do unless you are very clear about the format of a PE file. Take a look (via Google) at the documents describing the content of such a file and then see if you can figure out how to do it. But don''t be surprised if your program starts to behave in strange ways.
A much more sensible solution is to get the system information at run time from the OS.


这篇关于修改EXE文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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