C# Class Reko.Core.MemoryArea

Contains the bytes that are present in memory after a program is loaded.
Loading sparse images should load multiple memory areas. Use SegmentMap and ImageSegments to accomplish this.
ファイルを表示 Open project: uxmal/reko Class Usage Examples

Public Methods

Method Description
CompareArrays ( byte src, int iSrc, byte dst, int cb ) : bool
CreateBeReader ( Address addr ) : BeImageReader
CreateBeReader ( ulong offset ) : BeImageReader
CreateLeReader ( Address addr ) : Reko.Core.LeImageReader
CreateLeReader ( ulong offset ) : Reko.Core.LeImageReader
FixupLeUInt16 ( uint imageOffset, ushort delta ) : ushort

Adds the delta to the ushort at the given offset.

IsValidAddress ( Address addr ) : bool
IsValidLinearAddress ( ulong linearAddr ) : bool
MemoryArea ( Address addrBase, byte bytes ) : Reko.Core.Expressions
ReadBe ( byte abImage, long imageOffset, PrimitiveType type ) : Constant
ReadBe ( long imageOffset, PrimitiveType type ) : Constant
ReadBeDouble ( byte abImage, long off ) : Constant
ReadBeDouble ( long off ) : Constant
ReadBeFloat ( byte abImage, long off ) : Constant
ReadBeFloat ( long off ) : Constant
ReadBeInt16 ( byte img, long offset ) : short
ReadBeInt16 ( uint off ) : short
ReadBeInt32 ( byte abImage, long off ) : int
ReadBeInt32 ( uint off ) : int
ReadBeInt64 ( byte image, long off ) : long
ReadBeInt64 ( uint off ) : long
ReadBeUInt16 ( byte abImage, long off ) : ushort
ReadBeUInt16 ( uint off ) : ushort
ReadBeUInt32 ( byte abImage, long off ) : uint
ReadBeUInt32 ( uint off ) : uint
ReadBeUInt64 ( byte abImage, long off ) : ulong
ReadBeUint64 ( uint off ) : ulong
ReadByte ( Address addr ) : byte
ReadLe ( byte abImage, long imageOffset, PrimitiveType type ) : Constant
ReadLe ( long imageOffset, PrimitiveType type ) : Constant

Reads a little-endian word from image offset.

If the word being read was a relocation, it is returned with a [[pointer]] or [[segment]] data type. Otherwise a neutral [[word]] is returned.

ReadLeDouble ( Address addr ) : Constant
ReadLeDouble ( byte abImage, long off ) : Constant
ReadLeDouble ( long off ) : Constant
ReadLeFloat ( Address addr ) : Constant
ReadLeFloat ( byte abImage, long off ) : Constant
ReadLeFloat ( long off ) : Constant
ReadLeInt16 ( Address addr ) : short
ReadLeInt16 ( byte abImage, long offset ) : short
ReadLeInt16 ( uint off ) : short
ReadLeInt32 ( Address addr ) : int
ReadLeInt32 ( byte abImage, long off ) : int
ReadLeInt32 ( uint off ) : int
ReadLeInt64 ( Address addr ) : long
ReadLeInt64 ( byte image, long off ) : long
ReadLeInt64 ( uint off ) : long
ReadLeUInt16 ( Address addr ) : ushort
ReadLeUInt16 ( byte img, long off ) : ushort
ReadLeUInt16 ( uint off ) : ushort
ReadLeUInt32 ( Address addr ) : uint
ReadLeUInt32 ( byte img, long off ) : uint
ReadLeUInt32 ( uint off ) : uint
ReadLeUInt64 ( byte img, long off ) : ulong
ReadLeUint64 ( Address addr ) : ulong
ReadLeUint64 ( uint off ) : ulong
ToString ( ) : string
TryReadBe ( long imageOffset, PrimitiveType type, Constant &c ) : bool
TryReadBeInt32 ( byte abImage, long off, int &value ) : bool
TryReadBeInt64 ( byte image, long off, long &value ) : bool
TryReadBeUInt16 ( byte img, long offset, ushort &value ) : bool
TryReadBeUInt32 ( byte abImage, long off, uint &value ) : bool
TryReadBeUInt64 ( byte image, long off, ulong &value ) : bool
TryReadByte ( Address addr, byte &b ) : bool
TryReadByte ( byte img, long off, byte &b ) : bool
TryReadByte ( long off, byte &b ) : bool
TryReadBytes ( Address addr, int length, byte membuf ) : bool
TryReadBytes ( long off, int length, byte membuf ) : bool
TryReadLe ( long imageOffset, PrimitiveType type, Constant &c ) : bool
TryReadLeInt32 ( byte abImage, uint off, int &value ) : bool
TryReadLeInt64 ( byte image, long off, long &value ) : bool
TryReadLeUInt16 ( byte abImage, uint offset, ushort &us ) : bool
TryReadLeUInt32 ( Address address, uint &dw ) : bool
TryReadLeUInt32 ( byte abImage, long off, uint &value ) : bool
TryReadLeUInt64 ( Address address, ulong &dw ) : bool
TryReadLeUInt64 ( byte image, long off, ulong &value ) : bool
WriteBeUInt32 ( byte abImage, uint offset, uint dw ) : void
WriteBeUInt32 ( long offset, uint dw ) : void
WriteByte ( Address addr, byte b ) : void
WriteByte ( long offset, byte b ) : void
WriteBytes ( byte srcBytes, long offset, int count ) : void
WriteBytes ( byte srcBytes, long offset, int count, byte dstBytes ) : void
WriteLeInt16 ( byte abImage, long offset, short w ) : void
WriteLeUInt16 ( Address addr, ushort w ) : void
WriteLeUInt16 ( long offset, ushort w ) : void
WriteLeUInt32 ( Address addr, uint dw ) : void
WriteLeUInt32 ( long offset, uint dw ) : void

