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

Classes

class  FileImageDataSource
 Uses operating-system positional I/O to keep large ROMs off the managed heap and permit concurrent reads.
interface  IImageDataSource
 Abstracts offset-based reads so parsers never depend on or mutate a shared stream position.
class  ImageDataSourceExtensions
 Builds exact-region parser reads on top of data sources whose primitive operations may legally be short.
class  ImageSliceStream
 Presents one validated image region as an independent, seekable, read-only stream.
interface  INdsDsiSignatureProvider
 Abstracts DSi header signing so build pipelines may use a managed private key, hardware-backed key, or remote signing authority without exposing private material to the builder. Implementations must produce the format's 128-byte RSA-1024 PKCS#1 v1.5 signature over SHA-1 of the exact supplied 0xE00 bytes. More...
class  MemoryImageDataSource
 Projects caller-owned memory as an allocation-free random-access source for small or already-loaded images.
class  NamespaceDoc
 Provides the complete managed API for reading, validating, editing, comparing, extracting, and building Nintendo DS and DSi images.
class  NdsBanner
 Represents a versioned menu icon, localized titles, and optional DSi animation. More...
class  NdsBannerAnimationStep
 Describes one timed DSi menu-icon pose. Tile and palette frames are selected independently so an animation can recolor existing artwork without duplicating its 512-byte tile data; a zero packed word is reserved as the hardware sequence terminator and therefore cannot represent a step. More...
class  NdsBannerBuilder
 Builds deterministic DS banners, including the DSi animated-icon layout. More...
class  NdsBannerParser
 Reads the version prefix first so only the exact supported banner structure is allocated from an image.
class  NdsBinary
 Centralizes the little-endian and fixed-field string conventions shared by DS-family structures.
class  NdsBuildFile
 Holds one NitroFS payload while an image is being assembled, independently of any source ROM. More...
class  NdsChecksums
 Calculates checksums used by Nintendo DS image structures. More...
class  NdsDirectory
 Materializes one FNT directory record as a navigable node while preserving its encoded child order. More...
class  NdsDirectoryImportOptions
 Bounds host-directory materialization and makes merge and link behavior explicit. More...
 Supplies DSi-only execution, service, storage, and policy metadata while retaining unmodeled extension bytes from an optional template. Physical program, digest, banner, and total-size fields remain layout-owned. More...
class  NdsDsiDigestBuilder
 Generates the two-level DSi content HMAC hierarchy from already committed image bytes.
class  NdsDsiDigestOptions
 Configures the optional DSi hierarchical HMAC-SHA1 tables that cover common NTR content and DSi-mode TWL Programs. Table sizes and offsets remain layout-owned so callers cannot supply internally inconsistent values. More...
class  NdsDsiHeader
 Projects DSi security, digest, memory, title, and save metadata while preserving the complete extension. More...
class  NdsDsiHeaderWriter
 Overlays typed DSi metadata, layout-owned regions, and explicitly requested authentication fields onto the extended header. Reserved template bytes survive, while stale size, digest, HMAC, and signature claims do not.
class  NdsDsiIntegrityOptions
 Defines which DSi authentication fields a build can honestly produce. Component HMACs use caller-selected key material, while an optional signing provider keeps private-key custody outside the image builder. The built-in ndstool policy remains explicitly a homebrew compatibility identity rather than a retail trust claim. More...
class  NdsDsiIntegrityValidator
 Validates DSi-specific bounds and authentication fields without assigning trust to unprovided keys.
class  NdsDsiKeyScrambler
 Implements the DSi 128-bit KeyX/KeyY scrambler in cartridge-register byte order. It contains only the public arithmetic and modcrypt slot prefix; callers remain responsible for the provenance of arbitrary key components. More...
class  NdsDsiRsaPublicKey
 Represents one explicitly trusted RSA-1024 public key for DSi header authentication. Trust is supplied by the caller; constructing this value does not imply that a modulus belongs to Nintendo or any particular publisher. More...
class  NdsDsiRsaSignatureProvider
 Snapshots a managed RSA-1024 private key for deterministic DSi header signing. Dispose the provider after its build recipes finish so copied private parameters are cleared; the source RSA remains caller-owned. More...
class  NdsEditPlan
 Describes semantic preservation edits before any destination is created or truncated. More...
class  NdsElfAssembler
 Converts validated ELF segments into cartridge-ready Program and Overlay definitions.
class  NdsElfImportOptions
 Bounds ELF ingestion and controls whether ndstool-style Overlay program headers become definitions. More...
