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

    AsciiSpan

    pub struct AsciiSpan {
    address : Int64
    bytes : Bytes
    } derive(Eq,
    Debug
    )

    One printable ASCII run, retaining its absolute firmware address and bytes.

    ByteOrder

    pub(all) enum ByteOrder {
    LittleEndian
    BigEndian
    } derive(Eq,
    Debug
    )

    Integer byte order for addressed word reads and reference scans.

    CortexMVectorTable

    pub struct CortexMVectorTable {
    base_address : Int64
    initial_stack_pointer : Int64
    reset_vector : Int64
    reset_address : Int64
    thumb : Bool
    stack_aligned : Bool
    reset_mapped : Bool
    } derive(Eq,
    Debug
    )

    Minimal Cortex-M vector information at an explicit vector-table base.

    CortexMVectorTable::base

    fn CortexMVectorTable::base(self : CortexMVectorTable) -> Int64

    Address from which the first two Cortex-M vectors were decoded.

    CortexMVectorTable::has_thumb_bit

    fn CortexMVectorTable::has_thumb_bit(self : CortexMVectorTable) -> Bool

    Whether the raw reset vector selects Thumb state.

    CortexMVectorTable::is_reset_mapped

    fn CortexMVectorTable::is_reset_mapped(self : CortexMVectorTable) -> Bool

    Whether the normalized reset handler has a byte in the sparse image.

    CortexMVectorTable::is_stack_aligned

    fn CortexMVectorTable::is_stack_aligned(self : CortexMVectorTable) -> Bool

    Whether the initial stack pointer meets the requested alignment.

    CortexMVectorTable::raw_reset_vector

    fn CortexMVectorTable::raw_reset_vector(self : CortexMVectorTable) -> Int64

    Raw reset vector, including the architectural Thumb-state bit.

    CortexMVectorTable::reset_handler

    fn CortexMVectorTable::reset_handler(self : CortexMVectorTable) -> Int64

    Reset handler address with the Thumb-state bit cleared.

    CortexMVectorTable::stack_pointer

    fn CortexMVectorTable::stack_pointer(self : CortexMVectorTable) -> Int64

    Initial main stack pointer stored in vector slot zero.

    ImageChecksum

    pub struct ImageChecksum {
    algorithm : ImageChecksumAlgorithm
    range :
    AddressRange

    value : Int64
    processed_bytes : Int
    filled_bytes : Int
    fill : Byte?
    } derive(Eq,
    Debug
    )

    Result retains the exact address window and fill choice used for holes.

    ImageChecksum::hex

    fn ImageChecksum::hex(self : ImageChecksum) -> String

    Uppercase checksum text with the conventional width of its algorithm.

    ImageChecksumAlgorithm

    pub(all) enum ImageChecksumAlgorithm {
    Crc32Ieee
    Crc16Ccitt
    Sum8
    Sum16
    Sum32
    } derive(Eq,
    Debug
    )

    Common firmware-level checksums. These operate on reconstructed image bytes; they are distinct from Intel HEX and S-Record record checksums.

    MaskedPattern

    pub struct MaskedPattern {
    bytes : Bytes
    mask : Bytes
    } derive(Eq,
    Debug
    )

    Bytes plus a per-bit mask. A zero mask bit is a wildcard; an all-ones mask performs an exact byte comparison.

    MaskedPattern::exact

    Construct an exact nonempty pattern.

    MaskedPattern::new

    Construct a masked nonempty pattern. Pattern and mask lengths must match.

    checksum_image

    Calculate a checksum over an explicit half-open address window. Sparse gaps require an explicit fill byte, preventing accidental checksums over invented data. Work and allocation are bounded independently of the highest address.

    encode_uint

    fn encode_uint(value : Int64, width : Int, order? : ByteOrder) -> Bytes raise
    FirmwareError

    Encode one unsigned 1..4 byte integer with explicit byte order.

    find_ascii_strings

    fn find_ascii_strings(image :
    FirmwareImage
    , min_length? : Int, max_strings? : Int, max_retained_bytes? : Int) -> Array[AsciiSpan] raise
    FirmwareError

    Extract printable ASCII runs from occupied data. A gap always terminates a run. Limits bound both returned objects and retained bytes.

    find_pattern

    Find pattern starts in normalized occupied segments. Matches may cross an original record boundary after normalization, but never cross an address gap. Overlapping matches are returned in ascending address order.

    find_uint

    fn find_uint(image :
    FirmwareImage
    , value : Int64, width : Int, order? : ByteOrder, alignment? : Int, max_matches? : Int) -> Array[Int64] raise
    FirmwareError

    Find occupied words equal to an unsigned value. Candidates are checked at a caller-selected alignment and cannot cross gaps. Results are sorted.

    inspect_cortex_m_vectors

    fn inspect_cortex_m_vectors(image :
    FirmwareImage
    , base_address : Int64, stack_alignment? : Int) -> CortexMVectorTable raise
    FirmwareError

    Decode the first two little-endian Cortex-M vectors without assuming that the image starts at address zero. This inspects structure only; device- specific RAM and executable-region checks belong in target layout policy.

    read_uint

    Read one unsigned 1..4 byte integer from consecutive occupied addresses. The result uses Int64 so every 32-bit bit pattern remains nonnegative.

    write_uint

    Return an image copy with encoded bytes applied under an explicit overlap policy. The source image remains unchanged if encoding or insertion fails.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io