Private Methods

Method Description
CreateImageMap ( ) : Reko.Core.SegmentMap
IntPow ( double b, int e ) : double
ToOffset ( Address addr ) : long

Method Details

CompareArrays() public static method

public static CompareArrays ( byte src, int iSrc, byte dst, int cb ) : bool
src byte
iSrc int
dst byte
cb int
return bool

CreateBeReader() public method

public CreateBeReader ( Address addr ) : BeImageReader
addr Address
return BeImageReader

CreateBeReader() public method

public CreateBeReader ( ulong offset ) : BeImageReader
offset ulong
return BeImageReader

CreateLeReader() public method

public CreateLeReader ( Address addr ) : Reko.Core.LeImageReader
addr Address
return Reko.Core.LeImageReader

CreateLeReader() public method

public CreateLeReader ( ulong offset ) : Reko.Core.LeImageReader
offset ulong
return Reko.Core.LeImageReader

FixupLeUInt16() public method

Adds the delta to the ushort at the given offset.
public FixupLeUInt16 ( uint imageOffset, ushort delta ) : ushort
imageOffset uint
delta ushort
return ushort

IsValidAddress() public method

public IsValidAddress ( Address addr ) : bool
addr Address
return bool

IsValidLinearAddress() public method

public IsValidLinearAddress ( ulong linearAddr ) : bool
linearAddr ulong
return bool

MemoryArea() public method

public MemoryArea ( Address addrBase, byte bytes ) : Reko.Core.Expressions
addrBase Address
bytes byte
return Reko.Core.Expressions

ReadBe() public static method

public static ReadBe ( byte abImage, long imageOffset, PrimitiveType type ) : Constant
abImage byte
imageOffset long
type PrimitiveType
return Constant

ReadBe() public method

public ReadBe ( long imageOffset, PrimitiveType type ) : Constant
imageOffset long
type PrimitiveType
return Constant

ReadBeDouble() public static method

public static ReadBeDouble ( byte abImage, long off ) : Constant
abImage byte
off long
return Constant

ReadBeDouble() public method

public ReadBeDouble ( long off ) : Constant
off long
return Constant

ReadBeFloat() public static method

public static ReadBeFloat ( byte abImage, long off ) : Constant
abImage byte
off long
return Constant

ReadBeFloat() public method

public ReadBeFloat ( long off ) : Constant
off long
return Constant

ReadBeInt16() public static method

public static ReadBeInt16 ( byte img, long offset ) : short
img byte
offset long
return short

ReadBeInt16() public method

public ReadBeInt16 ( uint off ) : short
off uint
return short

ReadBeInt32() public static method

public static ReadBeInt32 ( byte abImage, long off ) : int
abImage byte
off long
return int

ReadBeInt32() public method

public ReadBeInt32 ( uint off ) : int
off uint
return int

ReadBeInt64() public static method

