Package ghidra.app.decompiler
Class DecompileProcess
- java.lang.Object
-
- ghidra.app.decompiler.DecompileProcess
-
public class DecompileProcess extends java.lang.ObjectClass for communicating with a single decompiler process. The process controls decompilation for a single Program. The process is initiated by the registerProgram method. If the process is ready, the statusGood flag will be set to true. This flag must be checked via the isReady method prior to invoking any of the public methods. If the process isn't ready, the only way to recover is by reissuing the registerProgram call and making any other necessary initialization calls.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDecompileProcess.DisposeState
-
Constructor Summary
Constructors Constructor Description DecompileProcess(java.lang.String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intderegisterProgram()Free decompiler resourcesvoiddispose()DecompileProcess.DisposeStategetDisposeState()booleanisReady()voidregisterProgram(DecompileCallback cback, java.lang.String pspecxml, java.lang.String cspecxml, java.lang.String tspecxml, java.lang.String coretypesxml)Initialize decompiler for a particular platformLimitedByteBuffersendCommand(java.lang.String command)Send a single command to the decompiler with no parameters and return responseLimitedByteBuffersendCommand1Param(java.lang.String command, java.lang.String param1)Send a command to the decompiler with one parameter and return the resultLimitedByteBuffersendCommand1ParamTimeout(java.lang.String command, java.lang.String param, int timeoutSecs)LimitedByteBuffersendCommand2Params(java.lang.String command, java.lang.String param1, java.lang.String param2)Send a command with 2 parameters to the decompiler and read the resultvoidsetMaxResultSize(int maxResultSizeMBytes)voidsetShowNamespace(boolean showNamespace)
-
-
-
Method Detail
-
dispose
public void dispose()
-
getDisposeState
public DecompileProcess.DisposeState getDisposeState()
-
registerProgram
public void registerProgram(DecompileCallback cback, java.lang.String pspecxml, java.lang.String cspecxml, java.lang.String tspecxml, java.lang.String coretypesxml) throws java.io.IOException, DecompileException
Initialize decompiler for a particular platform- Parameters:
cback- = callback object for decompilerpspecxml- = string containing .pspec xmlcspecxml- = string containing .cspec xmltspecxml- = XML string containing translator spec- Throws:
java.io.IOExceptionDecompileException
-
deregisterProgram
public int deregisterProgram() throws java.io.IOException, DecompileExceptionFree decompiler resources- Returns:
- Throws:
java.io.IOExceptionDecompileException
-
sendCommand
public LimitedByteBuffer sendCommand(java.lang.String command) throws java.io.IOException, DecompileException
Send a single command to the decompiler with no parameters and return response- Parameters:
command- is the name of the command to execute- Returns:
- the response String
- Throws:
java.io.IOExceptionDecompileException
-
isReady
public boolean isReady()
-
sendCommand1ParamTimeout
public LimitedByteBuffer sendCommand1ParamTimeout(java.lang.String command, java.lang.String param, int timeoutSecs) throws java.io.IOException, DecompileException
- Parameters:
command- the decompiler should executeparam- an additional parameter for the commandtimeoutSecs- the number of seconds to run before timing out- Returns:
- the response string
- Throws:
java.io.IOExceptionDecompileException
-
sendCommand2Params
public LimitedByteBuffer sendCommand2Params(java.lang.String command, java.lang.String param1, java.lang.String param2) throws java.io.IOException, DecompileException
Send a command with 2 parameters to the decompiler and read the result- Parameters:
command- string to sendparam1- is the first parameter stringparam2- is the second parameter string- Returns:
- the result string
- Throws:
java.io.IOExceptionDecompileException
-
setMaxResultSize
public void setMaxResultSize(int maxResultSizeMBytes)
-
setShowNamespace
public void setShowNamespace(boolean showNamespace)
-
sendCommand1Param
public LimitedByteBuffer sendCommand1Param(java.lang.String command, java.lang.String param1) throws java.io.IOException, DecompileException
Send a command to the decompiler with one parameter and return the result- Parameters:
command- is the command stringparam1- is the parameter as a string- Returns:
- the result string
- Throws:
java.io.IOExceptionDecompileException
-
-