对思网 > 杂谈 > 正文

​什么是反编译?

2024-12-07 20:18 来源:对思网 点击:

什么是反编译?

反编译

反编译是将可执行的(准备运行的)程序代码(也称为目标代码)转换为某种形式的高级编程语言,使其具有更易读的格式。反编译是一种逆向工程,它的作用与编译器的作用相反。它与编译相反。完成此任务的工具称为反编译器。反编译有许多不同的原因,例如理解程序、恢复源代码以进行存档或更新、查找病毒、调试程序和翻译过时的代码。完全自动化的反编译是不可能的。没有反编译器可以获得开发人员编写的确切源代码。

反编译有时被不道德地用于复制源代码以在未经版权所有者许可的情况下重复使用或改编。反编译 APK 文件并不是一项非常艰巨的任务。它需要将 dex 文件转换为 jar 文件,然后将这些 jar 文件转换为 java 源代码,从而获取应用程序源代码。可以通过保护性手段(例如代码复杂性和混淆)将程序设计为抗反编译。这包括反调试技术、限制调试器、跟踪检查、优化和剥离二进制文件。

Decompile

To decompile is to convert executable (ready-to-run) program code (also called object code) into some form of higher-level programming language so that it has a more readable format. Decompilation is a type of reverse engineering that does the opposite of what a compiler does. It is the inverse of compilation. The tool that accomplishes this is called a decompiler. There are a number of different reasons for decompilation, such as understanding a program, recovering the source code for purposes of archiving or updating, finding viruses, debugging programs, and translating obsolete code. It is not possible to have a fully automated decompilation. No decompiler can get the exact source code that the developer wrote.

Decompilation is sometimes used unethically to reproduce source code for reuse or adaptation without permission of the copyright holder. Decompiling an APK file is not a very hard task to do. It requires transforming dex files to jar files and then those jar files to java source code, thereby fetching the app source code. Programs can be designed to be resistant to decompilation through protective means, such as code complexity and obfuscation. This includes, anti-debug techniques, restricting debuggers, trace checking, optimizations, and stripping binaries.