windows 如何编辑或查看 dll 文件的源代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30534554/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to edit or see the source code for dll files
提问by Stefan Madlo
I have a DLL file for old game(age of empires) I just want to edit that file or see the source code. I tried reflector toll and some others, but without any result
我有一个旧游戏(帝国时代)的 DLL 文件,我只想编辑该文件或查看源代码。我试过反射器收费和其他一些,但没有任何结果
so, 1- how can I edit or see that DLL file??
2- can I know In what language that file was written?
所以,1-我如何编辑或查看该 DLL 文件?
2- 我可以知道该文件是用什么语言编写的吗?
采纳答案by CristiFati
It's sort of difficult. I mean you can look at the file with a hex editor, but it's not going to look nice. However, you can use 3rdparty tools in order to get as much info you can about the .dll:
Dependency Walker- useful to get the .dlls that your .dlldepends on (and the functions that it need from there), exported functions, ...
PE Explorer- a nice tool (I'm not saying it's the best) that lists lots of info about the dll (sections, resources, ...) and it also has a disassembler (this reverse engineers the .dlland displays it in the form of assembly code). If you understand the assembly code you can then modify it (by modifying the corresponding bytes in your .dll), but that's for experts only. The problem is that it only handles 32bit(x86) .dlls, and the latest version is from 2009 :(
Most likely it was written in C. The tools I listed can tell you more. You can also look with a hex editor at the .dll, inside it there might be references to source files
这有点困难。我的意思是你可以用十六进制编辑器查看文件,但它看起来不太好。但是,你可以使用3度党的工具,以获得尽可能多的信息,你可以对.dll文件:
的Dependency Walker-有用得到的.dlls表示您的.dll依赖于(而且它从那里需要的功能),导出的函数,...
PE Explorer- 一个很好的工具(我不是说它是最好的),它列出了很多关于 dll 的信息(部分,资源,...),它还有一个反汇编器(这个对.dll 进行逆向工程并将其显示在汇编代码的形式)。如果您了解汇编代码,则可以对其进行修改(通过修改.dll 中的相应字节),但这仅供专家使用。问题是它只处理32 位( x86) .dlls,最新版本是 2009 年:(
它很可能是用C编写的。我列出的工具可以告诉你更多。您还可以使用十六进制编辑器查看.dll,其中可能包含对源文件的引用
If the .dllhas dependencies in form of msvcr###(d).dll(#sign is a placeholder for a digit) or vcruntime###(d).dll, then it's C, if it also has msvcp###(d).dll, then it's C++(created with VStudio).
如果.dll具有msvcr###(d).dll(#符号是数字的占位符)或vcruntime###(d).dll 形式的依赖项,则它是C,如果它还具有msvcp## #(d).dll,那么它是C++(用VStudio创建)。