我已经给客户一个古老的不支持的第三方供应商代码在jar文件中,我试图对其进行逆向工程,所以我重新实现了与用于连接服务器的协议相同的协议。
我已经对它进行了反编译,其中一个类似乎在其中有标签和goto语句。我的编译器在这方面引发了一个棘手的问题,因为据我了解,goto在Java中不受支持。
由于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;任何协助解释这将是最高度赞赏。