Fernflower Readme

Sep 27th, 2011
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1. About the decompiler
  3. Fernflower is the first actually working analytical decompiler for Java and
  4. probably for a high-level programming language in general. Naturally it is still
  5. under development, please send your bug reports and improvement suggestions at
  9. 2. License
  11. See license_en.txt
  14. 3. Running from the command line
  16. java -jar fernflower.jar [-<option>=<value>]* [<source>]+ <destination>
  18. * means 0 or more times
  19. + means 1 or more times
  21. <source>: file or directory with files to be decompiled. Directories are recursively scanned. Allowed file extensions are class, zip and jar.
  22. Sources prefixed with -e= mean "library" files that won't be decompiled, but taken into account when analysing relationships between
  23. classes or methods. Especially renaming of identifiers (s. option 'ren') can benefit from information about external classes.
  24. <destination>: destination directory
  25. <option>,<value>: command line option with the corresponding value, see 4.
  27. Examples:
  29. java -jar fernflower.jar -hes=0 -hdc=0 c:\Temp\binary\ -e=c:\Java\rt.jar c:\Temp\source\
  31. java -jar fernflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\binary\Boot.class c:\Temp\source\
  34. 4. Command line options
  36. With the exception of mpm and urc the value of 1 means the option is activated, 0 - deactivated. Default
  37. value, if any, is given between parentheses.
  39. Typically, the following options will be changed by user, if any: hes, hdc, dgs, mpm, ren, urc
  40. The rest of options can be left as they are: they are aimed at professional reverse engineers.
  42. rbr (1): hide bridge methods
  43. rsy (0): hide synthetic class members
  44. din (1): decompile inner classes
  45. dc4 (1): collapse 1.4 class references
  46. das (1): decompile assertions
  47. hes (1): hide empty super invocation
  48. hdc (1): hide empty default constructor
  49. dgs (0): decompile generic signatures
  50. occ (0): ouput copyright comment
  51. ner (1): assume return not throwing exceptions
  52. den (1): decompile enumerations
  53. rgn (1): remove getClass() invocation, when it is part of a qualified new statement
  54. bto (1): interpret int 1 as boolean true (workaround to a compiler bug)
  55. nns (1): allow for not set synthetic attribute (workaround to a compiler bug)
  56. uto (1): consider nameless types as java.lang.Object (workaround to a compiler architecture flaw)
  57. udv (1): reconstruct variable names from debug information, if present
  58. rer (1): remove empty exception ranges
  59. fdi (1): deinline finally structures
  60. asc (0): allow only ASCII characters in string literals. All other characters will be encoded using Unicode escapes (JLS 3.3). Default encoding is UTF8.
  61. mpm (0): maximum allowed processing time per decompiled method, in seconds. 0 means no upper limit.
  62. ren (0): rename ambiguous (resp. obfuscated) classes and class elements
  63. urc : full name of user-supplied class implementing IIdentifierRenamer. It is used to determine which
  64. class identifiers should be renamed and provides new identifier names. For more information
  65. s. section 5
  67. The default logging level is INFO. This value can be overwritten by setting the option 'log' as follows:
  69. log (INFO): possible values TRACE, INFO, WARN, ERROR
  72. 5. Renaming identifiers
  74. Some obfuscators give classes and their member elements short, meaningless and above all ambiguous names. Recompiling of such
  75. code leads to a great number of conflicts. Therefore it is advisable to let the decompiler rename elements in its turn,
  76. ensuring uniqueness of each identifier.
  78. Option 'ren' (i.e. -ren=1) activates renaming functionality. Default renaming strategy goes as follows:
  79. - rename an element if its name is a reserved word or is shorter than 3 characters
  80. - new names are built according to a simple pattern: (class|method|field)_<consecutive unique number>
  81. You can overwrite this rules by providing your own implementation of the 4 key methods invoked by the decompiler while renaming. Simply
  82. pass a class that implements de.fernflower.main.extern.IIdentifierRenamer in the option 'urc' (e.g. -urc=com.mypackage.MyRenamer) to
  83. Fernflower. The class must be available on the application classpath.
  85. The meaning of each method should be clear from naming: toBeRenamed determine whether the element will be renamed, while the other three
  86. provide new names for classes, methods and fields respectively.
RAW Paste Data