我试图在反编译后对一些 Java .class 文件进行去混淆处理,并且我遇到了一部分代码,它以我认为无法使用的方式使用标签。我不知道这是否是反编译器误解标签的错误,或者代码是否故意以这种方式混淆。换句话说,标签可以在Java字节码中这样使用吗?
请注意,标签出现在相关的 break 语句之后,而不是之前。它几乎似乎将它们用作 goto,而不是用于退出循环的标签。也根本没有循环,所以我对它们应该如何在这里使用感到有点困惑。
这里发生了什么?我在评论中标记了 3 个标签 (###)
if (i != 96)
{
if ((i ^ 0xFFFFFFFF) != -98)
{
if (i == 98)
break label417; // ### Here are the three breaks... The relevant labels appear later in the code
if (i != 99)
break label540;
if (!bool)
break label461;
}
}
else
{
if (localwb == this.localWB5)
{
if (this.localWB4 != null) {
this.localWB4.a((byte)-92, this);
if (!bool);
}
else
{
this.localWB6.a((byte)-9, this);
}
return true;
}
if (localwb == this.localWB4)
{
this.localWB6.a((byte)-59, this);
return true;
}
if (this.localWB3 != localwb)
break label540;
this.localWB2.a((byte)-38, this);
return true;
}
if (this.localWB6 == localwb)
{
if (this.localWB4 != null) {
this.localWB4.a((byte)-122, this);
if (!bool);
}
else {
this.localWB5.a((byte)-63, this);
}
return true;
}
if (this.localWB4 == localwb)
{
this.localWB5.a((byte)-22, this);
return true;
}
if ((this.localWB2 == localwb) && (this.localWB3.M))
{
this.localWB3.a((byte)-84, this);
return true;
label417: // ### The first label. Note how this next if-statement has inaccessible code... if the above if-statement is true, it would have already returned true; However, the label appears after the return statement, almost as if the label is being used as a goto.
if (localwb == this.localWB2)
{
this.localWB6.a((byte)-86, this);
return true;
}
if (this.localWB3 == localwb)
{
this.localWB5.a((byte)-31, this);
return true;
label461: // ### The second label
if ((this.localWB6 == localwb) || (this.localWB4 == localwb))
{
this.localWB2.a((byte)-60, this);
return true;
}
if (localwb == this.localWB5)
{
if (this.localWB3.M)
{
this.localWB3.a((byte)-44, this);
if (!bool);
}
else {
this.localWB2.a((byte)-9, this);
}
return true;
}
}
}
label540: // ### The final label.