JJams_King: 扰乱器就是把 bytecode 中的类名,方法名,变量名等变成无意义的符号。
例如,以下源程序:
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);
}
}
}
加扰后,再反编译出来是:
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);
}
}
而更高级的扰乱器,还能加密字符常量和扰乱程序流。加扰后,再反编译后变成这样:
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 42 else
26;
System.out.println(a);
if (!c) goto 52 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
}
}
你想破译其中的思路可就难了
以上资料摘自:http://www.zelix.com/klassmaster/