public class

DecompilationContext

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.DecompilationContext

Class Overview

Decompilation context holding information about a decompilation and its results, as well as decompilation options. Immutable object, Thread-safe.

Summary

Public Constructors
DecompilationContext()
Construct a new context with no particular options (defaults will be used).
DecompilationContext(DecompilationOptions opt)
Construct a new context with the provided options.
DecompilationContext(int flags, Long maxTimePerMethod, Long maxTimeTotal)
Convenience constructor.
DecompilationContext(int flags)
Convenience constructor.
Public Methods
DecompilationOptions addFlags(int flags)
Convenience method.
DecompilationContext fork()
Fork the context.
IProgressCallback getCallback()
int getCounter1()
Retrieve the value of custom counter 1.
int getCounter2()
Retrieve the value of custom counter 2.
Object getData(String key)
String getError(String sig)
Map<String, String> getErrorMap()
Convenience method.
int getFlags()
Convenience method.
Map<String, Object> getMap1()
Retrieve the custom map 1.
Map<String, Object> getMap2()
Retrieve the custom map 2.
Long getMaxTimePerMethod()
Convenience method.
Long getMaxTimeTotal()
Convenience method.
DecompilationOptions getOptions()
Map<String, DecompilationResult> getResultMap()
DecompilationResult getResults(String sig)
boolean hasErrors()
boolean hasFlags(int f)
Convenience method.
int incrementCounter1()
Increment the value of custom counter 1.
int incrementCounter2()
Increment the value of custom counter 2.
boolean isInterruptionRequested()
void putData(String key, Object value)
boolean recordAndCheckDeferredRequests(int cnt, int cap)
Record occurrences or future occurrences of deferred requests, and check them against a provided cap.
int recordDeferredRequest()
Record the occurrence or future occurrence of a deferred request.
void recordError(String sig, String error)
void recordResult(String sig, DecompilationResult r)
DecompilationOptions removeFlags(int flags)
Convenience method.
void requestInterruption()
static DecompilationContext safe(DecompilationContext ctx)
void setCallback(IProgressCallback callback)
Set an optional callback object to receive progress information regarding a decompilation operation.
DecompilationOptions setOptions(DecompilationOptions options)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DecompilationContext ()

Construct a new context with no particular options (defaults will be used).

public DecompilationContext (DecompilationOptions opt)

Construct a new context with the provided options.

public DecompilationContext (int flags, Long maxTimePerMethod, Long maxTimeTotal)

Convenience constructor.

public DecompilationContext (int flags)

Convenience constructor.

Public Methods

public DecompilationOptions addFlags (int flags)

Convenience method.

Parameters
flags option flags to be added
Returns
  • the previous options

public DecompilationContext fork ()

Fork the context. The fork context reuses this context's objects. Forked contexts may be used hen performing concurrent decompilations.

Returns
  • a new context

public IProgressCallback getCallback ()

public int getCounter1 ()

Retrieve the value of custom counter 1. The counter is initialized with 0.

Returns
  • the counter value

public int getCounter2 ()

Retrieve the value of custom counter 2. The counter is initialized with 0.

Returns
  • the counter value

public Object getData (String key)

public String getError (String sig)

public Map<String, String> getErrorMap ()

Convenience method. Map of key=object signature (e.g., method jvm name) to value= error string (e.g., stacktrace)

public int getFlags ()

Convenience method.

public Map<String, Object> getMap1 ()

Retrieve the custom map 1. A decompiler may use this concurrent map as they choose.

public Map<String, Object> getMap2 ()

Retrieve the custom map 2. A decompiler may use this concurrent map as they choose.

public Long getMaxTimePerMethod ()

Convenience method.

public Long getMaxTimeTotal ()

Convenience method.

public DecompilationOptions getOptions ()

Returns
  • current options (never null)

public Map<String, DecompilationResult> getResultMap ()

public DecompilationResult getResults (String sig)

public boolean hasErrors ()

public boolean hasFlags (int f)

Convenience method.

public int incrementCounter1 ()

Increment the value of custom counter 1. A decompiler may use this counter as they choose.

Returns
  • the updated counter value

public int incrementCounter2 ()

Increment the value of custom counter 2. A decompiler may use this counter as they choose.

Returns
  • the updated counter value

public boolean isInterruptionRequested ()

public void putData (String key, Object value)

public boolean recordAndCheckDeferredRequests (int cnt, int cap)

Record occurrences or future occurrences of deferred requests, and check them against a provided cap.

Parameters
cnt count of deferred requests to record
cap current cap (a negative number means no cap)
Returns
  • true if the updated recorded count of deferred requests is within the cap; false if it exceeds the cap

public int recordDeferredRequest ()

Record the occurrence or future occurrence of a deferred request.

Returns
  • the updated recorded count of deferred requests

public void recordError (String sig, String error)

public void recordResult (String sig, DecompilationResult r)

public DecompilationOptions removeFlags (int flags)

Convenience method.

Parameters
flags option flags to be removed
Returns
  • the previous options

public void requestInterruption ()

public static DecompilationContext safe (DecompilationContext ctx)

public void setCallback (IProgressCallback callback)

Set an optional callback object to receive progress information regarding a decompilation operation.

public DecompilationOptions setOptions (DecompilationOptions options)

Returns
  • the previous options