在不破坏exe的情况下将代码添加到exe?需要帮助! [英] Adding code to an exe without breaking the exe? Help Needed!

查看:59
本文介绍了在不破坏exe的情况下将代码添加到exe?需要帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.exe文件,其中包含以下代码...

MH1 FH1 BF1 SWT KID

我想在不破坏.exe
的情况下将PT1添加到此列表中 它应该看起来像这样.

MH1 FH1 BF1 PT1 SWT KID

有人告诉我,如果没有逆向工程方面的广泛知识,就无法做到.

还有人告诉我,使用DLL注入可以做到这一点.

任何建议都会有所帮助.

CC

附加信息:

1.我已尝试在exe中添加"PT1",并且该exe不再可执行..我对该领域不了解,如何在不破坏exe的情况下添加此代码行的任何建议将不胜感激.

2.关于我应该怎么做的任何建议?该应用程序是一个非常古老的游戏.我没有源代码.我们试图从vivendi游戏中获取源代码,他们表示找不到该源代码,也没有指派一个团队来找到它.我不知道反编译的第一步.我可以发布指向.exe的链接,以查看此处是否有人愿意尝试一下,它只有2.76 mb.如果您需要有关该游戏的更多信息,我很乐意将其发布,以便您可以对其进行一些研究.

3.由于我们对源代码的许多要求,Vivendi游戏非常了解我们的复兴游戏的项目.进行诸如高多边形字符,新的UI菜单,可以玩游戏的不同分辨率之类的改进.到目前为止,这些分辨率已经完成,很容易在EXE中进行修改.正在创建新的Hi poly字符.

4."SWT BG1 BG2 BG3 MH1 MH2 FH1 FH2 BF1 KID PRH TAC"是指游戏中的角色类别类型.例如:"BG1"指的是角色类坏家伙1".这些角色类类型是区分游戏.res文件中的Dialog和Animation文件的前缀.我们想添加一个新的字符类类型,称为"PT1".到目前为止,如果我要添加PT1代替KID代码,那么我们的新角色类就可以使用了.

5.我不知道这款游戏用什么语言编写.有没有办法找出这款游戏用什么语言编写?
您可以在我的网站http://www.mariachimaestro.com/Swat3/Utilities/Files/TGOTY_21_NOCD_PATCH.zip

I have an .exe file that has the following code...

MH1 FH1 BF1 SWT KID

I want to add PT1 in this list without breaking the .exe
It should look like this.

MH1 FH1 BF1 PT1 SWT KID

Someone told me that without extensive knowledge in reverse engineering this can''t be done.

Also someone told me that using DLL injection could do this.

Any suggestions would be helpful.

CC

Additional Information:

1. I have tried to add the "PT1" in the exe and the exe is no longer executable.. I have no knowledge in this field any suggestions as to how to add this line of code without breaking the exe would be greatly appreciated.

2. Any advice as to what I should do? This application is a very old game. I do not have the Source code. We have tried to request the source code from vivendi games and they stated they cannot find it, nor assign a team to locate it. I don''t know the first steps in decompiling it. I could post a link to the .exe to see if anyone here would like to give it a try, It''s only 2.76 mb. If you need more information about the game I would gladly post it so you can do some research on it.

3. Vivendi games is very well aware of our project to revive the game because of our many requests for the source code. Making improvments such as high poly characters, new UI menus, different resolutions that the game can be played in. Soo far the resolutions are finished they were very easy to modify in the EXE. New Hi poly characters are being created.

4."SWT BG1 BG2 BG3 MH1 MH2 FH1 FH2 BF1 KID PRH TAC" refers to the Character class types in the game. For Example: "BG1" refers to the Character class "Bad Guy 1". These Character Class types are the prefixes that distinguish Dialog and Animation files within the games .res files. We would like to add a new Character Class type called "PT1". Thus far, if I was to add the PT1 in place of the KID code, our new character class works.

5. I don''t know what language this game was written in. Is there a way to find out what language this game was written in?
You can find the file here on my website http://www.mariachimaestro.com/Swat3/Utilities/Files/TGOTY_21_NOCD_PATCH.zip

推荐答案

1和4中找到该文件.快速看了看可执行文件.抱歉,但是实际上来说,您无法使用此游戏进行操作,因为该列表中的每个字符串都是单独引用的,并且在代码中似乎具有其自己的关联类或对象.这就是为什么替换该列表中的字符串而不能添加的原因.您必须向程序中添加大量代码以支持任何新的字符类.修改一点代码和一堆外部数据(例如字符模型)是一回事.对项目进行广泛的逆向工程(假设您拥有Vivendi的许可),并添加大量代码是另一回事.

2&3.我建议您集中精力处理图形和兼容性更新.仅当有可使用的Mod定义接口时,才添加字符类之类的新功能.

5.代码是C ++,很可能是用Microsoft Visual C ++ 2005编写的.
1 & 4. I took at quick look at the executable. Sorry, but practically speaking what you want to do is not possible with this game because each string in that list is referenced individually and appears to have its own associated class or object in the code. This is why replacing strings in that list works, but adding does not. You would have to add a large amount of code to the program to support any new character class. Modifying a little bit of the code and a bunch of external data like character models is one thing. Doing an extensive reverse engineering of the project (assuming you have Vivendi''s permission) and adding a significant amount of code is another.

2 & 3. I''d suggest concentrating more on your graphics and compatibility updates. Only add new features like character classes if there is a defined interface for mods that you can use.

5. The code is C++ and most likely written in Microsoft Visual C++ 2005.


好-您一直在问错问题.您将帖子标记为C#,但几乎可以肯定该游戏是用C ++编写的.在这种情况下,您基本上就被搞砸了.编译后的程序将通过跳转到内存地址来代替函数调用之类的东西.插入数据,移动所有这些地址,这就是程序中断的原因.我建议,如果您用PT1替换KID,然后负责绘制KID,那是您最好的选择,除非您想购买一个可以反编译C ++的昂贵程序(然后它不会创建CID)易懂的代码(由C#反编译创建)).
OK - you''ve been asking the wrong question. You marked your post as C#, but this game was almost certainly written in C++. That being the case, you''re basically screwed. A compiled program will replace things like function calls with jumps to memory addresses. Inserting your data, moves all those addresses, which is why your program breaks. I would suggest that if you replace KID with PT1, and then take responsibility for drawing a KID, that is your best bet, unless you want to buy an expensive program that can decompile C++ ( and then it won''t create the sort of legible code that decompiling C# creates ).


有人告诉我"-谁?做研究总是比只相信随机的人更好.逆向工程.NET代码仅意味着通过Reflektor运行它,并使其保存代码以供您重新编译. DLL注入-听起来很荒谬.
"someone told me" - who ? It''s always better to do research than to just believe random people. Reverse engineering .NET code just means running it through Reflektor and getting it to save the code for you to recompile. DLL injection - that just sounds ridiculous.


这篇关于在不破坏exe的情况下将代码添加到exe?需要帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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