├── .github ├── FUNDING.yml └── workflows │ └── kdmp-parser-rs.yml ├── .gitignore ├── Cargo.toml ├── LICENSE ├── README.md ├── examples └── parser.rs ├── pics ├── kdmp-parser.gif └── parser.gif ├── rustfmt.toml ├── src ├── bits.rs ├── error.rs ├── gxa.rs ├── lib.rs ├── map.rs ├── parse.rs ├── pxe.rs └── structs.rs └── tests ├── modules_1.json ├── modules_2.json ├── modules_3.json ├── modules_4.json ├── modules_5.json └── regression.rs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: 0vercl0k 2 | -------------------------------------------------------------------------------- /.github/workflows/kdmp-parser-rs.yml: -------------------------------------------------------------------------------- 1 | name: Builds 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | testdatas: 7 | env: 8 | TESTDATA_URL: https://github.com/0vercl0k/kdmp-parser/releases/download/v0.1/testdatas.7z 9 | 10 | name: fetch testdatas 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Cache Artifacts 14 | id: cache-testdatas 15 | uses: actions/cache@v4 16 | with: 17 | key: kdmp-parser-testdatas-cache 18 | path: . 19 | - if: steps.cache-testdatas.outputs.cache-hit != 'true' 20 | run: | 21 | sudo apt-get -y update; sudo apt-get install -y p7zip-full; 22 | curl ${{ env.TESTDATA_URL }} -O -L 23 | 7z x testdatas.7z; rm testdatas.7z 24 | - name: Upload artifacts 25 | uses: actions/upload-artifact@v4 26 | with: 27 | if-no-files-found: error 28 | name: kdmp-parser-testdatas-cache 29 | path: . 30 | 31 | fmt: 32 | runs-on: ubuntu-latest 33 | name: fmt 34 | steps: 35 | - name: Checkout 36 | uses: actions/checkout@v4 37 | 38 | - name: Set up rust 39 | run: rustup default nightly 40 | 41 | - name: Install rustfmt 42 | run: rustup component add rustfmt 43 | 44 | - name: cargo fmt 45 | run: cargo +nightly fmt --check 46 | 47 | clippy: 48 | name: clippy 49 | runs-on: ubuntu-latest 50 | steps: 51 | - name: Checkout 52 | uses: actions/checkout@v4 53 | 54 | - name: Set up rust 55 | run: rustup default stable 56 | 57 | - name: cargo clippy 58 | env: 59 | RUSTFLAGS: "-Dwarnings" 60 | run: cargo clippy --workspace --tests --examples 61 | 62 | doc: 63 | name: doc 64 | runs-on: ubuntu-latest 65 | steps: 66 | - name: Checkout 67 | uses: actions/checkout@v4 68 | 69 | - name: Set up rust 70 | run: rustup default stable 71 | 72 | - name: cargo doc 73 | env: 74 | RUSTDOCFLAGS: "-Dwarnings" 75 | run: cargo doc 76 | 77 | build: 78 | strategy: 79 | fail-fast: false 80 | matrix: 81 | os: [ubuntu-latest, windows-latest, macos-latest] 82 | 83 | needs: testdatas 84 | runs-on: ${{ matrix.os }} 85 | name: build & test / ${{ matrix.os }} 86 | steps: 87 | - name: Checkout 88 | uses: actions/checkout@v4 89 | 90 | - name: Set up rust 91 | run: rustup default stable 92 | 93 | - name: Retrieve testdatas 94 | uses: actions/download-artifact@v4 95 | with: 96 | name: kdmp-parser-testdatas-cache 97 | path: . 98 | 99 | - name: cargo test 100 | env: 101 | TESTDATAS: "." 102 | run: cargo test --workspace 103 | 104 | - name: cargo test release 105 | env: 106 | TESTDATAS: "." 107 | run: cargo test --release --workspace 108 | 109 | - name: cargo check 110 | run: cargo check --workspace 111 | 112 | - name: cargo build 113 | run: cargo build --release --examples 114 | 115 | - name: Upload artifacts 116 | uses: actions/upload-artifact@v4 117 | with: 118 | name: parser-${{ matrix.os }} 119 | path: | 120 | target/release/examples/parser.exe 121 | target/release/examples/parser.pdb 122 | target/release/examples/parser 123 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 8 | Cargo.lock 9 | 10 | # These are backup files generated by rustfmt 11 | **/*.rs.bk 12 | 13 | # MSVC Windows builds of rustc generate these, which store debugging information 14 | *.pdb 15 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "kdmp-parser" 3 | version = "0.6.0" 4 | edition = "2021" 5 | authors = ["Axel '0vercl0k' Souchet"] 6 | categories = ["parser-implementations"] 7 | description = "A KISS Rust crate to parse Windows kernel crash-dumps created by Windows & its debugger." 8 | include = ["/Cargo.toml", "/LICENSE", "/src/**", "/examples/**", "README.md"] 9 | keywords = ["windows", "kernel", "crashdump"] 10 | license = "MIT" 11 | repository = "https://github.com/0vercl0k/kdmp-parser-rs" 12 | rust-version = "1.75" 13 | 14 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 15 | [dependencies] 16 | bitflags = "2.5.0" 17 | thiserror = "1.0" 18 | 19 | [dev-dependencies] 20 | anyhow = "1.0.80" 21 | clap = { version = "4.5.1", features = ["derive"] } 22 | serde = { version = "1.0", features = ["derive"] } 23 | serde_json = "1.0" 24 | 25 | [[example]] 26 | name = "parser" 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Axel Souchet 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
kdmp-parser
4 | A KISS Rust crate to parse Windows kernel crash-dumps created by Windows & its debugger. 5 |
6 | 11 |
12 |
13 |
{ 458 | pub flink: P, 459 | pub blink: P, 460 | } 461 | 462 | #[repr(C)] 463 | #[derive(Debug, Default)] 464 | pub struct UnicodeString
{ 465 | pub length: u16, 466 | pub maximum_length: u16, 467 | pub buffer: P, 468 | } 469 | 470 | #[derive(Debug, Default)] 471 | #[repr(C)] 472 | pub struct LdrDataTableEntry
{ 473 | pub in_load_order_links: ListEntry
, 474 | pub in_memory_order_links: ListEntry
, 475 | pub in_initialization_order_links: ListEntry
, 476 | pub dll_base: P, 477 | pub entry_point: P, 478 | pub size_of_image: u32, 479 | pub full_dll_name: UnicodeString
, 480 | pub base_dll_name: UnicodeString
,
481 | }
482 |
483 | // Copied from `WDBGEXTS.H`.
484 | #[repr(C)]
485 | #[derive(Debug, Default)]
486 | pub struct DbgKdDebugDataHeader64 {
487 | /// Link to other blocks
488 | pub list: ListEntry