|
|
@ -46,24 +46,12 @@ public class CodeAnalyzer implements Analyzer { |
|
|
|
LocalVariableTable lvt; |
|
|
|
LocalVariableTable lvt; |
|
|
|
|
|
|
|
|
|
|
|
public CodeAnalyzer(MethodAnalyzer ma, MethodInfo minfo, |
|
|
|
public CodeAnalyzer(MethodAnalyzer ma, MethodInfo minfo, |
|
|
|
AttributeInfo codeattr, ImportHandler i) |
|
|
|
ImportHandler i) |
|
|
|
{ |
|
|
|
{ |
|
|
|
method = ma; |
|
|
|
method = ma; |
|
|
|
imports = i; |
|
|
|
imports = i; |
|
|
|
DataInputStream stream = new DataInputStream |
|
|
|
code = minfo.getBytecode(); |
|
|
|
(new ByteArrayInputStream(codeattr.getContents())); |
|
|
|
CodeVerifier verifier = new CodeVerifier(getClazz(), minfo, code); |
|
|
|
|
|
|
|
|
|
|
|
ConstantPool cpool = ma.classAnalyzer.getConstantPool(); |
|
|
|
|
|
|
|
code = new BytecodeInfo(); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
code.read(cpool, stream); |
|
|
|
|
|
|
|
} catch (IOException ex) { |
|
|
|
|
|
|
|
ex.printStackTrace(Decompiler.err); |
|
|
|
|
|
|
|
code = null; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CodeVerifier verifier |
|
|
|
|
|
|
|
= new CodeVerifier(getClazz(), minfo, code); |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
verifier.verify(); |
|
|
|
verifier.verify(); |
|
|
|
} catch (VerifyException ex) { |
|
|
|
} catch (VerifyException ex) { |
|
|
@ -72,12 +60,10 @@ public class CodeAnalyzer implements Analyzer { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (Decompiler.useLVT) { |
|
|
|
if (Decompiler.useLVT) { |
|
|
|
AttributeInfo attr = code.findAttribute("LocalVariableTable"); |
|
|
|
LocalVariableInfo[] localvars = code.getLocalVariableTable(); |
|
|
|
if (attr != null) { |
|
|
|
if (localvars != null) |
|
|
|
if (Decompiler.showLVT) |
|
|
|
lvt = new LocalVariableTable(code.getMaxLocals(), |
|
|
|
Decompiler.err.println("Method: "+ma.getName()); |
|
|
|
localvars); |
|
|
|
lvt = new LocalVariableTable(code.getMaxLocals(), cpool, attr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
initParams(); |
|
|
|
initParams(); |
|
|
|
} |
|
|
|
} |
|
|
@ -236,6 +222,7 @@ public class CodeAnalyzer implements Analyzer { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
methodHeader.makeDeclaration(new jode.flow.VariableSet(param)); |
|
|
|
methodHeader.makeDeclaration(new jode.flow.VariableSet(param)); |
|
|
|
|
|
|
|
methodHeader.simplify(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void dumpSource(TabbedPrintWriter writer) |
|
|
|
public void dumpSource(TabbedPrintWriter writer) |
|
|
|