C# Class Reko.DecompilerDriver

The main driver class for decompilation of binaries.
This class is named this way as the previous name 'Decompiler' causes C# to get confused between the namespace and the class name.
Inheritance: IDecompiler
ファイルを表示 Open project: uxmal/reko

Public Methods

Method Description
AnalyzeDataFlow ( ) : void

Determines the signature of the procedures, the locations and types of all the values in the program.

Assemble ( string fileName, Assembler asm ) : void
Decompile ( string filename ) : void

Main entry point of the decompiler. Loads, decompiles, and outputs the results.

DecompilerDriver ( ILoader ldr, IServiceProvider services ) : Reko.Core
DumpAssembler ( Program program, Reko.Core.Output.Formatter wr ) : void
Load ( string fileName ) : bool

Loads (or assembles) the decompiler project. If a binary file is specified instead, we create a simple project for the file.

LoadCallSignatures ( Program program, ICollection userCalls ) : FunctionType>.IDictionary
LoadRawImage ( string fileName, RawFileElement raw ) : Program
LoadRawImage ( string fileName, string arch, string platform, Address addrBase ) : Program

Loads a program into memory, but performs no relocations.

ReconstructTypes ( ) : void

Extracts type information from the typeless rewritten programs.

RunScriptOnProgramImage ( Program program, Script_v2 script ) : void
ScanProcedure ( Reko.Core.ProgramAddress paddr ) : Reko.Core.ProcedureBase

Starts a scan at address addr on the user's request.

ScanPrograms ( ) : void

Generates the control flow graph and finds executable code in each program.

StructureProgram ( ) : void

Extracts structured program constructs out of snarled goto nests, if possible. Since procedures are now independent of each other, this analysis is done one procedure at a time.

WriteDecompiledProcedures ( Program program, TextWriter w ) : void
WriteDecompiledTypes ( Program program, TextWriter w ) : void
WriteDecompilerProducts ( ) : void
WriteGlobals ( Program program, TextWriter w ) : void
WriteHeaderComment ( string filename, Program program, TextWriter w ) : void

Protected Methods

Method Description
CreateDefaultProject ( string fileName, Program program ) : Reko.Core.Project

Private Methods

Method Description
BuildImageMaps ( ) : void

Build image maps for each program in preparation of the scanning phase.

CreateScanner ( Program program ) : IScanner
EmitProgram ( Program program, DataFlowAnalysis dfa, TextWriter output ) : void
ScanProgram ( Program program ) : void

Method Details

AnalyzeDataFlow() public method

Determines the signature of the procedures, the locations and types of all the values in the program.
public AnalyzeDataFlow ( ) : void
return void

Assemble() public method

public Assemble ( string fileName, Assembler asm ) : void
fileName string
asm Assembler
return void

CreateDefaultProject() protected method

protected CreateDefaultProject ( string fileName, Program program ) : Reko.Core.Project
fileName string
program Program
return Reko.Core.Project

Decompile() public method

Main entry point of the decompiler. Loads, decompiles, and outputs the results.
public Decompile ( string filename ) : void
filename string
return void

DecompilerDriver() public method

public DecompilerDriver ( ILoader ldr, IServiceProvider services ) : Reko.Core
ldr ILoader
services IServiceProvider
return Reko.Core

DumpAssembler() public method

public DumpAssembler ( Program program, Reko.Core.Output.Formatter wr ) : void
program Program
wr Reko.Core.Output.Formatter
return void

Load() public method

Loads (or assembles) the decompiler project. If a binary file is specified instead, we create a simple project for the file.
public Load ( string fileName ) : bool
fileName string
return bool

LoadCallSignatures() public method

public LoadCallSignatures ( Program program, ICollection userCalls ) : FunctionType>.IDictionary
program Program
userCalls ICollection
return FunctionType>.IDictionary

LoadRawImage() public method

public LoadRawImage ( string fileName, RawFileElement raw ) : Program
fileName string
raw RawFileElement
return Program

LoadRawImage() public method

Loads a program into memory, but performs no relocations.
public LoadRawImage ( string fileName, string arch, string platform, Address addrBase ) : Program
fileName string
arch string
platform string
addrBase Address
return Program

ReconstructTypes() public method

Extracts type information from the typeless rewritten programs.
public ReconstructTypes ( ) : void
return void

RunScriptOnProgramImage() public method

public RunScriptOnProgramImage ( Program program, Script_v2 script ) : void
program Program
script Script_v2
return void

ScanProcedure() public method

Starts a scan at address addr on the user's request.
public ScanProcedure ( Reko.Core.ProgramAddress paddr ) : Reko.Core.ProcedureBase
paddr Reko.Core.ProgramAddress
return Reko.Core.ProcedureBase

ScanPrograms() public method

Generates the control flow graph and finds executable code in each program.
public ScanPrograms ( ) : void
return void

StructureProgram() public method

Extracts structured program constructs out of snarled goto nests, if possible. Since procedures are now independent of each other, this analysis is done one procedure at a time.
public StructureProgram ( ) : void
return void

WriteDecompiledProcedures() public method

public WriteDecompiledProcedures ( Program program, TextWriter w ) : void
program Program
w System.IO.TextWriter
return void

WriteDecompiledTypes() public method

public WriteDecompiledTypes ( Program program, TextWriter w ) : void
program Program
w System.IO.TextWriter
return void

WriteDecompilerProducts() public method

public WriteDecompilerProducts ( ) : void
return void

WriteGlobals() public method

public WriteGlobals ( Program program, TextWriter w ) : void
program Program
w System.IO.TextWriter
return void

WriteHeaderComment() public method

public WriteHeaderComment ( string filename, Program program, TextWriter w ) : void
filename string
program Program
w System.IO.TextWriter
return void