Compile, anti-compilation, anti-reflective

xiaoxiao2021-03-06  39

The "pirated" behavior is staged every day, so the "anti-piracy" activity initiated by the BSA (Commercial Software Alliance) and the Department of Legal this year, so that everyone's wind is so good. However, even under such a stunned atmosphere, the "anti-anti-piracy" activity of the college students is also vibrating the word, and the media layout is talented. There is "piracy", there is "anti-piracy"; "anti-piracy", there is "anti-anti-piracy", this world is such a thing.

The same reason, "Compile", "Decompile"; "anti-compilation", "anti-compile". It is especially obvious for the intermediate code of Java and .NET this virtual machine.

The result after the Java program is Java Bytecode, and the result after .NET compiles is CIL (Common Intermediate Language), both of which have the following features:

Similar to the Stack-Based instruction set.

The same is a high-order item leading to machine language.

Not related to the platform.

Code Validation

Symbolic Link

All of the above features can make the process become easier to compile, all five points are not. So it is quite easy to compile Java and .NET. On the Internet, Java's anti-compiler (Decompiler) can be passed, and the compiled file can be revealed in the original code. I believe that. Net will also encounter the same problem. (At least, I am trying to write a .NET Decompiler.)

Imagine if you handed a hard-working Java and .net to others (Cai Xueqi?), He can launch the original code through the anti-compiler, and your wisdom property is likely to be violated.

Want to protect yourself, you must perform anti-reflector before shipping in Java or .NET software, this action is often referred to as an obfuscate. The confusing program is still in accordance with the original file format and instruction set, so it is still possible, and the execution result is also the same as if confused. It is just a confusing program code to become more chaotic, and it is not easy to be anti-compilation.

Some Java development tools (such as JBuilder) have an inner attachment (Obfuscator), or you can also purchase more powerful obfuscors. These commercial obfuscors usually only do three things:

Organize each Method in a messy manner.

Symbolic Data can eliminate the Java Constant Pool, or .NET Metadata (for example, the name of the Private Method).

Remove all DEBUG information (such as Java LocalVariaBleTable with Linenumbertable).

The role of Obfuscator If only the above general, only Method is partially role, the effect is not large. To increase the difficulty of anti-compilation, you must match the following ways:

Confusion within the Class: Confused the Method within the Class.

Confusion between Class: Confused the relationship between Class, such as incorporating or disassembling parent categories and subcategories.

There are some academic papers to study the above two points, but the results are still not large, and must be manually adjusted and cannot be automatically processed by the software. This is worth investing more in-depth research. Confused prices will encounter the following problems:

Usually the efficiency will deteriorate.

May not be executed. I have encountered such a situation, it is possible to be the fault of the obfuscator, and it is possible to be a JVM fault.

If you do "confusion between Class", it is very inadvertent, it is likely to be unable to execute. For example: If you use it in the Java, you are useful in instanceof, or if you are useful in the C # program, you must be careful about "confusion between Class", otherwise the consequences are unimaginable.

There are two levels of confusion:

The procedure cannot be automatically contracted: For example, some special jumps (GOTO), the relationship between the Block is unable to find specific Pattern.

The procedure is even if it is successful, it is not easy to compile, and it is not easy to read the compile.

Obfuscator is not Wanling Dan. If you have met a proficient in Obfuscating technology, it will fall into his hand with a Profiling tool, the original code. So, when using Obfuscator, you have to have this psychological preparation: "Anti-gentleness, may wish to be small; anti-stunning, no smart people". Place the software in Server to provide Service without selling software to the customer, this is the policy.

转载请注明原文地址:https://www.9cbs.com/read-73256.html

New Post(0)