SingleFileBundleReader
Namespace: Dotsider.Core.Analysis
Assembly: Dotsider.Core.dll
Reads .NET single-file bundles — detects the bundle signature, parses the manifest header, and extracts individual entries.
public static class SingleFileBundleReaderInheritance
Section titled “Inheritance”Object → SingleFileBundleReader
Methods
Section titled “Methods”FindEntryAssembly(string)
Section titled “FindEntryAssembly(string)”Detects a single-file bundle and extracts the entry assembly (the app’s own managed code).
Uses dotted-name-safe basename matching: for .exe files, strips the extension;
for extensionless files, appends .dll to the full filename.
Parameters:
bundlePath(String): Path to the potential bundle file.
Returns: Nullable<Byte[], String>>
The entry assembly bytes and name, or null if the file is not a bundle,
the manifest is invalid, or no entry assembly could be identified.
public static (byte[] Bytes, string Name)? FindEntryAssembly(string bundlePath)IsBundle(ReadOnlySpan<byte>, out long)
Section titled “IsBundle(ReadOnlySpan<byte>, out long)”Checks whether the raw bytes contain the .NET single-file bundle signature.
Parameters:
data(ReadOnlySpan<Byte>): The raw file bytes.headerOffset(Int64): When this method returnstrue, contains the byte offset of the bundle header.
Returns: Boolean
true if the signature is found; otherwise false.
public static bool IsBundle(ReadOnlySpan<byte> data, out long headerOffset)IsBundle(string, out long)
Section titled “IsBundle(string, out long)”Checks whether the file at filePath is a .NET single-file bundle.
Parameters:
filePath(String): Path to the file to inspect.headerOffset(Int64): When this method returnstrue, contains the byte offset of the bundle header.
Returns: Boolean
true if the file contains the bundle signature; otherwise false.
public static bool IsBundle(string filePath, out long headerOffset)ReadAssembly(string, BundleManifest, string)
Section titled “ReadAssembly(string, BundleManifest, string)”Finds and reads an assembly entry by assembly name (without extension).
Parameters:
filePath(String): Path to the bundle file.manifest(BundleManifest): The bundle manifest.assemblyName(String): Assembly name without extension (e.g. “System.Runtime”).
Returns: Byte[]
The assembly bytes, or null if the entry is not found, is unsafe, or cannot be read.
public static byte[]? ReadAssembly(string filePath, BundleManifest manifest, string assemblyName)ReadEntry(string, BundleManifest, string)
Section titled “ReadEntry(string, BundleManifest, string)”Reads a specific entry’s raw bytes from the bundle.
Parameters:
filePath(String): Path to the bundle file.manifest(BundleManifest): The bundle manifest.entryRelativePath(String): The RelativePath to read.
Returns: Byte[]
The entry’s bytes, or null if the entry was not found, is unsafe, or cannot be read.
public static byte[]? ReadEntry(string filePath, BundleManifest manifest, string entryRelativePath)ReadManifest(Stream)
Section titled “ReadManifest(Stream)”Reads the bundle manifest from a readable, seekable stream positioned at the header.
Parameters:
stream(Stream): A readable, seekable stream positioned at the bundle header offset.
Returns: BundleManifest
The parsed bundle manifest.
Exceptions:
- InvalidDataException: The stream is unsuitable, the manifest is malformed, or the bundle version is unsupported.
public static BundleManifest ReadManifest(Stream stream)ReadManifest(string, long)
Section titled “ReadManifest(string, long)”Reads the bundle manifest from the file at filePath.
Parameters:
filePath(String): Path to the bundle file.headerOffset(Int64): The byte offset of the bundle header, as returned by Int64%40).
Returns: BundleManifest
The parsed bundle manifest.
Exceptions:
- InvalidDataException: The header offset is invalid, the manifest is malformed, or the bundle version is unsupported.
public static BundleManifest ReadManifest(string filePath, long headerOffset)