javap

Understanding javap's output for the Constant Pool

只谈情不闲聊 提交于 2019-11-27 09:42:27
问题 When running javap on a very simple HelloWorld application I have some confusion on the output around the constant pool. Test Code public class TestClass { public static void main(String[] args) { System.out.println("hello world"); } } Javap -c -verbose output (snipped) // Header + consts 1..22 snipped const #22 = String #23; // hello world const #23 = Asciz hello world; public static void main(java.lang.String[]); Signature: ([Ljava/lang/String;)V Code: Stack=2, Locals=1, Args_size=1 0:

javap in a programmable way

青春壹個敷衍的年華 提交于 2019-11-27 08:09:42
问题 Can we use javap in our own java code in a programmable way? for example, the following code: public class TestClass { public static void main(String[] args) { System.out.println("hello world"); } } using javap in command line, we got : // Header + consts 1..22 snipped const #22 = String #23; // hello world const #23 = Asciz hello world; public static void main(java.lang.String[]); Signature: ([Ljava/lang/String;)V Code: Stack=2, Locals=1, Args_size=1 0: getstatic #16; //Field java/lang

Is there a disassembler + debugger for java (ala OllyDbg / SoftICE for assembler)?

放肆的年华 提交于 2019-11-27 01:08:13
问题 Is there a utility similar to OllyDbg / SoftICE for java? I.e. execute class (from jar / with class path) and, without source code, show the disassembly of the intermediate code with ability to step through / step over / search for references / edit specific intermediate code in memory / apply edit to file... If not, is it even possible to write something like this (assuming we're willing to live without hotspot for the debug duration)? Edit: I'm not talking about JAD or JD or Cavaj. These