C# Class Reko.Arch.PowerPC.PowerPcArchitecture

Inheritance: Reko.Core.ProcessorArchitecture
显示文件 Open project: uxmal/reko Class Usage Examples

Public Methods

Method Description
CreateDisassembler ( Reko.Core.ImageReader rdr ) : IEnumerable
CreateDisassemblerImpl ( Reko.Core.ImageReader rdr ) : PowerPcDisassembler
CreateImageReader ( MemoryArea image, Address addr ) : Reko.Core.ImageReader
CreateImageReader ( MemoryArea image, Address addrBegin, Address addrEnd ) : Reko.Core.ImageReader
CreateImageReader ( MemoryArea image, ulong offset ) : Reko.Core.ImageReader
CreateImageWriter ( ) : Reko.Core.ImageWriter
CreateImageWriter ( MemoryArea mem, Address addr ) : Reko.Core.ImageWriter
CreateInstructionComparer ( Normalize norm ) : IEqualityComparer
CreatePointerScanner ( Reko.Core.SegmentMap map, Reko.Core.ImageReader rdr, IEnumerable
addrs, PointerScannerFlags flags ) : IEnumerable
CreateProcessorState ( ) : ProcessorState
CreateRewriter ( Reko.Core.ImageReader rdr, ProcessorState state, Frame frame, IRewriterHost host ) : IEnumerable
CreateStackAccess ( Frame frame, int cbOffset, DataType dataType ) : Expression
GetFlagGroup ( string name ) : FlagGroupStorage
GetFlagGroup ( uint grf ) : FlagGroupStorage
GetOpcodeNames ( ) : int>.SortedList
GetOpcodeNumber ( string name ) : int?
GetRegister ( int i ) : RegisterStorage
GetRegister ( string name ) : RegisterStorage
GetRegisters ( ) : RegisterStorage[]
GetSubregister ( RegisterStorage reg, int offset, int width ) : RegisterStorage
GetTrampolineDestination ( IEnumerable rdr, IRewriterHost host ) : Reko.Core.ProcedureBase

Detects the presence of a PowerPC trampoline and returns the imported function that is actually being requested.

A PowerPC trampoline looks like this: addis rX,r0,XXXX (or oris rx,r0,XXXX) lwz rY,YYYY(rX) mtctr rY bctr rY When loading the ELF binary, we discovered the memory locations that will contain pointers to imported functions. If the address XXXXYYYY matches one of those memory locations, we have found a trampoline.

GrfToString ( uint grf ) : string
MakeAddressFromConstant ( Constant c ) : Address
PowerPcArchitecture ( PrimitiveType wordWidth ) : Reko.Core

Creates an instance of PowerPcArchitecture.

ReadCodeAddress ( int size, Reko.Core.ImageReader rdr, ProcessorState state ) : Address
TryGetRegister ( string name, RegisterStorage &reg ) : bool
TryParseAddress ( string txtAddress, Address &addr ) : bool

Method Details

CreateDisassembler() public method

public CreateDisassembler ( Reko.Core.ImageReader rdr ) : IEnumerable
rdr Reko.Core.ImageReader
return IEnumerable

CreateDisassemblerImpl() public method

public CreateDisassemblerImpl ( Reko.Core.ImageReader rdr ) : PowerPcDisassembler
rdr Reko.Core.ImageReader
return PowerPcDisassembler

CreateImageReader() public method

public CreateImageReader ( MemoryArea image, Address addr ) : Reko.Core.ImageReader
image Reko.Core.MemoryArea
addr Address
return Reko.Core.ImageReader

CreateImageReader() public method

public CreateImageReader ( MemoryArea image, Address addrBegin, Address addrEnd ) : Reko.Core.ImageReader
image Reko.Core.MemoryArea
addrBegin Address
addrEnd Address
return Reko.Core.ImageReader

CreateImageReader() public method

public CreateImageReader ( MemoryArea image, ulong offset ) : Reko.Core.ImageReader
image Reko.Core.MemoryArea
offset ulong
return Reko.Core.ImageReader

CreateImageWriter() public method

public CreateImageWriter ( ) : Reko.Core.ImageWriter
return Reko.Core.ImageWriter

