I am after a java bytecode disassembler whose output includes the bytecodes themselves, their operands, and their addresses in the .class file, and which displays numbers in hex, not decimal.
To show what I mean, here are a few lines taken from the output of javap:
private java.text.SimpleDateFormat createTimeFormat();
Code:
Stack=3, Locals=2, Args_size=1
0: new #84; //class java/text/SimpleDateFormat
3: dup
4: ldc #17; //String yyyy-MM-dd'T'HH:mm:ss
6: invokespecial #87; //Method java/text/SimpleDateFormat."<init>":(Ljava/lang/String;)V
9: astore_1
Every java bytecode disassembler I have found (I have spent much time on google, and downloaded several different ones to try) produces output which is essentially the same as this. Some format or decorate it slightly differently; some replace the command line interface with a fancy GUI; but not one of them displays the addresses of the instructions in the .class file, nor the bytecodes themselves - there are several which claim to show the bytecodes, but none of them actually do, they display only the textual mnemonics representing the bytecodes rather than the bytecodes themselves. Also, they all display the numerical information in decimal, not in hex.
Here is an edited version of the above output which I have transformed by hand to produce an example of the sort of thing I am looking for:
private java.text.SimpleDateFormat createTimeFormat();
Code:
Stack=3, Locals=2, Args_size=1
000010cf 0: bb 00 54 new #54; //class java/text/SimpleDateFormat
000010d2 3: 59 dup
000010d3 4: 12 11 ldc #11; //String yyyy-MM-dd'T'HH:mm:ss
000010d5 6: b7 00 57 invokespecial #57; //Method java/text/SimpleDateFormat."<init>":(Ljava/lang/String;)V
000010d8 9: 4c astore_1
The addresses at the start of the lines correspond to the position of the instructions in the .class file, as one would find in a plain hexdump. The hex representations of the bytecodes and their operands are shown, and the disassembly shows the constants in hex.
Is there anything available which would produce output resembling this? It does not matter if the fields are in a different order, as long as they are all there. It must run on Linux, either natively or under java.