├── .github └── workflows │ ├── build.yml │ └── release.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── build.rs ├── memflow.toml ├── resources └── mplus-1p-regular.ttf └── src ├── config ├── mod.rs └── settings.rs ├── lib.rs ├── memflow_wrapper.rs └── reclass.rs /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and test 2 | 3 | on: [push, pull_request] 4 | 5 | env: 6 | CARGO_TERM_COLOR: always 7 | 8 | jobs: 9 | 10 | build_ubuntu_x86-64: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | matrix: 14 | os: [macos-latest, ubuntu-latest, windows-latest] 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Build 18 | run: cargo build --workspace --all-features --verbose 19 | 20 | test: 21 | runs-on: ${{ matrix.os }} 22 | strategy: 23 | matrix: 24 | os: [macos-latest, ubuntu-latest, windows-latest] 25 | steps: 26 | - uses: actions/checkout@v2 27 | - name: Run all tests 28 | run: cargo test --workspace --verbose 29 | 30 | lint: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: actions/checkout@v2 34 | - run: rustup component add clippy 35 | - name: Check formatting 36 | run: cargo fmt -- --check 37 | - uses: actions-rs/clippy-check@v1 38 | with: 39 | token: ${{ secrets.GITHUB_TOKEN }} 40 | args: --all-targets 41 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release binaries 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | env: 8 | CARGO_TERM_COLOR: always 9 | 10 | jobs: 11 | 12 | build_ubuntu_x86-64: 13 | name: Build artifacts for ubuntu-latest (x86-64) 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Build artifacts 18 | run: cargo build --release --workspace --all-features --verbose 19 | - uses: actions/upload-artifact@v2 20 | with: 21 | name: library-ubuntu 22 | path: target/release/*.so 23 | 24 | build_windows_x86-64: 25 | name: Build artifacts for windows-latest (x86-64) 26 | runs-on: windows-latest 27 | steps: 28 | - uses: actions/checkout@v2 29 | - name: Build artifacts 30 | run: cargo build --release --workspace --all-features --verbose 31 | - uses: actions/upload-artifact@v2 32 | with: 33 | name: library-windows 34 | path: target/release/*.dll 35 | 36 | build_macos_x86-64: 37 | name: Build artifacts for macos-latest (x86-64) 38 | runs-on: macos-latest 39 | steps: 40 | - uses: actions/checkout@v2 41 | - name: Build artifacts 42 | run: cargo build --release --workspace --all-features --verbose 43 | - uses: actions/upload-artifact@v2 44 | with: 45 | name: library-macos 46 | path: target/release/*.dylib 47 | 48 | publish_artifacts: 49 | name: Publish artifacts 50 | runs-on: ubuntu-latest 51 | needs: [build_ubuntu_x86-64, build_windows_x86-64, build_macos_x86-64] 52 | steps: 53 | - uses: actions/download-artifact@v2 54 | with: 55 | name: library-ubuntu 56 | - name: Create archive for linux x86-64 57 | run: zip memflow_reclass_plugin_linux_x86-64.zip *.so 58 | - name: Upload ubuntu artifacts 59 | uses: skx/github-action-publish-binaries@master 60 | env: 61 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 62 | with: 63 | args: 'memflow_reclass_plugin_linux_x86-64.zip' 64 | - uses: actions/download-artifact@v2 65 | with: 66 | name: library-windows 67 | - name: Create archive for windows x86-64 68 | run: zip memflow_reclass_plugin_windows_x86-64.zip *.dll 69 | - name: Upload windows artifacts 70 | uses: skx/github-action-publish-binaries@master 71 | env: 72 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 73 | with: 74 | args: 'memflow_reclass_plugin_windows_x86-64.zip' 75 | - uses: actions/download-artifact@v2 76 | with: 77 | name: library-macos 78 | - name: Create archive for macos x86-64 79 | run: zip memflow_reclass_plugin_macos_x86-64.zip *.dylib 80 | - name: Upload macos artifacts 81 | uses: skx/github-action-publish-binaries@master 82 | env: 83 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 84 | with: 85 | args: 'memflow_reclass_plugin_macos_x86-64.zip' 86 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "abi_stable" 7 | version = "0.10.3" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "3c8f0d5c8e09e8b591f6db9f56b006c9b9e7a44064acb274411ae51aaaa1364d" 10 | dependencies = [ 11 | "abi_stable_derive", 12 | "abi_stable_shared", 13 | "core_extensions", 14 | "crossbeam-channel", 15 | "generational-arena", 16 | "libloading 0.7.4", 17 | "lock_api", 18 | "parking_lot", 19 | "paste", 20 | "repr_offset", 21 | "rustc_version 0.4.0", 22 | "serde", 23 | "serde_derive", 24 | "serde_json", 25 | ] 26 | 27 | [[package]] 28 | name = "abi_stable_derive" 29 | version = "0.10.3" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "3b9810ef8debee5544010d92dac0b88b32853cd5bd5ca3298243c99e931da0f0" 32 | dependencies = [ 33 | "abi_stable_shared", 34 | "as_derive_utils", 35 | "core_extensions", 36 | "proc-macro2", 37 | "quote", 38 | "rustc_version 0.2.3", 39 | "syn 1.0.109", 40 | "typed-arena", 41 | ] 42 | 43 | [[package]] 44 | name = "abi_stable_shared" 45 | version = "0.10.3" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "ece9da89066e018d908b48755e17cdd08a46ce222f84b1f226e837f836f84a5f" 48 | dependencies = [ 49 | "core_extensions", 50 | ] 51 | 52 | [[package]] 53 | name = "ahash" 54 | version = "0.8.11" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 57 | dependencies = [ 58 | "cfg-if", 59 | "once_cell", 60 | "version_check", 61 | "zerocopy", 62 | ] 63 | 64 | [[package]] 65 | name = "allocator-api2" 66 | version = "0.2.18" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" 69 | 70 | [[package]] 71 | name = "as_derive_utils" 72 | version = "0.10.3" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "e0a26fa495cefb8c86d9ce183b3f39ad11678e54fb3c20e6b7dbd87770811d9b" 75 | dependencies = [ 76 | "core_extensions", 77 | "proc-macro2", 78 | "quote", 79 | "syn 1.0.109", 80 | ] 81 | 82 | [[package]] 83 | name = "autocfg" 84 | version = "1.3.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 87 | 88 | [[package]] 89 | name = "bit_field" 90 | version = "0.10.2" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" 93 | 94 | [[package]] 95 | name = "bitflags" 96 | version = "1.3.2" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 99 | 100 | [[package]] 101 | name = "bitflags" 102 | version = "2.5.0" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 105 | 106 | [[package]] 107 | name = "bumpalo" 108 | version = "3.16.0" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 111 | 112 | [[package]] 113 | name = "cfg-if" 114 | version = "1.0.0" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 117 | 118 | [[package]] 119 | name = "cglue" 120 | version = "0.2.14" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "9cbee103c8a337b7cf4d299133132237dff667d5f90cb1e97626a5caa1bb9ab9" 123 | dependencies = [ 124 | "abi_stable", 125 | "cglue-macro", 126 | "no-std-compat", 127 | "rustc_version 0.4.0", 128 | "serde", 129 | "tarc", 130 | ] 131 | 132 | [[package]] 133 | name = "cglue-gen" 134 | version = "0.2.9" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "09113ac46fb70539ed96b74af4382516fc25bfc463164eeb0ca036b9f77371d8" 137 | dependencies = [ 138 | "itertools 0.10.5", 139 | "lazy_static", 140 | "proc-macro-crate", 141 | "proc-macro2", 142 | "quote", 143 | "syn 1.0.109", 144 | ] 145 | 146 | [[package]] 147 | name = "cglue-macro" 148 | version = "0.2.3" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "cf28b8c74a050973c9972edfad2f32f404bc1ff6725e37d003e7d55504dec1cf" 151 | dependencies = [ 152 | "cglue-gen", 153 | "proc-macro2", 154 | "quote", 155 | "syn 1.0.109", 156 | ] 157 | 158 | [[package]] 159 | name = "coarsetime" 160 | version = "0.1.34" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "13b3839cf01bb7960114be3ccf2340f541b6d0c81f8690b007b2b39f750f7e5d" 163 | dependencies = [ 164 | "libc", 165 | "wasix", 166 | "wasm-bindgen", 167 | ] 168 | 169 | [[package]] 170 | name = "core_extensions" 171 | version = "1.5.3" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | checksum = "92c71dc07c9721607e7a16108336048ee978c3a8b129294534272e8bac96c0ee" 174 | dependencies = [ 175 | "core_extensions_proc_macros", 176 | ] 177 | 178 | [[package]] 179 | name = "core_extensions_proc_macros" 180 | version = "1.5.3" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "69f3b219d28b6e3b4ac87bc1fc522e0803ab22e055da177bff0068c4150c61a6" 183 | 184 | [[package]] 185 | name = "crossbeam-channel" 186 | version = "0.5.13" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" 189 | dependencies = [ 190 | "crossbeam-utils", 191 | ] 192 | 193 | [[package]] 194 | name = "crossbeam-utils" 195 | version = "0.8.20" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" 198 | 199 | [[package]] 200 | name = "darling" 201 | version = "0.20.9" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" 204 | dependencies = [ 205 | "darling_core", 206 | "darling_macro", 207 | ] 208 | 209 | [[package]] 210 | name = "darling_core" 211 | version = "0.20.9" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" 214 | dependencies = [ 215 | "fnv", 216 | "ident_case", 217 | "proc-macro2", 218 | "quote", 219 | "strsim", 220 | "syn 2.0.66", 221 | ] 222 | 223 | [[package]] 224 | name = "darling_macro" 225 | version = "0.20.9" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" 228 | dependencies = [ 229 | "darling_core", 230 | "quote", 231 | "syn 2.0.66", 232 | ] 233 | 234 | [[package]] 235 | name = "dataview" 236 | version = "0.1.2" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "47a802a2cad0ff4dfc4f3110da174b7a6928c315cae523e88638cfb72941b4d5" 239 | 240 | [[package]] 241 | name = "dataview" 242 | version = "1.0.1" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "50eb3a329e19d78c3a3dfa4ec5a51ecb84fa3a20c06edad04be25356018218f9" 245 | 246 | [[package]] 247 | name = "dirs" 248 | version = "5.0.1" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" 251 | dependencies = [ 252 | "dirs-sys", 253 | ] 254 | 255 | [[package]] 256 | name = "dirs-sys" 257 | version = "0.4.1" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" 260 | dependencies = [ 261 | "libc", 262 | "option-ext", 263 | "redox_users", 264 | "windows-sys", 265 | ] 266 | 267 | [[package]] 268 | name = "either" 269 | version = "1.12.0" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" 272 | 273 | [[package]] 274 | name = "equivalent" 275 | version = "1.0.1" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 278 | 279 | [[package]] 280 | name = "fixed-slice-vec" 281 | version = "0.10.0" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "1bb23c599a9ff5b981529099902fe5de8d55ecc8c1f451542da17b8d2d65326e" 284 | 285 | [[package]] 286 | name = "fnv" 287 | version = "1.0.7" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 290 | 291 | [[package]] 292 | name = "generational-arena" 293 | version = "0.2.9" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "877e94aff08e743b651baaea359664321055749b398adff8740a7399af7796e7" 296 | dependencies = [ 297 | "cfg-if", 298 | ] 299 | 300 | [[package]] 301 | name = "getrandom" 302 | version = "0.2.15" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 305 | dependencies = [ 306 | "cfg-if", 307 | "libc", 308 | "wasi", 309 | ] 310 | 311 | [[package]] 312 | name = "goblin" 313 | version = "0.8.2" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" 316 | dependencies = [ 317 | "log", 318 | "plain", 319 | "scroll", 320 | ] 321 | 322 | [[package]] 323 | name = "hashbrown" 324 | version = "0.14.5" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 327 | dependencies = [ 328 | "ahash", 329 | "allocator-api2", 330 | ] 331 | 332 | [[package]] 333 | name = "ident_case" 334 | version = "1.0.1" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 337 | 338 | [[package]] 339 | name = "indexmap" 340 | version = "2.2.6" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" 343 | dependencies = [ 344 | "equivalent", 345 | "hashbrown", 346 | ] 347 | 348 | [[package]] 349 | name = "instant" 350 | version = "0.1.13" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" 353 | dependencies = [ 354 | "cfg-if", 355 | ] 356 | 357 | [[package]] 358 | name = "itertools" 359 | version = "0.10.5" 360 | source = "registry+https://github.com/rust-lang/crates.io-index" 361 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 362 | dependencies = [ 363 | "either", 364 | ] 365 | 366 | [[package]] 367 | name = "itertools" 368 | version = "0.12.1" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" 371 | dependencies = [ 372 | "either", 373 | ] 374 | 375 | [[package]] 376 | name = "itoa" 377 | version = "1.0.11" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 380 | 381 | [[package]] 382 | name = "lazy_static" 383 | version = "1.4.0" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 386 | 387 | [[package]] 388 | name = "libc" 389 | version = "0.2.155" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 392 | 393 | [[package]] 394 | name = "libloading" 395 | version = "0.7.4" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" 398 | dependencies = [ 399 | "cfg-if", 400 | "winapi", 401 | ] 402 | 403 | [[package]] 404 | name = "libloading" 405 | version = "0.8.3" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" 408 | dependencies = [ 409 | "cfg-if", 410 | "windows-targets 0.52.5", 411 | ] 412 | 413 | [[package]] 414 | name = "libredox" 415 | version = "0.1.3" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" 418 | dependencies = [ 419 | "bitflags 2.5.0", 420 | "libc", 421 | ] 422 | 423 | [[package]] 424 | name = "lock_api" 425 | version = "0.4.12" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 428 | dependencies = [ 429 | "autocfg", 430 | "scopeguard", 431 | ] 432 | 433 | [[package]] 434 | name = "log" 435 | version = "0.4.21" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 438 | 439 | [[package]] 440 | name = "memchr" 441 | version = "2.7.2" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 444 | 445 | [[package]] 446 | name = "memflow" 447 | version = "0.2.1" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "441730cf8e48d671cead445034c076acc2634fa95ba032feb5be78945c581551" 450 | dependencies = [ 451 | "abi_stable", 452 | "bitflags 1.3.2", 453 | "bumpalo", 454 | "cglue", 455 | "coarsetime", 456 | "dataview 1.0.1", 457 | "dirs", 458 | "fixed-slice-vec", 459 | "goblin", 460 | "hashbrown", 461 | "itertools 0.12.1", 462 | "libloading 0.8.3", 463 | "log", 464 | "memflow-derive", 465 | "memmap", 466 | "no-std-compat", 467 | "once_cell", 468 | "pelite", 469 | "rangemap", 470 | "serde", 471 | "smallvec", 472 | "toml 0.8.2", 473 | "x86_64", 474 | ] 475 | 476 | [[package]] 477 | name = "memflow-derive" 478 | version = "0.2.0" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "d766f6681f968c92eb0359fc4bc99039ebe2568df4bb884c7cb7b16023e94d32" 481 | dependencies = [ 482 | "darling", 483 | "proc-macro-crate", 484 | "proc-macro2", 485 | "quote", 486 | "syn 2.0.66", 487 | ] 488 | 489 | [[package]] 490 | name = "memflow-reclass-plugin" 491 | version = "0.2.1" 492 | dependencies = [ 493 | "log", 494 | "memflow", 495 | "serde", 496 | "simple-logging", 497 | "toml 0.8.2", 498 | "winres", 499 | ] 500 | 501 | [[package]] 502 | name = "memmap" 503 | version = "0.7.0" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" 506 | dependencies = [ 507 | "libc", 508 | "winapi", 509 | ] 510 | 511 | [[package]] 512 | name = "no-std-compat" 513 | version = "0.4.1" 514 | source = "registry+https://github.com/rust-lang/crates.io-index" 515 | checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" 516 | 517 | [[package]] 518 | name = "once_cell" 519 | version = "1.19.0" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 522 | 523 | [[package]] 524 | name = "option-ext" 525 | version = "0.2.0" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 528 | 529 | [[package]] 530 | name = "parking_lot" 531 | version = "0.11.2" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 534 | dependencies = [ 535 | "instant", 536 | "lock_api", 537 | "parking_lot_core", 538 | ] 539 | 540 | [[package]] 541 | name = "parking_lot_core" 542 | version = "0.8.6" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" 545 | dependencies = [ 546 | "cfg-if", 547 | "instant", 548 | "libc", 549 | "redox_syscall 0.2.16", 550 | "smallvec", 551 | "winapi", 552 | ] 553 | 554 | [[package]] 555 | name = "paste" 556 | version = "1.0.15" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 559 | 560 | [[package]] 561 | name = "pelite" 562 | version = "0.9.0" 563 | source = "registry+https://github.com/rust-lang/crates.io-index" 564 | checksum = "8c270b1a0c279bbcb4cff3d2294121731c48ee68f0435d26cf71018a853cb890" 565 | dependencies = [ 566 | "dataview 0.1.2", 567 | "no-std-compat", 568 | "pelite-macros", 569 | ] 570 | 571 | [[package]] 572 | name = "pelite-macros" 573 | version = "0.1.1" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "7a7cf3f8ecebb0f4895f4892a8be0a0dc81b498f9d56735cb769dc31bf00815b" 576 | 577 | [[package]] 578 | name = "plain" 579 | version = "0.2.3" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" 582 | 583 | [[package]] 584 | name = "proc-macro-crate" 585 | version = "2.0.2" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" 588 | dependencies = [ 589 | "toml_datetime", 590 | "toml_edit", 591 | ] 592 | 593 | [[package]] 594 | name = "proc-macro2" 595 | version = "1.0.85" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" 598 | dependencies = [ 599 | "unicode-ident", 600 | ] 601 | 602 | [[package]] 603 | name = "quote" 604 | version = "1.0.36" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 607 | dependencies = [ 608 | "proc-macro2", 609 | ] 610 | 611 | [[package]] 612 | name = "rangemap" 613 | version = "1.5.1" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" 616 | 617 | [[package]] 618 | name = "redox_syscall" 619 | version = "0.1.57" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 622 | 623 | [[package]] 624 | name = "redox_syscall" 625 | version = "0.2.16" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 628 | dependencies = [ 629 | "bitflags 1.3.2", 630 | ] 631 | 632 | [[package]] 633 | name = "redox_users" 634 | version = "0.4.5" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" 637 | dependencies = [ 638 | "getrandom", 639 | "libredox", 640 | "thiserror", 641 | ] 642 | 643 | [[package]] 644 | name = "repr_offset" 645 | version = "0.2.2" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "fb1070755bd29dffc19d0971cab794e607839ba2ef4b69a9e6fbc8733c1b72ea" 648 | dependencies = [ 649 | "tstr", 650 | ] 651 | 652 | [[package]] 653 | name = "rustc_version" 654 | version = "0.2.3" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 657 | dependencies = [ 658 | "semver 0.9.0", 659 | ] 660 | 661 | [[package]] 662 | name = "rustc_version" 663 | version = "0.4.0" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 666 | dependencies = [ 667 | "semver 1.0.23", 668 | ] 669 | 670 | [[package]] 671 | name = "rustversion" 672 | version = "1.0.17" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" 675 | 676 | [[package]] 677 | name = "ryu" 678 | version = "1.0.18" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 681 | 682 | [[package]] 683 | name = "scopeguard" 684 | version = "1.2.0" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 687 | 688 | [[package]] 689 | name = "scroll" 690 | version = "0.12.0" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" 693 | dependencies = [ 694 | "scroll_derive", 695 | ] 696 | 697 | [[package]] 698 | name = "scroll_derive" 699 | version = "0.12.0" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" 702 | dependencies = [ 703 | "proc-macro2", 704 | "quote", 705 | "syn 2.0.66", 706 | ] 707 | 708 | [[package]] 709 | name = "semver" 710 | version = "0.9.0" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 713 | dependencies = [ 714 | "semver-parser", 715 | ] 716 | 717 | [[package]] 718 | name = "semver" 719 | version = "1.0.23" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" 722 | 723 | [[package]] 724 | name = "semver-parser" 725 | version = "0.7.0" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 728 | 729 | [[package]] 730 | name = "serde" 731 | version = "1.0.203" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" 734 | dependencies = [ 735 | "serde_derive", 736 | ] 737 | 738 | [[package]] 739 | name = "serde_derive" 740 | version = "1.0.203" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" 743 | dependencies = [ 744 | "proc-macro2", 745 | "quote", 746 | "syn 2.0.66", 747 | ] 748 | 749 | [[package]] 750 | name = "serde_json" 751 | version = "1.0.117" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" 754 | dependencies = [ 755 | "itoa", 756 | "ryu", 757 | "serde", 758 | ] 759 | 760 | [[package]] 761 | name = "serde_spanned" 762 | version = "0.6.6" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" 765 | dependencies = [ 766 | "serde", 767 | ] 768 | 769 | [[package]] 770 | name = "simple-logging" 771 | version = "2.0.2" 772 | source = "registry+https://github.com/rust-lang/crates.io-index" 773 | checksum = "b00d48e85675326bb182a2286ea7c1a0b264333ae10f27a937a72be08628b542" 774 | dependencies = [ 775 | "lazy_static", 776 | "log", 777 | "thread-id", 778 | ] 779 | 780 | [[package]] 781 | name = "smallvec" 782 | version = "1.13.2" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 785 | 786 | [[package]] 787 | name = "strsim" 788 | version = "0.11.1" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 791 | 792 | [[package]] 793 | name = "syn" 794 | version = "1.0.109" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 797 | dependencies = [ 798 | "proc-macro2", 799 | "quote", 800 | "unicode-ident", 801 | ] 802 | 803 | [[package]] 804 | name = "syn" 805 | version = "2.0.66" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" 808 | dependencies = [ 809 | "proc-macro2", 810 | "quote", 811 | "unicode-ident", 812 | ] 813 | 814 | [[package]] 815 | name = "tarc" 816 | version = "0.1.4" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "88da97cd34718f47df2adae0c2310ee305e061c794b9c07fd33d8387f4ee2e1c" 819 | 820 | [[package]] 821 | name = "thiserror" 822 | version = "1.0.61" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" 825 | dependencies = [ 826 | "thiserror-impl", 827 | ] 828 | 829 | [[package]] 830 | name = "thiserror-impl" 831 | version = "1.0.61" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" 834 | dependencies = [ 835 | "proc-macro2", 836 | "quote", 837 | "syn 2.0.66", 838 | ] 839 | 840 | [[package]] 841 | name = "thread-id" 842 | version = "3.3.0" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" 845 | dependencies = [ 846 | "libc", 847 | "redox_syscall 0.1.57", 848 | "winapi", 849 | ] 850 | 851 | [[package]] 852 | name = "toml" 853 | version = "0.5.11" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" 856 | dependencies = [ 857 | "serde", 858 | ] 859 | 860 | [[package]] 861 | name = "toml" 862 | version = "0.8.2" 863 | source = "registry+https://github.com/rust-lang/crates.io-index" 864 | checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" 865 | dependencies = [ 866 | "serde", 867 | "serde_spanned", 868 | "toml_datetime", 869 | "toml_edit", 870 | ] 871 | 872 | [[package]] 873 | name = "toml_datetime" 874 | version = "0.6.3" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" 877 | dependencies = [ 878 | "serde", 879 | ] 880 | 881 | [[package]] 882 | name = "toml_edit" 883 | version = "0.20.2" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" 886 | dependencies = [ 887 | "indexmap", 888 | "serde", 889 | "serde_spanned", 890 | "toml_datetime", 891 | "winnow", 892 | ] 893 | 894 | [[package]] 895 | name = "tstr" 896 | version = "0.2.4" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "7f8e0294f14baae476d0dd0a2d780b2e24d66e349a9de876f5126777a37bdba7" 899 | dependencies = [ 900 | "tstr_proc_macros", 901 | ] 902 | 903 | [[package]] 904 | name = "tstr_proc_macros" 905 | version = "0.2.2" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "e78122066b0cb818b8afd08f7ed22f7fdbc3e90815035726f0840d0d26c0747a" 908 | 909 | [[package]] 910 | name = "typed-arena" 911 | version = "2.0.2" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" 914 | 915 | [[package]] 916 | name = "unicode-ident" 917 | version = "1.0.12" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 920 | 921 | [[package]] 922 | name = "version_check" 923 | version = "0.9.4" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 926 | 927 | [[package]] 928 | name = "volatile" 929 | version = "0.4.6" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "442887c63f2c839b346c192d047a7c87e73d0689c9157b00b53dcc27dd5ea793" 932 | 933 | [[package]] 934 | name = "wasi" 935 | version = "0.11.0+wasi-snapshot-preview1" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 938 | 939 | [[package]] 940 | name = "wasix" 941 | version = "0.12.21" 942 | source = "registry+https://github.com/rust-lang/crates.io-index" 943 | checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d" 944 | dependencies = [ 945 | "wasi", 946 | ] 947 | 948 | [[package]] 949 | name = "wasm-bindgen" 950 | version = "0.2.92" 951 | source = "registry+https://github.com/rust-lang/crates.io-index" 952 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 953 | dependencies = [ 954 | "cfg-if", 955 | "wasm-bindgen-macro", 956 | ] 957 | 958 | [[package]] 959 | name = "wasm-bindgen-backend" 960 | version = "0.2.92" 961 | source = "registry+https://github.com/rust-lang/crates.io-index" 962 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 963 | dependencies = [ 964 | "bumpalo", 965 | "log", 966 | "once_cell", 967 | "proc-macro2", 968 | "quote", 969 | "syn 2.0.66", 970 | "wasm-bindgen-shared", 971 | ] 972 | 973 | [[package]] 974 | name = "wasm-bindgen-macro" 975 | version = "0.2.92" 976 | source = "registry+https://github.com/rust-lang/crates.io-index" 977 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 978 | dependencies = [ 979 | "quote", 980 | "wasm-bindgen-macro-support", 981 | ] 982 | 983 | [[package]] 984 | name = "wasm-bindgen-macro-support" 985 | version = "0.2.92" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 988 | dependencies = [ 989 | "proc-macro2", 990 | "quote", 991 | "syn 2.0.66", 992 | "wasm-bindgen-backend", 993 | "wasm-bindgen-shared", 994 | ] 995 | 996 | [[package]] 997 | name = "wasm-bindgen-shared" 998 | version = "0.2.92" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1001 | 1002 | [[package]] 1003 | name = "winapi" 1004 | version = "0.3.9" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1007 | dependencies = [ 1008 | "winapi-i686-pc-windows-gnu", 1009 | "winapi-x86_64-pc-windows-gnu", 1010 | ] 1011 | 1012 | [[package]] 1013 | name = "winapi-i686-pc-windows-gnu" 1014 | version = "0.4.0" 1015 | source = "registry+https://github.com/rust-lang/crates.io-index" 1016 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1017 | 1018 | [[package]] 1019 | name = "winapi-x86_64-pc-windows-gnu" 1020 | version = "0.4.0" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1023 | 1024 | [[package]] 1025 | name = "windows-sys" 1026 | version = "0.48.0" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1029 | dependencies = [ 1030 | "windows-targets 0.48.5", 1031 | ] 1032 | 1033 | [[package]] 1034 | name = "windows-targets" 1035 | version = "0.48.5" 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" 1037 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1038 | dependencies = [ 1039 | "windows_aarch64_gnullvm 0.48.5", 1040 | "windows_aarch64_msvc 0.48.5", 1041 | "windows_i686_gnu 0.48.5", 1042 | "windows_i686_msvc 0.48.5", 1043 | "windows_x86_64_gnu 0.48.5", 1044 | "windows_x86_64_gnullvm 0.48.5", 1045 | "windows_x86_64_msvc 0.48.5", 1046 | ] 1047 | 1048 | [[package]] 1049 | name = "windows-targets" 1050 | version = "0.52.5" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 1053 | dependencies = [ 1054 | "windows_aarch64_gnullvm 0.52.5", 1055 | "windows_aarch64_msvc 0.52.5", 1056 | "windows_i686_gnu 0.52.5", 1057 | "windows_i686_gnullvm", 1058 | "windows_i686_msvc 0.52.5", 1059 | "windows_x86_64_gnu 0.52.5", 1060 | "windows_x86_64_gnullvm 0.52.5", 1061 | "windows_x86_64_msvc 0.52.5", 1062 | ] 1063 | 1064 | [[package]] 1065 | name = "windows_aarch64_gnullvm" 1066 | version = "0.48.5" 1067 | source = "registry+https://github.com/rust-lang/crates.io-index" 1068 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1069 | 1070 | [[package]] 1071 | name = "windows_aarch64_gnullvm" 1072 | version = "0.52.5" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" 1075 | 1076 | [[package]] 1077 | name = "windows_aarch64_msvc" 1078 | version = "0.48.5" 1079 | source = "registry+https://github.com/rust-lang/crates.io-index" 1080 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1081 | 1082 | [[package]] 1083 | name = "windows_aarch64_msvc" 1084 | version = "0.52.5" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" 1087 | 1088 | [[package]] 1089 | name = "windows_i686_gnu" 1090 | version = "0.48.5" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1093 | 1094 | [[package]] 1095 | name = "windows_i686_gnu" 1096 | version = "0.52.5" 1097 | source = "registry+https://github.com/rust-lang/crates.io-index" 1098 | checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" 1099 | 1100 | [[package]] 1101 | name = "windows_i686_gnullvm" 1102 | version = "0.52.5" 1103 | source = "registry+https://github.com/rust-lang/crates.io-index" 1104 | checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" 1105 | 1106 | [[package]] 1107 | name = "windows_i686_msvc" 1108 | version = "0.48.5" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1111 | 1112 | [[package]] 1113 | name = "windows_i686_msvc" 1114 | version = "0.52.5" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" 1117 | 1118 | [[package]] 1119 | name = "windows_x86_64_gnu" 1120 | version = "0.48.5" 1121 | source = "registry+https://github.com/rust-lang/crates.io-index" 1122 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1123 | 1124 | [[package]] 1125 | name = "windows_x86_64_gnu" 1126 | version = "0.52.5" 1127 | source = "registry+https://github.com/rust-lang/crates.io-index" 1128 | checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" 1129 | 1130 | [[package]] 1131 | name = "windows_x86_64_gnullvm" 1132 | version = "0.48.5" 1133 | source = "registry+https://github.com/rust-lang/crates.io-index" 1134 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1135 | 1136 | [[package]] 1137 | name = "windows_x86_64_gnullvm" 1138 | version = "0.52.5" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" 1141 | 1142 | [[package]] 1143 | name = "windows_x86_64_msvc" 1144 | version = "0.48.5" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1147 | 1148 | [[package]] 1149 | name = "windows_x86_64_msvc" 1150 | version = "0.52.5" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" 1153 | 1154 | [[package]] 1155 | name = "winnow" 1156 | version = "0.5.40" 1157 | source = "registry+https://github.com/rust-lang/crates.io-index" 1158 | checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" 1159 | dependencies = [ 1160 | "memchr", 1161 | ] 1162 | 1163 | [[package]] 1164 | name = "winres" 1165 | version = "0.1.12" 1166 | source = "registry+https://github.com/rust-lang/crates.io-index" 1167 | checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" 1168 | dependencies = [ 1169 | "toml 0.5.11", 1170 | ] 1171 | 1172 | [[package]] 1173 | name = "x86_64" 1174 | version = "0.14.12" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "96cb6fd45bfeab6a5055c5bffdb08768bd0c069f1d946debe585bbb380a7c062" 1177 | dependencies = [ 1178 | "bit_field", 1179 | "bitflags 2.5.0", 1180 | "rustversion", 1181 | "volatile", 1182 | ] 1183 | 1184 | [[package]] 1185 | name = "zerocopy" 1186 | version = "0.7.34" 1187 | source = "registry+https://github.com/rust-lang/crates.io-index" 1188 | checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" 1189 | dependencies = [ 1190 | "zerocopy-derive", 1191 | ] 1192 | 1193 | [[package]] 1194 | name = "zerocopy-derive" 1195 | version = "0.7.34" 1196 | source = "registry+https://github.com/rust-lang/crates.io-index" 1197 | checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" 1198 | dependencies = [ 1199 | "proc-macro2", 1200 | "quote", 1201 | "syn 2.0.66", 1202 | ] 1203 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "memflow-reclass-plugin" 3 | version = "0.2.1" 4 | authors = ["ko1N "] 5 | edition = "2018" 6 | description = "ReClass.NET plugin for the memflow physical memory introspection framework" 7 | documentation = "https://docs.rs/memflow-reclass-plugin" 8 | readme = "README.md" 9 | homepage = "https://memflow.github.io" 10 | repository = "https://github.com/memflow/memflow-reclass-plugin" 11 | license = "MIT" 12 | keywords = [ "memflow", "introspection", "memory", "dma", "reclass" ] 13 | categories = [ "memory-management", "os" ] 14 | build = "build.rs" 15 | 16 | [lib] 17 | name = "memflow_reclass" 18 | crate-type = ["cdylib"] 19 | 20 | [package.metadata.winres] 21 | FileDescription = "memflow" 22 | ProductName = "ReClass.NET Native Plugin" 23 | ProductVersion = "0.2.1" 24 | OriginalFilename = "memflow_reclass.dll" 25 | LegalCopyright = "Copyright © 2020-2021" 26 | Comments = "The memflow ReClass.NET connects to a Process running on a memflow target. See https://github.com/memflow/memflow for more about memflow." 27 | CompanyName = "ko1N, h33p" 28 | 29 | [dependencies] 30 | log = "0.4.8" 31 | simple-logging = "2.0.2" 32 | memflow = { version = "0.2", features = ["plugins"] } 33 | serde = { version = "1.0", features = ["derive"] } 34 | toml = "0.8" 35 | 36 | [target.'cfg(windows)'.build-dependencies] 37 | winres = "0.1" 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 ko1N 4 | Copyright (c) 2020 Aurimas Blažulionis <0x60@pm.me> 5 | Copyright (c) 2016 KN4CK3R 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # memflow-reclass-plugin 2 | 3 | This plugin integrates the [memflow](https://github.com/memflow/memflow) physical memory introspection framework with [ReClass.NET](https://github.com/ReClassNET/ReClass.NET). 4 | 5 | The plugin uses the memflow crates internally and also holds caches locally. Any connector that can be used with memflow can also be used with this plugin. 6 | 7 | ## Compilation 8 | 9 | Just run the following command to compile the plugin. 10 | 11 | ``` 12 | cargo build --release 13 | ``` 14 | 15 | The resulting plugin can be found under `./target/release/libmemflow_reclass.so` (or dll on windows). 16 | 17 | ## Usage 18 | 19 | After the plugin has been copied to the `./Plugins` folder in ReClass it can be selected as a plugin inside of ReClass. 20 | 21 | Make sure you start [ReClass.NET](https://github.com/ReClassNET/ReClass.NET) with the appropiate access rights (e.g. SYS_PTRACE) for the connector you intend to use. 22 | 23 | More information on access rights can be found in the [memflow repository](https://github.com/memflow/memflow) or in the specific connector repository. 24 | 25 | ## Configuration 26 | 27 | The `memflow.toml` file is used to configure the plugin and configure the memflow connector that should be used. The file has the following format: 28 | ```toml 29 | connector = "kvm" # the name of the connector to use 30 | args = "" # the argument string passed to the connector, optional 31 | log_level = "info" # changes the memflow logging level, optional 32 | parse_sections = true # will load section information of the process 33 | ``` 34 | 35 | Depending on the Connector you use it might be useful to disable section parsing as this slow down the ReClass UI. 36 | 37 | **The plugin as well as the `memflow.toml` file have to be put in the ReClass `/Plugins` folders.** 38 | 39 | ## Remarks 40 | 41 | This plugin is still work in progress and some features might not yet work as expected. 42 | 43 | ## License 44 | 45 | Licensed under MIT License, see [LICENSE](LICENSE). 46 | 47 | ### Contribution 48 | 49 | Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions. 50 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | #[cfg(windows)] 2 | extern crate winres; 3 | 4 | #[cfg(windows)] 5 | fn main() { 6 | // compile with default values from Cargo.toml 7 | winres::WindowsResource::new().compile().unwrap(); 8 | } 9 | 10 | #[cfg(not(windows))] 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /memflow.toml: -------------------------------------------------------------------------------- 1 | connector = "kvm" 2 | args = "" 3 | log_level = "info" 4 | parse_sections = true 5 | -------------------------------------------------------------------------------- /resources/mplus-1p-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/memflow/memflow-reclass-plugin/263540e5489fb5c5cf363d14e2468b7389030fd7/resources/mplus-1p-regular.ttf -------------------------------------------------------------------------------- /src/config/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod settings; 2 | -------------------------------------------------------------------------------- /src/config/settings.rs: -------------------------------------------------------------------------------- 1 | use memflow::prelude::v1::*; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | // see https://github.com/serde-rs/serde/issues/368 5 | fn default_string_info() -> String { 6 | "info".to_string() 7 | } 8 | fn default_bool_true() -> bool { 9 | true 10 | } 11 | 12 | #[derive(Debug, Clone, Serialize, Deserialize)] 13 | pub struct Config { 14 | pub connector: String, 15 | #[serde(default)] 16 | pub args: String, 17 | 18 | #[serde(default = "default_string_info")] 19 | pub log_level: String, 20 | 21 | // TODO: expose caching options (lifetimes, etc) 22 | #[serde(default = "default_bool_true")] 23 | pub parse_sections: bool, 24 | } 25 | 26 | impl Default for Config { 27 | fn default() -> Config { 28 | Config { 29 | connector: String::new(), 30 | args: String::new(), 31 | 32 | log_level: "info".to_string(), 33 | 34 | parse_sections: false, 35 | } 36 | } 37 | } 38 | 39 | pub struct Settings { 40 | config: Config, 41 | } 42 | 43 | impl Settings { 44 | /// Loads the current config from the {PWD}/Plugins/memflow.toml file. 45 | pub fn new() -> Self { 46 | // load config file 47 | let pwd = std::env::current_dir().expect("unable to get pwd"); 48 | let config = if let Ok(configstr) = 49 | std::fs::read_to_string(pwd.join("Plugins").join("memflow.toml")) 50 | { 51 | toml::from_str::(&configstr).unwrap_or_default() 52 | } else { 53 | Config::default() 54 | }; 55 | 56 | Self { config } 57 | } 58 | 59 | /// Saves the current configuration to the {PWD}/Plugins/memflow.toml file. 60 | pub fn persist(&self) -> Result<()> { 61 | let pwd = std::env::current_dir().map_err(|_| { 62 | Error(ErrorOrigin::Other, ErrorKind::Unknown).log_error("unable to get pwd") 63 | })?; 64 | let configstr = toml::to_string_pretty(&self.config).map_err(|_| { 65 | Error(ErrorOrigin::Other, ErrorKind::Configuration) 66 | .log_error("unable to serialize config") 67 | })?; 68 | std::fs::write(pwd.join("Plugins").join("memflow.toml"), configstr).map_err(|_| { 69 | Error(ErrorOrigin::Other, ErrorKind::NotFound).log_error("unable to write config file") 70 | })?; 71 | Ok(()) 72 | } 73 | 74 | /// Retrieves the current config 75 | pub fn config(&self) -> Config { 76 | self.config.clone() 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod reclass; 2 | use reclass::*; 3 | 4 | mod memflow_wrapper; 5 | use memflow_wrapper::*; 6 | 7 | mod config; 8 | 9 | use std::ffi::c_void; 10 | use std::ptr; 11 | use std::slice; 12 | 13 | use memflow::prelude::v1::*; 14 | 15 | const NTOSKRNL_PID: ProcessId = 4; 16 | const NTOSKRNL_HANDLE: ProcessHandle = 4 as ProcessHandle; 17 | 18 | #[no_mangle] 19 | pub extern "C" fn EnumerateProcesses(callback: EnumerateProcessCallback) { 20 | if let Ok(mut memflow) = unsafe { lock_memflow() } { 21 | // `fake` ntoskrnl.exe process 22 | let mut proc_data = EnumerateProcessData::new( 23 | NTOSKRNL_PID, 24 | "ntoskrnl.exe", 25 | r"\SystemRoot\system32\ntoskrnl.exe", 26 | ); 27 | (callback)(&mut proc_data); 28 | 29 | // processes 30 | if let Ok(proc_list) = memflow.os.process_info_list() { 31 | for proc_info in proc_list.iter() { 32 | if let Ok(mut process) = memflow.os.process_by_info(proc_info.to_owned()) { 33 | if let Ok(primary_module) = process.primary_module() { 34 | let mut proc_data = EnumerateProcessData::new( 35 | proc_info.pid as ProcessId, 36 | &primary_module.name, 37 | &primary_module.path, 38 | ); 39 | (callback)(&mut proc_data) 40 | } 41 | } 42 | } 43 | } 44 | } 45 | } 46 | 47 | #[no_mangle] 48 | pub extern "C" fn EnumerateRemoteSectionsAndModules( 49 | handle: ProcessHandle, 50 | callback_section: EnumerateRemoteSectionsCallback, 51 | callback_module: EnumerateRemoteModulesCallback, 52 | ) { 53 | if let Ok(mut memflow) = unsafe { lock_memflow() } { 54 | let parse_sections = memflow.config.parse_sections; 55 | 56 | if handle == NTOSKRNL_HANDLE { 57 | let kernel = memflow.get_kernel_mut(); 58 | 59 | // iterate sections 60 | if parse_sections { 61 | if let Some(kernel_translate) = kernel.as_mut_impl_virtualtranslate() { 62 | let mut maps = kernel_translate.virt_page_map_vec(mem::gb(1) as imem); 63 | maps.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); 64 | 65 | // TODO: sections need drastic improvement 66 | let mut section_vaddr = 0; 67 | let mut section_size = 0; 68 | for map in maps 69 | .iter() 70 | .filter(|map| map.0.to_umem() < 0xFFFF000000000000u64) 71 | { 72 | if section_vaddr + section_size != map.0.to_umem() { 73 | if section_size > 0 { 74 | let mut section_data = EnumerateRemoteSectionData::new( 75 | section_vaddr as *mut c_void, 76 | section_size as usize, 77 | ); 78 | 79 | (callback_section)(&mut section_data); 80 | } 81 | 82 | section_vaddr = map.0.to_umem(); 83 | section_size = map.1; 84 | } else { 85 | section_size += map.1; 86 | } 87 | } 88 | } 89 | } 90 | 91 | // iterate modules 92 | if let Ok(module_list) = kernel.module_list() { 93 | for module in module_list.iter() { 94 | let mut module_data = EnumerateRemoteModuleData::new( 95 | module.base.to_umem() as *mut c_void, 96 | module.size as usize, 97 | &module.path, 98 | ); 99 | (callback_module)(&mut module_data); 100 | } 101 | } 102 | } else if let Some(proc) = memflow.get_process_mut(handle as u32) { 103 | // iterate sections 104 | if parse_sections { 105 | if let Some(proc_translate) = proc.as_mut_impl_virtualtranslate() { 106 | let mut maps = proc_translate.virt_page_map_vec(mem::gb(1) as imem); 107 | maps.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); 108 | 109 | // TODO: sections need drastic improvement 110 | let mut section_vaddr = 0; 111 | let mut section_size = 0; 112 | for map in maps 113 | .iter() 114 | .filter(|map| map.0.to_umem() < 0xFFFF000000000000u64) 115 | { 116 | if section_vaddr + section_size != map.0.to_umem() { 117 | if section_size > 0 { 118 | let mut section_data = EnumerateRemoteSectionData::new( 119 | section_vaddr as *mut c_void, 120 | section_size as usize, 121 | ); 122 | 123 | (callback_section)(&mut section_data); 124 | } 125 | 126 | section_vaddr = map.0.to_umem(); 127 | section_size = map.1; 128 | } else { 129 | section_size += map.1; 130 | } 131 | } 132 | } 133 | } 134 | 135 | // iterate modules 136 | if let Ok(module_list) = proc.module_list() { 137 | for module in module_list.iter() { 138 | let mut module_data = EnumerateRemoteModuleData::new( 139 | module.base.to_umem() as *mut c_void, 140 | module.size as usize, 141 | &module.path, 142 | ); 143 | (callback_module)(&mut module_data); 144 | } 145 | } 146 | } 147 | } 148 | } 149 | 150 | #[no_mangle] 151 | pub extern "C" fn OpenRemoteProcess(id: ProcessId, _desired_access: i32) -> ProcessHandle { 152 | if let Ok(mut memflow) = unsafe { lock_memflow() } { 153 | if id == NTOSKRNL_PID { 154 | NTOSKRNL_HANDLE 155 | } else { 156 | match memflow.open_process(id as u32) { 157 | Ok(handle) => handle as ProcessHandle, 158 | Err(_) => ptr::null_mut(), 159 | } 160 | } 161 | } else { 162 | ptr::null_mut() 163 | } 164 | } 165 | 166 | #[no_mangle] 167 | pub extern "C" fn IsProcessValid(handle: ProcessHandle) -> bool { 168 | if let Ok(mut memflow) = unsafe { lock_memflow() } { 169 | if handle == NTOSKRNL_HANDLE { 170 | true 171 | } else if let Some(process) = memflow.get_process_mut(handle as u32) { 172 | process.state() == ProcessState::Alive 173 | } else { 174 | false 175 | } 176 | } else { 177 | false 178 | } 179 | } 180 | 181 | #[no_mangle] 182 | pub extern "C" fn CloseRemoteProcess(handle: ProcessHandle) { 183 | if let Ok(mut memflow) = unsafe { lock_memflow() } { 184 | if handle != NTOSKRNL_HANDLE { 185 | memflow.close_process(handle as u32); 186 | } 187 | } 188 | } 189 | 190 | #[no_mangle] 191 | pub extern "C" fn ReadRemoteMemory( 192 | handle: ProcessHandle, 193 | address: *mut c_void, 194 | buffer: *mut c_void, 195 | offset: i32, 196 | size: i32, 197 | ) -> bool { 198 | #[allow(clippy::collapsible_else_if)] 199 | if let Ok(mut memflow) = unsafe { lock_memflow() } { 200 | if handle == NTOSKRNL_HANDLE { 201 | if let Some(mem_view) = memflow.get_kernel_mut().as_mut_impl_memoryview() { 202 | let slice = unsafe { slice::from_raw_parts_mut(buffer as *mut u8, size as usize) }; 203 | mem_view 204 | .read_raw_into((address as u64).wrapping_add(offset as u64).into(), slice) 205 | .is_ok() 206 | } else { 207 | false 208 | } 209 | } else { 210 | if let Some(proc) = memflow.get_process_mut(handle as u32) { 211 | let slice = unsafe { slice::from_raw_parts_mut(buffer as *mut u8, size as usize) }; 212 | proc.read_raw_into((address as u64).wrapping_add(offset as u64).into(), slice) 213 | .is_ok() 214 | } else { 215 | false 216 | } 217 | } 218 | } else { 219 | false 220 | } 221 | } 222 | 223 | #[no_mangle] 224 | pub extern "C" fn WriteRemoteMemory( 225 | handle: ProcessHandle, 226 | address: *mut c_void, 227 | buffer: *mut c_void, 228 | offset: i32, 229 | size: i32, 230 | ) -> bool { 231 | #[allow(clippy::collapsible_else_if)] 232 | if let Ok(mut memflow) = unsafe { lock_memflow() } { 233 | if handle == NTOSKRNL_HANDLE { 234 | if let Some(mem_view) = memflow.get_kernel_mut().as_mut_impl_memoryview() { 235 | let slice = unsafe { slice::from_raw_parts_mut(buffer as *mut u8, size as usize) }; 236 | mem_view 237 | .write_raw((address as u64).wrapping_add(offset as u64).into(), slice) 238 | .is_ok() 239 | } else { 240 | false 241 | } 242 | } else { 243 | if let Some(proc) = memflow.get_process_mut(handle as u32) { 244 | let slice = unsafe { slice::from_raw_parts_mut(buffer as *mut u8, size as usize) }; 245 | proc.write_raw((address as u64).wrapping_add(offset as u64).into(), slice) 246 | .is_ok() 247 | } else { 248 | false 249 | } 250 | } 251 | } else { 252 | false 253 | } 254 | } 255 | 256 | #[no_mangle] 257 | pub extern "C" fn ControlRemoteProcess(_handle: ProcessHandle, _action: i32) {} 258 | 259 | #[no_mangle] 260 | pub extern "C" fn AttachDebuggerToProcess(_id: ProcessId) -> bool { 261 | false 262 | } 263 | 264 | #[no_mangle] 265 | pub extern "C" fn DetachDebuggerFromProcess(_id: ProcessId) {} 266 | 267 | #[no_mangle] 268 | pub extern "C" fn AwaitDebugEvent(_event: *mut c_void /*DebugEvent*/, _timeout: i32) -> bool { 269 | false 270 | } 271 | 272 | #[no_mangle] 273 | pub extern "C" fn HandleDebugEvent(_event: *mut c_void /*DebugEvent*/) {} 274 | 275 | #[no_mangle] 276 | pub extern "C" fn SetHardwareBreakpoint( 277 | _id: ProcessId, 278 | _address: *mut c_void, 279 | _reg: i32, 280 | _ty: i32, 281 | _size: i32, 282 | _set: bool, 283 | ) -> bool { 284 | false 285 | } 286 | -------------------------------------------------------------------------------- /src/memflow_wrapper.rs: -------------------------------------------------------------------------------- 1 | use crate::config::settings::{Config, Settings}; 2 | use std::collections::HashMap; 3 | use std::sync::{Arc, Mutex, MutexGuard}; 4 | 5 | use log::LevelFilter; 6 | 7 | use memflow::prelude::v1::*; 8 | 9 | static mut MEMFLOW_INSTANCE: Option>> = None; 10 | 11 | pub unsafe fn lock_memflow<'a>() -> Result> { 12 | if MEMFLOW_INSTANCE.is_none() { 13 | match Memflow::try_init() { 14 | Ok(memflow) => { 15 | MEMFLOW_INSTANCE = Some(Arc::new(Mutex::new(memflow))); 16 | } 17 | Err(err) => { 18 | return Err(err.log_error("unable to initialize memflow")); 19 | } 20 | }; 21 | } 22 | 23 | if let Some(memflow) = MEMFLOW_INSTANCE.as_ref() { 24 | if let Ok(memflow) = memflow.lock() { 25 | Ok(memflow) 26 | } else { 27 | Err(Error(ErrorOrigin::Other, ErrorKind::NotFound).log_error("unable to lock memflow")) 28 | } 29 | } else { 30 | Err(Error(ErrorOrigin::Other, ErrorKind::NotFound) 31 | .log_error("memflow is not properly initialized")) 32 | } 33 | } 34 | 35 | pub struct Memflow { 36 | pub config: Config, 37 | pub os: OsInstanceArcBox<'static>, 38 | pub handles: HashMap>, 39 | } 40 | 41 | impl Memflow { 42 | pub fn try_init() -> Result { 43 | // setup logging 44 | #[cfg(unix)] 45 | simple_logging::log_to(std::io::stdout(), LevelFilter::Info); 46 | #[cfg(not(unix))] 47 | simple_logging::log_to_file("memflow_reclass.log", LevelFilter::Info).ok(); 48 | 49 | // load config file and set initial logging level 50 | let settings = Settings::new(); 51 | log_level_from_str(settings.config().log_level.as_ref()); 52 | 53 | let config = settings.config(); 54 | 55 | // update logging level after showing the configuration dialog 56 | log_level_from_str(config.log_level.as_ref()); 57 | 58 | // load connector 59 | let inventory = Inventory::scan(); 60 | let os = { 61 | match inventory 62 | .builder() 63 | .connector(&config.connector) 64 | .args(config.args.parse()?) 65 | .os("win32") 66 | .build() 67 | { 68 | Ok(os) => os, 69 | Err(err) => { 70 | return Err(err); 71 | } 72 | } 73 | }; 74 | 75 | Ok(Self { 76 | config, 77 | os, 78 | handles: HashMap::new(), 79 | }) 80 | } 81 | 82 | pub fn open_process(&mut self, pid: u32) -> Result { 83 | let proc = self.os.clone().into_process_by_pid(pid)?; 84 | self.handles.insert(pid, proc); 85 | Ok(pid) 86 | } 87 | 88 | pub fn close_process(&mut self, handle: u32) { 89 | self.handles.remove(&handle); 90 | } 91 | 92 | pub fn get_kernel_mut(&mut self) -> &mut OsInstanceArcBox<'static> { 93 | &mut self.os 94 | } 95 | 96 | pub fn get_process_mut( 97 | &mut self, 98 | handle: u32, 99 | ) -> Option<&mut IntoProcessInstanceArcBox<'static>> { 100 | self.handles.get_mut(&handle) 101 | } 102 | } 103 | 104 | fn log_level_from_str(log_level: &str) { 105 | match log_level.to_lowercase().as_ref() { 106 | "error" => log::set_max_level(LevelFilter::Error), 107 | "warn" => log::set_max_level(LevelFilter::Warn), 108 | "info" => log::set_max_level(LevelFilter::Info), 109 | "debug" => log::set_max_level(LevelFilter::Debug), 110 | "trace" => log::set_max_level(LevelFilter::Trace), 111 | _ => log::set_max_level(LevelFilter::Off), 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/reclass.rs: -------------------------------------------------------------------------------- 1 | use std::ffi::c_void; 2 | 3 | pub const MAX_PATH: usize = 260; 4 | 5 | pub type ProcessId = usize; 6 | pub type ProcessHandle = *mut c_void; 7 | 8 | #[repr(C, packed)] 9 | pub struct EnumerateProcessData { 10 | pub pid: ProcessId, 11 | pub name: [u16; MAX_PATH], 12 | pub path: [u16; MAX_PATH], 13 | } 14 | const _: [(); std::mem::size_of::()] = [(); 0x418]; 15 | 16 | impl EnumerateProcessData { 17 | pub fn new(pid: ProcessId, name: &str, path: &str) -> Self { 18 | let name16 = name.encode_utf16().collect::>(); 19 | let mut namebuf = [0u16; MAX_PATH]; 20 | namebuf[..name16.len().min(MAX_PATH)] 21 | .copy_from_slice(&name16[..name16.len().min(MAX_PATH)]); 22 | 23 | let path16 = path.encode_utf16().collect::>(); 24 | let mut pathbuf = [0u16; MAX_PATH]; 25 | pathbuf[..path16.len().min(MAX_PATH)] 26 | .copy_from_slice(&path16[..path16.len().min(MAX_PATH)]); 27 | 28 | Self { 29 | pid, 30 | name: namebuf, 31 | path: pathbuf, 32 | } 33 | } 34 | } 35 | 36 | #[repr(C, packed)] 37 | pub struct EnumerateRemoteSectionData { 38 | base_address: *mut c_void, 39 | size: usize, 40 | ty: i32, // enum SectionType 41 | category: i32, // enum SectionCategory 42 | protection: i32, // enum SectionProtection 43 | name: [u16; 16], 44 | module_path: [u16; MAX_PATH], 45 | } 46 | const _: [(); std::mem::size_of::()] = [(); 0x244]; 47 | 48 | impl EnumerateRemoteSectionData { 49 | pub fn new(base_address: *mut c_void, size: usize) -> Self { 50 | Self { 51 | base_address, 52 | size, 53 | ty: 0, // Unknown 54 | category: 0, // Unknown 55 | protection: 1 | 2, // Read Write 56 | name: [0u16; 16], 57 | module_path: [0u16; MAX_PATH], 58 | } 59 | } 60 | } 61 | 62 | #[repr(C, packed)] 63 | pub struct EnumerateRemoteModuleData { 64 | base_address: *mut c_void, 65 | size: usize, 66 | path: [u16; MAX_PATH], 67 | } 68 | const _: [(); std::mem::size_of::()] = [(); 0x218]; 69 | 70 | impl EnumerateRemoteModuleData { 71 | pub fn new(base_address: *mut c_void, size: usize, path: &str) -> Self { 72 | let path16 = path.encode_utf16().collect::>(); 73 | let mut pathbuf = [0u16; MAX_PATH]; 74 | pathbuf[..path16.len().min(MAX_PATH)] 75 | .copy_from_slice(&path16[..path16.len().min(MAX_PATH)]); 76 | 77 | Self { 78 | base_address, 79 | size, 80 | path: pathbuf, 81 | } 82 | } 83 | } 84 | 85 | pub type EnumerateProcessCallback = extern "C" fn(*mut EnumerateProcessData); 86 | pub type EnumerateRemoteSectionsCallback = extern "C" fn(*mut EnumerateRemoteSectionData); 87 | pub type EnumerateRemoteModulesCallback = extern "C" fn(*mut EnumerateRemoteModuleData); 88 | --------------------------------------------------------------------------------