X hits on this document

368 views

0 shares

0 downloads

0 comments

29 / 120

top-level public class to be defined per *.java source file and requires that the bytecode

be stored in a file with whose name matches the pattern TopLevelClassName.class.

Java bytecode

Machine instruction

JVM instruction

Java Virtual Machine (JVM)

Machine code

CPU

Figure 5.1. Execution of Java bytecode versus machine code.

5.1 Decompiling and Disassembling Java Bytecode

To demonstrate how much more feasible it is to recover Java source code from

Java bytecode than it is to recover C/C++ code from machine code, we decompile the

bytecode for the program ListArguments.java using Jad, a Java decompiler which can be

found here [16]; we then compare the generated Java source with the original. Before

performing the decompilation we peek at the bytecode using javap to get an idea of how

much information survives the translation from high-level Java source to the intermediate

format of Java bytecode. Table 5.1 contains the source code for ListArguments.java, a

simple Java program that echoes each argument passed on the command-line to standard

output.

21

Document info
Document views368
Page views369
Page last viewedThu Dec 08 14:45:39 UTC 2016
Pages120
Paragraphs2913
Words25794

Comments