Asmtools should be able to process corrupted binaries as much as possible.
jdis cannot print the complete output if the class file contains lookupswitch, wide, or tableswitch instructions with an incorrect structure, and it does not provide details about the structural issue:
>jdis lookupswitch00301m11n.class
package javasoft/sqe/tests/vm/instr/lookupswitch/lookupswitch003/lookupswitch00301m1;
public class lookupswitch00301m11n version 45:3
{
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
jdis - ERROR: Fatal exception in file: lookupswitch00301m11n.class
Expected output should be:
jdis lookupswitch00301m11n.class
package javasoft/sqe/tests/vm/instr/lookupswitch/lookupswitch003/lookupswitch00301m1;
public class lookupswitch00301m11n version 45:3
{
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
stack 3 locals 2
{
sipush 1;
lookupswitch {
BOGUS;
};
nop;
nop;
nop;
lconst_0;
impdep2 255;
impdep2 255;
L12: iconst_0;
ireturn;
}
SourceFile "lookupswitch00301m11n.jasm";
} // end Class javasoft/sqe/tests/vm/instr/lookupswitch/lookupswitch003/lookupswitch00301m1/lookupswitch00301m11n compiled from "lookupswitch00301m11n.jasm"
jdis - ERROR: The index -1 is out of range for the code array of the method.
1 error(s) in the file: lookupswitch00301m11n.class
jdis cannot print the complete output if the class file contains lookupswitch, wide, or tableswitch instructions with an incorrect structure, and it does not provide details about the structural issue:
>jdis lookupswitch00301m11n.class
package javasoft/sqe/tests/vm/instr/lookupswitch/lookupswitch003/lookupswitch00301m1;
public class lookupswitch00301m11n version 45:3
{
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
jdis - ERROR: Fatal exception in file: lookupswitch00301m11n.class
Expected output should be:
jdis lookupswitch00301m11n.class
package javasoft/sqe/tests/vm/instr/lookupswitch/lookupswitch003/lookupswitch00301m1;
public class lookupswitch00301m11n version 45:3
{
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
stack 3 locals 2
{
sipush 1;
lookupswitch {
BOGUS;
};
nop;
nop;
nop;
lconst_0;
impdep2 255;
impdep2 255;
L12: iconst_0;
ireturn;
}
SourceFile "lookupswitch00301m11n.jasm";
} // end Class javasoft/sqe/tests/vm/instr/lookupswitch/lookupswitch003/lookupswitch00301m1/lookupswitch00301m11n compiled from "lookupswitch00301m11n.jasm"
jdis - ERROR: The index -1 is out of range for the code array of the method.
1 error(s) in the file: lookupswitch00301m11n.class
- links to
-
Commit(master) openjdk/asmtools/1144f071
-
Review(master) openjdk/asmtools/84