NdsForge.NET 1.0.1
Read, validate, edit, compare, and build Nintendo DS and DSi images from .NET
Loading...
Searching...
No Matches
NdsForge.NdsElfProgramImporter Class Reference

Imports executable ARM ELF32 files into builder-ready Program and Overlay definitions. Parsing is deliberately bounded and transactional: callers receive a complete result only after every selected range is validated. More...

Static Public Member Functions

static NdsElfImportResult Import (ReadOnlyMemory< byte > data, NdsProcessor processor, NdsElfImportOptions? options=null)
 Imports an ELF already available in memory without retaining or mutating the caller's buffer.
static async ValueTask< NdsElfImportResultImportAsync (string path, NdsProcessor processor, NdsElfImportOptions? options=null, CancellationToken cancellationToken=default)
 Reads and imports a filesystem ELF after checking its length before allocation.
static async ValueTask< NdsElfImportResultImportAsync (Stream stream, NdsProcessor processor, bool leaveOpen=false, NdsElfImportOptions? options=null, CancellationToken cancellationToken=default)
 Consumes ELF bytes from a stream's current position, including non-seekable sources, under a hard allocation bound. Stream ownership is explicit and independent from successful parsing.

Detailed Description

Imports executable ARM ELF32 files into builder-ready Program and Overlay definitions. Parsing is deliberately bounded and transactional: callers receive a complete result only after every selected range is validated.

Definition at line 9 of file NdsElfProgramImporter.cs.

Member Function Documentation

◆ Import()

NdsElfImportResult NdsForge.NdsElfProgramImporter.Import ( ReadOnlyMemory< byte > data,
NdsProcessor processor,
NdsElfImportOptions? options = null )
inlinestatic

Imports an ELF already available in memory without retaining or mutating the caller's buffer.

Parameters
dataComplete ELF32 input.
processorARM9, ARM7, ARM9i, or ARM7i segment classification to select.
optionsOptional resource and Overlay policy.
Returns
A detached Program and any decoded Overlay definitions.

Definition at line 16 of file NdsElfProgramImporter.cs.

◆ ImportAsync() [1/2]

async ValueTask< NdsElfImportResult > NdsForge.NdsElfProgramImporter.ImportAsync ( Stream stream,
NdsProcessor processor,
bool leaveOpen = false,
NdsElfImportOptions? options = null,
CancellationToken cancellationToken = default )
inlinestatic

Consumes ELF bytes from a stream's current position, including non-seekable sources, under a hard allocation bound. Stream ownership is explicit and independent from successful parsing.

Parameters
streamReadable source positioned at ELF byte zero.
processorProcessor and DS/DSi mode whose segments are selected.
leaveOpenWhether the source remains usable after success, cancellation, or format failure.
optionsOptional resource and Overlay policy.
cancellationTokenCancels bounded buffering before parsing.
Returns
A detached Program and Overlay result.

Definition at line 70 of file NdsElfProgramImporter.cs.

◆ ImportAsync() [2/2]

async ValueTask< NdsElfImportResult > NdsForge.NdsElfProgramImporter.ImportAsync ( string path,
NdsProcessor processor,
NdsElfImportOptions? options = null,
CancellationToken cancellationToken = default )
inlinestatic

Reads and imports a filesystem ELF after checking its length before allocation.

Parameters
pathInput file whose contents are consumed without modification.
processorProcessor and DS/DSi mode whose segments are selected.
optionsOptional resource and Overlay policy.
cancellationTokenCancels file reading before a result escapes.
Returns
A detached Program and Overlay result independent from the closed file.

Definition at line 38 of file NdsElfProgramImporter.cs.


The documentation for this class was generated from the following file: