我已经给出了一些古老的不受支持的第三方供应商代码在客户的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 = <SOME VALUE> // Compiler complains about "x cannot be resolved to a variable"
y = <ANOTHER VALUE> // 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;
}
据我所知,线跟随冒号是标签,但我不明白这里出了什么问题。
与转到该行正在测试用于真正,所以我可以只是删除标签,因为它们是这里无关紧要,但我不明白这是什么行表示:
local;
还是这个:
JVM INSTR ret 12;
任何解释此协议的援助将不胜感激。
如果您的反编译器声称将JVM字节码转换为Java,但它输出的代码不是有效的Java,那么这不是您的反编译器中的错误吗? – Raedwald
挑剔的注意事项:注意逆向工程第三方供应商代码 - 甚至发布它 - 它可能不被供应商允许:/ – Christian
我认为我尽可能混淆了代码... –