SongYZZZ/moon-firmware/firmware does not have a README file

    ConversionResult

    pub(all) struct ConversionResult {
    bytes : Bytes
    warnings : Array[
    Diagnostic
    ]
    binary_base : Int64?
    }

    Encoded bytes and explicit information about metadata that the output loses.

    ConvertOptions

    Unified output configuration, keeping the protocol-specific controls typed.

    ConvertOptions::new

    Defaults keep sparse BIN expansion below 16 MiB and require explicit fill.

    EntryPolicy

    pub(all) enum EntryPolicy {
    RejectEntryConflict
    PreferFirst
    PreferLast
    } derive(Eq,
    Debug
    )

    Execution metadata conflicts are separate from data overwrite policy.

    FirmwareDiff

    pub(all) struct FirmwareDiff {
    only_left : Array[
    AddressRange
    ]
    only_right : Array[
    AddressRange
    ]
    changed : Array[
    AddressRange
    ]
    identical_bytes : Int64
    changed_bytes : Int64
    removed_bytes : Int64
    added_bytes : Int64
    entry_changed : Bool
    } derive(Eq,
    Debug
    )

    Address-level comparison, retaining compact ranges rather than expanded gaps.

    FirmwareDiff::is_equal

    fn FirmwareDiff::is_equal(self : FirmwareDiff) -> Bool

    True when occupied bytes and exact execution entry state are equal.

    FirmwareDiff::render

    fn FirmwareDiff::render(self : FirmwareDiff) -> String

    Compact deterministic report. Ranges are inclusive in rendered output.

    ImageStatistics

    pub(all) struct ImageStatistics {
    format :
    Format

    lowest_address : Int64?
    highest_address : Int64?
    address_span : Int64
    payload_bytes : Int
    segment_count : Int
    gap_count : Int
    gap_bytes : Int64
    largest_gap : Int64
    entry :
    EntryPoint
    ?
    checksum_status :
    ChecksumStatus

    record_count : Int
    record_counts : Array[Int]
    warning_count : Int
    } derive(Eq,
    Debug
    )

    Facts computed from normalized memory and source metadata.

    ImageStatistics::render

    fn ImageStatistics::render(self : ImageStatistics) -> String

    Stable human-readable report used by the CLI and examples.

    convert

    Convert an in-memory image, reporting unavoidable format metadata changes.

    decode_text

    fn decode_text(bytes : Bytes, format :
    Format
    , max_length? : Int) -> String raise
    FirmwareError

    Byte-to-text boundary rejects non-ASCII, except a leading UTF-8 BOM which the permissive line policy handles explicitly. Invalid UTF-8 is never replaced.

    detect_format

    fn detect_format(bytes : Bytes) ->
    Format

    Content detection is conservative. Printable text with no record signature remains Unknown; a binary hint is needed for ambiguous printable raw bytes.

    diff_images

    Sweep occupied interval boundaries. Runtime depends on actual payload and segment count, never on the numeric distance between sparse addresses.

    fill_range

    Fill only unoccupied bytes in a bounded window. Existing payload is retained.

    format_checksum

    fn format_checksum(status :
    ChecksumStatus
    ) -> String

    A transformed image has no claim that original record checksums still apply.

    format_entry

    fn format_entry(entry :
    EntryPoint
    ?) -> String

    Execution display retains CS:IP notation when available.

    format_from_path

    fn format_from_path(path : String) ->
    Format

    Extension hints are subordinate to content, and never suppress text errors.

    inspect_image

    Inspect without allocating dense bytes or depending on textual formatting.

    load_firmware

    Load bytes with optional format hint and explicit raw binary placement. Record signatures take precedence over hints, including a misleading .bin.

    merge_images

    Merge images transactionally; no caller-owned image is modified on failure. Default rejects every overlap. AllowIdentical still rejects differing bytes.

    relocate

    Relocate all payload and execution addresses with checked signed arithmetic. Segmented entry representation is replaced with Linear and diagnosed.

    remove_range

    Remove a window, preserving both disjoint outer portions and dropping an entry that points into removed memory. This never fills the new gap.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io