Struct BundlerParameters
- Namespace
- AsmResolver.DotNet.Bundles
- Assembly
- AsmResolver.DotNet.dll
Defines parameters for the .NET application bundler.
public struct BundlerParameters
- Inherited Members
Constructors
BundlerParameters(byte[], string)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
BundlerParameters(byte[], string, IDataSource?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, IDataSource? imageToCopyHeadersFrom)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFrom
IDataSourceThe binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
BundlerParameters(byte[], string, SubSystem, ResourceDirectory?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, SubSystem subSystem, ResourceDirectory? resources)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
subSystem
SubSystemThe subsystem to use in the final Windows PE binary.
resources
ResourceDirectoryThe resources to copy into the final Windows PE binary.
BundlerParameters(byte[], string, PEImage?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, PEImage? imageToCopyHeadersFrom)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFrom
PEImageThe PE image to copy the headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
BundlerParameters(byte[], string, byte[]?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(byte[] appHostTemplate, string appBinaryPath, byte[]? imageToCopyHeadersFrom)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFrom
byte[]The binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
BundlerParameters(string, string)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(string appHostTemplatePath, string appBinaryPath)
Parameters
appHostTemplatePath
stringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplate
or<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native
.appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
BundlerParameters(string, string, string?)
Initializes new bundler parameters.
[Obsolete("Use BundlerParameters::FromTemplate instead.")]
public BundlerParameters(string appHostTemplatePath, string appBinaryPath, string? imagePathToCopyHeadersFrom)
Parameters
appHostTemplatePath
stringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplate
or<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native
.appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
imagePathToCopyHeadersFrom
stringThe path to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
Properties
ApplicationBinaryPath
Gets or sets the path to the binary within the bundle that contains the application's entry point.
public string ApplicationBinaryPath { readonly get; set; }
Property Value
ApplicationHostTemplate
Gets or sets the template application hosting binary.
public byte[] ApplicationHostTemplate { readonly get; set; }
Property Value
- byte[]
Remarks
By default, the official implementations of the application host can be found in one of the following installation directories:
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplate
<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native
IsArm64Linux
Gets a value indicating whether the bundled executable targets the Linux operating system on ARM64.
public bool IsArm64Linux { readonly get; set; }
Property Value
PathPlaceholder
Gets or sets the path placeholder in ApplicationHostTemplate that will be replaced with the contents of ApplicationBinaryPath.
public byte[] PathPlaceholder { readonly get; set; }
Property Value
- byte[]
Resources
Gets or sets the Win32 resources directory to copy into the final PE executable.
public ResourceDirectory? Resources { readonly get; set; }
Property Value
Remarks
This field is ignored if IsArm64Linux is set to true
, or ApplicationHostTemplate
does not contain a proper PE image.
SubSystem
Gets or sets the Windows subsystem the final PE executable should target.
public SubSystem SubSystem { readonly get; set; }
Property Value
Remarks
This field is ignored if IsArm64Linux is set to true
, or ApplicationHostTemplate
does not contain a proper PE image.
Methods
FromExistingBundle(byte[], string)
Extracts bundler parameters from an existing packaged bundled PE file.
public static BundlerParameters FromExistingBundle(byte[] originalFile, string appBinaryPath)
Parameters
originalFile
byte[]The raw contents of the original PE file.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
Returns
Remarks
This method uses heuristics to determine the right offsets within the existing apphost bundle file, and is not guaranteed to always produce the right bundler parameters.
FromExistingBundle(byte[], string, string)
Extracts bundler parameters from an existing packaged bundled PE file.
public static BundlerParameters FromExistingBundle(byte[] originalFile, string originalAppBinaryPath, string newAppBinaryPath)
Parameters
originalFile
byte[]The raw contents of the original PE file.
originalAppBinaryPath
stringThe original name of the file in the bundle that contains the entry point of the application.
newAppBinaryPath
stringThe new name of the file in the bundle that contains the entry point of the application.
Returns
Remarks
This method uses heuristics to determine the right offsets within the existing apphost bundle file, and is not guaranteed to always produce the right bundler parameters.
FromExistingBundle(string, string)
Extracts bundler parameters from an existing packaged bundled PE file.
public static BundlerParameters FromExistingBundle(string originalFile, string appBinaryPath)
Parameters
originalFile
stringThe path to the original PE file.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
Returns
Remarks
This method uses heuristics to determine the right offsets within the existing apphost bundle file, and is not guaranteed to always produce the right bundler parameters.
FromTemplate(byte[], string)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(byte[] appHostTemplate, string appBinaryPath)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
Returns
FromTemplate(byte[], string, PEImage?)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(byte[] appHostTemplate, string appBinaryPath, PEImage? imageToCopyHeadersFrom)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFrom
PEImageThe image to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
Returns
FromTemplate(byte[], string, byte[]?)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(byte[] appHostTemplate, string appBinaryPath, byte[]? imageToCopyHeadersFrom)
Parameters
appHostTemplate
byte[]The application host template file to use.
appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
imageToCopyHeadersFrom
byte[]The binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.
Returns
FromTemplate(string, string)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(string appHostTemplatePath, string appBinaryPath)
Parameters
appHostTemplatePath
stringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplate
or<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native
.appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
Returns
FromTemplate(string, string, string?)
Initializes new bundler parameters from an apphost template.
public static BundlerParameters FromTemplate(string appHostTemplatePath, string appBinaryPath, string? imagePathToCopyHeadersFrom)
Parameters
appHostTemplatePath
stringThe path to the application host file template to use. By default this is stored in
<DOTNET-INSTALLATION-PATH>/sdk/<version>/AppHostTemplate
or<DOTNET-INSTALLATION-PATH>/packs/Microsoft.NETCore.App.Host.<runtime-identifier>/<version>/runtimes/<runtime-identifier>/native
.appBinaryPath
stringThe name of the file in the bundle that contains the entry point of the application.
imagePathToCopyHeadersFrom
stringThe path to the binary to copy the PE headers and Win32 resources from. This is typically the original native executable file that hosts the CLR, or the original AppHost file the bundle was extracted from.