class  NdsElfImportResult
 Returns a builder-ready executable plus any Overlay definitions decoded from the same ELF image. More...
class  NdsElfParser
 Validates the ELF32 ARM envelope and bounded program-header table before any payload assembly begins.
class  NdsElfProgramImporter
 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...
class  NdsElfSegment
 Projects the eight fixed ELF32 program-header words without exposing an incomplete general ELF model.
class  NdsExtractionOptions
 Controls component and NitroFS extraction. More...
class  NdsFile
 Connects a byte-preserving FNT path and stable FAT identifier to lazily read cartridge bytes. More...
class  NdsFileNameTableWriter
 Translates the path-oriented build model into the compact linked-directory representation used on cartridge.
class  NdsFileSystem
 Provides tree, path, and file-ID access to an image's NitroFS. More...
class  NdsFileSystemBuilder
 Models structural NitroFS changes before ROM offsets and file identifiers are assigned. More...
class  NdsFileSystemBuildSnapshot
 Couples a serialized NitroFS name table with the payload and directory-ID assignments it encodes.
class  NdsHeader
 Projects the common cartridge header into typed fields while retaining every byte needed for lossless work. More...
class  NdsHeaderEdit
 Collects validated mutable identity and card-control header fields. More...
class  NdsHostDirectoryImporter
 Stages a host tree in deterministic order and rejects unsafe or oversized input before builder mutation.
class  NdsImage
 Provides structured, random-access inspection of a Nintendo DS-family image. More...
class  NdsImageBuildContentPreparer
 Converts one logical build recipe into immutable bytes and File IDs governed by the selected profile.
class  NdsImageBuilder
 Assembles a deterministic Nintendo DS Image from typed Programs, metadata, Banner, logo, and NitroFS tree. More...
class  NdsImageBuildImporter
 Detaches logical DS or DSi components from an existing Image for deliberate Structural Rebuild operations.
class  NdsImageBuildOptions
 Controls deterministic physical placement without mixing Layout policy into image metadata. More...
class  NdsImageBuildResult
 Reports the concrete Layout identities assigned while committing a Build Recipe. More...
class  NdsImageBuildVerifier
 Reopens generated output through public parsing paths and compares every recipe-owned payload.
class  NdsImageBuildWriter
 Calculates one immutable Layout, serializes its interdependent tables, and commits components in offset order.
class  NdsImageComparer
 Compares hash-bearing manifests so tooling can distinguish content edits from identity and layout changes. More...
class  NdsImageDiff
 Collects deterministic semantic, identity, and layout differences between two manifest snapshots. More...
class  NdsImageEditor
 Collects explicit image changes and saves them without mutating the source. More...
class  NdsImageExtractor
 Maps selected image structures to a hardened, portable directory tree using atomic per-file writes.
class  NdsImageHeaderWriter
 Serializes the common Nintendo DS cartridge header after layout has assigned every referenced region. Keeping this operation separate prevents the layout planner from duplicating the format's offset tuples and ensures both Nintendo logo and header checksums are computed only after all dependent fields are final.
class  NdsImageLayoutPlanner
 Assigns every physical build region from frozen content sizes without consulting mutable stream state.
class  NdsImageLoader
 Coordinates header, filesystem, overlay, and banner parsers while preserving data-source ownership rules.
class  NdsImageManifest
 Provides a stable, content-addressed description of one parsed image for CI artifacts, review, and semantic comparison. The manifest contains no ROM payload bytes and cannot reconstruct copyrighted or private content. More...
class  NdsImageManifestCapture
 Streams image regions into stable manifest DTOs without materializing payloads or leaking source ownership.
class  NdsImageValidator
 Applies cross-component integrity checks that require both parsed metadata and the source image length.
class  NdsKey1Cipher
 Implements the format-mandated KEY1 schedule and 64-bit block permutation over caller-supplied tables.
class  NdsKey1KeyTable
 Holds the 18 round words and four 256-word substitution boxes consumed by the DS KEY1 algorithm. The library deliberately has no built-in retail table: callers obtain the 0x1048 bytes from a source they are authorized to use and can keep that provenance outside build recipes and logs. More...
class  NdsLegacyArm7Hook
 Reproduces ndstool's historical trainer layout by relocating ARM7, appending caller code and a header backup, and patching boot addresses with the historical staged CRC correction. It is isolated because modern builds do not need it. More...
class  NdsLegacyArm7HookResult
 Reports a detached legacy ARM7 hook image and the regions introduced by the compatibility transform. More...
class  NdsLegacyCrc32
 Implements the reversible CRC32 correction word used only by the historical ARM7 hook layout.