CreateImageWriter() public method

public CreateImageWriter ( MemoryArea mem, Address addr ) : Reko.Core.ImageWriter
mem Reko.Core.MemoryArea
addr Address
return Reko.Core.ImageWriter

CreateInstructionComparer() public method

public CreateInstructionComparer ( Normalize norm ) : IEqualityComparer
norm Normalize
return IEqualityComparer

CreatePointerScanner() public abstract method

public abstract CreatePointerScanner ( Reko.Core.SegmentMap map, Reko.Core.ImageReader rdr, IEnumerable
addrs, PointerScannerFlags flags ) : IEnumerable
map Reko.Core.SegmentMap
rdr Reko.Core.ImageReader
addrs IEnumerable
flags PointerScannerFlags
return IEnumerable

CreateProcessorState() public method

public CreateProcessorState ( ) : ProcessorState
return Reko.Core.ProcessorState

CreateRewriter() public method

public CreateRewriter ( Reko.Core.ImageReader rdr, ProcessorState state, Frame frame, IRewriterHost host ) : IEnumerable
rdr Reko.Core.ImageReader
state Reko.Core.ProcessorState
frame Reko.Core.Frame
host IRewriterHost
return IEnumerable

CreateStackAccess() public method

public CreateStackAccess ( Frame frame, int cbOffset, DataType dataType ) : Expression
frame Reko.Core.Frame
cbOffset int
dataType DataType
return Expression

GetFlagGroup() public method

public GetFlagGroup ( string name ) : FlagGroupStorage
name string
return FlagGroupStorage

GetFlagGroup() public method

public GetFlagGroup ( uint grf ) : FlagGroupStorage
grf uint
return FlagGroupStorage

GetOpcodeNames() public method

public GetOpcodeNames ( ) : int>.SortedList
return int>.SortedList

GetOpcodeNumber() public method

public GetOpcodeNumber ( string name ) : int?
name string
return int?

GetRegister() public method

public GetRegister ( int i ) : RegisterStorage
i int
return RegisterStorage

GetRegister() public method

public GetRegister ( string name ) : RegisterStorage
name string
return RegisterStorage

GetRegisters() public method

public GetRegisters ( ) : RegisterStorage[]
return RegisterStorage[]

GetSubregister() public method

public GetSubregister ( RegisterStorage reg, int offset, int width ) : RegisterStorage
reg RegisterStorage
offset int
width int
return RegisterStorage

GetTrampolineDestination() public method

Detects the presence of a PowerPC trampoline and returns the imported function that is actually being requested.
A PowerPC trampoline looks like this: addis rX,r0,XXXX (or oris rx,r0,XXXX) lwz rY,YYYY(rX) mtctr rY bctr rY When loading the ELF binary, we discovered the memory locations that will contain pointers to imported functions. If the address XXXXYYYY matches one of those memory locations, we have found a trampoline.
public GetTrampolineDestination ( IEnumerable rdr, IRewriterHost host ) : Reko.Core.ProcedureBase
rdr IEnumerable
host IRewriterHost
return Reko.Core.ProcedureBase

GrfToString() public method

public GrfToString ( uint grf ) : string
grf uint
return string

MakeAddressFromConstant() public abstract method

public abstract MakeAddressFromConstant ( Constant c ) : Address
c Constant
return Address

PowerPcArchitecture() public method

Creates an instance of PowerPcArchitecture.
public PowerPcArchitecture ( PrimitiveType wordWidth ) : Reko.Core
wordWidth PrimitiveType Supplies the word width of the PowerPC architecture.
return Reko.Core

ReadCodeAddress() public method

public ReadCodeAddress ( int size, Reko.Core.ImageReader rdr, ProcessorState state ) : Address
size int
rdr Reko.Core.ImageReader
state Reko.Core.ProcessorState
return Address

TryGetRegister() public method

public TryGetRegister ( string name, RegisterStorage &reg ) : bool
name string
reg RegisterStorage
return bool

TryParseAddress() public method

public TryParseAddress ( string txtAddress, Address &addr ) : bool
txtAddress string
addr Address
return bool