public static ReadBeInt64 ( byte image, long off ) : long
image byte
off long
return long

ReadBeInt64() public method

public ReadBeInt64 ( uint off ) : long
off uint
return long

ReadBeUInt16() public static method

public static ReadBeUInt16 ( byte abImage, long off ) : ushort
abImage byte
off long
return ushort

ReadBeUInt16() public method

public ReadBeUInt16 ( uint off ) : ushort
off uint
return ushort

ReadBeUInt32() public static method

public static ReadBeUInt32 ( byte abImage, long off ) : uint
abImage byte
off long
return uint

ReadBeUInt32() public method

public ReadBeUInt32 ( uint off ) : uint
off uint
return uint

ReadBeUInt64() public static method

public static ReadBeUInt64 ( byte abImage, long off ) : ulong
abImage byte
off long
return ulong

ReadBeUint64() public method

public ReadBeUint64 ( uint off ) : ulong
off uint
return ulong

ReadByte() public method

public ReadByte ( Address addr ) : byte
addr Address
return byte

ReadLe() public static method

public static ReadLe ( byte abImage, long imageOffset, PrimitiveType type ) : Constant
abImage byte
imageOffset long
type PrimitiveType
return Constant

ReadLe() public method

Reads a little-endian word from image offset.
If the word being read was a relocation, it is returned with a [[pointer]] or [[segment]] data type. Otherwise a neutral [[word]] is returned.
public ReadLe ( long imageOffset, PrimitiveType type ) : Constant
imageOffset long Offset from image start, in bytes.
type PrimitiveType Size of the word being requested.
return Constant

ReadLeDouble() public method

public ReadLeDouble ( Address addr ) : Constant
addr Address
return Constant

ReadLeDouble() public static method

public static ReadLeDouble ( byte abImage, long off ) : Constant
abImage byte
off long
return Constant

ReadLeDouble() public method

public ReadLeDouble ( long off ) : Constant
off long
return Constant

ReadLeFloat() public method

public ReadLeFloat ( Address addr ) : Constant
addr Address
return Constant

ReadLeFloat() public static method

public static ReadLeFloat ( byte abImage, long off ) : Constant
abImage byte
off long
return Constant

ReadLeFloat() public method

public ReadLeFloat ( long off ) : Constant
off long
return Constant

ReadLeInt16() public method

public ReadLeInt16 ( Address addr ) : short
addr Address
return short

ReadLeInt16() public static method

public static ReadLeInt16 ( byte abImage, long offset ) : short
abImage byte
offset long
return short

ReadLeInt16() public method

public ReadLeInt16 ( uint off ) : short
off uint
return short

ReadLeInt32() public method

public ReadLeInt32 ( Address addr ) : int
addr Address
return int

ReadLeInt32() public static method

public static ReadLeInt32 ( byte abImage, long off ) : int
abImage byte
off long
return int

ReadLeInt32() public method

public ReadLeInt32 ( uint off ) : int
off uint
return int

ReadLeInt64() public method

public ReadLeInt64 ( Address addr ) : long
addr Address
return long

ReadLeInt64() public static method

public static ReadLeInt64 ( byte image, long off ) : long
image byte
off long
return long

ReadLeInt64() public method

public ReadLeInt64 ( uint off ) : long
off uint
return long

ReadLeUInt16() public method

public ReadLeUInt16 ( Address addr ) : ushort
addr Address
return ushort

ReadLeUInt16() public static method

public static ReadLeUInt16 ( byte img, long off ) : ushort
img byte
off long
return ushort

ReadLeUInt16() public method

public ReadLeUInt16 ( uint off ) : ushort
off uint
return ushort

ReadLeUInt32() public method

public ReadLeUInt32 ( Address addr ) : uint
addr Address
return uint

ReadLeUInt32() public static method

public static ReadLeUInt32 ( byte img, long off ) : uint
img byte
off long
return uint

ReadLeUInt32() public method

public ReadLeUInt32 ( uint off ) : uint
off uint
return uint

ReadLeUInt64() public static method

public static ReadLeUInt64 ( byte img, long off ) : ulong
img byte
off long
return ulong

ReadLeUint64() public method

public ReadLeUint64 ( Address addr ) : ulong
addr Address
return ulong

ReadLeUint64() public method

public ReadLeUint64 ( uint off ) : ulong
off uint
return ulong

ToString() public method

public ToString ( ) : string
return string

TryReadBe() public method

