Class NativeDecompilerExporter

java.lang.Object
com.pnfsoftware.jeb.core.units.code.DecompilerExporter
com.pnfsoftware.jeb.core.units.code.asm.decompiler.NativeDecompilerExporter

public class NativeDecompilerExporter extends DecompilerExporter
Helper class used to decompile and export to source files all or a subset of classes or methods of a native code unit.

Example: export all top-level items to an output folder:

 INativeDecompilerUnit decomp = ...; // retrieved from the current IRuntimeProject
 File outdir = ...;
 DecompilerExporter exp = decomp.getExporter();
 exp.setOutputFolder(outdir, false);
 exp.setMethodTimeout(60_000L);  // safety
 exp.setTotalTimeout(15 * 60_000L);  // safety
 exp.setCallback(new ProgressCallbackAdapter() {
     @Override
     public void message(String msg) {
         System.out.println(msg);
     }
 });
 boolean success = exp.process();
 System.out.println("Errors: " + exp.getErrors());
 
  • Constructor Details

  • Method Details

    • generateMethodFileName

      protected String generateMethodFileName(String address)
      Overrides:
      generateMethodFileName in class DecompilerExporter
    • generateClassFileName

      protected String generateClassFileName(String address)
      Overrides:
      generateClassFileName in class DecompilerExporter
    • process

      public boolean process()
      Description copied from class: DecompilerExporter
      Decompile and export all meaningful elements. This is the recommended method to call. Top-level classes and their constituents will be exported; orphaned methods and other items will be exported as well.

      If an output folder was specified, the resulting source files will be stored in a folder hierarchy that matches their namespace or package name.

      Specified by:
      process in class DecompilerExporter
      Returns:
      true if no error occurred; false if some errors occurred