December 22, 2009

How to Read and Recompile *.CLASS file?

1.Using javap command read only members of class  and variables
ex: javap java.lang.String

2. Using JAD software read and recompile also old .class file but very carefull using this command ,changes the original code also. Some command JAD

Jad accepts the following options:

-a - annotate the output with JVM bytecodes (default: off)

-af - same as -a, but output fully qualified names when annotating

-clear - clear all prefixes, including the default ones (can be abbreviated as -cl)

-b - output redundant braces (e.g., if(a) { b(); }, default: off)

-d - directory for output files (will be created when necessary)

-dead - try to decompile dead parts of code (if any) (default: off)

-disass - disassemble method bytecodes (no JAVA source generated)

-f - output fully qualified names for classes/fields/methods (default: off)

-ff - output class fields before methods (default: after methods)

-i - output default initializers for all non-final fields

-l - split strings into pieces of maximum chars (default: off)

-lnc - annotate the output with line numbers (default: off)

-lradix - display long integers using the specified radix (8, 10 or 16)

-nl - split strings on newline character (default: off)

-nocast - don't generate auxiliary casts

-nocode - don't generate the source code for methods

-noconv - don't convert Java identifiers (default: convert)

-noctor - suppress the empty constructors

-nodos - do not check for class files written in DOS mode (CR before NL, default: check)

-nofd - don't disambiguate fields with the same names by adding signatures to their names (default: do)

-noinner - turn off the support of inner classes (default: on)

-nolvt - ignore Local Variable Table information

-nonlb - don't output a newline before opening brace (default: do)

-o - overwrite output files without confirmation (default: off)

-p - send decompiled code to STDOUT (e.g., for piping)

-pi - pack imports into one line after imports (default: 3)

-pv - pack fields with identical types into one line (default: off)-pa - prefix for all packages in generated source files

-pc - prefix for classes with numerical names (default: _cls)

-pf - prefix for fields with numerical names (default: _fld)

-pe - prefix for unused exception names (default: _ex)

-pl - prefix for locals with numerical names (default: _lcl)

-pm - prefix for methods with numerical names (default: _mth)

-pp - prefix for method parms with numerical names (default: _prm)

-r - restore package directory structrure

-radix - display integers using the specified radix (8, 10 or 16)

-s - output file extension (by default '.jad')

-safe - generate additional casts to disambiguate methods/fields (default: off)

-space - output space between keyword (if/for/while/etc) and expression (default: off)

-stat - display the total number of processed classes/methods/fields

-t - use tabs instead of spaces for indentation

-t - use spaces for indentation (default: 4)

-v - display method names being decompiled

-8 - convert UNICODE strings into 8-bit strings
using the current ANSI code page (Win32 only)

-& - redirect STDERR to STDOUT (Win32 only)

All single-word options have three formats:

-o - 'reverses' value of an option
-o+ - set value to 'true' or 'on'
-o- - set value to 'false' or 'off'

You can specify the options you want to be set by default in the environment variable

JAD_OPTIONS. For example:

JAD_OPTIONS=-ff+ -nonlb+ -t+ -space+


To Read .CLASS file using CavaJ Software.
To Downlad CavaJ :



No comments:

Post a Comment

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

My Favorite Site's List

#update below script more than 500 posts