逆向工程 C++ DLL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/623475/
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
Reverse engineer C++ DLL
提问by Bender
I have a small utility that was originally written in VS2005.
我有一个最初用 VS2005 编写的小实用程序。
I need to make a small change, but the source code for one of the dlls has been lost somewhere.
我需要做一个小改动,但其中一个 dll 的源代码在某处丢失了。
Is there a free or reasonably priced tool to reverse engineer the dll back to C++ code.
是否有免费或价格合理的工具可以将 dll 反向工程回 C++ 代码。
回答by Jonas Gulle
Hex-Rays decompileris a great tool, but the code will be quite hard to read and you will have to spend a lot of time to reverse engineer the whole DLL.
Hex-Rays 反编译器是一个很好的工具,但是代码很难阅读,你将不得不花费大量时间对整个 DLL 进行逆向工程。
回答by abhilash
You might also want to have a look at OllyDbgwhich is a 32-bit assembler level analysing debugger. It is used to analyze binary code in scenarios where you do not have a source code. It is light weight debugger. OllyDbgis a shareware so you can download & use it for free..!!
您可能还想看看OllyDbg,它是一个 32 位汇编程序级分析调试器。它用于在您没有源代码的情况下分析二进制代码。它是轻量级调试器。OllyDbg是一个共享软件,所以你可以免费下载和使用它..!!
Visit OllyDbg is home page here
访问 OllyDbg 是这里的主页
PS:Back in the day crackers used SoftICEfrom NuMega for debugging into an executable & grab a snapshot at the values of registers. SoftICE was an advanced debugger. It was definitely the favorite tool for the crackers. I don't know about the present status of the product. NuMega's site had no information about it. I may have overlooked it but I could not find it. I recommend that you get your hands on a legacy version (4.0x) of SoftICE & apply the WindowsXP patch for SoftICE. Working with SoftICE is something of an "experience".
PS:过去,破解者使用NuMega 的SoftICE调试到可执行文件中并抓取寄存器值的快照。SoftICE 是一个高级调试器。这绝对是饼干们最喜欢的工具。我不知道产品的现状。NuMega 的网站没有关于它的信息。我可能忽略了它,但我找不到它。我建议您使用旧版 (4.0x) SoftICE 并为 SoftICE 应用 WindowsXP 补丁。使用 SoftICE 是一种“体验”。
Further Read:Reversing: Secrets of Reverse Engineering by Eldad Eilam
进一步阅读:逆向:逆向工程的秘密Eldad Eilam
回答by Dani van der Meer
I don't know the exact situation you have, and how much the functionality the DLL implements for your application. But I would argue that in most cases it would be better to rewrite the missing DLL based on the known functionality.
我不知道您的确切情况,以及 DLL 为您的应用程序实现了多少功能。但我认为,在大多数情况下,根据已知功能重写丢失的 DLL 会更好。
This is especially true if you have some documentation for it.
如果您有一些文档,则尤其如此。
Trying to reverse engineer the binary code to assembler, then to C++ and then try to modify it to provide the existing functionality will be in most cases to time consuming, and maybe even impossible.
尝试将二进制代码逆向工程到汇编器,然后到 C++,然后尝试修改它以提供现有功能在大多数情况下会非常耗时,甚至可能是不可能的。
回答by Anders Hansson
A little depending on your situation I would keep the legacy/binary DLL as-is and write a wrapper DLL that will change and/or add any additional behavior.
有点取决于您的情况,我会保持旧版/二进制 DLL 原样,并编写一个包装 DLL 来更改和/或添加任何其他行为。
The idea is to aggregate the old functionality in a new DLL which imports the old one.
这个想法是在一个新的 DLL 中聚合旧功能,该 DLL 导入旧功能。
回答by schnaader
If your small change is to edit some text or to skip some routines, you could use a hex editor or a disassembler, but you won't be able to see the original C++ code, and even if you find a tool that turns the DLL back into code, all the variable names would be gone and it would be a big mess.
如果你的小改动是编辑一些文本或跳过一些例程,你可以使用十六进制编辑器或反汇编器,但你将无法看到原始的 C++ 代码,即使你找到一个工具来转换 DLL回到代码中,所有变量名都将消失,这将是一团糟。
回答by Frank
You have to do it like game and app crackers do: Use a disassembler and hack the Assembler code.
你必须像游戏和应用程序破解者那样做:使用反汇编程序并破解汇编程序代码。
回答by Peter
You cant turn meat back to a animal and even if you could you would have a dead animal :P
你不能把肉变回动物,即使可以,你也会有一只死动物:P
回答by Peter
IF it was done in .NET then why not use the dotNet Reflector.
如果它是在 .NET 中完成的,那么为什么不使用 dotNet Reflector。