class  NdsManifestAllocation
 Snapshots every FAT record, including unnamed private Overlay payloads and otherwise unreferenced allocations. More...
class  NdsManifestBanner
 Snapshots banner format, content, localized text, and physical placement without embedding rendered pixels. More...
class  NdsManifestDsi
 Snapshots DSi-specific title, size, security-mode, and modcrypt layout metadata. More...
class  NdsManifestFile
 Snapshots one named NitroFS allocation so path, numeric identity, layout, and payload can change independently. More...
class  NdsManifestHeader
 Snapshots common header identity, execution policy, and size claims in serialization-stable scalar fields. More...
class  NdsManifestOverlay
 Snapshots one Overlay record and its resolved payload identity without conflating Overlay and File IDs. More...
class  NdsManifestProgram
 Snapshots one executable's physical placement, runtime mapping, and content identity. More...
class  NdsManifestRegion
 Serializes a half-open image interval without relying on value-type JSON conventions. More...
class  NdsModcrypt
 Applies the DSi AES-CTR transform with little-endian counter advancement. Encryption and decryption are the same operation; overloads support isolated buffers, arbitrary slices, and bounded caller-owned streams. More...
class  NdsModcryptContext
 Captures the AES-128 normal key and both HMAC-derived initial counters needed to transform DSi modcrypt areas. Every byte array is copied so a reviewed context cannot change when its source buffers are reused or cleared. More...
class  NdsModcryptTransform
 Maintains one forward-only AES-CTR cursor so large streams need neither alignment nor whole-file buffering.
class  NdsOverlay
 Describes an ARM overlay-table entry and its referenced FAT payload. More...
class  NdsOverlayDefinition
 Describes one Overlay record and its private Allocation when constructing a new Image. More...
class  NdsOverlayParser
 Decodes processor-specific overlay tables and links each record to its actual FAT payload.
class  NdsProgram
 Describes an executable program region and its runtime addresses. More...
class  NdsProgramDefinition
 Supplies one executable payload and the CPU addresses required to place it in a newly built image. More...
class  NdsReadOptions
 Controls resource limits applied while parsing an image. More...
class  NdsRegion
 Identifies a bounded range of bytes in an image. More...
class  NdsSecureArea
 Provides pure inspection and KEY1 transformations for the conventional 0x4000-0x7FFF cartridge interval. Operations return new buffers and never rewrite a source image, header checksum, or caller key table. More...
class  NdsSecureAreaInspection
 Reports secure-area presence, encryption state, and checksum evidence without modifying image bytes. More...
class  NdsSecureAreaValidator
 Translates pure secure-area inspection into stable validation diagnostics with explicit key semantics.
class  NdsSemanticDifference
 Describes one stable manifest path whose semantic value differs between two images. More...
class  NdsValidationOptions
 Supplies optional trust material and policy for validation checks that cannot be inferred from image bytes. Structural, CRC, digest-table, and development-marker checks remain available without external keys. More...
class  NdsValidationResult
 Contains all diagnostics produced by a validation pass. More...
class  NdsWriteOptions
 Controls preservation-oriented image saves. More...
class  NitroFileSystemParser
 Reconciles the linked FNT hierarchy with the flat FAT allocation array under explicit safety limits.
class  StreamImageDataSource
 Adapts a caller stream to positional reads while serializing access to its unavoidable shared cursor.

Enumerations

enum  NdsBannerLanguage {
  Japanese , English , French , German ,
  Italian , Spanish , Chinese , Korean
}
 Identifies a localized Nintendo DS banner title slot. More...
enum  NdsDsiSignatureMode { Cleared , NoGbaDevelopmentMarker , RsaSha1 }
 Selects how a DSi build populates the 128-byte signature field under an explicit authenticity policy. More...
enum  NdsFileCollisionPolicy { Fail , KeepExisting , Replace }
 Controls how a host-directory import handles a file path already present in the NitroFS recipe. More...
enum  NdsHostLinkPolicy { Reject , Skip }
 Controls treatment of host reparse points and symbolic links during bounded directory ingestion. More...
enum  NdsImageBuildProfile { Deterministic , Ndstool1503 }
 Selects a documented Layout personality without contaminating the logical Build Recipe. More...
enum  NdsDiagnosticSeverity { Information , Warning , Error }
 Indicates the impact of a validation finding. More...
enum  NdsDifferenceKind {
  Added , Removed , Modified , Relocated ,
  Renumbered , Moved
}
 Classifies how one semantic or physical image value changed between manifest snapshots. More...
