C# 클래스 PERWAPI.PEFile

Base class for the PEFile (starting point)
상속: Module
파일 보기 프로젝트 열기: xored/f4 1 사용 예제들

공개 메소드들

메소드 설명
AddExternalManagedResource ( ManifestResource mr, bool isPublic ) : void

Add a managed resource from another assembly.

AddExternalManagedResource ( string resName, AssemblyRef assem, bool isPublic ) : void

Add a managed resource from another assembly.

AddExternalManagedResource ( string resName, ModuleRef mod, uint offset, bool isPublic ) : void

Add a managed resource from another module in this assembly.

AddExternalManagedResource ( string resName, ResourceFile resFile, uint offset, bool isPublic ) : void

Add a managed resource from another file in this assembly.

AddManagedResource ( string resName, byte resBytes, bool isPublic ) : void

Add a managed resource to this PEFile. The resource will be embedded in this PE file.

AddUnmanagedResources ( string resFilename ) : void

Add a manifest resource to this PEFile

GetElement ( uint token ) : MetaDataElement

Get a Meta Data Element from this PE file

GetFileName ( ) : string
GetImportedAssemblies ( ) : AssemblyRef[]
GetNamesOfImports ( ) : string[]
GetNetVersion ( ) : NetVersion

Get the version of .NET for this PE file

GetNetVersionString ( ) : string

Get the .NET version for this PE file

GetResource ( string name ) : ManifestResource

Find a resource

GetResources ( ) : PERWAPI.ManifestResource[]
GetThisAssembly ( ) : Assembly

Get the descriptor for this assembly. The PEFile must have been created with hasAssembly = true

MakeDebuggable ( bool allowDebug, bool suppressOpt ) : void

Makes the assembly debuggable by attaching the DebuggableAttribute to the Assembly. Call immediately before calling WritePEFile.

MakeExternAssembly ( string assemName ) : AssemblyRef

Make a descriptor for an external assembly to this PEFile (.assembly extern)

MakeExternModule ( string name ) : ModuleRef

Make a descriptor for an external module to this PEFile (.module extern)

PEFile ( string fileName ) : System

Create a new PE File with the name "fileName". If "fileName" ends in ".dll" then the file is a dll, otherwise it is an exe file. This PE File has no assembly.

PEFile ( string fileName, string assemblyName ) : System

Create a new PE File with the name "fileName". If "fileName" ends in ".dll" then the file is a dll, otherwise it is an exe file. This file has an Assembly called "assemblyName".

ReadExportedInterface ( string filename ) : ReferenceScope

Read an existing PE File and return the exported interface (ie. anything that was specified as public). All the MetaData structures will be Refs.

ReadPEFile ( string filename ) : PEFile

Read a PE file and create all the data structures to represent it

ReadPublicClasses ( string filename ) : PEFile
SetCorFlags ( CorFlags flags ) : void

Set the flags (.corflags)

SetFileName ( string filename ) : void
SetIsDLL ( bool isDll ) : void

Specify if this PEFile is a .dll or .exe

SetNetVersion ( NetVersion nVer ) : void

Set the .NET version for this PE file

SetOutputDirectory ( string outputDir ) : void

Set the directory that the PE File will be written to. The default is the current directory.

SetOutputStream ( Stream output ) : void

Direct PE File output to an existing stream, instead of creating a new file.

SetSubSystem ( SubSystem subS ) : void

Set the subsystem (.subsystem) (Default is Windows Console mode)

WriteCILFile ( bool debug ) : void

Write out a CIL text file for this PE file

WritePEFile ( bool writePDB ) : void

Write out the PEFile (the "bake" function)

비공개 메소드들

메소드 설명
AddToFileList ( ) : void
AddToResourceList ( ManifestResource res ) : void
BuildMetaData ( ) : void
ReadPDBScope ( PDBScope scope, MergeBuffer mergeBuffer, Scope parent, MethodDef thisMeth ) : Scope
SetDLLFlags ( ushort dflags ) : void
SetThisAssembly ( Assembly assem ) : void

메소드 상세

AddExternalManagedResource() 공개 메소드

Add a managed resource from another assembly.
public AddExternalManagedResource ( ManifestResource mr, bool isPublic ) : void
mr ManifestResource
isPublic bool
리턴 void

AddExternalManagedResource() 공개 메소드

Add a managed resource from another assembly.
public AddExternalManagedResource ( string resName, AssemblyRef assem, bool isPublic ) : void
resName string The name of the resource
assem AssemblyRef The assembly where the resource is
isPublic bool Access for the resource
리턴 void

AddExternalManagedResource() 공개 메소드

Add a managed resource from another module in this assembly.
public AddExternalManagedResource ( string resName, ModuleRef mod, uint offset, bool isPublic ) : void
resName string The name of the resource
mod ModuleRef
offset uint
isPublic bool Access for the resource
리턴 void

AddExternalManagedResource() 공개 메소드

Add a managed resource from another file in this assembly.
public AddExternalManagedResource ( string resName, ResourceFile resFile, uint offset, bool isPublic ) : void
resName string The name of the resource
resFile ResourceFile
offset uint
isPublic bool Access for the resource
리턴 void

AddManagedResource() 공개 메소드

