3 回答

TA貢獻1780條經驗 獲得超5個贊
一般情況下Java應用的開發者為了保護代碼不被別人抄襲,在生成class文件的時候都java文件進行了混淆,這種class文件用反編譯工具得到的結果很難看懂,并且不能進行編譯。本文從研究的角度,淺析如何讀懂這種反編譯過來的文件。
例子一:賦值
反編譯過來的代碼如下:
Node node;
Node node1 = _$3.getChildNodes().item(0);
node1;
node1;
JVM INSTR swap ;
node;
getChildNodes();
0;
item();
getChildNodes();
0;
item();
getNodeValue();
String s;
s;
原始語句:
Node node;
Node node1 = currDocument.getChildNodes().item(0);
node = node1;
String s = node.getChildNodes().item(0).getChildNodes().item(0).getNodeValue();
注解:
JVM INSTR swap ; //賦值語句
練習:
String s1;
String s8 = node.getChildNodes().item(1).getChildNodes().item(0).getNodeValue();
s8;
s8;
JVM INSTR swap ;
s1;
10;
Integer.parseInt();
int i;
i;
例子二:不帶參數創建對象
反編譯過來的代碼如下:
JVM INSTR new #244 <Class CrossTable>;
JVM INSTR dup ;
JVM INSTR swap ;
CrossTable();
CrossTable crosstable;
crosstable;
原始語句:
CrossTable crosstable = new CrossTable();
注解:
練習:
JVM INSTR new #246 <Class Database>;
JVM INSTR dup ;
JVM INSTR swap ;
Database();
Object obj;
obj;
例子三:帶參數創建對象
反編譯過來的代碼如下:
JVM INSTR new #262 <Class StringBuffer>;
JVM INSTR dup ;
JVM INSTR swap ;
String.valueOf(s2);
StringBuffer();
s.substring(j, i);
append();
s6;
append();
toString();
s2;
原始語句:
s2 = (new StringBuffer(String.valueOf(s2))).append(s.substring(j, i)).append(s6).toString();
注解:
此語句實際上是:s2 += s.substring(j, i) + s6;
練習:
例子四:for循環
反編譯過來的代碼如下:
int k = 0;
goto _L4
_L8:
...
k++;
_L4:
if(k < as.length) goto _L8; else goto _L7
原始語句:
for(int k=0;k < as.length;k++)
{
...
}
注解:
例子五:while循環
反編譯過來的代碼如下:
String s1 = "";
goto _L1
_L3:
JVM INSTR new #262 <Class StringBuffer>;
JVM INSTR dup ;
JVM INSTR swap ;
String.valueOf(s1);
StringBuffer();
_$2(resultset, s, l);
append();
toString();
s1;
_L1:
if(resultset.next()) goto _L3; else goto _L2
原始語句:
String s1 = "";
while(resultset.next())
{
s1 = s1 + resultSetToString(resultset, s, l);
}
/* break MISSING_BLOCK_LABEL_209;
JVM INSTR dup ;
Object obj;
obj;
toString();
JVM INSTR pop ;
flag = true;
break MISSING_BLOCK_LABEL_209;
JVM INSTR dup ;
obj;
printStackTrace();
((Throwable) (obj)).toString();
flag = true;
break MISSING_BLOCK_LABEL_209;
JVM INSTR dup ;
obj;
toString();
JVM INSTR pop ;
flag = true;
break MISSING_BLOCK_LABEL_209;
JVM INSTR dup ;
obj;
toString();
JVM INSTR pop ;
flag = true;
break MISSING_BLOCK_LABEL_209;
JVM INSTR dup ;
obj;
toString();
JVM INSTR pop ;
flag = true;*/

TA貢獻1829條經驗 獲得超7個贊
不會! if ((l3 = (System.currentTimeMillis() - l2) + 10L) < 62L)
try
{
Thread.sleep(62L - l3);
}
catch (Exception )
} while (true);
if (a_byte == 1)
b();
a_Bobby.notifyDestroyed();
}
private final void d()
{
byte abyte0[] = a();
boolean flag = false;
String s1 = "BC5Data";
a a1 = this;
try
{
RecordStore recordstore;
(recordstore = RecordStore.openRecordStore(s1, false)).setRecord(1, abyte0, 0, abyte0.length);
recordstore.closeRecordStore();
return;
}
catch (Exception )
try
{
RecordStore.deleteRecordStore(s1);
}
catch (Exception )
······
看到了吧~這就是格式!匯編語言!??!
編譯連接之后,再用txt打開~就只能看到亂碼啦。
添加回答
舉報