enum  NdsRepairKind {
  None = 0 , HeaderCrc = 1 << 0 , NintendoLogoCrc = 1 << 1 , BannerCrcs = 1 << 2 ,
  SecureAreaCrc = 1 << 3
}
 Names independently requested checksum repairs so an edit plan never hides a broad implicit fix operation. More...
enum  NdsImageComponent {
  None = 0 , Header = 1 << 0 , Programs = 1 << 1 , FileSystemTables = 1 << 2 ,
  NitroFileSystem = 1 << 3 , Overlays = 1 << 4 , Banner = 1 << 5 , Logo = 1 << 6 ,
  All = Header | Programs | FileSystemTables | NitroFileSystem | Overlays | Banner | Logo
}
 Identifies image components that can be exported. More...
enum  NdsOverwritePolicy { Fail , Overwrite , Skip }
 Controls how extraction handles existing regular files. More...
enum  NdsModcryptArea { First = 0 , Second = 1 }
 Identifies which DSi modcrypt interval and HMAC-derived initial counter a transformation uses. More...
enum  NdsModcryptKeyMode { InsecureHeaderKey , SecureNormalKey }
 Records whether a modcrypt context came from public header bytes or externally derived secure material. More...
enum  NdsImageKind { NintendoDs = 0 , NintendoDsiEnhanced = 2 , NintendoDsiExclusive = 3 }
 Identifies the hardware family targeted by an image. More...
enum  NdsProcessor { Arm9 , Arm7 , Arm9i , Arm7i }
 Identifies a processor and execution mode. More...
enum  NdsSecureAreaState {
  Absent , Decrypted , Encrypted , Multiboot ,
  Unrecognized , Malformed
}
 Classifies the cartridge security interval without conflating encrypted bytes with malformed metadata. More...

Enumeration Type Documentation

◆ NdsBannerLanguage

Identifies a localized Nintendo DS banner title slot.

Enumerator
Japanese 

Occupies title slot zero and is available in every supported banner version.

English 

Occupies title slot one and is available in every supported banner version.

French 

Occupies title slot two and is available in every supported banner version.

German 

Occupies title slot three and is available in every supported banner version.

Italian 

Occupies title slot four and is available in every supported banner version.

Spanish 

Occupies title slot five and completes the six-language version-one layout.

Chinese 

Occupies slot six, introduced by banner version two and retained by later versions.

Korean 

Occupies slot seven, introduced by banner version three and present in DSi animated banners.

Definition at line 4 of file NdsBannerLanguage.cs.

◆ NdsDiagnosticSeverity

Indicates the impact of a validation finding.

Enumerator
Information 

Additional information that does not indicate malformed data.

Warning 

Suspicious data that can still be interpreted safely.

Error 

Malformed or inconsistent data that prevents a reliable operation.

Definition at line 4 of file NdsDiagnosticSeverity.cs.

◆ NdsDifferenceKind

Classifies how one semantic or physical image value changed between manifest snapshots.

Enumerator
Added 

A component or optional structure exists only in the right image.

Removed 

A component or optional structure exists only in the left image.

Modified 

Content or metadata differs while the component retains the same logical identity.

Relocated 

The same component occupies a different physical image interval.

Renumbered 

The same logical component has a different FAT or similar numeric identifier.

Moved 

A uniquely content-matched file changed its canonical NitroFS path.

Definition at line 4 of file NdsDifferenceKind.cs.

◆ NdsDsiSignatureMode

Selects how a DSi build populates the 128-byte signature field under an explicit authenticity policy.

Enumerator
Cleared 

Leaves all signature bytes zero so consumers cannot mistake the image for authenticated retail content.

NoGbaDevelopmentMarker 

Writes the development marker used by ndstool and no$gba: fixed framing bytes plus SHA-1 of header bytes 0x000-0xDFF. This aids homebrew interoperability but is not an RSA signature.

RsaSha1 

Uses an application-supplied provider to produce a real RSA-1024 SHA-1 PKCS#1 v1.5 signature.

Definition at line 4 of file NdsDsiSignatureMode.cs.

◆ NdsFileCollisionPolicy

Controls how a host-directory import handles a file path already present in the NitroFS recipe.

Enumerator
Fail 

Rejects the complete import before any staged directory or file is applied.

KeepExisting 

Retains the existing builder-owned payload and counts the staged host file as skipped.

Replace 

Replaces the existing payload while preserving its logical NitroFS path.

Definition at line 4 of file NdsFileCollisionPolicy.cs.

◆ NdsHostLinkPolicy

Controls treatment of host reparse points and symbolic links during bounded directory ingestion.

Enumerator
Reject 