public TryReadBe ( long imageOffset, PrimitiveType type, Constant &c ) : bool
imageOffset long
type PrimitiveType
c Constant
return bool

TryReadBeInt32() public static method

public static TryReadBeInt32 ( byte abImage, long off, int &value ) : bool
abImage byte
off long
value int
return bool

TryReadBeInt64() public static method

public static TryReadBeInt64 ( byte image, long off, long &value ) : bool
image byte
off long
value long
return bool

TryReadBeUInt16() public static method

public static TryReadBeUInt16 ( byte img, long offset, ushort &value ) : bool
img byte
offset long
value ushort
return bool

TryReadBeUInt32() public static method

public static TryReadBeUInt32 ( byte abImage, long off, uint &value ) : bool
abImage byte
off long
value uint
return bool

TryReadBeUInt64() public static method

public static TryReadBeUInt64 ( byte image, long off, ulong &value ) : bool
image byte
off long
value ulong
return bool

TryReadByte() public method

public TryReadByte ( Address addr, byte &b ) : bool
addr Address
b byte
return bool

TryReadByte() public static method

public static TryReadByte ( byte img, long off, byte &b ) : bool
img byte
off long
b byte
return bool

TryReadByte() public method

public TryReadByte ( long off, byte &b ) : bool
off long
b byte
return bool

TryReadBytes() public method

public TryReadBytes ( Address addr, int length, byte membuf ) : bool
addr Address
length int
membuf byte
return bool

TryReadBytes() public method

public TryReadBytes ( long off, int length, byte membuf ) : bool
off long
length int
membuf byte
return bool

TryReadLe() public method

public TryReadLe ( long imageOffset, PrimitiveType type, Constant &c ) : bool
imageOffset long
type PrimitiveType
c Constant
return bool

TryReadLeInt32() public static method

public static TryReadLeInt32 ( byte abImage, uint off, int &value ) : bool
abImage byte
off uint
value int
return bool

TryReadLeInt64() public static method

public static TryReadLeInt64 ( byte image, long off, long &value ) : bool
image byte
off long
value long
return bool

TryReadLeUInt16() public static method

public static TryReadLeUInt16 ( byte abImage, uint offset, ushort &us ) : bool
abImage byte
offset uint
us ushort
return bool

TryReadLeUInt32() public method

public TryReadLeUInt32 ( Address address, uint &dw ) : bool
address Address
dw uint
return bool

TryReadLeUInt32() public static method

public static TryReadLeUInt32 ( byte abImage, long off, uint &value ) : bool
abImage byte
off long
value uint
return bool

TryReadLeUInt64() public method

public TryReadLeUInt64 ( Address address, ulong &dw ) : bool
address Address
dw ulong
return bool

TryReadLeUInt64() public static method

public static TryReadLeUInt64 ( byte image, long off, ulong &value ) : bool
image byte
off long
value ulong
return bool

WriteBeUInt32() public static method

public static WriteBeUInt32 ( byte abImage, uint offset, uint dw ) : void
abImage byte
offset uint
dw uint
return void

WriteBeUInt32() public method

public WriteBeUInt32 ( long offset, uint dw ) : void
offset long
dw uint
return void

WriteByte() public method

public WriteByte ( Address addr, byte b ) : void
addr Address
b byte
return void

WriteByte() public method

public WriteByte ( long offset, byte b ) : void
offset long
b byte
return void

WriteBytes() public method

public WriteBytes ( byte srcBytes, long offset, int count ) : void
srcBytes byte
offset long
count int
return void

WriteBytes() public static method

public static WriteBytes ( byte srcBytes, long offset, int count, byte dstBytes ) : void
srcBytes byte
offset long
count int
dstBytes byte
return void

WriteLeInt16() public static method

public static WriteLeInt16 ( byte abImage, long offset, short w ) : void
abImage byte
offset long
w short
return void

WriteLeUInt16() public method

public WriteLeUInt16 ( Address addr, ushort w ) : void
addr Address
w ushort
return void

WriteLeUInt16() public method

public WriteLeUInt16 ( long offset, ushort w ) : void
offset long
w ushort
return void

WriteLeUInt32() public method

public WriteLeUInt32 ( Address addr, uint dw ) : void
addr Address
dw uint
return void

WriteLeUInt32() public method

public WriteLeUInt32 ( long offset, uint dw ) : void
offset long
dw uint
return void