C# Class TUP.AsmResolver.Section

Represents a section of a portable executable.
ファイルを表示 Open project: Rex-Hays/GNIDA Class Usage Examples

Public Methods

Method Description
ContainsRawOffset ( uint rawoffset ) : bool

Returns true if the specified raw offset is located in the current section.

ContainsRva ( uint Rva ) : bool

Returns true if the specified virtual offset is located in the current section.

Disassemble ( ) : InstructionCollection

Disassembles the section to 32 bit assembly instructions.

Disassemble ( uint bytelength ) : InstructionCollection

Disassembles the section from the start with the given length.

Disassemble ( uint startoffset, uint bytelength ) : InstructionCollection

Disassembles the section from the given start offset and the given length.

GetBytes ( ) : byte[]

Gets the raw bytes of the section.

GetBytes ( uint offset, int size ) : byte[]

Gets the raw bytes of the section given by an offset and size

GetFirstSectionByFlag ( IEnumerable
sections, SectionFlags characteristics ) : Section

Gets the first section of a list of sections that contains the specified flag

GetFirstSectionByFlag ( Win32Assembly assembly, SectionFlags characteristics ) : Section

Gets the first section of an assembly that contains the specified flag

GetLastSectionByFlag ( IEnumerable
sections, SectionFlags characteristics ) : Section

Gets the last section of a list of sections that contains the specified flag

GetLastSectionByFlag ( Win32Assembly assembly, SectionFlags characteristics ) : Section

Gets the last section of an assembly that contains the specified flag

GetSectionByFileOffset ( IEnumerable
sections, uint rawoffset ) : Section

Gets the section of a list of sections by it's raw offset

GetSectionByFileOffset ( Win32Assembly assembly, uint rawoffset ) : Section

Gets the section of an assembly by it's raw offset.

GetSectionByName ( IEnumerable
sections, string sectionname ) : Section

Gets the section of a list of sections by it's name.

GetSectionByName ( Win32Assembly assembly, string sectionname ) : Section

Gets the section of an assembly by it's name.

GetSectionByRva ( IEnumerable
sections, uint virtualoffset ) : Section

Gets the section of a list of sections by it's virtual offset

GetSectionByRva ( Win32Assembly assembly, uint va ) : Section

Gets the section of an assembly by it's virtual offset.

RVAToFileOffset ( uint rva ) : uint

Converts a relative virtual address to a file offset

Section ( string name, uint offset, byte contents ) : System

Private Methods

Method Description
Section ( Win32Assembly assembly, uint headeroffset, Structures rawHeader ) : System

Method Details

ContainsRawOffset() public method

Returns true if the specified raw offset is located in the current section.
public ContainsRawOffset ( uint rawoffset ) : bool
rawoffset uint The raw offset to check.
return bool

ContainsRva() public method

Returns true if the specified virtual offset is located in the current section.
public ContainsRva ( uint Rva ) : bool
Rva uint The rva to check.
return bool

Disassemble() public method

Disassembles the section to 32 bit assembly instructions.
public Disassemble ( ) : InstructionCollection
return TUP.AsmResolver.ASM.InstructionCollection

Disassemble() public method

Disassembles the section from the start with the given length.
public Disassemble ( uint bytelength ) : InstructionCollection
bytelength uint The amount of bytes to read.
return TUP.AsmResolver.ASM.InstructionCollection

Disassemble() public method

Disassembles the section from the given start offset and the given length.
public Disassemble ( uint startoffset, uint bytelength ) : InstructionCollection
startoffset uint The offset to start reading.
bytelength uint The amount of bytes to read.
return TUP.AsmResolver.ASM.InstructionCollection

GetBytes() public method

Gets the raw bytes of the section.
public GetBytes ( ) : byte[]
return byte[]

GetBytes() public method

Gets the raw bytes of the section given by an offset and size
public GetBytes ( uint offset, int size ) : byte[]
offset uint
size int
return byte[]

GetFirstSectionByFlag() public static method

Gets the first section of a list of sections that contains the specified flag
public static GetFirstSectionByFlag ( IEnumerable
sections, SectionFlags characteristics ) : Section
sections IEnumerable
The section list to search in.
characteristics SectionFlags The flag to search for.
return Section

GetFirstSectionByFlag() public static method

Gets the first section of an assembly that contains the specified flag
public static GetFirstSectionByFlag ( Win32Assembly assembly, SectionFlags characteristics ) : Section
assembly Win32Assembly The assembly to search in.
characteristics SectionFlags The flag to search for.
return Section

GetLastSectionByFlag() public static method

Gets the last section of a list of sections that contains the specified flag
public static GetLastSectionByFlag ( IEnumerable
sections, SectionFlags characteristics ) : Section
sections IEnumerable
The section list to search in.
characteristics SectionFlags The flag to search for.
return Section

GetLastSectionByFlag() public static method

Gets the last section of an assembly that contains the specified flag
public static GetLastSectionByFlag ( Win32Assembly assembly, SectionFlags characteristics ) : Section
assembly Win32Assembly The assembly to search in.
characteristics SectionFlags The flag to search for.
return Section

GetSectionByFileOffset() public static method

Gets the section of a list of sections by it's raw offset
public static GetSectionByFileOffset ( IEnumerable
sections, uint rawoffset ) : Section
sections IEnumerable
The section list to search in.
rawoffset uint The raw offset to search for.
return Section

GetSectionByFileOffset() public static method

Gets the section of an assembly by it's raw offset.
public static GetSectionByFileOffset ( Win32Assembly assembly, uint rawoffset ) : Section
assembly Win32Assembly The assembly to search in.
rawoffset uint The raw offset to search for.
return Section

GetSectionByName() public static method

Gets the section of a list of sections by it's name.
public static GetSectionByName ( IEnumerable
sections, string sectionname ) : Section
sections IEnumerable
The section list to search in.
sectionname string The section name to search for.
return Section

GetSectionByName() public static method

Gets the section of an assembly by it's name.
public static GetSectionByName ( Win32Assembly assembly, string sectionname ) : Section
assembly Win32Assembly The assembly to search in.
sectionname string The section name to search for.
return Section

GetSectionByRva() public static method

Gets the section of a list of sections by it's virtual offset
public static GetSectionByRva ( IEnumerable
sections, uint virtualoffset ) : Section
sections IEnumerable
The section list to search in.
virtualoffset uint The virtual offset to search for.
return Section

GetSectionByRva() public static method

Gets the section of an assembly by it's virtual offset.
public static GetSectionByRva ( Win32Assembly assembly, uint va ) : Section
assembly Win32Assembly The assembly to search in.
va uint The virtual offset to search for.
return Section

RVAToFileOffset() public method

Converts a relative virtual address to a file offset
public RVAToFileOffset ( uint rva ) : uint
rva uint
return uint

Section() public method

public Section ( string name, uint offset, byte contents ) : System
name string
offset uint
contents byte
return System