我已经在客户的jar文件中给了一些古老的不受支持的第三方供应商代码,我正在尝试对其进行逆向工程,因此我重新实现了用于连接服务器的相同协议.
我已经反编译了它,其中一个类似乎有标签和goto语句.我的编译器在这方面投入了大量的东西,因为我理解它在Java中不支持goto.
由于IP问题,我无法发布所有代码,但这里是它的要点(我已将编译器错误放在注释中):
private void methodName(InputType input)
throws ConfigurationException
{
// initialization code here
_L2:
String x; // The compiler is complaining that "String cannot be resolved to a variable" here
String y; // This line is fine though...
// Some Code here
x = // Compiler complains about "x cannot be resolved to a variable"
y = // Compiler is fine with this.
// Some more code
if(true) goto _L2; else goto _L1 // Multiple issues here see following lines.
// Syntax error on token "goto", throw expected
// _L2 cannot be resolved to a variable
// Syntax error on token "goto", { expected
// Syntax error on token "goto", { expected
_L1: // Syntax error on token "goto", { expected
local; // local cannot be resolved to a variable
// Some more code
JVM INSTR ret 12; // Multiple issues here see following lines.
// JVM INSTR ret 12;
// Syntax error on token "ret", = expected
return;
}
我知道冒号后面的行是标签,但我不明白这里出了什么问题.
带goto的行正在测试为true所以我可以删除标签,因为它们在这里无关紧要,但我不明白这条线的含义:
local;
或这个:
JVM INSTR ret 12;
任何解释这一点的协助都将非常受欢迎.