About disrupting and decompile (reprint)

Source: Internet
Author: User
Tags expression goto string
Compile the following excerpt from the Dr.yysun answer in Delphibbs and hope it will help you

People who are programming with Java, if they do not want to expose the source program, have to fight against the compiler,
You must use the counter compiler to see how others will look at your program, and then look at the effect of the obfuscators (the disturbing device).

JAD is an excellent counter compiler for Windows http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
Around this engine, there are many graphical interfaces, such as Frontend. (I often use)

JODE is a free Java counter compiler and optimizer.
http://jode.sourceforge.net/

Intr@byte is a JBuilder plug-in tool (Opentool) that allows you to open *.class in JB
http://www.webappcabaret.com/bjb/index.jsp
It also uses the JAD engine and is limited to the definition part of the compiler class only.

Some websites can help you decompile, you give a URL, it analyzes how many applets there are,
Then, decompile it again. http://www.jreveal.org/

Finally, you want to understand the principle of decompile, you want to build a counter compiler and a disturbance, here is a free book.
Http://www.riis.com/depile.html

Other to Yahoo to find it, too much.

Jjams_king: The bytecode is to turn the class name, method name, variable name and so on into meaningless symbols.
For example, the following source program:
Package temp;
public class HelloWorld {
String HelloWorld = "Hello World";
String Byeworld = "Bye World";
public static void Main (string[] args) {
New HelloWorld (TRUE);
New HelloWorld (FALSE);
}
HelloWorld (Boolean ishappy) {
if (ishappy) {
System.out.println (HelloWorld);
}
else {
System.out.println (Byeworld);
}
}
}
After the scrambling, and then back to compile is:
Package A;
Import Java.io.PrintStream;
public Class A
{
String A;
String b;
A (Boolean flag)
{
A = "Hello world";
b = "Bye world";
if (flag)
System.out.println (a);
Else
System.out.println (b);
}
public static void Main (String astring[])
{
New A (true);
New A (false);
}
}

A more advanced spoiler can also encrypt character constants and disrupt the flow of programs. After the scrambling, and then back to compile to become like this:
Package A;
Import Java.io.PrintStream;
public Class A
{
String A;
String b;
public static Boolean C;
A (Boolean flag)
{
A = A ("q\0041\033/\03162\005,]");
b = A ("{\0308w\027v\0231\023");
if (!flag) goto 26 Else;
System.out.println (a);
if (!c) goto/Else 42;
System.out.println (b);
}

public static void Main (String astring[])
{
New A (1);
New A (0);
}

private static string A (string string)
{
Char ach[];
int i;
Int J;
int k;
Ach = String.tochararray ();
i = ach.length;
j = 0;
k = 0;
Expression 57
Expression ach
Expression J
Expression 97
Expression ach
Expression J
Expression 93
Expression ach
Expression J
Expression 119
Expression ach
Expression J
Expression 64
Expression ach
Expression J
DUP 2 over 1
Push []
^
Pop []
j + +;
k++;
if (i = = j)
return new String (ACH);
Expression K
Switch
Case 1:goto 21
Case 2:goto 29
Case 3:goto 37
Case 4:goto 45
Case 5:goto 10
Default:goto 54
}
}
It's hard for you to decipher the idea:)

The above information is excerpted from: http://www.zelix.com/klassmaster/




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.