Add a managed resource to this PEFile. The resource will be embedded in this PE file.
public AddManagedResource ( string resName, byte resBytes, bool isPublic ) : void
resName string The name of the managed resource
resBytes byte The managed resource
isPublic bool Access for the resource
리턴 void

AddUnmanagedResources() 공개 메소드

Add a manifest resource to this PEFile
public AddUnmanagedResources ( string resFilename ) : void
resFilename string
리턴 void

GetElement() 공개 메소드

Get a Meta Data Element from this PE file
public GetElement ( uint token ) : MetaDataElement
token uint The meta data token for the required element
리턴 MetaDataElement

GetFileName() 공개 메소드

public GetFileName ( ) : string
리턴 string

GetImportedAssemblies() 공개 메소드

public GetImportedAssemblies ( ) : AssemblyRef[]
리턴 AssemblyRef[]

GetNamesOfImports() 공개 메소드

public GetNamesOfImports ( ) : string[]
리턴 string[]

GetNetVersion() 공개 메소드

Get the version of .NET for this PE file
public GetNetVersion ( ) : NetVersion
리턴 NetVersion

GetNetVersionString() 공개 메소드

Get the .NET version for this PE file
public GetNetVersionString ( ) : string
리턴 string

GetResource() 공개 메소드

Find a resource
public GetResource ( string name ) : ManifestResource
name string The name of the resource
리턴 ManifestResource

GetResources() 공개 메소드

public GetResources ( ) : PERWAPI.ManifestResource[]
리턴 PERWAPI.ManifestResource[]

GetThisAssembly() 공개 메소드

Get the descriptor for this assembly. The PEFile must have been created with hasAssembly = true
public GetThisAssembly ( ) : Assembly
리턴 Assembly

MakeDebuggable() 공개 메소드

Makes the assembly debuggable by attaching the DebuggableAttribute to the Assembly. Call immediately before calling WritePEFile.
public MakeDebuggable ( bool allowDebug, bool suppressOpt ) : void
allowDebug bool set true to enable debugging, false otherwise
suppressOpt bool set true to disable optimizations that affect debugging
리턴 void

MakeExternAssembly() 공개 메소드

Make a descriptor for an external assembly to this PEFile (.assembly extern)
public MakeExternAssembly ( string assemName ) : AssemblyRef
assemName string the external assembly name
리턴 AssemblyRef

MakeExternModule() 공개 메소드

Make a descriptor for an external module to this PEFile (.module extern)
public MakeExternModule ( string name ) : ModuleRef
name string the external module name
리턴 ModuleRef

PEFile() 공개 메소드

Create a new PE File with the name "fileName". If "fileName" ends in ".dll" then the file is a dll, otherwise it is an exe file. This PE File has no assembly.
public PEFile ( string fileName ) : System
fileName string Name for the output file.
리턴 System

PEFile() 공개 메소드

Create a new PE File with the name "fileName". If "fileName" ends in ".dll" then the file is a dll, otherwise it is an exe file. This file has an Assembly called "assemblyName".
public PEFile ( string fileName, string assemblyName ) : System
fileName string Name for the output file
assemblyName string Name of the assembly
리턴 System

ReadExportedInterface() 공개 정적인 메소드

Read an existing PE File and return the exported interface (ie. anything that was specified as public). All the MetaData structures will be Refs.
public static ReadExportedInterface ( string filename ) : ReferenceScope
filename string The name of the pe file
리턴 ReferenceScope

ReadPEFile() 공개 정적인 메소드

Read a PE file and create all the data structures to represent it
public static ReadPEFile ( string filename ) : PEFile
filename string The file name of the PE file
리턴 PEFile

ReadPublicClasses() 공개 정적인 메소드

public static ReadPublicClasses ( string filename ) : PEFile
filename string
리턴 PEFile

SetCorFlags() 공개 메소드

Set the flags (.corflags)
public SetCorFlags ( CorFlags flags ) : void
flags CorFlags the flags value
리턴 void

SetFileName() 공개 메소드

public SetFileName ( string filename ) : void
filename string
리턴 void

SetIsDLL() 공개 메소드

Specify if this PEFile is a .dll or .exe
public SetIsDLL ( bool isDll ) : void
isDll bool
리턴 void

SetNetVersion() 공개 메소드

Set the .NET version for this PE file
public SetNetVersion ( NetVersion nVer ) : void
nVer NetVersion .NET version
리턴 void

SetOutputDirectory() 공개 메소드

Set the directory that the PE File will be written to. The default is the current directory.
public SetOutputDirectory ( string outputDir ) : void
outputDir string The directory to write the PE File to.
리턴 void

SetOutputStream() 공개 메소드

Direct PE File output to an existing stream, instead of creating a new file.
public SetOutputStream ( Stream output ) : void
output Stream The output stream
리턴 void

SetSubSystem() 공개 메소드

Set the subsystem (.subsystem) (Default is Windows Console mode)
public SetSubSystem ( SubSystem subS ) : void
subS SubSystem subsystem value
리턴 void

WriteCILFile() 공개 메소드

Write out a CIL text file for this PE file
public WriteCILFile ( bool debug ) : void
debug bool include debug information
리턴 void

WritePEFile() 공개 메소드

Write out the PEFile (the "bake" function)
public WritePEFile ( bool writePDB ) : void
writePDB bool
리턴 void