Rejects the complete import when any traversed entry redirects outside ordinary directory structure.

Skip 

Omits linked files or directory subtrees and reports how many entries were skipped.

Definition at line 4 of file NdsHostLinkPolicy.cs.

◆ NdsImageBuildProfile

Selects a documented Layout personality without contaminating the logical Build Recipe.

Enumerator
Deterministic 

Uses NdsForge's dependency-free stable ordering, explicit metadata, and configurable deterministic padding.

Ndstool1503 

Reproduces characterized Nintendo DS creation conventions from ndstool 1.50.3 for byte-level interoperability.

Definition at line 4 of file NdsImageBuildProfile.cs.

◆ NdsImageComponent

Identifies image components that can be exported.

Enumerator
None 

Suppresses all output and is useful when composing a selection conditionally.

Header 

The parsed header bytes.

Programs 

ARM7, ARM9, ARM7i, and ARM9i programs.

FileSystemTables 

The raw filename and file-allocation tables.

NitroFileSystem 

Exports named FNT entries beneath data/ while preserving their logical directory hierarchy.

Overlays 

Overlay tables and resolved payloads.

Banner 

Exports the complete version-sized banner structure, including reserved and animated DSi bytes.

Logo 

The raw Nintendo logo data from the header.

All 

Every supported component.

Definition at line 5 of file NdsImageComponent.cs.

◆ NdsImageKind

Identifies the hardware family targeted by an image.

Enumerator
NintendoDs 

A Nintendo DS application.

NintendoDsiEnhanced 

A Nintendo DS application with DSi-enhanced content.

NintendoDsiExclusive 

A DSi-exclusive application.

Definition at line 4 of file NdsImageKind.cs.

◆ NdsModcryptArea

Identifies which DSi modcrypt interval and HMAC-derived initial counter a transformation uses.

Enumerator
First 

Selects the first interval and the first sixteen bytes of the ARM9 HMAC.

Second 

Selects the second interval and the first sixteen bytes of the ARM7 HMAC.

Definition at line 4 of file NdsModcryptArea.cs.

◆ NdsModcryptKeyMode

Records whether a modcrypt context came from public header bytes or externally derived secure material.

Enumerator
InsecureHeaderKey 

The first sixteen header bytes are the normal AES key because either insecure-key flag is set.

SecureNormalKey 

The AES normal key was supplied explicitly after any platform-specific key scrambling occurred elsewhere.

Definition at line 4 of file NdsModcryptKeyMode.cs.

◆ NdsOverwritePolicy

Controls how extraction handles existing regular files.

Enumerator
Fail 

Fail before replacing an existing file.

Overwrite 

Atomically replace an existing regular file where supported.

Skip 

Leave an existing regular file unchanged.

Definition at line 4 of file NdsOverwritePolicy.cs.

◆ NdsProcessor

Identifies a processor and execution mode.

Enumerator
Arm9 

The ARM9 program used in Nintendo DS mode.

Arm7 

The ARM7 program used in Nintendo DS mode.

Arm9i 

The ARM9 program used in DSi mode.

Arm7i 

The ARM7 program used in DSi mode.

Definition at line 4 of file NdsProcessor.cs.

◆ NdsRepairKind

Names independently requested checksum repairs so an edit plan never hides a broad implicit fix operation.

Enumerator
None 

No source defect has been selected for repair.

HeaderCrc 

Recalculates the common header CRC over bytes 0x000-0x15D.

NintendoLogoCrc 

Recalculates the dedicated Nintendo-logo checksum stored at header offset 0x15C.

BannerCrcs 

Recalculates every cumulative checksum field defined by the current banner version.

SecureAreaCrc 

Recalculates the encrypted-representation secure-area checksum stored at header offset 0x6C.

Definition at line 5 of file NdsRepairKind.cs.

◆ NdsSecureAreaState

Classifies the cartridge security interval without conflating encrypted bytes with malformed metadata.

Enumerator
Absent 

The ARM9 layout does not use the cartridge interval beginning at 0x4000.

Decrypted 

The first two words contain the conventional destroyed secure-area identifier used by decrypted dumps.

Encrypted 

The first 2 KiB successfully decrypt to the secure-area identifier under the caller's KEY1 table.

Multiboot 

The interval begins with zero words used by multiboot-style images rather than a transformable secure payload.

Unrecognized 

Bytes are present but neither plain markers nor a caller-key-verifiable encrypted identifier were found.

Malformed 

The header selects a secure interval that is truncated or otherwise structurally unavailable.

Definition at line 4 of file NdsSecureAreaState.cs.