moondump

    Windows minidump (.dmp) parser and CLI: streams, modules, threads, CONTEXT, exception, memory reads, stack walk with Breakpad .sym symbols, and a machine-readable JSON report.

    minidump
    windows
    crash-dump
    dmp
    triage
    reverse-engineering
    Download zip
    Version
    0.1.2
    License
    Apache-2.0
    Last updated
    2 days ago
    Downloads
    41

    #moondump

    A Windows crash-dump (minidump, .dmp) parser library and command-line tool, written in MoonBit.

    The intended use case is malware-sample triage and crash-site inspection: without Windows, WinDbg, or DbgHelp, it reads a .dmp into structure — the stream directory, module list, threads and their CONTEXT, the exception record, memory reads, a stack walk, Breakpad .sym symbolization, native x64 PE unwind metadata, and WER's long-tail extension streams. The same parsed data can also be handed over as a machine-readable JSON document (schema: "moondump/v1").

    • Format sources: Microsoft MINIDUMP_HEADER / MINIDUMP_STREAM_TYPE (minidumpapiset.h), Google Crashpad minidump_file_format.md, Breakpad minidump_format.h.
    • Behavioral reference: rust-minidump (MIT). Every offset and field was written against the local Windows SDK header, one by one — nothing from memory.
    • Unwind semantics: Breakpad docs/symbol_files.md, cfi_frame_info.cc, postfix_evaluator-inl.h, and stackwalker_x86.cc.
    • License: Apache-2.0. The MIT/BSD-3 statements for the test corpus are in testdata/README.md.

    #Installation

    Requires moonc >= 1.0.0-rc1. Install the MoonBit toolchain, clone this repository, then run moon update, moon check --deny-warn, and moon build. The default wasm backend runs the examples below. Native builds also need a C compiler and OpenSSL development headers on Linux (Visual Studio C++ Build Tools on Windows). To use the library in another module, run moon add aicongli-829/moondump and import "aicongli-829/moondump" in that package's moon.pkg.

    #Usage

    moon run cmd/main -- testdata/test.dmp # full text report moon run cmd/main -- testdata/test.dmp --symbols ./sym # symbolize from *.sym in a directory moon run cmd/main -- crash.dmp --image app.exe --no-scan # exact x64 PE binary unwind moon run cmd/main -- testdata/test.dmp --json # JSON document only moon run examples -- testdata/test.dmp # minimal library-usage example

    FlagEffect
    --symbols <dir>Recursively collect *.sym files for symbolization and deterministic STACK CFI/STACK WIN unwinding; may be given multiple times
    --image <path>Load an exact RSDS-matched AMD64 EXE/DLL for native .pdata/.xdata unwinding; repeat for calls across modules
    --max-frames <n>Walk at most n frames per stack (excluding the context frame), default 64
    --no-scanDisable stack-window scanning; deterministic x64 UNWIND_INFO, .sym CFI/WIN, and frame-pointer fallback remain active
    --all-stacksWalk the stack of every thread; default is the crash thread plus the first 8
    --jsonEmit the machine-readable JSON report (schema: "moondump/v1") instead of formatted text
    --helpPrint usage only

    Text output (excerpt; real output, not hand-drawn):

    file : 11317 bytes signature : MDMP version : 0x5128a793 (format version 42899) streams : 9 flags : 0x0 generation flags: Normal system : Win32NT 5.1.2600 Service Pack 2 architecture : x86 (1 logical processors) MiscInfo : v1, SizeOfInfo 24 bytes Flags1 : 0x3 ProcessId | ProcessTimes process ID : 3932 modules : 13 module(s) c:\test_app.exe range 0x400000-0x42d000 image 0x2d000 timestamp 0x45d35f6c checksum 0x0 RSDS 5A9832E5-2872-41C1-838E-D98914E9B7FF/1 c:\test_app.pdb crash site: thread : 3060 (thread table #0) exception code : 0xc0000005 EXCEPTION_ACCESS_VIOLATION flags = 0x1003f eip = 0x40429e esp = 0x12fe84 ebp = 0x12fe88 stack walk: symbol store : 0 symbol files (0 when --symbols is not given) up to 64 frames per thread scan on (scan up to 4096 bytes per thread) #0 thread 3060 (crash thread) thread-table context layout x86 pointer 4 bytes window 0x12f31c-0x130000 #0 0x7c90eb94 context context C:\WINDOWS\system32\ntdll.dll+0xeb94 (empty_store) function table: none return site undecidable #1 0x7c90e9c0 scan slot 0x12f320 C:\WINDOWS\system32\ntdll.dll+0xe9c0 … (this walk is "the moment the dump was written"; the thread was waiting in ntdll at that point, 13 frames in total) note frame-pointer chain broke: next frame pointer 0x0 is outside (0x12fff0, 0x130000) the two contexts have different instruction pointers: thread-table 0x7c90eb94, exception-site 0x40429e. the former is from dump-writing time; the walk below is the crash moment exception-site context layout x86 pointer 4 bytes window 0x12f31c-0x130000 #0 0x40429e context context c:\test_app.exe+0x429e (empty_store) function table: none return site undecidable #1 0x404200 fp slot 0x12fe8c c:\test_app.exe+0x4200 (empty_store) function table: none return site undecidable #2 0x4053ec fp slot 0x12ff74 c:\test_app.exe+0x53ec (empty_store) function table: none return site undecidable #3 0x7c816fd7 fp slot 0x12ffc4 C:\WINDOWS\system32\kernel32.dll+0x16fd7 (empty_store) function table: none return site undecidable #4 0x405443 scan slot 0x12fff8 c:\test_app.exe+0x5443 (empty_store) function table: none return site undecidable note frame-pointer chain broke: next frame pointer 0x0 is outside (0x12fff0, 0x130000) #1 thread 4544 …

    moon run examples -- testdata/test.dmp is the runnable minimal example; its stack-walk part carries a symbol file inline (a .sym matching test.dmp's own debug id, embedded in the example — in real use, pass --symbols <dir>):

    symbol table: accepted the inline test_app.sym stack walk: thread 3060 layout x86 pointer 4 bytes frames 5 cfi frames 0 win frames 0 fp frames 3 #0 context 0x40429e c:\test_app.exe+0x429e (ok) test_app!crash_here #1 fp 0x404200 c:\test_app.exe+0x4200 (unresolved) #2 fp 0x4053ec c:\test_app.exe+0x53ec (unresolved) #3 fp 0x7c816fd7 C:\WINDOWS\system32\kernel32.dll+0x16fd7 (no_symbol_file) #4 scan 0x405443 c:\test_app.exe+0x5443 (unresolved) note frame-pointer chain broke: next frame pointer 0x0 is outside (0x12fff0, 0x130000)

    Library usage:

    // All of these are raise + Option: parse failures throw named errors, and a stream the
    // generator never wrote returns None. "The stream is absent" and "the stream is there but
    // the table is empty" are different situations, so callers handle both explicitly.

    ///|
    fn inspect(bytes : Bytes) -> Unit raise {
    let dump = @moondump.open_dump(bytes) // validates signature and format version
    let entries = dump.stream_directory() // stream directory, 12 bytes per entry
    match dump.modules(entries) { // ModuleList + VS_FIXEDFILEINFO + CodeView
    None => println("no ModuleList in this dump")
    Some(mods) =>
    println(
    mods.modules.length().to_string() +
    " modules, skipped malformed records: " +
    mods.skipped.to_string(),
    )
    }
    match dump.exception(entries) { // exception code, access-violation address, crash CONTEXT
    None => println("no ExceptionStream in this dump")
    Some(exc) =>
    println(
    "thread " +
    exc.thread_id.to_string() +
    " crashed at 0x" +
    exc.address.to_string(radix=16),
    )
    }
    match dump.memory_map(entries) { // unified index over MemoryList / Memory64List
    None => println("this dump carries no memory stream")
    Some(map) =>
    // An unmapped address, or one straddling two ranges, reads back as None —
    // not as "read 0 bytes".
    match dump.read_memory_at(map, 0x12f31cUL, 16) {
    None => println("virtual address not captured")
    Some(data) => println("read " + data.length().to_string() + " bytes")
    }
    }
    }

    Stack walk + symbolization:

    ///|
    fn inspect_stack(bytes : Bytes, sym_text : String) -> Unit raise {
    let dump = @moondump.open_dump(bytes)
    let entries = dump.stream_directory()
    // Frame-to-module attribution and module-relative offsets both come from the module list
    let mods = match dump.modules(entries) {
    None => []
    Some(m) => m.modules
    }
    // The function-table stream is corroboration only ("was this address ever registered"),
    // it never drives the walk
    let ft = dump.function_table(entries)
    // Architecture comes from SystemInfo; which register table actually applies is decided by
    // the CONTEXT itself (see the section below). With no SystemInfo, pass 0xffff:
    // read_context will not recognize the table and returns None instead of guessing.
    let arch : UInt16 = match dump.system_info(entries) {
    None => 0xffff
    Some(si) => si.processor_architecture
    }
    let store = @moondump.symbol_store_new()
    // Only files with a valid MODULE line are accepted; bad ones land in `rejected`,
    // never silently dropped
    let accepted = @moondump.symbol_store_add(store, "test_app.sym", sym_text)
    println(
    if accepted {
    "symbol file accepted"
    } else {
    "no valid MODULE line, recorded in rejected"
    },
    )
    match
    (dump.exception(entries), dump.threads(entries), dump.memory_map(entries)) {
    (Some(exc), Some(threads), Some(map)) =>
    match @moondump.find_thread_by_id(threads, exc.thread_id) {
    None =>
    println(
    "the thread named by the exception stream is not in the thread list",
    )
    Some((_, t)) =>
    match dump.read_context(arch, exc.thread_context) {
    None =>
    println(
    "context unreadable: register table unsupported or CONTEXT size unreasonable",
    )
    Some(ctx) => {
    let opts = @moondump.stack_walk_options_default()
    // The store supplies deterministic STACK CFI/WIN rules as well as names.
    let w = dump.walk_thread_stack_with_symbols(
    map,
    mods,
    ft,
    t,
    ctx,
    opts,
    Some(store),
    )
    println(
    "layout " +
    w.layout +
    " frames " +
    w.frames.length().to_string(),
    )
    for f in w.frames {
    let sym = @moondump.symbolize_frame(f, mods, store)
    println(
    f.kind +
    " " +
    @moondump.hex_uint(f.address) +
    " " +
    sym.status,
    )
    }
    }
    }
    }
    _ => println("missing exception / thread-list / memory stream; cannot walk")
    }
    }

    examples/main.mbt is the runnable version of these calls: moon run examples -- testdata/test.dmp. Both snippets above have compile-checked copies in examples/readme_check.mbt — if the examples drift from the API, moon check fails immediately instead of waiting for a reader to find out.

    #Stream coverage

    StreamStatus
    Header / StreamDirectory (unknown streams listed verbatim)✅
    SystemInfo (x86 / amd64 / arm / arm64 / ia64 platform detection)✅
    ModuleList (108-byte entries + VS_FIXEDFILEINFO + CodeView/Debug)✅
    MiscInfo v1–v5 (time zone, DST rules, XState table, Flags1 gating)✅
    ThreadList (48-byte entries + per-architecture CONTEXT tables)✅
    ExceptionStream (Windows exception codes / Linux signals / access-violation parameter conventions)✅
    MemoryList / Memory64List / MemoryInfoList (including reads by virtual address)✅
    UnloadedModuleList, HandleData, FunctionTable, ThreadInfoList, ThreadNames✅ format layer
    Breakpad .sym symbols + deterministic CFI/WIN stack walk + --json report✅
    Comment(A/W), SystemMemoryInfo, ProcessVmCounters, Crashpad/Breakpad extension streams⛔ listed, not parsed

    The last group is deliberate: no authoritative field layout for those streams is available offline, and this project's rule is no parser without a checkable source — and no invented field names.

    #Stack walking and symbolization

    Starting from a thread's CONTEXT, the walk reconstructs the call chain using only memory that was actually captured into the file. Five frame kinds, distinguished by kind, are never mixed together:

    • "context": the instruction pointer from the CONTEXT, always the first frame — it was not read from the stack.
    • "cfi": a caller recovered by Breakpad STACK CFI INIT plus STACK CFI rows from the matching .sym file. This is rule-directed unwinding, not a guess based on whether a stack value looks like code.
    • "win": a caller recovered by Breakpad STACK WIN type 0 (FrameTypeFPO) or type 4 (FrameData). Type 4 records may carry a register program; overlapping type 4 ranges take precedence over type 0.
    • "fp": the frame-pointer fallback. x86 reads [EBP+4], amd64 reads [RBP+8], arm64 reads [X29+8]. It works for standard frame-pointer prologues, but an omitted frame pointer breaks the chain and the break location goes into notes.
    • "scan": stack-window scanning at pointer width. It can recover candidates after precise unwinding and the frame-pointer chain stop, but stale local values also count — callers must treat these as approximations. Only truly adjacent duplicate code slots merge; a non-code or already-covered slot ends the run.

    A deterministic prefix stays in recovered caller order. A missing rule may continue with the explicitly labeled FP/scan fallback; a matching rule that fails stops that walk rather than silently relabeling the failed step as a heuristic frame. The JSON counters cfi_frames, win_frames, and fp_frames are recounted after truncation and always agree with frames.

    CFI evaluation follows Breakpad's postfix language (+ - * / % @, unary ^, and value-first assignment), including smashed LTO assignments such as =$T0. .cfa is evaluated first; .ra and saved-register rules then use the original callee registers and the computed CFA. INIT ranges are half-open, delta rows apply at or before the lookup PC, and later duplicate rows replace earlier ones. Initial lookup uses the exact IP; recovered x86/amd64 callers use return PC−1 and arm64 callers use PC−4, while reported frame addresses remain unchanged. Arithmetic wraps at the CONTEXT pointer width. Only architecture-appropriate callee-saved registers survive omitted rules. .undef explicitly invalidates a register; an unsupported, unreadable, or otherwise failed CFA/RA/PC/SP/auxiliary rule stops deterministic unwinding. Malformed STACK records with a readable address and extent remain addressable, so a broken rule cannot be mistaken for a missing rule and silently replaced by a heuristic frame.

    WIN evaluates the declared FPO layout or FrameData program, including .cbCalleeParams from the previously unwound inner frame and Breakpad's bounded return-address probe. FrameData programs read the full current register state before the caller is reduced to WIN-preserved registers; explicit program assignments to preserved registers are retained. WIN metadata numbers are hexadecimal. Recovered IPs below 4 KiB end the stack; the recovered SP must increase, except that the first unwind may be a register-only return with unchanged SP. Repeated IPs remain valid so recursive call chains are not truncated.

    Each frame also carries two pieces of corroboration: return_site ("call" / "no_call" / "unknown" — whether the bytes before this return address encode E8 or FF /2,4) and in_function_table (whether the function-table stream ever registered this address). Both are evidence only — neither decides whether the frame is kept.

    Pointer width follows the field table the CONTEXT itself identifies (StackWalk.layout is its name), not a guess from the SystemInfo architecture: in a WOW64 dump, SystemInfo can say amd64 while the same thread's context is a 716-byte x86 table whose stack slots hold 4-byte pointers. When the field table cannot be identified, supported = false with a reason, and not a single frame is fabricated. There is no WOW64 sample in the public corpus, so this rule is a design decision based on field-table length, not a measured claim.

    Symbolization uses Breakpad .sym files: MODULE / FILE / FUNC / line records directly following a FUNC / PUBLIC. Module matching falls back in three steps — debug id → pdb name → module name — with matched_by recording which step hit. Ambiguous module matches are usable for name lookup but are refused for deterministic unwinding. symbol.status is a closed set that separates the reasons "no symbol" can happen:

    statusMeaning
    okHit a FUNC or PUBLIC record
    unresolvedA symbol file is loaded, but the address falls into no FUNC/PUBLIC
    ambiguousMultiple .sym files matched; the first is used, candidates gives the count
    no_moduleThe address is in no module, so no module-relative offset can be computed
    no_symbol_fileThe symbol store has no .sym for this module
    empty_storeThe symbol store is empty (--symbols not given)

    #Capability matrix

    “Supported” means implemented against a checkable format/source and covered by tests; “approximate” means useful evidence that must not be presented as a confirmed call chain.

    CapabilityStatusBoundary
    Header, stream directory, SystemInfo, modules, misc/thread/exception streamsSupportedOffsets and field widths checked against the Windows SDK/Crashpad
    MemoryList / Memory64List / MemoryInfoList and bounded virtual-address readsSupportedOverlap and clipping behavior is explicit
    x86 / amd64 / arm64 CONTEXT decodingSupportedarm64 has synthetic coverage, no public real arm64 dump
    Breakpad MODULE / FILE / FUNC / PUBLIC / line recordsSupportedMoonBit CLI reads text .sym; auxiliary Python tool can convert PDB public symbols
    Breakpad STACK CFI INIT / STACK CFISupportedCFA/RA/register rules, postfix arithmetic, dereference, assignment, .undef
    Breakpad STACK WIN type 0 and type 4SupportedDeclared FPO layout, FrameData program, overlap precedence, bounded RA probe
    Frame-pointer chainApproximateStandard prologue only; omitted or corrupted FP ends the chain
    Stack-window scanApproximateMay retain stale locals; adjacent duplicate runs are pruned
    x64 binary UNWIND_INFOMoonBit CLI, boundedRepeated --image loads exact RSDS-matched AMD64 PE images; native .pdata/.xdata reader handles common version-1 GPR rules, chained records, prologs and supported epilogs. Missing stack bytes or unsupported operations stop deterministic unwinding
    Open-ended Breakpad RA/EBP search beyond the bounded WIN probeUnsupportedNo guessed return-address search
    ARM64 pointer-authentication strippingUnsupportedRaw recovered addresses are retained
    PDB public symbolsAuxiliary tool, boundedtools/pdb_to_sym.py checks GUID+age and converts S_PUB32 records to .sym; nearest public names are hints, with no private functions or source lines
    PDB symbol-server downloadsAuxiliary tool, boundedExplicit HTTP(S) server URL; exact GUID+age check before cache or use; no compressed .pd_ fallback
    minidump-stackwalk --json field compatibilityUnsupportedJSON is moondump's own documented moondump/v1 schema

    #Native x64 unwind and optional PDB tools

    The MoonBit CLI accepts matching PE images directly. A minidump usually records a module's identity and stack, not its complete .pdata/.xdata bytes. Image identity is checked against the dump's RSDS GUID and age; a different same-name binary is never substituted. Python 3 standard-library tools remain available for PDB public symbols and an independent x64 check.

    # Convert a local PDB's public symbols to the .sym format read by moondump. python tools/pdb_to_sym.py --image app.exe --pdb app.pdb --output _scratch/symbols/app.sym moon run cmd/main -- crash.dmp --symbols _scratch/symbols # Or request the exact PDB from a chosen HTTP(S) symbol server and cache it. python tools/pdb_to_sym.py --image app.exe --server https://msdl.microsoft.com/download/symbols --output _scratch/symbols/app.sym # Unwind x64 frames from the captured stack and matching PE .pdata/.xdata. moon run cmd/main -- crash.dmp --image app.exe --image kernel32.dll --no-scan # Independent Python crosscheck with optional PDB public-name hints. python tools/x64_stack.py --dump crash.dmp --image app.exe --pdb app.pdb

    Both walkers accept repeated image paths for calls crossing modules and stop when the next image, stack slot, unwind opcode, or epilog form is unavailable. The Python --server can replace --pdb for public-name lookup. The PDB converter emits public names only, not private function ranges or source lines; the x64 walker labels them public-nearest so an address is not mistaken for an exact function match. Both paths have synthetic fixture coverage. A locally generated optimized MSVC crash triplet also verified four x64 frames and converted 3,812 PDB publics; its dump, EXE, and PDB remain ignored under testdata/local/, while the source is testdata/generators/x64_sample.c. Supplying the matching system DLL images extended both native and Python walks to five verified return slots. A local HTTP symbol-server test exercises download and identity validation; no external server response has been tested yet.

    #JSON report (schema moondump/v1)

    moon run cmd/main -- testdata/test.dmp --json

    This is moondump's own schema, not the output format of minidump-stackwalk --json: with no way to byte-compare against that tool offline, no field compatibility is claimed (the document's generator.note says the same). What can be claimed: a stable shape, constant fields, and a single source of truth with the text output — the same parse results in a different arrangement, with no second set of heuristics.

    Rules:

    • The top level has exactly 17 fields, always present, in fixed order: schema, generator,file, streams, system_info, misc_info, modules, unloaded_modules, threads, exception, stacks,memory, thread_names, thread_infos, handles, function_table, symbol_store. A missing value is null, never an absent key; reordering the fields is a schema change and bumps the version.
    • Addresses are always hex strings ("0x7ff6e7c40000"), 64-bit lengths are always decimal strings ("8408702"); only quantities that fit in 32 bits are JSON numbers — double precision is exact only up to 2^53, and addresses and file sizes do not get to gamble on that.
    • A section that fails to parse becomes {"kind": "...", "message": "..."} and the document still ships; whole-document failures (bad arguments, unreadable file, invalid signature) produce only {schema, generator, error}.
    • Long lists are wrapped as {count, truncated, items} with a cap of 2000 entries; truncation is stated in the document, never silent.

    Excerpt (--json, indented by 2):

    { "schema": "moondump/v1", "generator": { "name": "moondump", "version": "0.1.2", "note": "..." }, "file": { "path": "testdata/test.dmp", "size": "11317", "signature": "MDMP", "signature_raw": "0x504d444d", "format_version": 42899, "format_version_known": true, "number_of_streams": 9, "time_date_stamp": 1171480435, "minidump_type": ["Normal"] }, "exception": { "thread_id": 3060, "code": "0xc0000005", "code_name": "EXCEPTION_ACCESS_VIOLATION", "parameters": ["0x1", "0x45"] }, "stacks": { "memory_map": "present", "max_frames": 64, "max_scan_bytes": 4096, "scan": true, "symbolicated": false, "walked": 3, "skipped_threads": 0, "items": { "count": 3, "truncated": false, "items": [ { "thread_id": 3060, "source": "exception_context", "layout": "x86", "pointer_size": 4, "supported": true, "window": { "low": "0x12f31c", "high": "0x130000", "size": "3300" }, "frame_count": 5, "cfi_frames": 0, "win_frames": 0, "fp_frames": 3, "scanned_slots": 95, "scan_limited": false, "notes": ["frame-pointer chain broke: next frame pointer 0x0 is outside (0x12fff0, 0x130000)"], "frames": [ { "index": 0, "ip": "0x40429e", "kind": "context", "stack_slot": null, "module": "c:\\test_app.exe", "module_index": 0, "offset": "0x429e", "function_table": null, "return_site": "unknown", "symbol": null } ] } ] } } }

    stacks.items[i].source says which CONTEXT this walk came from: exception_context (the moment of the crash) or thread_table_context (the moment the dump was written). When the crash thread's two contexts have different instruction pointers, both walks are emitted, and items[0] is always the crash-site one; the text CLI also walks both, it just puts "the next one is the crash moment" in front of the reader's eyes instead of in the ordering. The remaining threads follow in thread-table order.

    The library can hand you the Json value directly, no text in between: dump.report_json(opts); failed documents come from @moondump.json_failure(kind, message); printing uses json_report_text.

    #Two findings from real dumps

    Real WER dumps write the FunctionTableStream in a layout that does not match the SDK's declared strides. The declared 32-byte stride leaves only 6 of 113 records self-consistent; after sweeping every start offset against every record width, the only self-consistent layout starts at SizeOfHeader + SizeOfAlignPad with record width SizeOfDescriptor + SizeOfNativeDescriptor + SizeOfFunctionEntry + SizeOfAlignPad (184 bytes) — i.e. "descriptor + native descriptor + inline function entries + padding", with the x64 IMAGE_FUNCTION_ENTRY triple inlined into each record.

    The implementation does not pick a side: both candidate layouts are checked against the evidence, and the self-consistent one wins; if neither is consistent, the declared stride is used and layout_ok = false is set, with the CLI printing "neither layout is self-consistent; reading with the declared stride — do not trust these results".

    The crash thread in test.dmp has two contexts parked in completely different places: the exception stream's CONTEXT has instruction pointer 0x40429e (c:\test_app.exe+0x429e — the crash point itself), while the same thread's CONTEXT in the thread table has 0x7c90eb94 (ntdll.dll+0xeb94 — by the time the dump was written, the thread was no longer at the crash site). Walking only the thread-table context never shows the crash site; walking only the exception context never shows what the thread was waiting on. So both are emitted. Details in docs/proposal.md §8 (Chinese), including how this finding once cost the JSON output an entire stack.

    #Robustness

    • All RVA/length arithmetic uses saturating add and multiply; any out-of-bounds access becomes a named ParseError variant (Truncated / RvaTooLarge / BadStreamCount / InvalidUtf16 etc.). Nothing panics.
    • Malformed fixtures (directory RVA out of range, fabricated entry counts) are exercised in tests — see corpus/corpus_test.mbt.
    • The UTF-16LE decoder rejects lone surrogates with InvalidUtf16; no silent replacement.
    • Large files are never copied into memory wholesale: the reader maps ranges lazily.
    • In --json mode, stdout carries exactly one document: MoonBit has no stderr channel in this toolchain, so bad arguments, file-read failures, and invalid signatures all become the document's error field. Callers get either a report that JSON.parses or a well-formed failure report — never text mixed with logs.

    #Testing and verification

    moon info && moon fmt moon check --deny-warn moon test # wasm moon test --target native # native python -m unittest discover -s tools -p 'test_*.py' # 32 Python and native-CLI integration tests

    • Public-corpus regression: all seven rust-minidump fixtures run a full-field summary (stream count, module count, thread count, exception code, memory-stream state, stack counts, ...), and even the malformed dumps must produce a complete document — see corpus/corpus_test.mbt.
    • JSON goes through the full pipeline: report_json → stringify → @json.parse reads the text back, then asserts the reparsed value equals the in-memory one (corpus/json_corpus_test.mbt). Checking only the in-memory Json proves nothing about whether the text is valid JSON with these field names and this nesting — and text is exactly what upstream scripts consume.
    • Both output channels share one source: the JSON per-frame summaries and the text stack walk come from the same values; each frame's kind/address/slot/module attribution must agree.
    • Independent deterministic-unwind semantics: synthetic amd64/x86 fixtures assert the expected caller IP/SP directly from hand-derived CFI and WIN rules. They cover optimized callers without frame pointers, INIT/row selection, .cfa/.ra ordering, value-first and smashed assignments, callee-saved registers, .undef, exact initial CONTEXT PC versus adjusted return PC, malformed-rule fail-closed markers, WIN overlap precedence, FrameData full-register evaluation, explicit preserved-register assignments, .cbCalleeParams, bounded RA probing, recursive stacks, failure-without-heuristic-relabeling, and missing-rule fallback. These expectations are derived from Breakpad's documented rules, not from the walker's own output.
    • Real optimized x64 CFI crosscheck: a local /O2 MSVC program with no frame pointer in the crash frame was dumped through MiniDumpWriteDump. Three narrow CFI rules were derived from independent dumpbin /UNWINDINFO records, then the MoonBit CLI recovered three cfi callers with --no-scan; the Node byte oracle checked all three return slots (bad=0). The rules are local to that build and are not a general PE-to-CFI conversion. Reproduction steps are in testdata/generators/README.md.
    • An independent oracle for the stack walk: testdata/oracle/stack_oracle.js reads the raw stack slot table, frame-pointer chain, and module list straight from the bytes per the SDK layout (no heuristics at all). stack_crosscheck.js checks every stack-backed cfi/win/fp/scan frame's (slot, address) pair and module attribution. A deterministic cfi/win frame marked direct has no source slot; its address and module offset are checked against the independently extracted module list instead. The scripts share zero code with the implementation and can be re-run directly:

      node testdata/oracle/stack_oracle.js testdata/test.dmp > /tmp/golden.txt moon run cmd/main --target native -- testdata/test.dmp > /tmp/cli.txt node testdata/oracle/stack_crosscheck.js /tmp/golden.txt test.dmp /tmp/cli.txt

      The last line prints checked=<non-context frames> direct=<register-only frames> bad=<mismatches>; bad must be 0. Latest five-corpus run: 269 checked frames, 0 direct frames, bad=0.
    • What is deliberately not claimed: this machine has no minidump-stackwalk binary and no offline channel to byte-compare against it, so no field compatibility with its output is claimed; the only claims are the same-source, re-runnable checks above.
    • Real WER dumps are run locally only (they contain process memory and user-name paths and never enter the repository); they are how layout-level mismatches like the FunctionTableStream one get found.

    #Test corpus

    testdata/*.dmp all come from rust-minidump's testdata/ (MIT; the full license text ships alongside), with per-file coverage notes in testdata/README.md. Real WER dumps generated on this machine contain process memory and user-name paths, never enter the repository, and are used for local cross-checking only; .gitignore blocks them via *.dmp + testdata/local/ + _scratch/.

    CI (.github/workflows/ci.yml) checks, builds, tests and runs the example on wasm, wasm-gc, js and native. The native job also runs Python/CLI integration tests and the independent raw stack-slot check. See THIRD_PARTY_NOTICES.md for upstream notices.

    FILE record indices are limited to 0..1048575 because the public file-name table is a dense array. Larger indices are counted as bad records; lookup checks the original 64-bit index before converting it to an array index.

    #Acknowledgement

    • rust-minidump — MIT; test corpus and behavioral reference.
    • Google Breakpad / Crashpad — format documentation, extension stream numbers, and the CFI/WIN/postfix unwind semantics.
    • Microsoft Windows SDK minidumpapiset.h — the final authority on field offsets.

    Rva

    type Rva = UInt64

    Relative virtual address (RVA) within the file. minidump has no section table, so an RVA numerically equals a file offset, but fields mix 32/64 bits (Memory64List uses 64-bit RVAs and sizes), so everything is carried in UInt64 to avoid silent truncation on large dumps.

    ParseError

    pub(all) suberror ParseError {
    InvalidSignature(UInt)
    RvaTooLarge(UInt64)
    Truncated(UInt64, UInt64, UInt64)
    BadStreamCount(UInt)
    InvalidUtf16(UInt)
    StreamTooSmall(UInt, UInt64, UInt64)
    ListSizeMismatch(UInt, UInt64, UInt64)
    ContextSizeMismatch(UInt16, UInt, UInt)
    } derive(
    Debug
    )

    Parse failure. All malformed/out-of-bounds input funnels here; panics are not allowed.

    ParseError::to_repr

    automatically derived

    BinaryX64Image

    pub(all) struct BinaryX64Image {
    data : Bytes
    debug_id : String
    sections : Array[(UInt, UInt, UInt)]
    exception_rva : UInt
    exception_size : UInt
    } derive(Eq,
    Debug
    )

    BinaryX64Image::equal

    automatically derived

    BinaryX64Image::not_equal

    fn BinaryX64Image::not_equal(x : BinaryX64Image, y : BinaryX64Image) -> Bool
    automatically derived

    BinaryX64Image::runtime_function

    fn BinaryX64Image::runtime_function(self : BinaryX64Image, rva : UInt) -> (UInt, UInt, UInt)?

    BinaryX64Image::to_repr

    automatically derived

    CodeView

    pub(all) enum CodeView {
    Rsds(CodeViewRsds)
    Unrecognized(UInt)
    Missing
    Corrupt
    } derive(Eq,
    Debug
    )

    Module debug info (CodeView).

    Only RSDS is decoded for now: every CvRecord in the Windows corpus is RSDS. Other magics are reported as the raw 4 bytes, with no unverified decoding — the known case is 0x4270454c ("LEpB") written by breakpad on Linux (a build-id record; all 8 modules in linux-mini.dmp use it). Its field layout will be filled in once multi-language corpus confirms it.

    CodeView::equal

    fn CodeView::equal(CodeView, CodeView) -> Bool
    automatically derived

    CodeView::not_equal

    fn CodeView::not_equal(x : CodeView, y : CodeView) -> Bool
    automatically derived

    CodeView::to_repr

    automatically derived

    CodeViewRsds

    pub(all) struct CodeViewRsds {
    debug_id : String
    age : UInt
    pdb_name : String
    } derive(Eq,
    Debug
    )

    The three items decoded from an RSDS (PDB 7.0) record.

    This toolchain's enum variants only accept named types as payloads, no inline field lists, so the RSDS data gets its own struct.

    CodeViewRsds::equal

    automatically derived

    CodeViewRsds::not_equal

    fn CodeViewRsds::not_equal(x : CodeViewRsds, y : CodeViewRsds) -> Bool
    automatically derived

    CodeViewRsds::to_repr

    automatically derived

    Context

    pub(all) enum Context {
    X86(ContextX86)
    Amd64(ContextAmd64)
    Arm64(ContextArm64)
    Undecoded(ContextUndecoded)
    } derive(Eq,
    Debug
    )

    Thread context. The variant name is the field table actually used, not the SystemInfo architecture: in WOW64-style dumps SystemInfo says amd64 while the thread context is a 716-byte x86 layout; the decoded result is then X86, making the contradiction visible at a glance.

    Context::context_flags

    fn Context::context_flags(self : Context) -> UInt

    The raw ContextFlags. Undecoded has no trustworthy field table, so always 0 — preventing callers from mistaking "failed to decode" for "no fields set".

    Context::equal

    fn Context::equal(Context, Context) -> Bool
    automatically derived

    Context::flag_architecture

    fn Context::flag_architecture(self : Context) -> UInt16

    Which tier of ContextFlags bit table to split names with — follows the field table actually used, not SystemInfo: with WOW64's amd64 system info paired with a 716-byte x86 context, the bits in that 0x1003f carry x86 semantics.

    Context::frame_pointer

    fn Context::frame_pointer(self : Context) -> UInt64?

    Context::instruction_pointer

    fn Context::instruction_pointer(self : Context) -> UInt64?

    Instruction pointer / stack pointer / frame pointer — the three stack walking (W4) needs.

    Context::layout_name

    fn Context::layout_name(self : Context) -> String

    Name of the field table actually used.

    Context::not_equal

    fn Context::not_equal(x : Context, y : Context) -> Bool
    automatically derived

    Context::registers

    fn Context::registers(self : Context) -> Array[(String, String)]

    Flatten the decoded registers into (name, hex value) pairs; CLI and tests share one ordering. Undecoded architectures return an empty array.

    Context::stack_pointer

    fn Context::stack_pointer(self : Context) -> UInt64?

    Context::to_repr

    automatically derived

    ContextAmd64

    pub(all) struct ContextAmd64 {
    context_flags : UInt
    mx_csr : UInt
    seg_cs : UInt16
    seg_ds : UInt16
    seg_es : UInt16
    seg_fs : UInt16
    seg_gs : UInt16
    seg_ss : UInt16
    eflags : UInt
    dr0 : UInt64
    dr1 : UInt64
    dr2 : UInt64
    dr3 : UInt64
    dr6 : UInt64
    dr7 : UInt64
    rax : UInt64
    rcx : UInt64
    rdx : UInt64
    rbx : UInt64
    rsp : UInt64
    rbp : UInt64
    rsi : UInt64
    rdi : UInt64
    r8 : UInt64
    r9 : UInt64
    r10 : UInt64
    r11 : UInt64
    r12 : UInt64
    r13 : UInt64
    r14 : UInt64
    r15 : UInt64
    rip : UInt64
    } derive(Eq,
    Debug
    )

    Integer/control registers of the amd64 CONTEXT. Floating point (FltSave@256, 512 bytes) and VectorRegister@768 are left for future XState-related handling; not decoded here.

    ContextAmd64::equal

    automatically derived

    ContextAmd64::not_equal

    fn ContextAmd64::not_equal(x : ContextAmd64, y : ContextAmd64) -> Bool
    automatically derived

    ContextAmd64::to_repr

    automatically derived

    ContextArm64

    pub(all) struct ContextArm64 {
    context_flags : UInt
    cpsr : UInt
    x : Array[UInt64]
    sp : UInt64
    pc : UInt64
    fpcr : UInt
    fpsr : UInt
    bcr : Array[UInt]
    bvr : Array[UInt64]
    wcr : Array[UInt]
    wvr : Array[UInt64]
    } derive(Eq,
    Debug
    )

    Integer/control and debug registers of the arm64 CONTEXT. x holds X0..X28 plus Fp(X29) and Lr(X30), 31 entries total (the two halves of that union in winnt.h).

    ContextArm64::equal

    automatically derived

    ContextArm64::not_equal

    fn ContextArm64::not_equal(x : ContextArm64, y : ContextArm64) -> Bool
    automatically derived

    ContextArm64::to_repr

    automatically derived

    ContextUndecoded

    pub(all) struct ContextUndecoded {
    architecture : UInt16
    declared_size : UInt
    reason : String
    } derive(Eq,
    Debug
    )

    A CONTEXT that could not be decoded against a field table: keeps the architecture and declared length, and says why decoding failed.

    ContextUndecoded::equal

    automatically derived

    ContextUndecoded::not_equal

    fn ContextUndecoded::not_equal(x : ContextUndecoded, y : ContextUndecoded) -> Bool
    automatically derived

    ContextUndecoded::to_repr

    automatically derived

    ContextX86

    pub(all) struct ContextX86 {
    context_flags : UInt
    dr0 : UInt
    dr1 : UInt
    dr2 : UInt
    dr3 : UInt
    dr6 : UInt
    dr7 : UInt
    seg_gs : UInt
    seg_fs : UInt
    seg_es : UInt
    seg_ds : UInt
    edi : UInt
    esi : UInt
    ebx : UInt
    edx : UInt
    ecx : UInt
    eax : UInt
    ebp : UInt
    eip : UInt
    seg_cs : UInt
    eflags : UInt
    esp : UInt
    seg_ss : UInt
    } derive(Eq,
    Debug
    )

    Registers decoded from the x86 (32-bit) CONTEXT.

    SegCs / SegSs are declared as DWORD in the C header (winnt.h:8577/8580), not WORD, so they stay UInt32 here; amd64's two are real WORDs, using UInt16. FloatSave and ExtendedRegisters are floating-point/SIMD state, useless for crash triage; this implementation skips them by offset rather than pretending they are "decoded".

    ContextX86::equal

    fn ContextX86::equal(ContextX86, ContextX86) -> Bool
    automatically derived

    ContextX86::not_equal

    fn ContextX86::not_equal(x : ContextX86, y : ContextX86) -> Bool
    automatically derived

    ContextX86::to_repr

    automatically derived

    Dump

    pub(all) struct Dump {
    header : Header
    data : Bytes
    }

    An opened dump: the whole byte block plus a validated header; streams are parsed lazily on demand.

    Dump::exception

    fn Dump::exception(self : Dump, entries : Array[StreamEntry]) -> Exception? raise ParseError

    Fetch the ExceptionStream (the crash site) via the directory; returns None if absent.

    Dump::function_table

    fn Dump::function_table(self : Dump, entries : Array[StreamEntry]) -> FunctionTableInfo? raise ParseError

    Dump::handles

    fn Dump::handles(self : Dump, entries : Array[StreamEntry]) -> Array[Handle]? raise ParseError

    Dump::memory_info_list

    fn Dump::memory_info_list(self : Dump, entries : Array[StreamEntry]) -> Array[MemoryInfo]? raise ParseError

    Dump::memory_map

    fn Dump::memory_map(self : Dump, entries : Array[StreamEntry]) -> MemoryMap? raise ParseError

    Build the index: merge -> sort -> clip. Returns None when the directory has neither memory stream.

    Dump::memory_regions

    fn Dump::memory_regions(self : Dump, entries : Array[StreamEntry]) -> Array[MemoryRegion]? raise ParseError

    The raw declared table merged from both memory streams (unsorted, unclipped). Use it to faithfully answer "what memory does this dump declare"; to read memory, go through Dump::memory_map.

    Dump::misc_info

    fn Dump::misc_info(self : Dump, entries : Array[StreamEntry]) -> MiscInfo? raise ParseError

    Fetch the MiscInfoStream via the directory.

    Dump::modules

    fn Dump::modules(self : Dump, entries : Array[StreamEntry]) -> ModuleList? raise ParseError

    Fetch the ModuleListStream via the directory.

    Dump::range_in_file

    fn Dump::range_in_file(self : Dump, rva : UInt64, len : UInt64) -> Bool

    Check whether [rva, rva+len) lies entirely within the file. Malformed dumps often have stream RVAs pointing outside the file; a coarse check up front makes failures easier to locate than erroring at read time.

    Dump::read_byte

    fn Dump::read_byte(self : Dump, rva : UInt64) -> Byte raise ParseError

    Single-byte read. The toolchain's byte type is Byte and Bytes::get returns Byte?; bounds checking reuses offset, and the remaining None branch just collapses "already bounds-checked" into unreachable.

    Dump::read_context

    fn Dump::read_context(self : Dump, architecture : UInt16, context : LocationDescriptor) -> Context? raise ParseError

    Parse a CONTEXT.

    Order of field-table selection (never guess; prefer reporting undecoded):
    1. size == 0 or rva == 0 → None: the generator wrote no context at all;
    2. no verified table for the architecture → Undecoded, reporting only the architecture and declared length;
    3. the declared length exactly equals the canonical length of another verified layout and not this architecture's → switch tables by length. Length is an exact signature, harder evidence than SystemInfo's architecture field: both WOW64's "amd64 system info + 716-byte context" and the reverse are covered;
    4. the declared length fits this architecture's table → decode per the architecture (extra bytes are not guessed at);
    5. nothing matches → ContextSizeMismatch (truncated, or an unverified layout like old ARM64).

    Dump::read_exception

    fn Dump::read_exception(self : Dump, entry : StreamEntry) -> Exception raise ParseError

    Parse ExceptionStream. Fewer than 168 bytes is an immediate error: the exception stream has exactly one layout, there is no "shorter legal version" of it.

    Dump::read_function_table

    fn Dump::read_function_table(self : Dump, entry : StreamEntry) -> FunctionTableInfo raise ParseError

    Dump::read_handle_data

    fn Dump::read_handle_data(self : Dump, entry : StreamEntry) -> Array[Handle] raise ParseError

    Dump::read_memory_64_list

    fn Dump::read_memory_64_list(self : Dump, entry : StreamEntry) -> Array[MemoryRegion] raise ParseError

    MINIDUMP_MEMORY64_LIST (stream 9): memory is laid out contiguously after BaseRva; each entry gives only {start address, length}, with the position computed by accumulation.

    Corpus cross-check: full-dump.dmp is MiniDumpWithFullMemory with 54 segments and BaseRva=11902; accumulating to the end lands exactly on 8408702, equal to the file length, byte for byte.

    Dump::read_memory_at

    fn Dump::read_memory_at(self : Dump, map : MemoryMap, address : UInt64, len : Int) -> Bytes? raise ParseError

    Read a stretch of memory by virtual address. Returns None rather than erroring when the address is not covered: walking off the stack is normal during stack traversal, and callers must distinguish "no memory here" from "the file is broken". Reads byte-by-byte, suitable for sampling tens of bytes; for a large whole-segment buffer, slice it yourself via file_rva_for.

    Dump::read_memory_info_list

    fn Dump::read_memory_info_list(self : Dump, entry : StreamEntry) -> Array[MemoryInfo] raise ParseError

    Parse MemoryInfoListStream. The stride is the SizeOfEntry declared in the file, not a hardcoded 48: future _EX variants can only grow, and walking by the declared stride keeps the first 48 bytes readable.

    Dump::read_memory_list

    fn Dump::read_memory_list(self : Dump, entry : StreamEntry) -> Array[MemoryRegion] raise ParseError

    MINIDUMP_MEMORY_LIST (stream 5): each entry independently carries {start address, length, RVA}, so segments may be unordered and overlapping.

    Corpus: test.dmp 3 segments / linux-mini.dmp 2 / simple-crashpad.dmp 1 / invalid-parameter.dmp 10, all with DataSize exactly 4 + 16*count.

    Dump::read_misc_info

    fn Dump::read_misc_info(self : Dump, entry : StreamEntry) -> MiscInfo raise ParseError

    Parse a MiscInfo stream (stream type is always 15; Linux/breakpad dumps also write it).

    Dump::read_module_list

    fn Dump::read_module_list(self : Dump, entry : StreamEntry) -> ModuleList raise ParseError

    Parse ModuleListStream.

    Length validation aligns with rust-minidump: DataSize must equal 4 + count*108, with the single known writer leniency of "exactly 4 extra bytes" also accepted; everything else raises ListSizeMismatch. Entries are skipped per the rules (and counted in skipped): size_of_image == 0, or base+size overflows (meaning the record's addresses are untrustworthy and would attribute frames to the wrong module).

    Dump::read_string

    fn Dump::read_string(self : Dump, rva : UInt64) -> String raise ParseError

    MINIDUMP_STRING: 4-byte length + UTF-16LE body. The length is in bytes; unpaired surrogates are rejected as InvalidUtf16, no silent replacement.

    Do not strip a trailing NUL, because observation shows there is nothing to strip: in real local WER dumps and the public corpus, the module paths, PDB names, and thread names of all four generators (WER, breakpad Windows/Linux, crashpad) end in a normal character one by one (e/l/y/b/o and the like), i.e. these writers' Length field does not include a trailing NUL. Since no observed sample supports it, "defensive NUL stripping" is not added — it would silently eat characters that are really there.

    Dump::read_system_info

    fn Dump::read_system_info(self : Dump, entry : StreamEntry) -> SystemInfo raise ParseError

    Parse a SystemInfo stream.

    Length requirements follow rust-minidump: fewer than 56 bytes is an error, extra bytes are ignored. All 5 dumps in the corpus have DataSize exactly 56.

    Dump::read_thread_info_list

    fn Dump::read_thread_info_list(self : Dump, entry : StreamEntry) -> Array[ThreadInfo] raise ParseError

    Dump::read_thread_list

    fn Dump::read_thread_list(self : Dump, entry : StreamEntry) -> Array[Thread] raise ParseError

    Parse ThreadListStream / ThreadExListStream.

    Only the thread records themselves are read here, not the CONTEXTs: one malformed context must not take the whole thread table down. Fetch contexts separately with Dump::read_context.

    Dump::read_thread_names

    fn Dump::read_thread_names(self : Dump, entry : StreamEntry) -> Array[ThreadName] raise ParseError

    Dump::read_uint16

    fn Dump::read_uint16(self : Dump, rva : UInt64) -> UInt16 raise ParseError

    Dump::read_uint32

    fn Dump::read_uint32(self : Dump, rva : UInt64) -> UInt raise ParseError

    Dump::read_uint32_at

    fn Dump::read_uint32_at(self : Dump, map : MemoryMap, address : UInt64) -> UInt? raise ParseError

    Dump::read_uint64

    fn Dump::read_uint64(self : Dump, rva : UInt64) -> UInt64 raise ParseError

    Dump::read_uint64_at

    fn Dump::read_uint64_at(self : Dump, map : MemoryMap, address : UInt64) -> UInt64? raise ParseError

    Read one pointer width by virtual address. None when the address is uncovered or fewer than 8 bytes remain in the segment.

    Dump::read_unloaded_module_list

    fn Dump::read_unloaded_module_list(self : Dump, entry : StreamEntry) -> UnloadedModuleList raise ParseError

    Skipping rules match the module table: size_of_image == 0, or the interval addition wraps around.

    Dump::report_json

    fn Dump::report_json(self : Dump, opts : JsonOptions) ->
    Json

    dump.report_json(opts): the complete structured report for one dump. It does not raise — any section that fails to read falls back to {"kind": ..., "message": ...}, so the caller always gets at least a parseable document. Only when the stream directory itself is too malformed to list does streams.error say so; every other section gives whatever it can, as usual.

    Dump::stream_directory

    fn Dump::stream_directory(self : Dump) -> Array[StreamEntry] raise ParseError

    The stream directory. A malformed entry count is rejected here rather than left to overflow when the streams are read.

    Dump::system_info

    fn Dump::system_info(self : Dump, entries : Array[StreamEntry]) -> SystemInfo? raise ParseError

    Fetch the SystemInfoStream via the directory; returns None if the stream is absent.

    Dump::thread_infos

    fn Dump::thread_infos(self : Dump, entries : Array[StreamEntry]) -> Array[ThreadInfo]? raise ParseError

    Dump::thread_names

    fn Dump::thread_names(self : Dump, entries : Array[StreamEntry]) -> Array[ThreadName]? raise ParseError

    Dump::threads

    fn Dump::threads(self : Dump, entries : Array[StreamEntry]) -> Array[Thread]? raise ParseError

    Fetch the thread table via the directory: ThreadListStream first, then ThreadExListStream.

    Dump::unloaded_modules

    fn Dump::unloaded_modules(self : Dump, entries : Array[StreamEntry]) -> UnloadedModuleList? raise ParseError

    Dump::walk_thread_stack

    fn Dump::walk_thread_stack(self : Dump, map : MemoryMap, modules : Array[Module], ft : FunctionTableInfo?, thread : Thread, ctx : Context, opts : StackWalkOptions) -> StackWalk raise ParseError

    Stack walk of one thread. The context and thread record are supplied by the caller (dump.threads / dump.read_context / dump.exception can all produce them); the function table may be passed in as corroboration; when it is not (or that stream is absent), in_function_table is all None.

    Dump::walk_thread_stack_with_symbols

    fn Dump::walk_thread_stack_with_symbols(self : Dump, map : MemoryMap, modules : Array[Module], ft : FunctionTableInfo?, thread : Thread, ctx : Context, opts : StackWalkOptions, store : SymbolStore?) -> StackWalk raise ParseError

    Stack walk with Breakpad rules enabled. Passing None preserves the legacy frame-pointer + scan behavior; passing a store uses deterministic CFI/WIN whenever the current instruction has a matching rule.

    Exception

    pub(all) struct Exception {
    thread_id : UInt
    code : UInt
    flags : UInt
    nested_record_address : UInt64
    address : UInt64
    number_parameters : UInt
    parameters : Array[UInt64]
    thread_context : LocationDescriptor
    } derive(Eq,
    Debug
    )

    One unhandled/dump-triggering exception record.

    Exception::equal

    fn Exception::equal(Exception, Exception) -> Bool
    automatically derived

    Exception::fault_address

    fn Exception::fault_address(self : Exception) -> UInt64?

    The "accessed address" beyond the faulting instruction: likewise only meaningful for ACCESS_VIOLATION / IN_PAGE_ERROR (ExceptionInformation[1]).

    Exception::is_memory_access

    fn Exception::is_memory_access(self : Exception) -> Bool

    Exception::not_equal

    fn Exception::not_equal(x : Exception, y : Exception) -> Bool
    automatically derived

    Exception::to_repr

    automatically derived

    Exception::underlying_status

    fn Exception::underlying_status(self : Exception) -> UInt64?

    IN_PAGE_ERROR's ExceptionInformation[2]: the real NTSTATUS behind the failed page read.

    FixedFileInfo

    pub(all) struct FixedFileInfo {
    signature : UInt
    struct_version : UInt
    file_version_hi : UInt
    file_version_lo : UInt
    product_version_hi : UInt
    product_version_lo : UInt
    file_flags_mask : UInt
    file_flags : UInt
    file_os : UInt
    file_type : UInt
    file_sub_type : UInt
    file_date_hi : UInt
    file_date_lo : UInt
    } derive(Eq,
    Debug
    )

    Module version info, fixed at 13 32-bit words / 52 bytes.

    In minidump this struct uses the 52-byte layout from breakpad's minidump_format.h (the file_os / file_type / file_subType trio), not the 40-byte VS_FIXEDFILEINFO from Windows winver.h. This was derived and confirmed from the corpus: test.dmp's ModuleListStream has DataSize=1408, exactly 4 + 13*108, and only with 52-byte records does CvRecord land on the RSDS magic. Field names follow breakpad (file_sub_type corresponds to breakpad's file_subType).

    FixedFileInfo::equal

    automatically derived

    FixedFileInfo::not_equal

    fn FixedFileInfo::not_equal(x : FixedFileInfo, y : FixedFileInfo) -> Bool
    automatically derived

    FixedFileInfo::to_repr

    automatically derived

    FunctionTable

    pub(all) struct FunctionTable {
    minimum_address : UInt64
    maximum_address : UInt64
    base_address : UInt64
    entry_count : UInt
    inline_entry : (UInt, UInt, UInt)?
    } derive(Eq,
    Debug
    )

    FunctionTable::equal

    automatically derived

    FunctionTable::not_equal

    fn FunctionTable::not_equal(x : FunctionTable, y : FunctionTable) -> Bool
    automatically derived

    FunctionTable::to_repr

    automatically derived

    FunctionTableInfo

    pub(all) struct FunctionTableInfo {
    descriptors : Array[FunctionTable]
    size_of_descriptor : UInt
    size_of_native_descriptor : UInt
    size_of_function_entry : UInt
    declared_header : UInt
    size_of_align_pad : UInt
    layout : FunctionTableLayout
    layout_ok : Bool
    record_width : UInt64
    entries_rva : UInt64
    total_entries : UInt64
    entries_in_file : Bool
    } derive(Eq,
    Debug
    )

    FunctionTableInfo::equal

    automatically derived

    FunctionTableInfo::not_equal

    fn FunctionTableInfo::not_equal(x : FunctionTableInfo, y : FunctionTableInfo) -> Bool
    automatically derived

    FunctionTableInfo::to_repr

    automatically derived

    FunctionTableLayout

    pub enum FunctionTableLayout {
    Declared
    InlineRecords
    } derive(Eq,
    Debug
    )

    The two layouts of the descriptor array.

    FunctionTableLayout::equal

    automatically derived

    FunctionTableLayout::not_equal

    automatically derived

    FunctionTableLayout::to_repr

    automatically derived

    Handle

    pub(all) struct Handle {
    handle : UInt64
    type_name : String
    object_name : String
    attributes : UInt
    granted_access : UInt
    handle_count : UInt
    pointer_count : UInt
    object_info_rva : UInt64
    descriptor_size : UInt
    } derive(Eq,
    Debug
    )

    Handle::equal

    fn Handle::equal(Handle, Handle) -> Bool
    automatically derived

    Handle::not_equal

    fn Handle::not_equal(x : Handle, y : Handle) -> Bool
    automatically derived

    Handle::to_repr

    automatically derived
    pub(all) struct Header {
    signature : UInt
    version : UInt
    number_of_streams : UInt
    stream_directory_rva : UInt64
    checksum : UInt
    time_date_stamp : UInt
    flags : UInt64
    } derive(Eq,
    Debug
    )

    MINIDUMP_HEADER, fixed 32 bytes.

    Header::equal

    fn Header::equal(Header, Header) -> Bool
    automatically derived

    Header::not_equal

    fn Header::not_equal(x : Header, y : Header) -> Bool
    automatically derived

    Header::to_repr

    automatically derived

    JsonOptions

    pub(all) struct JsonOptions {
    path : String?
    symbols : SymbolStore?
    walk : StackWalkOptions
    all_threads : Bool
    }

    Switches for report_json.

    LocationDescriptor

    pub(all) struct LocationDescriptor {
    size : UInt
    rva : UInt64
    } derive(Eq,
    Debug
    )

    MINIDUMP_LOCATION_DESCRIPTOR: a (size, RVA) pair. Reused in many places (a module's CvRecord / MiscRecord, the later UnloadedModuleList, etc.). RVA 0 means the generator did not write it.

    The field order in the file is DataSize first, then Rva (matching the MS header), which is easy to get backwards from memory: in test.dmp the first module has 0x28 (40) at +76 and 4908 at +80, and 4908 is exactly the position of the first "RSDS" magic in the file — confirming that the smaller value is the length and the larger is the offset.

    LocationDescriptor::equal

    automatically derived

    LocationDescriptor::not_equal

    automatically derived

    LocationDescriptor::to_repr

    automatically derived

    MemoryDescriptor

    pub(all) struct MemoryDescriptor {
    start_address : UInt64
    location : LocationDescriptor
    } derive(Eq,
    Debug
    )

    MINIDUMP_MEMORY_DESCRIPTOR: where a virtual-address range lives in the dump file.

    The C layout is DWORD64 StartOfMemoryRange followed by a MINIDUMP_LOCATION_DESCRIPTOR (DataSize 4 + Rva 4), 16 bytes total. Thread stacks, ThreadEx's BackingStore, and MemoryListStream entries all use this struct.

    MemoryDescriptor::equal

    automatically derived

    MemoryDescriptor::not_equal

    fn MemoryDescriptor::not_equal(x : MemoryDescriptor, y : MemoryDescriptor) -> Bool
    automatically derived

    MemoryDescriptor::to_repr

    automatically derived

    MemoryInfo

    pub(all) struct MemoryInfo {
    base_address : UInt64
    allocation_base : UInt64
    allocation_protect : UInt
    region_size : UInt64
    state : UInt
    protect : UInt
    type_ : UInt
    } derive(Eq,
    Debug
    )

    MINIDUMP_MEMORY_INFO: describes the virtual-address layout, not content (which addresses are committed, their protection attributes, image vs private memory), from um\minidumpapiset.h:690. 48 bytes: BaseAddress8 + AllocationBase8 + AllocationProtect4 + padding4
    • RegionSize8 + State4 + Protect4 + Type4 + padding4.

    MemoryInfo::end_address

    fn MemoryInfo::end_address(self : MemoryInfo) -> UInt64

    MemoryInfo::equal

    fn MemoryInfo::equal(MemoryInfo, MemoryInfo) -> Bool
    automatically derived

    MemoryInfo::not_equal

    fn MemoryInfo::not_equal(x : MemoryInfo, y : MemoryInfo) -> Bool
    automatically derived

    MemoryInfo::to_repr

    automatically derived

    MemoryMap

    pub(all) struct MemoryMap {
    regions : Array[MemoryRegion]
    dropped : UInt
    } derive(Eq,
    Debug
    )

    The "read memory by virtual address" view: both memory streams merged, sorted, and clipped to the file end. Stack walking, memory search, and crash-site forensics all read from here.

    MemoryMap::clipped_count

    fn MemoryMap::clipped_count(self : MemoryMap) -> UInt

    Number of clipped segments: those whose declared length differs from their readable length.

    MemoryMap::equal

    fn MemoryMap::equal(MemoryMap, MemoryMap) -> Bool
    automatically derived

    MemoryMap::file_rva_for

    fn MemoryMap::file_rva_for(self : MemoryMap, address : UInt64, len : UInt64) -> UInt64?

    Address -> file RVA. With it, the existing read_uint32/read_uint64 can be used directly.

    MemoryMap::not_equal

    fn MemoryMap::not_equal(x : MemoryMap, y : MemoryMap) -> Bool
    automatically derived

    MemoryMap::readable

    fn MemoryMap::readable(self : MemoryMap, address : UInt64, len : UInt64) -> Bool

    Whether an address range is readable (fully covered and genuinely inside the file).

    MemoryMap::region_at

    fn MemoryMap::region_at(self : MemoryMap, address : UInt64) -> MemoryRegion?

    Only asks "is this address itself present in the dump".

    MemoryMap::region_count

    fn MemoryMap::region_count(self : MemoryMap) -> Int

    MemoryMap::region_for

    fn MemoryMap::region_for(self : MemoryMap, address : UInt64, len : UInt64) -> MemoryRegion?

    Find the memory segment fully covering [address, address+len).

    Binary-search for "the last start_address <= address", then walk backward. Earlier regions can extend beyond later ones: start order cannot bound ends. Normal dumps have non-overlapping ranges and hit on the first check; on overlap take the segment with the largest start address (the most specific one).

    MemoryMap::to_repr

    automatically derived

    MemoryMap::total_bytes

    fn MemoryMap::total_bytes(self : MemoryMap) -> UInt64

    Total readable bytes (by clipped lengths).

    MemoryRegion

    pub(all) struct MemoryRegion {
    start_address : UInt64
    declared_size : UInt64
    size : UInt64
    file_rva : UInt64
    } derive(Eq,
    Debug
    )

    One memory region.

    Three lengths that must not be conflated:
    • declared_size: the raw length written in the stream.
    • size: the length actually readable after clipping to the end of the file. In real dumps the last Memory64List segment often sits exactly on the file end, and some writers overstate the length by tens of bytes; storing both makes the malformation visible instead of turning into an out-of-bounds read.
    • file_rva: where this memory lives in the file. MemoryList(5) gives it directly; Memory64List(9) does not — it accumulates as BaseRva + thesum of all preceding segments' declared lengths, per the SDK comment verbatim ("the RVA is the base RVA plus the sum of the preceeding data blocks", um\minidumpapiset.h:66).

    MemoryRegion::contains

    fn MemoryRegion::contains(self : MemoryRegion, address : UInt64) -> Bool

    Whether the address falls within the readable range.

    MemoryRegion::covers

    fn MemoryRegion::covers(self : MemoryRegion, address : UInt64, len : UInt64) -> Bool

    Whether [address, address+len) lies entirely within this memory. Reading an 8-byte pointer requires full coverage; otherwise the value is stitched together, which is more dangerous than not reading at all.

    MemoryRegion::end_address

    fn MemoryRegion::end_address(self : MemoryRegion) -> UInt64

    Right boundary (exclusive).

    MemoryRegion::equal

    automatically derived

    MemoryRegion::not_equal

    fn MemoryRegion::not_equal(x : MemoryRegion, y : MemoryRegion) -> Bool
    automatically derived

    MemoryRegion::to_repr

    automatically derived

    MemoryRegion::was_clipped

    fn MemoryRegion::was_clipped(self : MemoryRegion) -> Bool

    Was clipped (declared length differs from readable length).

    MiscInfo

    pub(all) struct MiscInfo {
    info_version : UInt
    size_of_info : UInt
    flags1 : UInt
    process_id : UInt?
    process_times : ProcessTimes?
    processor_power_info : ProcessorPowerInfo?
    process_integrity_level : UInt?
    process_execute_flags : UInt?
    protected_process : UInt?
    time_zone_id : UInt?
    time_zone : TimeZoneInformation?
    build_string : String?
    dbg_build_string : String?
    xstate_config : XStateConfig?
    process_cookie : UInt?
    } derive(Eq,
    Debug
    )

    The MINIDUMP_MISC_INFO stream. Everything except SizeOfInfo/Flags1 is gated on "version sufficient + bit set"; when not satisfied the value is None (not 0) — the two semantics must stay distinguishable: 0 is a value the generator wrote, None means "this dump simply does not provide it".

    size_of_info keeps the raw field: MS says it equals the struct length, but writers have been observed writing other numbers (Crashpad often differs by 4 bytes), so it is displayed only — not validated, and not used for version detection.

    MiscInfo::equal

    fn MiscInfo::equal(MiscInfo, MiscInfo) -> Bool
    automatically derived

    MiscInfo::not_equal

    fn MiscInfo::not_equal(x : MiscInfo, y : MiscInfo) -> Bool
    automatically derived

    MiscInfo::to_repr

    automatically derived

    Module

    pub(all) struct Module {
    base_of_image : UInt64
    size_of_image : UInt
    checksum : UInt
    time_date_stamp : UInt
    name : String
    version_info : FixedFileInfo
    code_view : CodeView
    misc_record : LocationDescriptor
    reserved0 : UInt64
    reserved1 : UInt64
    } derive(Eq,
    Debug
    )

    Module (image) record.

    Module::code_view_pdb_name

    fn Module::code_view_pdb_name(self : Module) -> String

    The module's PDB name (empty string when there is no RSDS record). It lives here because only symbol resolution uses it.

    Module::contains

    fn Module::contains(self : Module, address : UInt64) -> Bool

    Whether an address falls within this module. Stack walking relies on it to attribute return addresses to modules.

    Module::end_address

    fn Module::end_address(self : Module) -> UInt64

    The end address (exclusive) occupied by the module.

    Module::equal

    fn Module::equal(Module, Module) -> Bool
    automatically derived

    Module::file_version

    fn Module::file_version(self : Module) -> String

    File version, in "5.1.2600.2180" form.

    Module::not_equal

    fn Module::not_equal(x : Module, y : Module) -> Bool
    automatically derived

    Module::offset_of

    fn Module::offset_of(self : Module, address : UInt64) -> UInt64?

    The offset within the module when the address falls inside it.

    Module::product_version

    fn Module::product_version(self : Module) -> String

    Product version.

    Module::to_repr

    automatically derived

    ModuleList

    pub(all) struct ModuleList {
    modules : Array[Module]
    skipped : Int
    } derive(Eq,
    Debug
    )

    What comes out of reading a module list.

    ModuleList::equal

    fn ModuleList::equal(ModuleList, ModuleList) -> Bool
    automatically derived

    ModuleList::not_equal

    fn ModuleList::not_equal(x : ModuleList, y : ModuleList) -> Bool
    automatically derived

    ModuleList::to_repr

    automatically derived

    ProcessTimes

    pub(all) struct ProcessTimes {
    create_time : UInt
    user_time : UInt
    kernel_time : UInt
    } derive(Eq,
    Debug
    )

    The PROCESS_TIMES group of times, in seconds (one each for kernel/user CPU time).

    ProcessTimes::equal

    automatically derived

    ProcessTimes::not_equal

    fn ProcessTimes::not_equal(x : ProcessTimes, y : ProcessTimes) -> Bool
    automatically derived

    ProcessTimes::to_repr

    automatically derived

    ProcessorPowerInfo

    pub(all) struct ProcessorPowerInfo {
    max_mhz : UInt
    current_mhz : UInt
    mhz_limit : UInt
    max_idle_state : UInt
    current_idle_state : UInt
    } derive(Eq,
    Debug
    )

    The PROCESSOR_POWER_INFO group of frequencies/idle states.

    ProcessorPowerInfo::equal

    automatically derived

    ProcessorPowerInfo::not_equal

    automatically derived

    ProcessorPowerInfo::to_repr

    automatically derived

    ResolvedFrame

    pub(all) struct ResolvedFrame {
    name : String
    start : UInt64
    kind : String
    file : String
    line : Int64?
    } derive(Eq,
    Debug
    )

    The result of resolving one address. A line of None means "hit a function but no line number" or "hit only a PUBLIC"; both must be distinguishable from "no symbol at all".

    ResolvedFrame::equal

    automatically derived

    ResolvedFrame::not_equal

    fn ResolvedFrame::not_equal(x : ResolvedFrame, y : ResolvedFrame) -> Bool
    automatically derived

    ResolvedFrame::to_repr

    automatically derived

    StackFrame

    pub(all) struct StackFrame {
    address : UInt64
    lookup_address : UInt64?
    stack_address : UInt64?
    kind : String
    module_index : Int?
    module_name : String
    offset : UInt64?
    in_function_table : Bool?
    return_site : String
    } derive(Eq,
    Debug
    )

    A frame. address is the instruction address. stack_address records the source slot when the value was read from memory; direct-register CFI/WIN callers may have no slot.

    StackFrame::equal

    fn StackFrame::equal(StackFrame, StackFrame) -> Bool
    automatically derived

    StackFrame::not_equal

    fn StackFrame::not_equal(x : StackFrame, y : StackFrame) -> Bool
    automatically derived

    StackFrame::to_repr

    automatically derived

    StackWalk

    pub(all) struct StackWalk {
    thread_id : UInt
    layout : String
    pointer_size : UInt
    supported : Bool
    reason : String
    frames : Array[StackFrame]
    notes : Array[String]
    fp_frames : Int
    cfi_frames : Int
    win_frames : Int
    scanned_slots : Int64
    scan_limited : Bool
    window_low : UInt64?
    window_high : UInt64?
    } derive(Eq,
    Debug
    )

    The result of one stack walk.

    StackWalk::equal

    fn StackWalk::equal(StackWalk, StackWalk) -> Bool
    automatically derived

    StackWalk::not_equal

    fn StackWalk::not_equal(x : StackWalk, y : StackWalk) -> Bool
    automatically derived

    StackWalk::to_repr

    automatically derived

    StackWalkOptions

    pub(all) struct StackWalkOptions {
    max_frames : Int
    max_scan_bytes : Int64
    scan : Bool
    } derive(Eq,
    Debug
    )

    Walk options. Both limits must be explicit: a real dump's stack window can be several MB.

    StackWalkOptions::equal

    automatically derived

    StackWalkOptions::not_equal

    fn StackWalkOptions::not_equal(x : StackWalkOptions, y : StackWalkOptions) -> Bool
    automatically derived

    StackWalkOptions::to_repr

    automatically derived

    StreamEntry

    pub(all) struct StreamEntry {
    stream_type : UInt
    data_size : UInt
    rva : UInt64
    } derive(Eq,
    Debug
    )

    One entry of the stream directory. Both DataSize and RVA are 32-bit in the file.

    StreamEntry::equal

    fn StreamEntry::equal(StreamEntry, StreamEntry) -> Bool
    automatically derived

    StreamEntry::not_equal

    fn StreamEntry::not_equal(x : StreamEntry, y : StreamEntry) -> Bool
    automatically derived

    StreamEntry::to_repr

    automatically derived

    SymFunction

    pub(all) struct SymFunction {
    address : UInt64
    size : UInt64
    name : String
    lines : Array[SymLine]
    } derive(Eq,
    Debug
    )

    A FUNC record. lines keeps file order — dump_syms writes them in ascending address order.

    SymFunction::equal

    fn SymFunction::equal(SymFunction, SymFunction) -> Bool
    automatically derived

    SymFunction::not_equal

    fn SymFunction::not_equal(x : SymFunction, y : SymFunction) -> Bool
    automatically derived

    SymFunction::to_repr

    automatically derived

    SymLine

    pub(all) struct SymLine {
    address : UInt64
    size : UInt64
    line : Int64
    file : Int64
    } derive(Eq,
    Debug
    )

    A LINE record: size bytes starting at address belong to line line of source file number file.

    SymLine::equal

    fn SymLine::equal(SymLine, SymLine) -> Bool
    automatically derived

    SymLine::not_equal

    fn SymLine::not_equal(x : SymLine, y : SymLine) -> Bool
    automatically derived

    SymLine::to_repr

    automatically derived

    SymPublic

    pub(all) struct SymPublic {
    address : UInt64
    size : UInt64
    name : String
    } derive(Eq,
    Debug
    )

    A PUBLIC record, no line numbers. The historical size field stores Breakpad parameter_size; PUBLIC has no function extent.

    SymPublic::equal

    fn SymPublic::equal(SymPublic, SymPublic) -> Bool
    automatically derived

    SymPublic::not_equal

    fn SymPublic::not_equal(x : SymPublic, y : SymPublic) -> Bool
    automatically derived

    SymPublic::to_repr

    automatically derived

    SymStackRule

    pub(all) struct SymStackRule {
    address : UInt64
    size : UInt64
    kind : SymStackRuleKind
    body : String
    malformed : Bool
    } derive(Eq,
    Debug
    )

    SymStackRule::equal

    automatically derived

    SymStackRule::not_equal

    fn SymStackRule::not_equal(x : SymStackRule, y : SymStackRule) -> Bool
    automatically derived

    SymStackRule::to_repr

    automatically derived

    SymStackRuleKind

    pub(all) enum SymStackRuleKind {
    CfiInit
    Cfi
    Win
    } derive(Eq,
    Debug
    )

    One parsed unwind record. Addresses are module-relative RVAs, as with FUNC. body is the expression after the address (and size for INIT/WIN); parsing its grammar belongs to the evaluator so a future unsupported opcode cannot invalidate otherwise usable symbol records.

    SymStackRuleKind::equal

    automatically derived

    SymStackRuleKind::not_equal

    fn SymStackRuleKind::not_equal(x : SymStackRuleKind, y : SymStackRuleKind) -> Bool
    automatically derived

    SymStackRuleKind::to_repr

    automatically derived

    SymbolFile

    pub(all) struct SymbolFile {
    os : String
    arch : String
    debug_id : String
    name : String
    files : Array[String]
    functions : Array[SymFunction]
    publics : Array[SymPublic]
    stack_rules : Array[SymStackRule]
    line_records : Int64
    cfi_records : Int64
    win_records : Int64
    other_records : Int64
    bad_stack_records : Int64
    bad_records : Int64
    total_function_size : UInt64
    ascending : Bool
    valid : Bool
    } derive(Eq,
    Debug
    )

    The parsed result of one .sym file.

    SymbolFile::equal

    fn SymbolFile::equal(SymbolFile, SymbolFile) -> Bool
    automatically derived

    SymbolFile::not_equal

    fn SymbolFile::not_equal(x : SymbolFile, y : SymbolFile) -> Bool
    automatically derived

    SymbolFile::to_repr

    automatically derived

    SymbolStore

    pub(all) struct SymbolStore {
    loaded : Array[(String, SymbolFile)]
    rejected : Array[String]
    images : Array[BinaryX64Image]
    } derive(Eq,
    Debug
    )

    A collection of symbol files. Indexed by content (the debug id on the MODULE line), not by directory convention: the breakpad <debug_file>/<debug_id>/<name>.sym three-level path is not implemented identically by every producer, while the id a file declares for itself is authoritative. So every .sym found by recursive loading is parsed and kept.

    SymbolStore::equal

    fn SymbolStore::equal(SymbolStore, SymbolStore) -> Bool
    automatically derived

    SymbolStore::not_equal

    fn SymbolStore::not_equal(x : SymbolStore, y : SymbolStore) -> Bool
    automatically derived

    SymbolStore::to_repr

    automatically derived

    SymbolTarget

    pub(all) struct SymbolTarget {
    name : String
    kind : String
    symbol_start : UInt64?
    offset : UInt64?
    file : String
    line : Int64?
    symbol_source : String
    matched_by : String
    status : String
    candidates : Int
    } derive(Eq,
    Debug
    )

    The symbol resolution result for one frame. status is a closed set of values; callers must use it to distinguish the causes of "no symbol":
    • "ok": a function or PUBLIC matched.
    • "unresolved": a symbol table exists, but this address falls in no FUNC/PUBLIC.
    • "ambiguous": multiple .sym files matched; the first is used and candidates gives the count.
    • "no_module": the address is not in any module, so the module offset cannot be computed.
    • "no_symbol_file": the symbol store has no .sym for this module.
    • "empty_store": the symbol store is empty (--symbols was not given).

    SymbolTarget::equal

    automatically derived

    SymbolTarget::not_equal

    fn SymbolTarget::not_equal(x : SymbolTarget, y : SymbolTarget) -> Bool
    automatically derived

    SymbolTarget::to_repr

    automatically derived

    SystemInfo

    pub(all) struct SystemInfo {
    processor_architecture : UInt16
    processor_level : UInt16
    processor_revision : UInt16
    number_of_processors : Byte
    product_type : Byte
    major_version : UInt
    minor_version : UInt
    build_number : UInt
    platform_id : UInt
    csd_version : String
    suite_mask : UInt16
    reserved2 : UInt16
    cpu : Array[UInt]
    cpu_vendor : String?
    } derive(Eq,
    Debug
    )

    MINIDUMP_SYSTEM_INFO, fixed 56 bytes.

    The layout of the first 32 bytes was verified byte-by-byte against 5 real dumps under testdata/ (Windows x86/XP, Windows x64, Crashpad macOS, breakpad Linux, Windows x64 full memory): versions read back as 5.1.2600 + "Service Pack 2" and 10.0.19042, and suite_mask reads back as valid VER_SUITE bitmaps like 0x0100/0x0300 — which places SuiteMask at 28, not 30.

    Bytes 32..56 are the CPU_INFORMATION union, fixed at 24 bytes, with contents varying by architecture/generator: x86 and amd64 are vendor_id[3]@32 + version_information@44 + feature_information@48 + amd_extended_cpu_features@52; the ARM family is cpuid@32 + elf_hwcaps@36; everything else is 2 u64s of processor_features. So this keeps the 6 raw 32-bit words, and only surfaces a vendor when it actually looks like a vendor string.

    SystemInfo::equal

    fn SystemInfo::equal(SystemInfo, SystemInfo) -> Bool
    automatically derived

    SystemInfo::not_equal

    fn SystemInfo::not_equal(x : SystemInfo, y : SystemInfo) -> Bool
    automatically derived

    SystemInfo::to_repr

    automatically derived

    SystemTime

    pub(all) struct SystemTime {
    year : UInt16
    month : UInt16
    day_of_week : UInt16
    day : UInt16
    hour : UInt16
    minute : UInt16
    second : UInt16
    milliseconds : UInt16
    } derive(Eq,
    Debug
    )

    SYSTEMTIME, fixed 16 bytes (minwinbase.h:90). Note this holds a time-zone transition rule (which week/day/hour), not an absolute moment; on machines that ignore DST the whole block is 0, so is_empty is the norm, not malformation.

    SystemTime::equal

    fn SystemTime::equal(SystemTime, SystemTime) -> Bool
    automatically derived

    SystemTime::is_empty

    fn SystemTime::is_empty(self : SystemTime) -> Bool

    SystemTime::not_equal

    fn SystemTime::not_equal(x : SystemTime, y : SystemTime) -> Bool
    automatically derived

    SystemTime::rule_text

    fn SystemTime::rule_text(self : SystemTime) -> String

    Compress a "DST transition rule" into one fixed-width text line. Deliberately not formatted as a date: wYear is 0 throughout the corpus; the value expresses a rule like "switch on the first Sunday of November at 02:00" (day_of_week + day together mean "the Nth weekday"), and dressing it up as an absolute date would only mislead report readers.

    SystemTime::to_repr

    automatically derived

    Thread

    pub(all) struct Thread {
    id : UInt
    suspend_count : UInt
    priority_class : UInt
    priority : UInt
    teb : UInt64
    stack : MemoryDescriptor
    context : LocationDescriptor
    backing_store : MemoryDescriptor?
    entry_size : UInt
    } derive(Eq,
    Debug
    )

    One thread record.

    Thread and ThreadEx share one type: the only difference is backing_store, which is present only for 64-byte records. Splitting into two types would add a pointless extra match to the most common use, iterating threads.

    Thread::equal

    fn Thread::equal(Thread, Thread) -> Bool
    automatically derived

    Thread::not_equal

    fn Thread::not_equal(x : Thread, y : Thread) -> Bool
    automatically derived

    Thread::to_repr

    automatically derived

    ThreadInfo

    pub(all) struct ThreadInfo {
    thread_id : UInt
    dump_flags : UInt
    dump_error : UInt
    exit_status : UInt
    create_time : UInt64
    exit_time : UInt64
    kernel_time : UInt64
    user_time : UInt64
    start_address : UInt64
    affinity : UInt64
    } derive(Eq,
    Debug
    )

    ThreadInfo::equal

    fn ThreadInfo::equal(ThreadInfo, ThreadInfo) -> Bool
    automatically derived

    ThreadInfo::not_equal

    fn ThreadInfo::not_equal(x : ThreadInfo, y : ThreadInfo) -> Bool
    automatically derived

    ThreadInfo::to_repr

    automatically derived

    ThreadName

    pub(all) struct ThreadName {
    thread_id : UInt
    name : String
    } derive(Eq,
    Debug
    )

    ThreadName::equal

    fn ThreadName::equal(ThreadName, ThreadName) -> Bool
    automatically derived

    ThreadName::not_equal

    fn ThreadName::not_equal(x : ThreadName, y : ThreadName) -> Bool
    automatically derived

    ThreadName::to_repr

    automatically derived

    TimeZoneInformation

    pub(all) struct TimeZoneInformation {
    bias : Int
    standard_name : String
    standard_date : SystemTime
    standard_bias : Int
    daylight_name : String
    daylight_date : SystemTime
    daylight_bias : Int
    } derive(Eq,
    Debug
    )

    TIME_ZONE_INFORMATION, fixed 172 bytes (timezoneapi.h:35). Bias is the minutes such that "local time + Bias = UTC", so its sign is the opposite of the UTC offset: in the corpus US Eastern writes 300 (= UTC-05:00) and Beijing writes -480 (= UTC+08:00).

    TimeZoneInformation::equal

    automatically derived

    TimeZoneInformation::not_equal

    automatically derived

    TimeZoneInformation::to_repr

    automatically derived

    UnloadedModule

    pub(all) struct UnloadedModule {
    base_of_image : UInt64
    size_of_image : UInt
    checksum : UInt
    time_date_stamp : UInt
    name : String
    } derive(Eq,
    Debug
    )

    UnloadedModule::end_address

    fn UnloadedModule::end_address(self : UnloadedModule) -> UInt64

    Same as Module::end_address: the wraparound itself is exactly what is wanted here. Callers recognize malformed "base+size overflow" records via end_address() < base_of_image. Saturating addition would erase this clue (saturating to all ones, never less than the base).

    UnloadedModule::equal

    automatically derived

    UnloadedModule::not_equal

    fn UnloadedModule::not_equal(x : UnloadedModule, y : UnloadedModule) -> Bool
    automatically derived

    UnloadedModule::to_repr

    automatically derived

    UnloadedModuleList

    pub(all) struct UnloadedModuleList {
    modules : Array[UnloadedModule]
    skipped : UInt
    declared_count : UInt64
    } derive(Eq,
    Debug
    )

    UnloadedModuleList::equal

    automatically derived

    UnloadedModuleList::not_equal

    automatically derived

    UnloadedModuleList::to_repr

    automatically derived

    XStateConfig

    pub(all) struct XStateConfig {
    size_of_info : UInt
    context_size : UInt
    enabled_features : UInt64
    features : Array[XStateFeature]
    } derive(Eq,
    Debug
    )

    XSTATE_CONFIG_FEATURE_MSC_INFO (minidumpapiset.h:562), 528 bytes. context_size is the total size of the extended CONTEXT; AVX stack walking needs it to determine the read length. Bit i of enabled_features corresponds to features[i].

    XStateConfig::enabled

    fn XStateConfig::enabled(self : XStateConfig, index : Int) -> Bool

    XStateConfig::equal

    automatically derived

    XStateConfig::feature

    fn XStateConfig::feature(self : XStateConfig, index : Int) -> XStateFeature?

    Get XState feature number index (None when out of range or not enabled).

    XStateConfig::not_equal

    fn XStateConfig::not_equal(x : XStateConfig, y : XStateConfig) -> Bool
    automatically derived

    XStateConfig::to_repr

    automatically derived

    XStateFeature

    pub(all) struct XStateFeature {
    offset : UInt
    size : UInt
    } derive(Eq,
    Debug
    )

    XSTATE_FEATURE (winnt.h:14412): { Offset, Size }, 8 bytes.

    XStateFeature::equal

    automatically derived

    XStateFeature::not_equal

    fn XStateFeature::not_equal(x : XStateFeature, y : XStateFeature) -> Bool
    automatically derived

    XStateFeature::to_repr

    automatically derived

    address_module_line

    fn address_module_line(modules : Array[Module], address : UInt64) -> String

    Crash address attribution: on a hit, "module name+offset"; otherwise state explicitly that it is in no module (dumps with a zero address or addresses outside all modules are common, and worth distinguishing).

    architecture_name

    fn architecture_name(arch : UInt16) -> String

    Architecture name; unknown numbers display as-is.

    architecture_names

    let architecture_names : Array[(UInt16, String)]

    wProcessorArchitecture values and display names.

    Names align with rust-minidump's cpu_arch output (x86/amd64/arm/arm64/…) so future JSON cross-checks won't differ on this field. Two easy-to-miss points: ARM64 is 12 (not 11) — 11 is undefined in MS/breakpad/ rust-minidump; breakpad's old ARM64 encoding uses 0x8003 and coexists with MS's 12.

    binary_x64_image

    fn binary_x64_image(data : Bytes) -> BinaryX64Image?

    breakpad_info_stream

    let breakpad_info_stream : UInt

    The first of breakpad's "Gg" extension streams. The Linux* stream family's numbering differs across implementations; no name until verified.

    code_view_rsds_signature

    let code_view_rsds_signature : UInt

    The RSDS (PDB 7.0) magic of a CodeView record, i.e. ASCII "RSDS".

    comment_stream_a

    let comment_stream_a : UInt

    comment_stream_w

    let comment_stream_w : UInt

    compressed_memory_stream_unverified

    let compressed_memory_stream_unverified : UInt

    25/26 only appear in code blocks of the Microsoft docs (the CompressedMemoryStream family); neither the constant table nor rust-minidump/breakpad confirm their contents or bounds, so keep the number but no name for now.

    context_amd64_size

    let context_amd64_size : UInt

    context_arch_by_size

    fn context_arch_by_size(size : UInt) -> UInt16?

    Infer the architecture from the declared length (cross-checking only; see Dump::read_context).

    context_arm64_size

    let context_arm64_size : UInt

    context_expected_size

    fn context_expected_size(architecture : UInt16) -> UInt?

    Whether the architecture has a verified CONTEXT field table.

    32-bit ARM (number 5) is deliberately absent from this table: the local SDK's ARM _CONTEXT (winnt.h:5287, computed 416 bytes) is not the same layout breakpad/rust-minidump use for minidumps, and the corpus has no ARM dump to prove otherwise. Per the "no guessed offsets" rule, such architectures go through Context::Undecoded, reporting only the declared length.

    context_flag_bits

    fn context_flag_bits(architecture : UInt16) -> Array[(UInt, String)]

    The low bits of a CONTEXT's ContextFlags: which fields the writer actually filled. Numbers come from um\winnt.h (x86: lines 8440-8454; amd64: the comment block at 4273-4290). arm64's bit semantics have not been independently verified, so it just gets raw hex.

    context_pointer_size

    fn context_pointer_size(ctx : Context) -> UInt?

    The adopted field table determines the pointer width. Undecoded has no verified field table, and hence no width.

    context_summary

    fn context_summary(ctx : Context) -> String

    One-line summary for test corpus and CLI overview: amd64/0x10001f rip=0x.. rsp=0x...

    context_x86_size

    let context_x86_size : UInt

    The canonical lengths (bytes) of the CONTEXT for each architecture.

    • x86: _CONTEXT from um\winnt.h:8506 (pshpack4) — ContextFlags@0, Dr0..Dr7@4..24, FLOATING_SAVE_AREA(112)@28, SegGs/Fs/Es/Ds@140..152, Edi..Eax@156..176, Ebp@180 Eip@184 SegCs@188 EFlags@192 Esp@196 SegSs@200, ExtendedRegisters[512]@204 → 204+512 = 716. test.dmp (XP x86) has ContextSize exactly 716, and reading with this table yields SegCs=0x1b, SegSs=0x23, EFlags=0x246, and an Esp inside the thread's declared stack range — four independent invariants all line up, so these offsets have both header and corpus backing.
    • amd64: _CONTEXT from um\winnt.h:4304 (DECLSPEC_ALIGN(16)) → 1232; see the offset constants below. All 4 amd64 dumps in the corpus have ContextSize 1232, with Rsp inside each thread's stack range and Rip inside some module's image.
    • arm64: _ARM64_NT_CONTEXT from um\winnt.h:6796, whose header comments carry the offsets; the last field /* +0x390 */ → 912 (ARM64_MAX_BREAKPOINTS=8, ARM64_MAX_WATCHPOINTS=2, see winnt.h:6733). The corpus has no arm64 dump, so this tier has header backing only.

    crashpad_info_stream

    let crashpad_info_stream : UInt

    Crashpad's "CP" extension stream.

    describe_context_flags

    fn describe_context_flags(architecture : UInt16, flags : UInt) -> Array[String]

    Split ContextFlags: the architecture base bit (x86=0x10000, amd64=0x100000) is confirmed separately; the rest are split by bit name, with leftovers going into Unknown(0x..).

    describe_error

    fn describe_error(err : ParseError) -> String

    Human-readable error descriptions for the CLI and tests.

    describe_exception_flags

    fn describe_exception_flags(flags : UInt) -> Array[String]

    EXCEPTION_RECORD's Flags: currently only "noncontinuable" is a public bit (value 1, see minwinbase.h's EXCEPTION_NONCONTINUABLE_EXCEPTION). The MS docs only say the remaining bits are reserved, so they are left as-is.

    describe_minidump_type

    fn describe_minidump_type(flags : UInt64) -> Array[String]

    Split the low half of header.flags into MDMP_TYPE names; any remaining unrecognized bits end up as Unknown(0x..), and 0 means MiniDumpNormal.

    describe_misc_flags

    fn describe_misc_flags(flags : UInt) -> Array[String]

    Split Flags1 into a name list; undefined bits go into a single Unknown entry, never silently dropped.

    describe_suite_mask

    fn describe_suite_mask(suite_mask : UInt16) -> Array[String]

    Split suite_mask; returns an empty array when no bit is set, unrecognized bits end up as Unknown(0x..).

    describe_thread_dump_flags

    fn describe_thread_dump_flags(flags : UInt) -> Array[String]

    error_kind

    fn error_kind(err : ParseError) -> String

    Error category name, for tests and the CLI.

    exception_code_label

    fn exception_code_label(platform_id : UInt, code : UInt) -> String

    Exception code label: Windows looks up the EXCEPTION_* table, Linux-family tries the signal table first; on a miss fall back to the Windows table's Unknown form (the number always stays visible).

    exception_code_name

    fn exception_code_name(code : UInt) -> String

    Exception code name; falls back to raw hex when not found.

    exception_code_names

    let exception_code_names : Array[(UInt, String)]

    Windows exception code table. Every entry in the left column was verified against the local SDK: um\minwinbase.h:401-424 gives the EXCEPTION_* → STATUS_* aliasing, and shared\ntstatus.h gives the values (orderings like 0xC000008D being DENORMAL and 0x8E being DIVIDE_BY_ZERO can only be looked up, not memorized). The three entries beyond the EXCEPTION_* ones have no minwinbase.h alias but are codes genuinely readable in minidumps; their values likewise come from ntstatus.h.

    exception_maximum_parameters

    let exception_maximum_parameters : UInt

    exception_record_size

    let exception_record_size : UInt

    The body length of MINIDUMP_EXCEPTION (same as EXCEPTION_RECORD64): ExceptionCode4 + ExceptionFlags4 + ExceptionRecord8 + ExceptionAddress8
    • NumberParameters4 + __unusedAlignment4 + ExceptionInformation[15]*8 = 152. The parameter cap of 15 comes from EXCEPTION_MAXIMUM_PARAMETERS at um\winnt.h:10080.

    exception_stream

    let exception_stream : UInt

    exception_stream_size

    let exception_stream_size : UInt

    MINIDUMP_EXCEPTION_STREAM = ThreadId4 + __alignment4 + ExceptionRecord(152)
    • ThreadContext(8) = 168. All 4 dumps in the corpus that carry an exception stream have DataSize 168, matching the header-derived value.

    expected_signature

    let expected_signature : UInt

    The value of the four bytes "MDMP" read little-endian.

    find_module

    fn find_module(modules : Array[Module], address : UInt64) -> (Int, Module)?

    Find a module by virtual address. On multiple hits (malformed dumps with overlapping module ranges), take the first — matching rust-minidump's module list behavior.

    find_thread_by_id

    fn find_thread_by_id(threads : Array[Thread], id : UInt) -> (Int, Thread)?

    Find a thread by ID in the thread table. The exception stream gives only the ID, not the index.

    fixed_file_info_signature

    let fixed_file_info_signature : UInt

    The valid signature of VS_FIXEDFILEINFO.

    Note: this value must not be used for validation. In the observed corpus the main program module ("c:\test_app.exe") writes 0, and only system modules write 0xfeef04bd; rust-minidump never validates it either. The field is kept for display only.

    frame_chain_supported

    fn frame_chain_supported(ctx : Context) -> Bool

    How far the frame-pointer chain is trusted, per architecture. x86/amd64 are covered by synthetic-dump tests; arm64 is handled with the same "frame pointer and return address in adjacent slots" shape, but there is no real arm64 dump offline to prove it — when the chain cannot proceed, the result carries a corresponding note and never silently gives a wrong call chain.

    function_table_descriptor_size

    let function_table_descriptor_size : UInt

    function_table_header_size

    let function_table_header_size : UInt

    FunctionTableStream (13, written as FunctionListStream in some docs). A 24-byte header SizeOfHeader/SizeOfDescriptor/SizeOfNativeDescriptor/SizeOfFunctionEntry/NumberOfDescriptors/SizeOfAlignPad; descriptors are 32 bytes: MinimumAddress/MaximumAddress/BaseAddress(each u64) + EntryCount u32 + pad u32 (um\minidumpapiset.h:514, :522).

    But writers do not all follow that layout. Measured on a local WER dump: the stream is 21268 bytes and the header declares 24/32/136/12/113/4. Reading with the declared stride of 32, only 6 of the 113 descriptors have addresses that still look like Windows user-mode virtual addresses; after switching to "the array starts at SizeOfHeader + SizeOfAlignPad, and each record occupies SizeOfDescriptor + SizeOfNativeDescriptor + SizeOfFunctionEntry +SizeOfAlignPad = 184 bytes", all 113/113 are self-consistent, and the 12 bytes inlined in each record are exactly an x64 IMAGE_FUNCTION_ENTRY (RVAs of the magnitude BeginAddress=0, EndAddress=0x280,UnwindInfoAddress=0x298). Exhausting start∈[24,40] and stride∈[32,400] (both 4-aligned), only the (28,184) pair makes all records self-consistent — so this layer computes both layouts, picks the self-consistent one, and records the choice in layout so callers can see the confidence. When neither is self-consistent, fall back to the declared stride and set layout_ok=false. The entry contents are architecture-dependent; this layer only reports "where, how many, how wide, readable or not" — decoding is left to the caller that needs it.

    function_table_layout_name

    fn function_table_layout_name(layout : FunctionTableLayout) -> String

    function_table_stream

    let function_table_stream : UInt

    The SDK calls this number MINIDUMP_FUNCTION_TABLE_STREAM (function-table stream), not "function list".

    get_stream

    fn get_stream(entries : Array[StreamEntry], stream_type : UInt) -> StreamEntry?

    Look up an entry by stream type in the directory. When a type appears more than once, take the last one: rust-minidump builds a per-type map where later entries overwrite earlier ones (with a warn); match that so field-by-field cross-checks line up.

    handle_data_header_size

    let handle_data_header_size : UInt

    HandleDataStream (12). A 16-byte header SizeOfHeader/SizeOfDescriptor/NumberOfDescriptors/Reserved; a v1 descriptor is 32 bytes, a v2 descriptor adds ObjectInfoRva + Reserved0 for 40 bytes total (um\minidumpapiset.h:464, :474, :490). A handle's type name and object name are the direct clues for investigating named kernel objects, mutexes, and shared memory, so these two RVAs must be decoded into strings, not just reported as numbers.

    handle_data_stream

    let handle_data_stream : UInt

    handle_descriptor_2_size

    let handle_descriptor_2_size : UInt

    handle_descriptor_size

    let handle_descriptor_size : UInt

    handle_operation_list_stream

    let handle_operation_list_stream : UInt

    header_format_version

    fn header_format_version(version : UInt) -> UInt

    Extract the low 16 bits of Version (the format version).

    header_format_version_is_known

    fn header_format_version_is_known(version : UInt) -> Bool

    hex_uint

    fn hex_uint(value : UInt64) -> String

    ipt_trace_stream

    let ipt_trace_stream : UInt

    json_failure

    fn json_failure(kind : String, message : String) ->
    Json

    The error document used when the whole document cannot be produced (file unreadable, arguments unusable).

    Under --json, stdout is allowed exactly one JSON document: even errors must go into the document — no explanatory line may be printed to stdout on the side, or the upstream program would fail parsing on the very first byte. Section-level failures use the same {"kind", "message"} shape, so readers only need to recognize one form.

    json_list_cap_value

    fn json_list_cap_value() -> Int

    json_options_default

    fn json_options_default() -> JsonOptions

    json_report_text

    fn json_report_text(doc :
    Json
    ) -> String

    One-line JSON report (indent 2). Both the CLI and the tests use it, so stringify is not written out twice.

    known_format_version

    let known_format_version : UInt

    The low 16 bits of MINIDUMP_HEADER.Version are the format version, commonly 42899 (0xa793). In dumps generated by WER the high 16 bits were observed to be generator-dependent (e.g. 0xa0f4); neither breakpad nor rust-minidump rejects files over it, so this only offers a check and never blocks.

    last_reserved_stream

    let last_reserved_stream : UInt

    linux_signal_names

    let linux_signal_names : Array[(UInt, String)]

    Linux-family signal numbers. breakpad/crashpad write the signal number into ExceptionCode on non-Windows platforms; the 0xb in linux-mini.dmp is the corpus proof (SIGSEGV). The remaining numbers are common POSIX values not covered by this repo's corpus; defer to the Linux headers when cross-checking.

    memory_64_header_size

    let memory_64_header_size : UInt

    MINIDUMP_MEMORY64_LIST header: NumberOfMemoryRanges(8) + BaseRva(8) = 16; entries are MINIDUMP_MEMORY_DESCRIPTOR64 = StartOfMemoryRange(8) + DataSize(8).

    memory_64_list_stream

    let memory_64_list_stream : UInt

    memory_access_kind

    fn memory_access_kind(code : UInt, parameters : Array[UInt64]) -> String?

    ACCESS_VIOLATION / IN_PAGE_ERROR's ExceptionInformation[0]: 0=read, 1=write, 8=hit user-mode DEP (executed a non-executable page). Source: MS Learn's EXCEPTION_RECORD struct documentation on ExceptionInformation. Other codes have no such convention; returns None.

    memory_descriptor_size

    let memory_descriptor_size : UInt

    Width of MINIDUMP_MEMORY_DESCRIPTOR: StartOfMemoryRange(8) + MINIDUMP_LOCATION_DESCRIPTOR(DataSize4 + Rva4) = 16.

    memory_info_committed_bytes

    fn memory_info_committed_bytes(items : Array[MemoryInfo]) -> UInt64

    Layout statistic: committed memory bytes. Feeds the CLI's one-liner "X bytes committed". Uses saturating addition: in a malformed dump a pile of entries with RegionSize all 1 must not wrap the total back down to a small number — "3 bytes committed" is a more deceptive conclusion than a straight error.

    memory_info_executable_outside_modules

    fn memory_info_executable_outside_modules(items : Array[MemoryInfo], modules : Array[Module]) -> Array[MemoryInfo]

    Committed regions that are in no module yet carry the execute bit. A normal process's code regions are MEM_IMAGE and inside module ranges, so "executable but outside any image" is one of the most stable signals for packers, injected stubs, RWX heap code, and the like. When modules is empty (module table not parsed), no judgment is made and an empty array is returned — better to report nothing than to flag all of ntdll as suspect.

    memory_info_for_module

    fn memory_info_for_module(items : Array[MemoryInfo], target : Module) -> Array[MemoryInfo]

    Layout entries falling within a given module. Malware-sample analysis commonly uses this to check "do code regions all come from loaded modules".

    memory_info_list_header_size

    let memory_info_list_header_size : UInt

    MINIDUMP_MEMORY_INFO_LIST header: SizeOfHeader4 + SizeOfEntry4 + NumberOfEntries(8) = 16 (um\minidumpapiset.h:708; the header has no fields beyond the count).

    memory_info_list_stream

    let memory_info_list_stream : UInt

    memory_info_size

    let memory_info_size : UInt

    Record length of MINIDUMP_MEMORY_INFO.

    memory_list_header_size

    let memory_list_header_size : UInt

    The MINIDUMP_MEMORY_LIST header is a single ULONG32 NumberOfMemoryRanges.

    memory_list_stream

    let memory_list_stream : UInt

    memory_protection_bases

    let memory_protection_bases : Array[(UInt, String)]

    The low byte of Protect: the access rights proper (um\winnt.h:14578).

    memory_protection_bits

    fn memory_protection_bits(protect : UInt) -> Array[String]

    Split Protect into a name list of "access rights + attributes". The low byte and high bits are handled separately, so PAGE_EXECUTE_READWRITE|PAGE_GUARD(0x104) splits into two entries, while 0x100 alone yields only the attribute name.

    memory_protection_flags

    let memory_protection_flags : Array[(UInt, String)]

    The high-bit attributes of Protect. 0x40000000 and 0x80000000 each have two same-valued macros (PAGE_TARGETS_INVALID/PAGE_TARGETS_NO_UPDATE, PAGE_REVERT_TO_FILE_MAP/PAGE_ENCLAVE_THREAD_CONTROL); a single integer cannot distinguish them, so the names are listed side by side. PAGE_GRAPHICS_* and PAGE_ENCLAVE_* are not in the table and appear as Unknown(0x..) — seeing them in a user-mode crash dump is itself noteworthy.

    memory_protection_is_executable

    fn memory_protection_is_executable(protect : UInt) -> Bool

    Executable bit: the low byte's PAGE_EXECUTE / _EXECUTE_READ / _EXECUTE_READWRITE / _EXECUTE_WRITECOPY land on the four bits of 0xf0; high-bit attributes (GUARD, NOCACHE, ...) do not participate.

    memory_protection_is_writable

    fn memory_protection_is_writable(protect : UInt) -> Bool

    Writable: the four bits PAGE_READWRITE(0x04) / PAGE_WRITECOPY(0x08) / PAGE_EXECUTE_READWRITE(0x40) / PAGE_EXECUTE_WRITECOPY(0x80) of the low byte, mask 0xcc. Note the executable variants' two write rights sit in the upper half (0x40/0x80); checking only 0x0c would classify PAGE_EXECUTE_READWRITE as "not writable" — this one was forced out by a test.

    memory_protection_name

    fn memory_protection_name(protect : UInt) -> String

    One-line readable form of Protect; 0 renders as 0 (no protection bits set), not Unknown(0x0).

    memory_state_name

    fn memory_state_name(state : UInt) -> String

    memory_state_names

    let memory_state_names : Array[(UInt, String)]

    The three values of MEMORY_BASIC_INFORMATION.State (um\winnt.h:14606).

    memory_type_name

    fn memory_type_name(type_ : UInt) -> String

    memory_type_names

    let memory_type_names : Array[(UInt, String)]

    The three values of Type (um\winnt.h:14712).

    minidump_type_flags

    let minidump_type_flags : Array[(UInt64, String)]

    Bit table for MDMP_TYPE (MiniDumpWriteDump's uFlags), which decides which streams a dump may contain. Values come from the Microsoft documentation and are stable; unlisted bits are left to the caller as raw values.

    misc1_process_id

    let misc1_process_id : UInt

    Bits of Flags1. The header file's lines 577–585 say verbatim: "A member is valid if it's within the available size and its corresponding bit is set." — so this implementation surfaces a field only when both "version is sufficient" and "the bit is set" hold.

    misc1_process_times

    let misc1_process_times : UInt

    misc1_processor_power_info

    let misc1_processor_power_info : UInt

    misc3_process_execute_flags

    let misc3_process_execute_flags : UInt

    misc3_process_integrity

    let misc3_process_integrity : UInt

    misc3_protected_process

    let misc3_protected_process : UInt

    misc3_timezone

    let misc3_timezone : UInt

    misc4_buildstring

    let misc4_buildstring : UInt

    let misc5_process_cookie : UInt

    misc_info_flag_bits

    let misc_info_flag_bits : Array[(UInt, String)]

    misc_info_stream

    let misc_info_stream : UInt

    misc_info_v1_size

    let misc_info_v1_size : UInt

    The struct size (bytes) of each version in the MINIDUMP_MISC_INFO family.

    The numbers come from the field declarations in the local SDK header minidumpapiset.h (Windows Kits 10.0.26100.0), computed under C alignment rules — not copied folklore:
    • v1 = 6 u32s = 24
    • v2 = v1 + 5 u32s = 44
    • v3 = v2 + 4 u32s + TIME_ZONE_INFORMATION(172) = 232 (172 = Bias4 + StandardName64 + StandardDate16 + StandardBias4 + DaylightName64 + DaylightDate16 + DaylightBias4)
    • v4 = v3 + WCHARMAX_PATH + WCHAR40 = 832
    • v5 = v4 + XSTATE_CONFIG_FEATURE_MSC_INFO(528) + u32 = 1364 (528 = 4 + 4 + 8 + 64*8; the start at 832 is already 8-aligned, no padding) These five thresholds match the numbers rust-minidump uses for version detection, so they can be cross-checked.

    misc_info_v2_size

    let misc_info_v2_size : UInt

    misc_info_v3_size

    let misc_info_v3_size : UInt

    misc_info_v4_size

    let misc_info_v4_size : UInt

    misc_info_v5_size

    let misc_info_v5_size : UInt

    misc_info_version

    fn misc_info_version(data_size : UInt) -> UInt

    The stream's declared DataSize -> struct version: the largest version that fits completely. Sizes below v1 also return 1; the read site's StreamTooSmall does the rejecting, so callers need no second check.

    module_debug_id

    fn module_debug_id(m : Module) -> String

    The module's breakpad-form debug id: the CodeView RSDS GUID with dashes removed and uppercased, followed directly by the age in hex (no leading zeros, no separator), e.g. 66599F779E4E4E0CAF53C37D2F147FB71 (the trailing 1 is age=1).

    This is the spelling dump_syms writes on the MODULE line and symbol servers use to lay out directories. With no RSDS record (Missing/Unrecognized/Corrupt) an empty string is returned; an empty string counts as "no id" in normalize_debug_id/lookups and never matches by accident.

    module_list_stream

    let module_list_stream : UInt

    module_size

    let module_size : UInt

    Per-record length of MINIDUMP_MODULE. 108 = 8+4+4+4+4+52+8+8+8+8.

    normalize_debug_id

    fn normalize_debug_id(id : String) -> String

    Debug id normalization: strip hyphens, lowercase to uppercase. Breakpad directories use the form 36515FB5D04345E491F672FA2E2878C02 — "GUID without dashes + age" — while CodeView and hand-placed .sym files do not agree on how the dashes are laid out, so both sides are normalized before comparing. Only ASCII case is folded: when a PDB name contains non-ASCII, keeping it verbatim is safer than unicode folding.

    open_dump

    fn open_dump(data : Bytes) -> Dump raise ParseError

    Open a dump from in-memory bytes, validating only the header.

    parse_symbol_file

    fn parse_symbol_file(text : String) -> SymbolFile

    Parse a whole .sym file. CRLF, trailing whitespace, and runs of spaces are all tolerated.

    platform_id_name

    fn platform_id_name(platform_id : UInt) -> String

    PlatformId: the Windows side uses MS's VER_PLATFORM_*, the non-Windows side breakpad's MDOSPlatform (0x81xx/0x82xx); the two numbering schemes overlap on 0..3. rust-minidump's internal enum is shifted by +1 overall, but observable behavior in cross-checks does not depend on that offset.

    platform_uses_signals

    fn platform_uses_signals(platform_id : UInt) -> Bool

    Should this platform's ExceptionCode be read as a signal number? macOS (0x8101) and iOS (0x8102) write Mach exception style, not covered here.

    process_vm_counters_stream

    let process_vm_counters_stream : UInt

    product_type_name

    fn product_type_name(product_type : Byte) -> String

    ProductType (VER_NT_*).

    quad_version

    fn quad_version(hi : UInt, lo : UInt) -> String

    Combine the (hi, lo) pair of 32-bit words into a four-part "5.1.2600.2180" version.

    MS defines hi = (major<<16)|minor and lo = (build<<16)|patch. Division and modulo instead of shifts, to avoid width pitfalls when shifting UInt32.

    signal_name

    fn signal_name(code : UInt) -> String?

    Signal name; returns None for numbers not in the table.

    stack_walk_options_default

    fn stack_walk_options_default() -> StackWalkOptions

    Defaults are chosen so "it fits on one terminal screen and runs under wasm": 64 frames and a 4 KB window (1024 slots).

    stream_type_name

    fn stream_type_name(stream_type : UInt) -> String

    Human-readable stream type names, for the CLI and tests. Unknown types (including breakpad/crashpad's 0x1000-family and 0x4767-family extension streams) are displayed as raw hex.

    suite_mask_bits

    let suite_mask_bits : Array[(UInt16, String)]

    Bit table for VER_SUITE_* (GetVersionEx's wSuiteMask; values are stable over time).

    symbol_file_file

    fn symbol_file_file(sf : SymbolFile, index : Int64) -> String

    An out-of-range file index in a LINE yields the empty string, no error — the norm for bad symbol files.

    symbol_file_function_at

    fn symbol_file_function_at(sf : SymbolFile, address : UInt64) -> SymFunction?

    Which function an address falls in. Binary search when ascending, otherwise a linear scan — same result, just slower.

    symbol_file_public_at

    fn symbol_file_public_at(sf : SymbolFile, address : UInt64) -> SymPublic?

    The PUBLIC with the largest start address not exceeding the target; on a tie, take the one later in the file.

    symbol_file_resolve

    fn symbol_file_resolve(sf : SymbolFile, address : UInt64) -> ResolvedFrame?

    Full resolution of one address: function + line → PUBLIC only → nothing. Return addresses passed in during stack unwinding have usually already had 1 subtracted by the caller; no correction is done here.

    symbol_file_unwind_at

    fn symbol_file_unwind_at(sf : SymbolFile, address : UInt64) -> Array[SymStackRule]?

    Select CFI INIT plus every delta row at or before the lookup RVA. Rows are sorted by address and retain file order for equal addresses. WIN is used only when this symbol file supplies no applicable CFI program.

    symbol_store_add

    fn symbol_store_add(store : SymbolStore, source : String, text : String) -> Bool

    Hand in a text. Returns whether it was accepted (has a valid MODULE line). A bad file only goes into rejected and does not affect symbol files already accepted.

    symbol_store_add_image

    fn symbol_store_add_image(store : SymbolStore, data : Bytes) -> Bool

    symbol_store_find

    fn symbol_store_find(store : SymbolStore, debug_id : String, name : String) -> SymbolFile?

    Find a module's symbol file: first an exact hit on the normalized debug id, then a fallback by module name (case-insensitive). Both are needed because hand-placed symbol files often have only the name changed, not the id.

    symbol_store_find_with_source

    fn symbol_store_find_with_source(store : SymbolStore, debug_id : String, name : String) -> (String, SymbolFile)?

    The source-carrying version of symbol_store_find. Symbol files are often placed in the wrong directory, so the report must be able to state "this address was resolved by which file".

    symbol_store_match_count

    fn symbol_store_match_count(store : SymbolStore, debug_id : String, name : String) -> Int

    How many files matched. When more than one, the caller should say plainly "the symbol file here is ambiguous; the first one was used" rather than pretend the correct one was picked.

    symbol_store_new

    fn symbol_store_new() -> SymbolStore

    symbol_target_line

    fn symbol_target_line(t : SymbolTarget) -> String

    One-line human-readable form of a SymbolTarget, shared by the CLI and the tests so the format is written only once.

    symbolize_frame

    fn symbolize_frame(frame : StackFrame, modules : Array[Module], store : SymbolStore) -> SymbolTarget

    Find symbols for one frame. Addresses in .sym are offsets relative to the image base, so the address must fall inside a module before a query can be built; when frame.offset is None (empty module table and the like), the result is "no_module" directly.

    system_info_size

    let system_info_size : UInt

    Full record length of MINIDUMP_SYSTEM_INFO.

    system_info_stream

    let system_info_stream : UInt

    system_memory_info_stream

    let system_memory_info_stream : UInt

    thread_dump_flag_names

    let thread_dump_flag_names : Array[(UInt, String)]

    MINIDUMP_THREAD_INFO_* bits (um\minidumpapiset.h:737–:742).

    thread_dump_flags_name

    fn thread_dump_flags_name(flags : UInt) -> String

    With no bits set, return 0 rather than Unknown(0x0).

    thread_ex_list_stream

    let thread_ex_list_stream : UInt

    thread_ex_size

    let thread_ex_size : UInt

    MINIDUMP_THREAD_EX = MINIDUMP_THREAD(48) + BackingStore(16) = 64.

    thread_info_list_header_size

    let thread_info_list_header_size : UInt

    ThreadInfoListStream (17): each thread's state at the moment the dump was written. A 12-byte header SizeOfHeader/SizeOfEntry/NumberOfEntries — the entry count here is 32-bit, unlike MemoryInfoList's 64-bit (um\minidumpapiset.h:757); entries are 64 bytes (:744). start_address is the thread entry point; combined with the module table it directly exposes injection signatures like "a thread's start point is not inside any image".

    thread_info_list_stream

    let thread_info_list_stream : UInt

    thread_info_size

    let thread_info_size : UInt

    thread_infos_started_outside_modules

    fn thread_infos_started_outside_modules(infos : Array[ThreadInfo], modules : Array[Module]) -> Array[ThreadInfo]

    Threads whose entry address is not inside any module — the first thing to look at in injection detection. Not evaluated when the module table is empty (an empty array is returned), for the same reason as memory_info_executable_outside_modules.

    thread_list_stream

    let thread_list_stream : UInt

    thread_name_entry_size

    let thread_name_entry_size : UInt

    thread_name_for

    fn thread_name_for(names : Array[ThreadName], id : UInt) -> String?

    Look up a name by thread id. Returns None when absent — "no such record" and "the name is an empty string" are not the same thing.

    thread_names_header_size

    let thread_names_header_size : UInt

    ThreadNamesStream (24). MINIDUMP_THREAD_NAME { ULONG ThreadId; RVA64 RvaOfThreadName }, MINIDUMP_THREAD_NAME_LIST { ULONG NumberOfThreadNames; ... } (um\minidumpapiset.h:719, :724). In C this struct is 8-byte aligned and would be padded to 16 bytes, but the dump writes it compactly: a real 568-byte stream measured (568-4)/12=47 entries exactly, while /16 does not divide evenly, so the stride is 12.

    thread_names_stream

    let thread_names_stream : UInt

    thread_size

    let thread_size : UInt

    Record length of MINIDUMP_THREAD.

    Computed from the field declarations in the local SDK header minidumpapiset.h: ThreadId4 + SuspendCount4 + PriorityClass4 + Priority4 + Teb8
    • Stack(8 + 4 + 4 = 16) + ThreadContext(4 + 4 = 8) = 48.

    Corpus cross-check: test.dmp's ThreadListStream is DataSize=100 / count=2, full-dump.dmp 196 / 4, invalid-parameter.dmp 292 / 6, simple-crashpad.dmp and linux-mini.dmp both 52 / 1 — all exactly 4 + 48*count.

    thread_walk_limit

    let thread_walk_limit : Int

    Default per-thread walk cap, matching the CLI's default behavior.

    time_zone_offset_text

    fn time_zone_offset_text(bias : Int) -> String

    Format a Bias in minutes as a readable offset like "+08:00" (the caller adds the "UTC" prefix itself). Bias's sign is opposite to the UTC offset (Beijing writes -480, US Eastern writes 300), so flip the sign first.

    token_stream

    let token_stream : UInt

    unloaded_module_list_header_size

    let unloaded_module_list_header_size : UInt

    UnloadedModuleListStream (14). A 12-byte header SizeOfHeader/SizeOfEntry/NumberOfEntries; entries are 24 bytes: BaseOfImage u64 / SizeOfImage u32 / CheckSum u32 /TimeDateStamp u32 / ModuleNameRva u32 (um\minidumpapiset.h:538, :550). In the sample analysis this stream is how "modules that were loaded and then unloaded" are identified — after injected code exits, only this is left.

    unloaded_module_list_stream

    let unloaded_module_list_stream : UInt

    unloaded_module_size

    let unloaded_module_size : UInt

    unused_stream

    let unused_stream : UInt

    MINIDUMP_STREAM_TYPE. Numbers follow Microsoft minidumpapiset.h and crashpad's minidump_file_format.md, cross-checked against rust-minidump's known_types. Unlisted types pass through as-is; unknown streams are not an error.

    version_string

    fn version_string(info : SystemInfo) -> String

    System version in "10.0.19042" form.

    x86_family_model_stepping

    fn x86_family_model_stepping(info : SystemInfo) -> (Int, Int, Int)

    x86/amd64 family/model/stepping.

    family comes straight from processor_level, model/stepping from the high/low bytes of processor_revision; this rule matches the corpus (test.dmp is a family 6 model 13 stepping 8 Pentium M). When family is 0xf, real CPUID decoding would combine version_information into extended model/stepping; that decode is unverified, so no guessing here.