A command-line utility for dumping the contents of class files.

The mikenakis-classdump logo.
Based on an image found on the interwebz.
How does the output of mikenakis-classdump look like?
mikenakis-classdump supports three styles of output:
- RAW_ONLY - Only the information found in the class file is shown; nothing is added to the output to help the human reader. This mode is not very useful, but it is provided for completeness.
- MIXED - a combination of raw and gilded (see below). Besides the raw information contained in the class file, a lot of information is added to help the human reader. For example, the LDC #3 instruction is followed by the comment /* "Hello, world!" */ showing the value of the constant that is being loaded. This is the most verbose mode, and it is useful for browsing through code with the intent of understanding it.
- GILDED_ONLY - Information is added to help the human reader, but quite a bit of the raw information is removed. This mode is useful for comparing class files, because it omits information that may differ due to random reasons, without affecting the behavior of the code. For example, the constant-pool is omitted, because constant-pool entries are ordered randomly, so two class files may be effectively identical despite the fact that their constants are ordered differently. The LDC #3 instruction is replaced with LDCx, because it really does not matter whether it is an LDC or an LDCW, while the number of the constant may vary depending on the ordering of the constant-pool entries. The /* "Hello, world!" */ comment gives all information that is necessary to know what constant is being loaded by the LDC instruction.
The MIXED output style of mikenakis-classdump for HelloWorld.class looks like this:
The GILDED_ONLY output style of mikenakis-classdump for HelloWorld.class looks like this:
Hosted on GitHub: https://github.com/mikenakis/mikenakis-classdump
License
This creative work is explicitly published under No License. This means that I remain the exclusive copyright holder of this creative work, and you may not do anything with it other than view its source code and admire it. More information here: michael.gr - Open Source but No License.
If you would like to do anything more with this creative work, please contact me.
No comments:
Post a Comment