From 93cc92ef23fd7b8e4d292bc79139cd25b1936d95 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 15 Jan 2025 14:51:22 -0500 Subject: [PATCH] More rust cleanup This commit is half done --- .gitignore | 1 - Cargo.lock | 3526 +++++++++++++++++ Cargo.toml | 9 +- arch/msp430/Cargo.toml | 5 - arch/riscv/Cargo.toml | 7 +- arch/riscv/disasm/src/lib.rs | 5 +- arch/riscv/src/lib.rs | 5 +- plugins/dwarf/dwarf_export/Cargo.lock | 495 --- plugins/dwarf/dwarf_import/Cargo.lock | 453 --- plugins/dwarf/dwarf_import/Cargo.toml | 6 +- plugins/idb_import/Cargo.lock | 563 --- plugins/idb_import/Cargo.toml | 6 +- plugins/idb_import/src/lib.rs | 4 +- plugins/pdb-ng/Cargo.lock | 350 -- plugins/pdb-ng/Cargo.toml | 6 +- plugins/pdb-ng/src/type_parser.rs | 2 +- plugins/warp/Cargo.toml | 8 - plugins/warp/src/cache.rs | 22 +- plugins/warp/src/lib.rs | 26 +- plugins/warp/src/matcher.rs | 6 +- plugins/warp/src/plugin.rs | 2 +- rust/examples/hlil.rs | 2 +- rust/examples/mlil.rs | 2 +- rust/examples/workflow.rs | 12 +- rust/src/architecture.rs | 8 +- rust/src/backgroundtask.rs | 3 +- rust/src/binaryview.rs | 98 +- rust/src/component.rs | 4 +- rust/src/custombinaryview.rs | 2 +- rust/src/filemetadata.rs | 8 +- rust/src/function.rs | 6 +- rust/src/hlil/function.rs | 52 +- rust/src/hlil/instruction.rs | 8 +- rust/src/llil/expression.rs | 670 ++-- rust/src/llil/function.rs | 6 +- rust/src/llil/instruction.rs | 302 +- rust/src/llil/lifting.rs | 6 +- rust/src/llil/operation.rs | 603 ++- rust/src/mlil/function.rs | 47 +- rust/src/mlil/instruction.rs | 8 +- rust/src/references.rs | 82 +- rust/src/types.rs | 2 +- rust/src/variable.rs | 2 +- view/bintxt/Cargo.toml | 8 +- {plugins/minidump => view/bintxt}/build.rs | 0 view/bintxt/src/ihex.rs | 18 +- view/bintxt/src/lib.rs | 4 +- {plugins => view}/minidump/.gitignore | 0 {plugins => view}/minidump/Cargo.toml | 6 +- {plugins => view}/minidump/README.md | 0 view/minidump/build.rs | 15 + .../loaded-minidump-screenshot-border.png | Bin ...ump-binary-view-type-screenshot-border.png | Bin ...mp-segments-sections-screenshot-border.png | Bin {plugins => view}/minidump/src/command.rs | 0 {plugins => view}/minidump/src/lib.rs | 0 {plugins => view}/minidump/src/view.rs | 0 57 files changed, 4764 insertions(+), 2727 deletions(-) create mode 100644 Cargo.lock delete mode 100644 plugins/dwarf/dwarf_export/Cargo.lock delete mode 100644 plugins/dwarf/dwarf_import/Cargo.lock delete mode 100644 plugins/idb_import/Cargo.lock delete mode 100644 plugins/pdb-ng/Cargo.lock rename {plugins/minidump => view/bintxt}/build.rs (100%) rename {plugins => view}/minidump/.gitignore (100%) rename {plugins => view}/minidump/Cargo.toml (77%) rename {plugins => view}/minidump/README.md (100%) create mode 100644 view/minidump/build.rs rename {plugins => view}/minidump/images/loaded-minidump-screenshot-border.png (100%) rename {plugins => view}/minidump/images/minidump-binary-view-type-screenshot-border.png (100%) rename {plugins => view}/minidump/images/minidump-segments-sections-screenshot-border.png (100%) rename {plugins => view}/minidump/src/command.rs (100%) rename {plugins => view}/minidump/src/lib.rs (100%) rename {plugins => view}/minidump/src/view.rs (100%) diff --git a/.gitignore b/.gitignore index adb601d32..91a0f3abb 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,6 @@ rust/target/ rust/binaryninjacore-sys/target/ rust/examples/*/target/ rust/examples/dwarf/*/target/ -Cargo.lock # Debugger docs docs/img/debugger diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..a8a0bfb3c --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3526 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys 0.59.0", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +dependencies = [ + "backtrace", +] + +[[package]] +name = "ar" +version = "0.9.0" +source = "git+https://github.com/mdsteele/rust-ar#755fc742a292a84fc267b79ae349877dd23a40e7" + +[[package]] +name = "arboard" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" +dependencies = [ + "clipboard-win", + "core-graphics", + "image", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "windows-sys 0.48.0", + "x11rb", +] + +[[package]] +name = "arch_msp430" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "log", + "msp430-asm", +] + +[[package]] +name = "arch_riscv" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "log", + "rayon", + "riscv-dis", +] + +[[package]] +name = "ashpd" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c39d707614dbcc6bed00015539f488d8e3fe3e66ed60961efc0c90f4b380b3" +dependencies = [ + "async-fs", + "async-net", + "enumflags2", + "futures-channel", + "futures-util", + "rand 0.8.5", + "raw-window-handle", + "serde", + "serde_repr", + "url", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "zbus", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", + "tracing", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object 0.36.7", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "binaryninja" +version = "0.1.0" +dependencies = [ + "binaryninjacore-sys", + "log", + "rayon", + "rstest", + "tempfile", + "thiserror 2.0.11", +] + +[[package]] +name = "binaryninjacore-sys" +version = "0.1.0" +dependencies = [ + "bindgen", + "proc-macro2", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.71.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +dependencies = [ + "bitflags 2.8.0", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "bon" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97493a391b4b18ee918675fb8663e53646fd09321c58b46afa04e8ce2499c869" +dependencies = [ + "bon-macros", + "rustversion", +] + +[[package]] +name = "bon-macros" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2af3eac944c12cdf4423eab70d310da0a8e5851a18ffb192c0a5e3f7ae1663" +dependencies = [ + "darling", + "ident_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytemuck" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "windows-sys 0.59.0", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "libc", +] + +[[package]] +name = "cpp_demangle" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "is-terminal", + "itertools 0.10.5", + "num-traits", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools 0.10.5", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dwarf_export" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "gimli", + "log", + "object 0.32.2", +] + +[[package]] +name = "dwarf_import" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "cpp_demangle", + "dwarfreader", + "gimli", + "indexmap", + "iset", + "log", + "regex", +] + +[[package]] +name = "dwarfdump" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "dwarfreader", + "gimli", +] + +[[package]] +name = "dwarfreader" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "gimli", + "thiserror 1.0.69", + "zstd", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enumflags2" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "env_filter" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "error-code" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flatbuffers" +version = "24.12.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f1baf0dbf96932ec9a3038d57900329c015b0bfb7b63d904f3bc27e2b02a096" +dependencies = [ + "bitflags 1.3.2", + "rustc_version", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +dependencies = [ + "fallible-iterator 0.3.0", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idb-rs" +version = "0.1.6" +source = "git+https://github.com/Vector35/idb-rs?tag=0.1.6#1c79c0e80688751119e1067876c38f2d26b84706" +dependencies = [ + "anyhow", + "bincode", + "clap", + "flate2", + "itertools 0.13.0", + "serde", +] + +[[package]] +name = "idb_import" +version = "0.1.0" +dependencies = [ + "anyhow", + "binaryninja", + "binaryninjacore-sys", + "idb-rs", + "log", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ihex" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "365a784774bb381e8c19edb91190a90d7f2625e057b55de2bc0f6b57bc779ff2" + +[[package]] +name = "image" +version = "0.25.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", + "tiff", +] + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "insta" +version = "1.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" +dependencies = [ + "console", + "linked-hash-map", + "once_cell", + "serde", + "similar", +] + +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "iset" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0716a0d7080cb7b20b9426276315e6ff5ed537bd920af47417b16de07f9ac76" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minidump" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24e8d3964f4a60ee45309dc76cfc3023588b0b62fcb79baa3e9134d4298c7ac" +dependencies = [ + "debugid", + "encoding_rs", + "memmap2", + "minidump-common", + "num-traits", + "procfs-core", + "range-map", + "scroll 0.12.0", + "thiserror 1.0.69", + "time", + "tracing", + "uuid", +] + +[[package]] +name = "minidump-common" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c464c28d59ae40fd48a1da695e338910f19f71e1e585dd37261d81eaa3adbee" +dependencies = [ + "bitflags 2.8.0", + "debugid", + "num-derive", + "num-traits", + "range-map", + "scroll 0.12.0", + "smart-default", +] + +[[package]] +name = "minidump_bn" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "log", + "minidump", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "msp430-asm" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91c22f111c205b788cc10e2a58aed039d5dd5554d3a9236be3d413a912ff3cb" + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.8.0", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.8.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.8.0", + "block2", + "dispatch", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "oorandom" +version = "11.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "pdb" +version = "0.8.0" +source = "git+https://github.com/Vector35/pdb-rs?rev=6016177#6016177223135625263934254147179606062496" +dependencies = [ + "fallible-iterator 0.2.0", + "scroll 0.11.0", + "uuid", +] + +[[package]] +name = "pdb-import-plugin" +version = "0.1.0" +dependencies = [ + "anyhow", + "binaryninja", + "binaryninjacore-sys", + "itertools 0.11.0", + "log", + "pdb", + "regex", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "plotters" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" + +[[package]] +name = "plotters-svg" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "pollster" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags 2.8.0", + "hex", +] + +[[package]] +name = "quick-xml" +version = "0.36.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "range-map" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12a5a2d6c7039059af621472a4389be1215a816df61aa4d531cfe85264aee95f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags 2.8.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "rfd" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a24763657bff09769a8ccf12c8b8a50416fb035fe199263b4c5071e4e3f006f" +dependencies = [ + "ashpd", + "block2", + "core-foundation 0.10.0", + "core-foundation-sys", + "js-sys", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "pollster", + "raw-window-handle", + "urlencoding", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "riscv-dis" +version = "0.1.0" +dependencies = [ + "byteorder", +] + +[[package]] +name = "rstest" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e905296805ab93e13c1ec3a03f4b6c4f35e9498a3d5fa96dc626d22c03cd89" +dependencies = [ + "futures-timer", + "futures-util", + "rstest_macros", + "rustc_version", +] + +[[package]] +name = "rstest_macros" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef0053bbffce09062bee4bcc499b0fbe7a57b879f1efe088d6d8d4c7adcdef9b" +dependencies = [ + "cfg-if", + "glob", + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "relative-path", + "rustc_version", + "syn", + "unicode-ident", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +dependencies = [ + "bitflags 2.8.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" + +[[package]] +name = "scroll" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "semver" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.135" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "similar" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "smart-default" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "srec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c3a0538ec242e3cd333cdcdc8b720faa2fa0a9d7f444cf1ff63e7d3303adfb" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tempdir" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +dependencies = [ + "rand 0.4.6", + "remove_dir_all", +] + +[[package]] +name = "tempfile" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "time" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "view_bintxt" +version = "0.1.0" +dependencies = [ + "binaryninja", + "binaryninjacore-sys", + "ihex", + "log", + "srec", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "warp" +version = "0.1.0" +source = "git+https://github.com/Vector35/warp/?rev=0ee5a6f#0ee5a6fddd3170b8468670f94202cfedd30df3f2" +dependencies = [ + "bon", + "flatbuffers", + "flate2", + "rand 0.8.5", + "uuid", +] + +[[package]] +name = "warp_ninja" +version = "0.1.0" +dependencies = [ + "ar", + "arboard", + "binaryninja", + "binaryninjacore-sys", + "cc", + "clap", + "criterion", + "dashmap", + "env_logger", + "insta", + "log", + "rayon", + "rfd", + "serde_json", + "tempdir", + "walkdir", + "warp", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wayland-backend" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" +dependencies = [ + "bitflags 2.8.0", + "rustix", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" +dependencies = [ + "bitflags 2.8.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" +dependencies = [ + "dlib", + "log", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +dependencies = [ + "memchr", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "gethostname", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zbus" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "192a0d989036cd60a1e91a54c9851fb9ad5bd96125d41803eed79d2e2ef74bd7" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-util", + "hex", + "nix", + "ordered-stream", + "serde", + "serde_repr", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.59.0", + "winnow", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3685b5c81fce630efc3e143a4ded235b107f1b1cdf186c3f115529e5e5ae4265" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "519629a3f80976d89c575895b05677cbc45eaf9f70d62a364d819ba646409cc8" +dependencies = [ + "serde", + "static_assertions", + "winnow", + "zvariant", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zstd" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "zvariant" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55e6b9b5f1361de2d5e7d9fd1ee5f6f7fcb6060618a1f82f3472f58f2b8d4be9" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "url", + "winnow", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573a8dd76961957108b10f7a45bac6ab1ea3e9b7fe01aff88325dc57bb8f5c8b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd46446ea2a1f353bfda53e35f17633afa79f4fe290a611c94645c69fe96a50" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "static_assertions", + "syn", + "winnow", +] diff --git a/Cargo.toml b/Cargo.toml index 686430cda..dfdd9e026 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,12 +9,17 @@ members = [ "rust/binaryninjacore-sys", "arch/riscv", "arch/msp430", + "view/bintxt", + "view/minidump", "plugins/dwarf/dwarf_import", "plugins/dwarf/dwarf_export", "plugins/dwarf/dwarfdump", "plugins/dwarf/shared", "plugins/idb_import", - "plugins/minidump", "plugins/pdb-ng", "plugins/warp" -] \ No newline at end of file +] + +[profile.release] +lto = true +debug = "full" \ No newline at end of file diff --git a/arch/msp430/Cargo.toml b/arch/msp430/Cargo.toml index cba425996..c2bf70608 100644 --- a/arch/msp430/Cargo.toml +++ b/arch/msp430/Cargo.toml @@ -12,8 +12,3 @@ msp430-asm = "^0.2" [lib] crate-type = ["cdylib"] - -[profile.release] -panic = "abort" -lto = true -debug = 1 diff --git a/arch/riscv/Cargo.toml b/arch/riscv/Cargo.toml index 77fc45fd5..ee3dbb71c 100644 --- a/arch/riscv/Cargo.toml +++ b/arch/riscv/Cargo.toml @@ -16,9 +16,4 @@ default = [] liftcheck = ["rayon", "binaryninja/rayon"] [lib] -crate-type = ["cdylib"] - -[profile.release] -panic = "abort" -lto = true -debug = 1 +crate-type = ["cdylib"] \ No newline at end of file diff --git a/arch/riscv/disasm/src/lib.rs b/arch/riscv/disasm/src/lib.rs index 41c711cec..a25516a62 100644 --- a/arch/riscv/disasm/src/lib.rs +++ b/arch/riscv/disasm/src/lib.rs @@ -6,6 +6,7 @@ use std::borrow::Cow; use std::fmt; +use std::fmt::Debug; use std::marker::PhantomData; use std::mem; @@ -290,7 +291,7 @@ impl FloatRegType for () {} impl FloatRegType for f32 {} impl FloatRegType for f64 {} -pub trait RegFile: Sized + Copy + Clone { +pub trait RegFile: Debug + Sized + Copy + Clone { type Int: IntRegType; type Float: FloatRegType; @@ -2330,7 +2331,7 @@ impl StandardExtension for ExtensionSupported { } } -pub trait RiscVDisassembler: Sized + Copy + Clone { +pub trait RiscVDisassembler: Debug + Sized + Copy + Clone { type RegFile: RegFile; type MulDivExtension: StandardExtension; type AtomicExtension: StandardExtension; diff --git a/arch/riscv/src/lib.rs b/arch/riscv/src/lib.rs index 8331a4343..b3a996b1d 100644 --- a/arch/riscv/src/lib.rs +++ b/arch/riscv/src/lib.rs @@ -41,6 +41,7 @@ use std::marker::PhantomData; use binaryninja::architecture::{BranchKind, IntrinsicId, RegisterId}; use binaryninja::confidence::{Conf, MAX_CONFIDENCE, MIN_CONFIDENCE}; +use binaryninja::llil::{ExpressionHandler, InstructionHandler}; use binaryninja::logger::Logger; use riscv_dis::{ FloatReg, FloatRegType, Instr, IntRegType, Op, RegFile, Register as RiscVRegister, @@ -89,7 +90,7 @@ struct Register { _dis: PhantomData, } -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] struct RiscVIntrinsic { id: Intrinsic, _dis: PhantomData, @@ -2472,7 +2473,7 @@ impl RelocationHandler // Actual target symbol is on the associated R_RISCV_PCREL_HI20 relocation, which // is pointed to by `reloc.target()`. let target = match bv - .get_relocations_at(reloc.target()) + .relocations_at(reloc.target()) .iter() .find(|r| r.info().native_type == Self::R_RISCV_PCREL_HI20) { diff --git a/plugins/dwarf/dwarf_export/Cargo.lock b/plugins/dwarf/dwarf_export/Cargo.lock deleted file mode 100644 index 56e90497e..000000000 --- a/plugins/dwarf/dwarf_export/Cargo.lock +++ /dev/null @@ -1,495 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "binaryninja" -version = "0.1.0" -dependencies = [ - "binaryninjacore-sys", - "log", -] - -[[package]] -name = "binaryninjacore-sys" -version = "0.1.0" -dependencies = [ - "bindgen", - "proc-macro2", -] - -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dwarf_export" -version = "0.1.0" -dependencies = [ - "binaryninja", - "gimli", - "log", - "object", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[package]] -name = "flate2" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "indexmap" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" -dependencies = [ - "equivalent", - "hashbrown 0.15.2", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.169" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" - -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" -dependencies = [ - "adler2", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "crc32fast", - "flate2", - "hashbrown 0.14.5", - "indexmap", - "memchr", - "ruzstd", -] - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "prettyplease" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] -name = "proc-macro2" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - -[[package]] -name = "ruzstd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" -dependencies = [ - "byteorder", - "derive_more", - "twox-hash", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "syn" -version = "2.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - -[[package]] -name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/plugins/dwarf/dwarf_import/Cargo.lock b/plugins/dwarf/dwarf_import/Cargo.lock deleted file mode 100644 index 81573cbd0..000000000 --- a/plugins/dwarf/dwarf_import/Cargo.lock +++ /dev/null @@ -1,453 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "binaryninja" -version = "0.1.0" -dependencies = [ - "binaryninjacore-sys", - "log", -] - -[[package]] -name = "binaryninjacore-sys" -version = "0.1.0" -dependencies = [ - "bindgen", - "proc-macro2", -] - -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "cc" -version = "1.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" -dependencies = [ - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "cpp_demangle" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "dwarf_import" -version = "0.1.0" -dependencies = [ - "binaryninja", - "cpp_demangle", - "dwarfreader", - "gimli", - "indexmap", - "iset", - "log", - "regex", -] - -[[package]] -name = "dwarfreader" -version = "0.1.0" -dependencies = [ - "binaryninja", - "gimli", - "thiserror", - "zstd", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "indexmap" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "iset" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0716a0d7080cb7b20b9426276315e6ff5ed537bd920af47417b16de07f9ac76" - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - -[[package]] -name = "libc" -version = "0.2.169" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" - -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "prettyplease" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] -name = "proc-macro2" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "syn" -version = "2.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "zstd" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/plugins/dwarf/dwarf_import/Cargo.toml b/plugins/dwarf/dwarf_import/Cargo.toml index 58a36e5fc..b8fb09b7b 100644 --- a/plugins/dwarf/dwarf_import/Cargo.toml +++ b/plugins/dwarf/dwarf_import/Cargo.toml @@ -15,8 +15,4 @@ log = "0.4.20" iset = "0.2.2" cpp_demangle = "0.4.3" regex = "1" -indexmap = "2.5.0" - -[profile.release] -lto = true -debug = "full" +indexmap = "2.5.0" \ No newline at end of file diff --git a/plugins/idb_import/Cargo.lock b/plugins/idb_import/Cargo.lock deleted file mode 100644 index 3b342cac6..000000000 --- a/plugins/idb_import/Cargo.lock +++ /dev/null @@ -1,563 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anstream" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" -dependencies = [ - "anstyle", - "windows-sys", -] - -[[package]] -name = "anyhow" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" -dependencies = [ - "backtrace", -] - -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - -[[package]] -name = "binaryninja" -version = "0.1.0" -dependencies = [ - "binaryninjacore-sys", - "log", -] - -[[package]] -name = "binaryninjacore-sys" -version = "0.1.0" -dependencies = [ - "bindgen", - "proc-macro2", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "4.5.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" - -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "flate2" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "idb-rs" -version = "0.1.6" -source = "git+https://github.com/Vector35/idb-rs?tag=0.1.6#1c79c0e80688751119e1067876c38f2d26b84706" -dependencies = [ - "anyhow", - "bincode", - "clap", - "flate2", - "itertools", - "serde", -] - -[[package]] -name = "idb_import" -version = "0.1.0" -dependencies = [ - "anyhow", - "binaryninja", - "idb-rs", - "log", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.169" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" - -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" -dependencies = [ - "adler2", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "prettyplease" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] -name = "proc-macro2" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - -[[package]] -name = "serde" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/plugins/idb_import/Cargo.toml b/plugins/idb_import/Cargo.toml index 01622826b..0c946f410 100644 --- a/plugins/idb_import/Cargo.toml +++ b/plugins/idb_import/Cargo.toml @@ -12,8 +12,4 @@ anyhow = { version = "1.0.86", features = ["backtrace"] } binaryninja = { path = "../../rust" } binaryninjacore-sys = { path = "../../rust/binaryninjacore-sys" } idb-rs = { git = "https://github.com/Vector35/idb-rs", tag = "0.1.6" } -log = "0.4.20" - -[profile.release] -lto = true -debug = "full" +log = "0.4.20" \ No newline at end of file diff --git a/plugins/idb_import/src/lib.rs b/plugins/idb_import/src/lib.rs index f7d59d829..2245703e3 100644 --- a/plugins/idb_import/src/lib.rs +++ b/plugins/idb_import/src/lib.rs @@ -20,7 +20,7 @@ use binaryninja::logger::Logger; struct IDBDebugInfoParser; impl CustomDebugInfoParser for IDBDebugInfoParser { fn is_valid(&self, view: &BinaryView) -> bool { - if let Some(project_file) = view.file().get_project_file() { + if let Some(project_file) = view.file().project_file() { project_file.name().as_str().ends_with(".i64") || project_file.name().as_str().ends_with(".idb") } else { @@ -49,7 +49,7 @@ impl CustomDebugInfoParser for IDBDebugInfoParser { struct TILDebugInfoParser; impl CustomDebugInfoParser for TILDebugInfoParser { fn is_valid(&self, view: &BinaryView) -> bool { - if let Some(project_file) = view.file().get_project_file() { + if let Some(project_file) = view.file().project_file() { project_file.name().as_str().ends_with(".til") } else { view.file().filename().as_str().ends_with(".til") diff --git a/plugins/pdb-ng/Cargo.lock b/plugins/pdb-ng/Cargo.lock deleted file mode 100644 index bf37093cf..000000000 --- a/plugins/pdb-ng/Cargo.lock +++ /dev/null @@ -1,350 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" - -[[package]] -name = "binaryninja" -version = "0.1.0" -dependencies = [ - "binaryninjacore-sys", - "log", -] - -[[package]] -name = "binaryninjacore-sys" -version = "0.1.0" -dependencies = [ - "bindgen", - "proc-macro2", -] - -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.169" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" - -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "pdb" -version = "0.8.0" -source = "git+https://github.com/Vector35/pdb-rs?rev=6016177#6016177223135625263934254147179606062496" -dependencies = [ - "fallible-iterator", - "scroll", - "uuid", -] - -[[package]] -name = "pdb-import-plugin" -version = "0.1.0" -dependencies = [ - "anyhow", - "binaryninja", - "itertools 0.11.0", - "log", - "pdb", - "regex", -] - -[[package]] -name = "prettyplease" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] -name = "proc-macro2" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - -[[package]] -name = "scroll" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "syn" -version = "2.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" - -[[package]] -name = "uuid" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/plugins/pdb-ng/Cargo.toml b/plugins/pdb-ng/Cargo.toml index 8c34a3c68..de9b958e3 100644 --- a/plugins/pdb-ng/Cargo.toml +++ b/plugins/pdb-ng/Cargo.toml @@ -16,8 +16,4 @@ pdb = { git = "https://github.com/Vector35/pdb-rs", rev = "6016177" } regex = "1" [features] -demo = [] - -[profile.release] -lto = true -debug = "full" +demo = [] \ No newline at end of file diff --git a/plugins/pdb-ng/src/type_parser.rs b/plugins/pdb-ng/src/type_parser.rs index 9c4e14f5c..febf83bd6 100644 --- a/plugins/pdb-ng/src/type_parser.rs +++ b/plugins/pdb-ng/src/type_parser.rs @@ -360,7 +360,7 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> { continue; } // If the bv has this type, DebugInfo will just update us to reference it - if self.bv.get_type_by_name(name.to_owned()).is_some() { + if self.bv.type_by_name(name.to_owned()).is_some() { continue; } diff --git a/plugins/warp/Cargo.toml b/plugins/warp/Cargo.toml index 883321b28..2726a332e 100644 --- a/plugins/warp/Cargo.toml +++ b/plugins/warp/Cargo.toml @@ -31,14 +31,6 @@ cc = "1.1.28" criterion = "0.5.1" insta = { version = "1.38.0", features = ["yaml"] } -[profile.release] -lto = true -debug = "full" - -[profile.dev.package] -insta.opt-level = 3 -similar.opt-level = 3 - [[bench]] name = "guid" harness = false diff --git a/plugins/warp/src/cache.rs b/plugins/warp/src/cache.rs index ccd3de66a..b28ab903f 100644 --- a/plugins/warp/src/cache.rs +++ b/plugins/warp/src/cache.rs @@ -4,7 +4,7 @@ use binaryninja::architecture::Architecture; use binaryninja::binaryview::{BinaryView, BinaryViewExt}; use binaryninja::confidence::MAX_CONFIDENCE; use binaryninja::function::Function as BNFunction; -use binaryninja::llil::{FunctionMutability, NonSSA, NonSSAVariant}; +use binaryninja::llil::{FunctionMutability, NonSSA, RegularNonSSA}; use binaryninja::rc::Guard; use binaryninja::rc::Ref as BNRef; use binaryninja::symbol::Symbol as BNSymbol; @@ -65,9 +65,9 @@ pub fn try_cached_function_match(function: &BNFunction) -> Option { .to_owned() } -pub fn cached_function( +pub fn cached_function( function: &BNFunction, - llil: &llil::LowLevelILFunction>, + llil: &llil::LowLevelILFunction>, ) -> Function { let view = function.view(); let view_id = ViewID::from(view.as_ref()); @@ -119,9 +119,9 @@ where } } -pub fn cached_function_guid( +pub fn cached_function_guid( function: &BNFunction, - llil: &llil::LowLevelILFunction>, + llil: &llil::LowLevelILFunction>, ) -> FunctionGUID { let view = function.view(); let view_id = ViewID::from(view); @@ -199,10 +199,10 @@ pub struct FunctionCache { } impl FunctionCache { - pub fn function( + pub fn function( &self, function: &BNFunction, - llil: &llil::LowLevelILFunction>, + llil: &llil::LowLevelILFunction>, ) -> Function { let function_id = FunctionID::from(function); match self.cache.get(&function_id) { @@ -229,7 +229,7 @@ impl GUIDCache { let func_platform = function.platform(); let mut constraints = HashSet::new(); for call_site in &function.call_sites() { - for cs_ref_addr in view.get_code_refs_from(call_site.address, Some(function)) { + for cs_ref_addr in view.code_refs_from_addr(call_site.address, Some(function)) { match view.function_at(&func_platform, cs_ref_addr) { Some(cs_ref_func) => { // Call site is a function, constrain on it. @@ -327,10 +327,10 @@ impl GUIDCache { } } - pub fn function_guid( + pub fn function_guid( &self, function: &BNFunction, - llil: &llil::LowLevelILFunction>, + llil: &llil::LowLevelILFunction>, ) -> FunctionGUID { let function_id = FunctionID::from(function); match self.cache.get(&function_id) { @@ -479,6 +479,6 @@ impl ObjectDestructor for CacheDestructor { if let Some(cache) = TYPE_REF_CACHE.get() { cache.remove(&view_id); } - log::debug!("Removed WARP caches for {:?}", view); + log::debug!("Removed WARP caches for {:?}", view.file().filename()); } } diff --git a/plugins/warp/src/lib.rs b/plugins/warp/src/lib.rs index d1f029e7f..ed95f46cc 100644 --- a/plugins/warp/src/lib.rs +++ b/plugins/warp/src/lib.rs @@ -11,8 +11,8 @@ use binaryninja::confidence::MAX_CONFIDENCE; use binaryninja::function::{Function as BNFunction, NativeBlock}; use binaryninja::llil; use binaryninja::llil::{ - ExprInfo, FunctionMutability, InstrInfo, Instruction, NonSSA, NonSSAVariant, Register, - VisitorAction, + ExprInfo, ExpressionHandler, FunctionMutability, InstrInfo, Instruction, InstructionHandler, + NonSSA, Register, RegularNonSSA, VisitorAction, }; use binaryninja::rc::Ref as BNRef; use std::path::PathBuf; @@ -41,9 +41,9 @@ pub fn user_signature_dir() -> PathBuf { binaryninja::user_directory().join("signatures/") } -pub fn build_function( +pub fn build_function( func: &BNFunction, - llil: &llil::LowLevelILFunction>, + llil: &llil::LowLevelILFunction>, ) -> Function { let bn_fn_ty = func.function_type(); Function { @@ -73,9 +73,9 @@ pub fn sorted_basic_blocks(func: &BNFunction) -> Vec( +pub fn function_guid( func: &BNFunction, - llil: &llil::LowLevelILFunction>, + llil: &llil::LowLevelILFunction>, ) -> FunctionGUID { let basic_blocks = sorted_basic_blocks(func); let basic_block_guids = basic_blocks @@ -85,9 +85,9 @@ pub fn function_guid( FunctionGUID::from_basic_blocks(&basic_block_guids) } -pub fn basic_block_guid( +pub fn basic_block_guid( basic_block: &BNBasicBlock, - llil: &llil::LowLevelILFunction>, + llil: &llil::LowLevelILFunction>, ) -> BasicBlockGUID { let func = basic_block.function(); let view = func.view(); @@ -95,7 +95,7 @@ pub fn basic_block_guid>| { + let is_blacklisted_instr = |instr: &Instruction>| { match instr.info() { InstrInfo::Nop(_) => true, InstrInfo::SetReg(op) => { @@ -121,8 +121,8 @@ pub fn basic_block_guid>| { - let is_variant_expr = |expr: &ExprInfo>| { + let is_variant_instr = |instr: &Instruction>| { + let is_variant_expr = |expr: &ExprInfo>| { match expr { ExprInfo::ConstPtr(op) if !view.sections_at(op.value()).is_empty() => { // Constant Pointer must be in a section for it to be relocatable. @@ -140,8 +140,8 @@ pub fn basic_block_guid Ref { - view.get_tag_type(TAG_NAME) + view.tag_type_by_name(TAG_NAME) .unwrap_or_else(|| view.create_tag_type(TAG_NAME, TAG_ICON)) } diff --git a/rust/examples/hlil.rs b/rust/examples/hlil.rs index ae06014b3..dbdc7540e 100644 --- a/rust/examples/hlil.rs +++ b/rust/examples/hlil.rs @@ -57,7 +57,7 @@ mod visitor { } fn print_variable(func: &HighLevelILFunction, var: &Variable) { - print!("{}", func.get_function().get_variable_name(var)); + print!("{}", func.function().variable_name(var)); } pub(crate) fn print_il_expr(instr: &HighLevelILLiftedInstruction, mut indent: usize) { diff --git a/rust/examples/mlil.rs b/rust/examples/mlil.rs index 7b9a83843..d4520abbe 100644 --- a/rust/examples/mlil.rs +++ b/rust/examples/mlil.rs @@ -58,7 +58,7 @@ mod visitor { } fn print_variable(func: &MediumLevelILFunction, var: &Variable) { - print!("{}", func.get_function().get_variable_name(var)); + print!("{}", func.function().variable_name(var)); } pub(crate) fn print_il_expr(instr: &MediumLevelILLiftedInstruction, mut indent: usize) { diff --git a/rust/examples/workflow.rs b/rust/examples/workflow.rs index a7695a095..84e6eab36 100644 --- a/rust/examples/workflow.rs +++ b/rust/examples/workflow.rs @@ -1,5 +1,7 @@ use binaryninja::binaryview::BinaryViewExt; -use binaryninja::llil::{ExprInfo, LiftedNonSSA, NonSSA, VisitorAction}; +use binaryninja::llil::{ + ExprInfo, ExpressionHandler, InstructionHandler, LiftedNonSSA, NonSSA, VisitorAction, +}; use binaryninja::workflow::{Activity, AnalysisContext, Workflow}; const RUST_ACTIVITY_NAME: &str = "analysis.plugins.rustexample"; @@ -26,8 +28,8 @@ fn example_activity(analysis_context: &AnalysisContext) { for basic_block in &func.basic_blocks() { for instr in basic_block.iter() { if let Some(llil_instr) = llil.instruction_at(instr) { - llil_instr.visit_tree(&mut |expr, info| { - if let ExprInfo::Const(_op) = info { + llil_instr.visit_tree(&mut |expr| { + if let ExprInfo::Const(_op) = expr.info() { // Replace all consts with 0x1337. println!("Replacing llil expression @ 0x{:x} : {}", instr, expr.index); unsafe { @@ -68,8 +70,8 @@ pub fn main() { if let Ok(llil) = func.low_level_il() { for block in &llil.basic_blocks() { for instr in block.iter() { - instr.visit_tree(&mut |_expr, expr_info| { - if let ExprInfo::Const(value) = expr_info { + instr.visit_tree(&mut |expr| { + if let ExprInfo::Const(value) = expr.info() { if value.value() == 0x1337 { println!( "Found constant 0x1337 at instruction 0x{:x} in function {}", diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index 08df3d70c..9a3648894 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -321,7 +321,7 @@ pub trait RegisterStack: Sized + Clone + Copy { fn id(&self) -> RegisterStackId; } -pub trait Flag: Sized + Clone + Copy + Hash + Eq { +pub trait Flag: Debug + Sized + Clone + Copy + Hash + Eq { type FlagClass: FlagClass; fn name(&self) -> Cow; @@ -359,7 +359,7 @@ pub trait FlagClass: Sized + Clone + Copy + Hash + Eq { fn id(&self) -> FlagClassId; } -pub trait FlagGroup: Sized + Clone + Copy { +pub trait FlagGroup: Debug + Sized + Clone + Copy { type FlagType: Flag; type FlagClass: FlagClass; @@ -397,7 +397,7 @@ pub trait FlagGroup: Sized + Clone + Copy { fn flag_conditions(&self) -> HashMap; } -pub trait Intrinsic: Sized + Clone + Copy { +pub trait Intrinsic: Debug + Sized + Clone + Copy { fn name(&self) -> Cow; /// Unique identifier for this `Intrinsic`. @@ -677,7 +677,7 @@ impl RegisterStack for UnusedRegisterStack { } /// Type for architrectures that do not use flags. Will panic if accessed as a flag. -#[derive(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct UnusedFlag; impl Flag for UnusedFlag { diff --git a/rust/src/backgroundtask.rs b/rust/src/backgroundtask.rs index e5fa6e77a..5c9a68515 100644 --- a/rust/src/backgroundtask.rs +++ b/rust/src/backgroundtask.rs @@ -59,7 +59,7 @@ impl BackgroundTask { unsafe { BNIsBackgroundTaskFinished(self.handle) } } - pub fn get_progress_text(&self) -> BnString { + pub fn progress_text(&self) -> BnString { unsafe { BnString::from_raw(BNGetBackgroundTaskProgressText(self.handle)) } } @@ -83,7 +83,6 @@ impl BackgroundTask { unsafe { let mut count = 0; let handles = BNGetRunningBackgroundTasks(&mut count); - Array::new(handles, count, ()) } } diff --git a/rust/src/binaryview.rs b/rust/src/binaryview.rs index 3e354221d..78cc62d25 100644 --- a/rust/src/binaryview.rs +++ b/rust/src/binaryview.rs @@ -23,9 +23,6 @@ use binaryninjacore_sys::*; -pub use binaryninjacore_sys::BNAnalysisState as AnalysisState; -pub use binaryninjacore_sys::BNModificationStatus as ModificationStatus; - use crate::architecture::{Architecture, CoreArchitecture}; use crate::basicblock::BasicBlock; use crate::component::{Component, ComponentBuilder, IntoComponentGuid}; @@ -60,10 +57,13 @@ use std::ffi::{c_char, c_void}; use std::ops::Range; use std::path::Path; use std::ptr::NonNull; -use std::{ops, result, slice}; +use std::{result, slice}; // TODO : general reorg of modules related to bv pub type Result = result::Result; +pub type BinaryViewEventType = BNBinaryViewEventType; +pub type AnalysisState = BNAnalysisState; +pub type ModificationStatus = BNModificationStatus; #[allow(clippy::len_without_is_empty)] pub trait BinaryViewBase: AsRef { @@ -208,7 +208,7 @@ pub trait BinaryViewExt: BinaryViewBase { } fn raw_view(&self) -> Option> { - self.file().get_view_of_type("Raw") + self.file().view_of_type("Raw") } fn view_type(&self) -> BnString { @@ -444,7 +444,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn symbols_in_range(&self, range: ops::Range) -> Array { + fn symbols_in_range(&self, range: Range) -> Array { unsafe { let mut count = 0; let len = range.end.wrapping_sub(range.start); @@ -474,7 +474,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn symbols_of_type_in_range(&self, ty: SymbolType, range: ops::Range) -> Array { + fn symbols_of_type_in_range(&self, ty: SymbolType, range: Range) -> Array { unsafe { let mut count = 0; let len = range.end.wrapping_sub(range.start); @@ -547,7 +547,6 @@ pub trait BinaryViewExt: BinaryViewBase { unsafe { let mut count = 0; let vars = BNGetDataVariables(self.as_ref().handle, &mut count); - Array::new(vars, count, ()) } } @@ -746,7 +745,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn get_type_by_name>(&self, name: T) -> Option> { + fn type_by_name>(&self, name: T) -> Option> { let mut raw_name = QualifiedName::into_raw(name.into()); unsafe { let type_handle = BNGetAnalysisTypeByName(self.as_ref().handle, &mut raw_name); @@ -758,7 +757,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn get_type_by_ref(&self, ref_: &NamedTypeReference) -> Option> { + fn type_by_ref(&self, ref_: &NamedTypeReference) -> Option> { unsafe { let type_handle = BNGetAnalysisTypeByRef(self.as_ref().handle, ref_.handle); if type_handle.is_null() { @@ -768,7 +767,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn get_type_by_id(&self, id: S) -> Option> { + fn type_by_id(&self, id: S) -> Option> { unsafe { let id_str = id.into_bytes_with_nul(); let type_handle = @@ -780,7 +779,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn get_type_name_by_id(&self, id: S) -> Option { + fn type_name_by_id(&self, id: S) -> Option { unsafe { let id_str = id.into_bytes_with_nul(); let name_handle = @@ -794,7 +793,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn get_type_id>(&self, name: T) -> Option { + fn type_id_by_name>(&self, name: T) -> Option { let mut raw_name = QualifiedName::into_raw(name.into()); unsafe { let id_cstr = BNGetAnalysisTypeId(self.as_ref().handle, &mut raw_name); @@ -1170,9 +1169,8 @@ pub trait BinaryViewExt: BinaryViewBase { } /// Get a tag type by its name. - fn get_tag_type(&self, name: S) -> Option> { + fn tag_type_by_name(&self, name: S) -> Option> { let name = name.into_bytes_with_nul(); - unsafe { let handle = BNGetTagType(self.as_ref().handle, name.as_ref().as_ptr() as *mut _); if handle.is_null() { @@ -1185,7 +1183,7 @@ pub trait BinaryViewExt: BinaryViewBase { /// Get a tag by its id. /// /// Note this does not tell you anything about where it is used. - fn get_tag(&self, id: S) -> Option> { + fn tag_by_id(&self, id: S) -> Option> { let id = id.into_bytes_with_nul(); unsafe { let handle = BNGetTag(self.as_ref().handle, id.as_ref().as_ptr() as *mut _); @@ -1317,7 +1315,7 @@ pub trait BinaryViewExt: BinaryViewBase { } /// Retrieves a list of [CodeReference]s pointing to a given address. - fn get_code_refs(&self, addr: u64) -> Array { + fn code_refs_to_addr(&self, addr: u64) -> Array { unsafe { let mut count = 0; let handle = BNGetCodeReferences(self.as_ref().handle, addr, &mut count); @@ -1325,29 +1323,8 @@ pub trait BinaryViewExt: BinaryViewBase { } } - /// Retrieves a list of addresses pointed to by a given address. - fn get_code_refs_from(&self, addr: u64, func: Option<&Function>) -> Vec { - unsafe { - let mut count = 0; - // TODO: We could have done a [CodeReference] however it seems to be poorly written. - // TODO: It uses manually drop on a ref that only gets dropped in the array, insane behavior. - // TODO: For now just construct it manually. - let mut src = BNReferenceSource { - func: func.map(|f| f.handle).unwrap_or(std::ptr::null_mut()), - arch: func - .map(|f| f.arch().handle) - .unwrap_or(std::ptr::null_mut()), - addr, - }; - let addresses = BNGetCodeReferencesFrom(self.as_ref().handle, &mut src, &mut count); - let res = std::slice::from_raw_parts(addresses, count).to_vec(); - BNFreeAddressList(addresses); - res - } - } - /// Retrieves a list of [CodeReference]s pointing into a given [Range]. - fn get_code_refs_in_range(&self, range: Range) -> Array { + fn code_refs_into_range(&self, range: Range) -> Array { unsafe { let mut count = 0; let handle = BNGetCodeReferencesInRange( @@ -1360,26 +1337,32 @@ pub trait BinaryViewExt: BinaryViewBase { } } - /// Retrieves a list of [DataReference]s pointing to a given address. - fn get_data_refs(&self, addr: u64) -> Array { + /// Retrieves a list of addresses pointed to by a given address. + fn code_refs_from_addr(&self, addr: u64, func: Option<&Function>) -> Vec { unsafe { let mut count = 0; - let handle = BNGetDataReferences(self.as_ref().handle, addr, &mut count); - Array::new(handle, count, ()) + let code_ref = + CodeReference::new(addr, func.map(|f| f.to_owned()), func.map(|f| f.arch())); + let mut raw_code_ref = CodeReference::into_owned_raw(&code_ref); + let addresses = + BNGetCodeReferencesFrom(self.as_ref().handle, &mut raw_code_ref, &mut count); + let res = std::slice::from_raw_parts(addresses, count).to_vec(); + BNFreeAddressList(addresses); + res } } - /// Retrieves a list of [DataReference]s originating from a given address. - fn get_data_refs_from(&self, addr: u64) -> Array { + /// Retrieves a list of [DataReference]s pointing to a given address. + fn data_refs_to_addr(&self, addr: u64) -> Array { unsafe { let mut count = 0; - let handle = BNGetDataReferencesFrom(self.as_ref().handle, addr, &mut count); + let handle = BNGetDataReferences(self.as_ref().handle, addr, &mut count); Array::new(handle, count, ()) } } /// Retrieves a list of [DataReference]s pointing into a given [Range]. - fn get_data_refs_in_range(&self, range: Range) -> Array { + fn data_refs_into_range(&self, range: Range) -> Array { unsafe { let mut count = 0; let handle = BNGetDataReferencesInRange( @@ -1392,8 +1375,17 @@ pub trait BinaryViewExt: BinaryViewBase { } } + /// Retrieves a list of [DataReference]s originating from a given address. + fn data_refs_from_addr(&self, addr: u64) -> Array { + unsafe { + let mut count = 0; + let handle = BNGetDataReferencesFrom(self.as_ref().handle, addr, &mut count); + Array::new(handle, count, ()) + } + } + /// Retrieves a list of [CodeReference]s for locations in code that use a given named type. - fn get_code_refs_for_type>(&self, name: T) -> Array { + fn code_refs_using_type_name>(&self, name: T) -> Array { let mut raw_name = QualifiedName::into_raw(name.into()); unsafe { let mut count = 0; @@ -1404,8 +1396,8 @@ pub trait BinaryViewExt: BinaryViewBase { } } - /// Retrieves a list of [DataReference]s instances of a given named type in data. - fn get_data_refs_for_type>(&self, name: T) -> Array { + /// Retrieves a list of [DataReference]s for locations in data that use a given named type. + fn data_refs_using_type_name>(&self, name: T) -> Array { let mut raw_name = QualifiedName::into_raw(name.into()); unsafe { let mut count = 0; @@ -1416,7 +1408,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn get_relocations_at(&self, addr: u64) -> Array { + fn relocations_at(&self, addr: u64) -> Array { unsafe { let mut count = 0; let handle = BNGetRelocationsAt(self.as_ref().handle, addr, &mut count); @@ -1424,7 +1416,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn get_relocation_ranges(&self) -> Vec> { + fn relocation_ranges(&self) -> Vec> { let ranges = unsafe { let mut count = 0; let reloc_ranges_ptr = BNGetRelocationRanges(self.as_ref().handle, &mut count); @@ -1940,8 +1932,6 @@ pub trait BinaryViewEventHandler: 'static + Sync { fn on_event(&self, binary_view: &BinaryView); } -pub type BinaryViewEventType = BNBinaryViewEventType; - /// Registers an event listener for binary view events. /// /// # Example diff --git a/rust/src/component.rs b/rust/src/component.rs index 02685ab48..668c2036b 100644 --- a/rust/src/component.rs +++ b/rust/src/component.rs @@ -205,7 +205,7 @@ impl Component { /// Get data variables referenced by this component /// /// * `recursive` - Get all DataVariables referenced by this component and subcomponents. - pub fn get_referenced_data_variables(&self, recursive: bool) -> Array { + pub fn referenced_data_variables(&self, recursive: bool) -> Array { let mut count = 0; let result = if recursive { unsafe { BNComponentGetReferencedDataVariablesRecursive(self.as_raw(), &mut count) } @@ -218,7 +218,7 @@ impl Component { /// Get Types referenced by this component /// /// * `recursive` - Get all Types referenced by this component and subcomponents. - pub fn get_referenced_types(&self, recursive: bool) -> Array { + pub fn referenced_types(&self, recursive: bool) -> Array { let mut count = 0; let result = if recursive { unsafe { BNComponentGetReferencedTypesRecursive(self.as_raw(), &mut count) } diff --git a/rust/src/custombinaryview.rs b/rust/src/custombinaryview.rs index b8a11df9f..cffea7471 100644 --- a/rust/src/custombinaryview.rs +++ b/rust/src/custombinaryview.rs @@ -440,7 +440,7 @@ impl<'a, T: CustomBinaryViewType> CustomViewBuilder<'a, T> { let view_name = view_type.name(); - if let Some(bv) = file.get_view_of_type(view_name.as_str()) { + if let Some(bv) = file.view_of_type(view_name.as_str()) { // while it seems to work most of the time, you can get really unlucky // if the a free of the existing view of the same type kicks off while // BNCreateBinaryViewOfType is still running. the freeObject callback diff --git a/rust/src/filemetadata.rs b/rust/src/filemetadata.rs index 45d83bae6..a770c491d 100644 --- a/rust/src/filemetadata.rs +++ b/rust/src/filemetadata.rs @@ -176,7 +176,7 @@ impl FileMetadata { } } - pub fn get_view_of_type(&self, view: S) -> Option> { + pub fn view_of_type(&self, view: S) -> Option> { let view = view.into_bytes_with_nul(); unsafe { @@ -188,7 +188,7 @@ impl FileMetadata { } } - pub fn get_project_file(&self) -> Option { + pub fn project_file(&self) -> Option { unsafe { let res = NonNull::new(BNGetProjectFile(self.handle))?; Some(ProjectFile::from_raw(res)) @@ -204,7 +204,7 @@ impl FileMetadata { let filename_ptr = filename.as_ref().as_ptr() as *mut _; // Databases are created with the root view (Raw). - let Some(raw_view) = self.get_view_of_type("Raw") else { + let Some(raw_view) = self.view_of_type("Raw") else { return false; }; @@ -224,7 +224,7 @@ impl FileMetadata { pub fn save_auto_snapshot(&self) -> bool { // Snapshots are saved with the root view (Raw). - let Some(raw_view) = self.get_view_of_type("Raw") else { + let Some(raw_view) = self.view_of_type("Raw") else { return false; }; diff --git a/rust/src/function.rs b/rust/src/function.rs index 7e480896a..f7a54e6c5 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -418,7 +418,7 @@ impl Function { unsafe { Array::new(lines, count, ()) } } - pub fn get_variable_name(&self, var: &Variable) -> BnString { + pub fn variable_name(&self, var: &Variable) -> BnString { unsafe { let raw_var = BNVariable::from(var); let raw_name = BNGetVariableName(self.handle, &raw_var); @@ -1374,7 +1374,7 @@ impl Function { pub fn function_tags(&self, auto: Option, tag_type: Option<&str>) -> Array { let mut count = 0; - let tag_type = tag_type.map(|tag_type| self.view().get_tag_type(tag_type)); + let tag_type = tag_type.map(|tag_type| self.view().tag_type_by_name(tag_type)); let tags = unsafe { match (tag_type, auto) { @@ -2156,7 +2156,7 @@ impl Function { /// Returns a list of ReferenceSource objects corresponding to the addresses /// in functions which reference this function pub fn caller_sites(&self) -> Array { - self.view().get_code_refs(self.start()) + self.view().code_refs_to_addr(self.start()) } /// Calling convention used by the function diff --git a/rust/src/hlil/function.rs b/rust/src/hlil/function.rs index 66e75be38..b2f7c9885 100644 --- a/rust/src/hlil/function.rs +++ b/rust/src/hlil/function.rs @@ -1,3 +1,4 @@ +use std::fmt::{Debug, Formatter}; use std::hash::{Hash, Hasher}; use binaryninjacore_sys::*; @@ -14,22 +15,6 @@ pub struct HighLevelILFunction { pub(crate) handle: *mut BNHighLevelILFunction, } -unsafe impl Send for HighLevelILFunction {} -unsafe impl Sync for HighLevelILFunction {} - -impl Eq for HighLevelILFunction {} -impl PartialEq for HighLevelILFunction { - fn eq(&self, rhs: &Self) -> bool { - self.get_function().eq(&rhs.get_function()) - } -} - -impl Hash for HighLevelILFunction { - fn hash(&self, state: &mut H) { - self.get_function().hash(state) - } -} - impl HighLevelILFunction { pub(crate) unsafe fn ref_from_raw( handle: *mut BNHighLevelILFunction, @@ -87,7 +72,7 @@ impl HighLevelILFunction { } } - pub fn get_function(&self) -> Ref { + pub fn function(&self) -> Ref { unsafe { let func = BNGetHighLevelILOwnerFunction(self.handle); Function::ref_from_raw(func) @@ -125,7 +110,7 @@ impl HighLevelILFunction { } pub fn set_current_address(&self, address: u64, arch: Option) { - let arch = arch.unwrap_or_else(|| self.get_function().arch()); + let arch = arch.unwrap_or_else(|| self.function().arch()); unsafe { BNHighLevelILSetCurrentAddress(self.handle, arch.handle, address) } } @@ -248,6 +233,31 @@ impl HighLevelILFunction { } } +impl Debug for HighLevelILFunction { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("HighLevelILFunction") + .field("arch", &self.function().arch()) + .field("instruction_count", &self.instruction_count()) + .finish() + } +} + +unsafe impl Send for HighLevelILFunction {} +unsafe impl Sync for HighLevelILFunction {} + +impl Eq for HighLevelILFunction {} +impl PartialEq for HighLevelILFunction { + fn eq(&self, rhs: &Self) -> bool { + self.function().eq(&rhs.function()) + } +} + +impl Hash for HighLevelILFunction { + fn hash(&self, state: &mut H) { + self.function().hash(state) + } +} + impl ToOwned for HighLevelILFunction { type Owned = Ref; @@ -268,9 +278,3 @@ unsafe impl RefCountable for HighLevelILFunction { BNFreeHighLevelILFunction(handle.handle); } } - -impl core::fmt::Debug for HighLevelILFunction { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "", self.handle) - } -} diff --git a/rust/src/hlil/instruction.rs b/rust/src/hlil/instruction.rs index 59c3876b3..4ae493865 100644 --- a/rust/src/hlil/instruction.rs +++ b/rust/src/hlil/instruction.rs @@ -749,7 +749,7 @@ impl HighLevelILInstruction { Import(op) => Lifted::Import(op), ConstData(op) => Lifted::ConstData(LiftedConstData { constant_data: ConstantData::new( - self.function.get_function(), + self.function.function(), RegisterValue { // TODO: Replace with a From for RegisterValueType. // TODO: We might also want to change the type of `op.constant_data_kind` @@ -818,7 +818,7 @@ impl HighLevelILInstruction { }), Intrinsic(op) => Lifted::Intrinsic(LiftedIntrinsic { intrinsic: CoreIntrinsic::new( - self.function.get_function().arch(), + self.function.function().arch(), IntrinsicId(op.intrinsic), ) .expect("Invalid intrinsic"), @@ -826,7 +826,7 @@ impl HighLevelILInstruction { }), IntrinsicSsa(op) => Lifted::IntrinsicSsa(LiftedIntrinsicSsa { intrinsic: CoreIntrinsic::new( - self.function.get_function().arch(), + self.function.function().arch(), IntrinsicId(op.intrinsic), ) .expect("Invalid intrinsic"), @@ -967,7 +967,7 @@ impl HighLevelILInstruction { fn lift_label(&self, op: Label) -> LiftedLabel { LiftedLabel { target: GotoLabel { - function: self.function.get_function(), + function: self.function.function(), target: op.target, }, } diff --git a/rust/src/llil/expression.rs b/rust/src/llil/expression.rs index 7f24641bf..6fab75057 100644 --- a/rust/src/llil/expression.rs +++ b/rust/src/llil/expression.rs @@ -15,22 +15,20 @@ use binaryninjacore_sys::BNGetLowLevelILByIndex; use binaryninjacore_sys::BNLowLevelILInstruction; -use std::fmt; -use std::fmt::{Display, Formatter}; -use std::marker::PhantomData; - use super::operation; use super::operation::Operation; +use super::VisitorAction; use super::*; - use crate::architecture::Architecture; -use crate::architecture::RegisterInfo; +use std::fmt; +use std::fmt::{Display, Formatter}; +use std::marker::PhantomData; -// used as a marker for Expressions that can produce a value +/// Used as a marker for an [`Expression`] that **can** produce a value. #[derive(Copy, Clone, Debug)] pub struct ValueExpr; -// used as a marker for Expressions that can not produce a value +/// Used as a marker for an [`Expression`] that can **not** produce a value. #[derive(Copy, Clone, Debug)] pub struct VoidExpr; @@ -47,6 +45,19 @@ impl Display for ExpressionIndex { } } +pub trait ExpressionHandler<'func, A, M, F> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn info(&self) -> ExprInfo<'func, A, M, F>; + + fn visit_tree(&self, f: &mut T) -> VisitorAction + where + T: FnMut(&Expression<'func, A, M, F, ValueExpr>) -> VisitorAction; +} + pub struct Expression<'func, A, M, F, R> where A: 'func + Architecture, @@ -72,6 +83,7 @@ where function: &'func LowLevelILFunction, index: ExpressionIndex, ) -> Self { + // TODO: Validate expression here? Self { function, index, @@ -80,305 +92,115 @@ where } } -impl<'func, A, M, V> fmt::Debug for Expression<'func, A, M, NonSSA, ValueExpr> +impl<'func, A, M, F, R> fmt::Debug for Expression<'func, A, M, F, R> where A: 'func + Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, + R: ExpressionResultType, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let op_info = self.info(); - write!(f, "", self.index, op_info) + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + f.debug_struct("Expression") + .field("index", &self.index) + .finish() } } -fn common_info<'func, A, M, F>( - function: &'func LowLevelILFunction, - op: BNLowLevelILInstruction, -) -> ExprInfo<'func, A, M, F> +impl<'func, A, M> ExpressionHandler<'func, A, M, SSA> for Expression<'func, A, M, SSA, ValueExpr> where A: 'func + Architecture, M: FunctionMutability, - F: FunctionForm, { - use binaryninjacore_sys::BNLowLevelILOperation::*; - - match op.operation { - LLIL_CONST => ExprInfo::Const(Operation::new(function, op)), - LLIL_CONST_PTR => ExprInfo::ConstPtr(Operation::new(function, op)), - - LLIL_EXTERN_PTR => ExprInfo::ExternPtr(Operation::new(function, op)), - - LLIL_ADD => ExprInfo::Add(Operation::new(function, op)), - LLIL_ADC => ExprInfo::Adc(Operation::new(function, op)), - LLIL_SUB => ExprInfo::Sub(Operation::new(function, op)), - LLIL_SBB => ExprInfo::Sbb(Operation::new(function, op)), - LLIL_AND => ExprInfo::And(Operation::new(function, op)), - LLIL_OR => ExprInfo::Or(Operation::new(function, op)), - LLIL_XOR => ExprInfo::Xor(Operation::new(function, op)), - LLIL_LSL => ExprInfo::Lsl(Operation::new(function, op)), - LLIL_LSR => ExprInfo::Lsr(Operation::new(function, op)), - LLIL_ASR => ExprInfo::Asr(Operation::new(function, op)), - LLIL_ROL => ExprInfo::Rol(Operation::new(function, op)), - LLIL_RLC => ExprInfo::Rlc(Operation::new(function, op)), - LLIL_ROR => ExprInfo::Ror(Operation::new(function, op)), - LLIL_RRC => ExprInfo::Rrc(Operation::new(function, op)), - LLIL_MUL => ExprInfo::Mul(Operation::new(function, op)), - - LLIL_MULU_DP => ExprInfo::MuluDp(Operation::new(function, op)), - LLIL_MULS_DP => ExprInfo::MulsDp(Operation::new(function, op)), - - LLIL_DIVU => ExprInfo::Divu(Operation::new(function, op)), - LLIL_DIVS => ExprInfo::Divs(Operation::new(function, op)), - - LLIL_DIVU_DP => ExprInfo::DivuDp(Operation::new(function, op)), - LLIL_DIVS_DP => ExprInfo::DivsDp(Operation::new(function, op)), - - LLIL_MODU => ExprInfo::Modu(Operation::new(function, op)), - LLIL_MODS => ExprInfo::Mods(Operation::new(function, op)), - - LLIL_MODU_DP => ExprInfo::ModuDp(Operation::new(function, op)), - LLIL_MODS_DP => ExprInfo::ModsDp(Operation::new(function, op)), - - LLIL_NEG => ExprInfo::Neg(Operation::new(function, op)), - LLIL_NOT => ExprInfo::Not(Operation::new(function, op)), - - LLIL_SX => ExprInfo::Sx(Operation::new(function, op)), - LLIL_ZX => ExprInfo::Zx(Operation::new(function, op)), - LLIL_LOW_PART => ExprInfo::LowPart(Operation::new(function, op)), - - LLIL_REG_SPLIT => ExprInfo::RegSplit(Operation::new(function, op)), - - LLIL_CMP_E => ExprInfo::CmpE(Operation::new(function, op)), - LLIL_CMP_NE => ExprInfo::CmpNe(Operation::new(function, op)), - LLIL_CMP_SLT => ExprInfo::CmpSlt(Operation::new(function, op)), - LLIL_CMP_ULT => ExprInfo::CmpUlt(Operation::new(function, op)), - LLIL_CMP_SLE => ExprInfo::CmpSle(Operation::new(function, op)), - LLIL_CMP_ULE => ExprInfo::CmpUle(Operation::new(function, op)), - LLIL_CMP_SGE => ExprInfo::CmpSge(Operation::new(function, op)), - LLIL_CMP_UGE => ExprInfo::CmpUge(Operation::new(function, op)), - LLIL_CMP_SGT => ExprInfo::CmpSgt(Operation::new(function, op)), - LLIL_CMP_UGT => ExprInfo::CmpUgt(Operation::new(function, op)), - - LLIL_BOOL_TO_INT => ExprInfo::BoolToInt(Operation::new(function, op)), - - LLIL_FADD => ExprInfo::Fadd(Operation::new(function, op)), - LLIL_FSUB => ExprInfo::Fsub(Operation::new(function, op)), - LLIL_FMUL => ExprInfo::Fmul(Operation::new(function, op)), - LLIL_FDIV => ExprInfo::Fdiv(Operation::new(function, op)), - - LLIL_FSQRT => ExprInfo::Fsqrt(Operation::new(function, op)), - LLIL_FNEG => ExprInfo::Fneg(Operation::new(function, op)), - LLIL_FABS => ExprInfo::Fabs(Operation::new(function, op)), - LLIL_FLOAT_TO_INT => ExprInfo::FloatToInt(Operation::new(function, op)), - LLIL_INT_TO_FLOAT => ExprInfo::IntToFloat(Operation::new(function, op)), - LLIL_FLOAT_CONV => ExprInfo::FloatConv(Operation::new(function, op)), - LLIL_ROUND_TO_INT => ExprInfo::RoundToInt(Operation::new(function, op)), - LLIL_FLOOR => ExprInfo::Floor(Operation::new(function, op)), - LLIL_CEIL => ExprInfo::Ceil(Operation::new(function, op)), - LLIL_FTRUNC => ExprInfo::Ftrunc(Operation::new(function, op)), - - LLIL_FCMP_E => ExprInfo::FcmpE(Operation::new(function, op)), - LLIL_FCMP_NE => ExprInfo::FcmpNE(Operation::new(function, op)), - LLIL_FCMP_LT => ExprInfo::FcmpLT(Operation::new(function, op)), - LLIL_FCMP_LE => ExprInfo::FcmpLE(Operation::new(function, op)), - LLIL_FCMP_GT => ExprInfo::FcmpGT(Operation::new(function, op)), - LLIL_FCMP_GE => ExprInfo::FcmpGE(Operation::new(function, op)), - LLIL_FCMP_O => ExprInfo::FcmpO(Operation::new(function, op)), - LLIL_FCMP_UO => ExprInfo::FcmpUO(Operation::new(function, op)), - - LLIL_UNIMPL => ExprInfo::Unimpl(Operation::new(function, op)), - LLIL_UNIMPL_MEM => ExprInfo::UnimplMem(Operation::new(function, op)), - - // TODO TEST_BIT ADD_OVERFLOW LLIL_REG_STACK_PUSH LLIL_REG_STACK_POP - _ => { - #[cfg(debug_assertions)] - { - log::error!( - "Got unexpected operation {:?} in value expr at 0x{:x}", - op.operation, - op.address - ); - } - - ExprInfo::Undef(Operation::new(function, op)) + fn info(&self) -> ExprInfo<'func, A, M, SSA> { + #[allow(unused_imports)] + use binaryninjacore_sys::BNLowLevelILOperation::*; + let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, self.index.0) }; + #[allow(clippy::match_single_binding)] + match op.operation { + // Any invalid ops for SSA will be checked here. + // SAFETY: We have checked for illegal operations. + _ => unsafe { ExprInfo::from_raw(self.function, op) }, } } -} -use super::VisitorAction; - -macro_rules! visit { - ($f:expr, $($e:expr),*) => { - if let VisitorAction::Halt = $f($($e,)*) { - return VisitorAction::Halt; + fn visit_tree(&self, f: &mut T) -> VisitorAction + where + T: FnMut(&Expression<'func, A, M, SSA, ValueExpr>) -> VisitorAction, + { + // First visit the current expression. + let info = self.info(); + match f(self) { + VisitorAction::Descend => {} + action => return action, } + // Recursively visit sub expressions. + info.visit_sub_expressions(|e| e.visit_tree(f)) } } -fn common_visit<'func, A, M, F, CB>(info: &ExprInfo<'func, A, M, F>, f: &mut CB) -> VisitorAction -where - A: 'func + Architecture, - M: FunctionMutability, - F: FunctionForm, - CB: FnMut(&Expression<'func, A, M, F, ValueExpr>) -> VisitorAction, -{ - use self::ExprInfo::*; - - match *info { - CmpE(ref op) | CmpNe(ref op) | CmpSlt(ref op) | CmpUlt(ref op) | CmpSle(ref op) - | CmpUle(ref op) | CmpSge(ref op) | CmpUge(ref op) | CmpSgt(ref op) | CmpUgt(ref op) - | FcmpE(ref op) | FcmpNE(ref op) | FcmpLT(ref op) | FcmpLE(ref op) | FcmpGE(ref op) - | FcmpGT(ref op) | FcmpO(ref op) | FcmpUO(ref op) => { - visit!(f, &op.left()); - visit!(f, &op.right()); - } - - Adc(ref op) | Sbb(ref op) | Rlc(ref op) | Rrc(ref op) => { - visit!(f, &op.left()); - visit!(f, &op.right()); - visit!(f, &op.carry()); - } - - Add(ref op) | Sub(ref op) | And(ref op) | Or(ref op) | Xor(ref op) | Lsl(ref op) - | Lsr(ref op) | Asr(ref op) | Rol(ref op) | Ror(ref op) | Mul(ref op) | MulsDp(ref op) - | MuluDp(ref op) | Divu(ref op) | Divs(ref op) | Modu(ref op) | Mods(ref op) - | Fadd(ref op) | Fsub(ref op) | Fmul(ref op) | Fdiv(ref op) => { - visit!(f, &op.left()); - visit!(f, &op.right()); - } - - DivuDp(ref op) | DivsDp(ref op) | ModuDp(ref op) | ModsDp(ref op) => { - visit!(f, &op.high()); - visit!(f, &op.low()); - visit!(f, &op.right()); - } - - Neg(ref op) | Not(ref op) | Sx(ref op) | Zx(ref op) | LowPart(ref op) - | BoolToInt(ref op) | Fsqrt(ref op) | Fneg(ref op) | Fabs(ref op) | FloatToInt(ref op) - | IntToFloat(ref op) | FloatConv(ref op) | RoundToInt(ref op) | Floor(ref op) - | Ceil(ref op) | Ftrunc(ref op) => { - visit!(f, &op.operand()); - } - - UnimplMem(ref op) => { - visit!(f, &op.mem_expr()); - } - - _ => {} - }; - - VisitorAction::Sibling -} - -impl<'func, A, M, V> Expression<'func, A, M, NonSSA, ValueExpr> +impl<'func, A, M> ExpressionHandler<'func, A, M, NonSSA> + for Expression<'func, A, M, NonSSA, ValueExpr> where A: 'func + Architecture, M: FunctionMutability, - V: NonSSAVariant, { - pub(crate) unsafe fn info_from_op( - &self, - op: BNLowLevelILInstruction, - ) -> ExprInfo<'func, A, M, NonSSA> { + fn info(&self) -> ExprInfo<'func, A, M, NonSSA> { + #[allow(unused_imports)] use binaryninjacore_sys::BNLowLevelILOperation::*; - + let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, self.index.0) }; + #[allow(clippy::match_single_binding)] match op.operation { - LLIL_LOAD => ExprInfo::Load(Operation::new(self.function, op)), - LLIL_POP => ExprInfo::Pop(Operation::new(self.function, op)), - LLIL_REG => ExprInfo::Reg(Operation::new(self.function, op)), - LLIL_REG_SPLIT => ExprInfo::RegSplit(Operation::new(self.function, op)), - LLIL_FLAG => ExprInfo::Flag(Operation::new(self.function, op)), - LLIL_FLAG_BIT => ExprInfo::FlagBit(Operation::new(self.function, op)), - LLIL_FLAG_COND => ExprInfo::FlagCond(Operation::new(self.function, op)), // TODO lifted only - LLIL_FLAG_GROUP => ExprInfo::FlagGroup(Operation::new(self.function, op)), // TODO lifted only - _ => common_info(self.function, op), - } - } - - pub fn info(&self) -> ExprInfo<'func, A, M, NonSSA> { - unsafe { - let op = BNGetLowLevelILByIndex(self.function.handle, self.index.0); - self.info_from_op(op) + // Any invalid ops for Lifted IL will be checked here. + // SAFETY: We have checked for illegal operations. + _ => unsafe { ExprInfo::from_raw(self.function, op) }, } } - pub fn visit_tree(&self, f: &mut F) -> VisitorAction + fn visit_tree(&self, f: &mut T) -> VisitorAction where - F: FnMut(&Self, &ExprInfo<'func, A, M, NonSSA>) -> VisitorAction, + T: FnMut(&Expression<'func, A, M, NonSSA, ValueExpr>) -> VisitorAction, { - use self::ExprInfo::*; - + // First visit the current expression. let info = self.info(); - - match f(self, &info) { + match f(self) { VisitorAction::Descend => {} action => return action, - }; - - match info { - Load(ref op) => visit!(Self::visit_tree, &op.source_mem_expr(), f), - _ => { - let mut fb = |e: &Self| e.visit_tree(f); - visit!(common_visit, &info, &mut fb); - } - }; - - VisitorAction::Sibling + } + // Recursively visit sub expressions. + info.visit_sub_expressions(|e| e.visit_tree(f)) } } -impl<'func, A, M> Expression<'func, A, M, SSA, ValueExpr> +impl<'func, A, M> ExpressionHandler<'func, A, M, NonSSA> + for Expression<'func, A, M, NonSSA, ValueExpr> where A: 'func + Architecture, M: FunctionMutability, { - pub(crate) unsafe fn info_from_op( - &self, - op: BNLowLevelILInstruction, - ) -> ExprInfo<'func, A, M, SSA> { + fn info(&self) -> ExprInfo<'func, A, M, NonSSA> { use binaryninjacore_sys::BNLowLevelILOperation::*; - + let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, self.index.0) }; match op.operation { - LLIL_LOAD_SSA => ExprInfo::Load(Operation::new(self.function, op)), - LLIL_REG_SSA | LLIL_REG_SSA_PARTIAL => ExprInfo::Reg(Operation::new(self.function, op)), - LLIL_REG_SPLIT_SSA => ExprInfo::RegSplit(Operation::new(self.function, op)), - LLIL_FLAG_SSA => ExprInfo::Flag(Operation::new(self.function, op)), - LLIL_FLAG_BIT_SSA => ExprInfo::FlagBit(Operation::new(self.function, op)), - _ => common_info(self.function, op), - } - } - - pub fn info(&self) -> ExprInfo<'func, A, M, SSA> { - unsafe { - let op = BNGetLowLevelILByIndex(self.function.handle, self.index.0); - self.info_from_op(op) + // Any invalid ops for Non-Lifted IL will be checked here. + LLIL_FLAG_COND => unreachable!("LLIL_FLAG_COND is only valid in Lifted IL"), + LLIL_FLAG_GROUP => unreachable!("LLIL_FLAG_GROUP is only valid in Lifted IL"), + // SAFETY: We have checked for illegal operations. + _ => unsafe { ExprInfo::from_raw(self.function, op) }, } } - pub fn visit_tree(&self, f: &mut F) -> VisitorAction + fn visit_tree(&self, f: &mut T) -> VisitorAction where - F: FnMut(&Self, &ExprInfo<'func, A, M, SSA>) -> VisitorAction, + T: FnMut(&Expression<'func, A, M, NonSSA, ValueExpr>) -> VisitorAction, { - use self::ExprInfo::*; - + // First visit the current expression. let info = self.info(); - - match f(self, &info) { + match f(self) { VisitorAction::Descend => {} action => return action, - }; - - match info { - // TODO ssa - Load(ref _op) => {} //visit!(Self::visit_tree, &op.source_mem_expr(), f), - _ => { - let mut fb = |e: &Self| e.visit_tree(f); - visit!(common_visit, &info, &mut fb); - } - }; - - VisitorAction::Sibling + } + // Recursively visit sub expressions. + info.visit_sub_expressions(|e| e.visit_tree(f)) } } @@ -390,6 +212,7 @@ where // TODO possible values } +#[derive(Debug)] pub enum ExprInfo<'func, A, M, F> where A: 'func + Architecture, @@ -443,8 +266,10 @@ where Zx(Operation<'func, A, M, F, operation::UnaryOp>), LowPart(Operation<'func, A, M, F, operation::UnaryOp>), - FlagCond(Operation<'func, A, M, F, operation::FlagCond>), - FlagGroup(Operation<'func, A, M, F, operation::FlagGroup>), + // Valid only in Lifted IL + FlagCond(Operation<'func, A, M, NonSSA, operation::FlagCond>), + // Valid only in Lifted IL + FlagGroup(Operation<'func, A, M, NonSSA, operation::FlagGroup>), CmpE(Operation<'func, A, M, F, operation::Condition>), CmpNe(Operation<'func, A, M, F, operation::Condition>), @@ -497,6 +322,119 @@ where M: FunctionMutability, F: FunctionForm, { + // TODO: Document what "unchecked" means and how to consume this safely. + pub(crate) unsafe fn from_raw( + function: &'func LowLevelILFunction, + op: BNLowLevelILInstruction, + ) -> Self { + use binaryninjacore_sys::BNLowLevelILOperation::*; + + match op.operation { + LLIL_LOAD | LLIL_LOAD_SSA => ExprInfo::Load(Operation::new(function, op)), + LLIL_POP => ExprInfo::Pop(Operation::new(function, op)), + LLIL_REG | LLIL_REG_SSA | LLIL_REG_SSA_PARTIAL => { + ExprInfo::Reg(Operation::new(function, op)) + } + LLIL_REG_SPLIT | LLIL_REG_SPLIT_SSA => ExprInfo::RegSplit(Operation::new(function, op)), + LLIL_CONST => ExprInfo::Const(Operation::new(function, op)), + LLIL_CONST_PTR => ExprInfo::ConstPtr(Operation::new(function, op)), + LLIL_FLAG | LLIL_FLAG_SSA => ExprInfo::Flag(Operation::new(function, op)), + LLIL_FLAG_BIT | LLIL_FLAG_BIT_SSA => ExprInfo::FlagBit(Operation::new(function, op)), + LLIL_EXTERN_PTR => ExprInfo::ExternPtr(Operation::new(function, op)), + + LLIL_ADD => ExprInfo::Add(Operation::new(function, op)), + LLIL_ADC => ExprInfo::Adc(Operation::new(function, op)), + LLIL_SUB => ExprInfo::Sub(Operation::new(function, op)), + LLIL_SBB => ExprInfo::Sbb(Operation::new(function, op)), + LLIL_AND => ExprInfo::And(Operation::new(function, op)), + LLIL_OR => ExprInfo::Or(Operation::new(function, op)), + LLIL_XOR => ExprInfo::Xor(Operation::new(function, op)), + LLIL_LSL => ExprInfo::Lsl(Operation::new(function, op)), + LLIL_LSR => ExprInfo::Lsr(Operation::new(function, op)), + LLIL_ASR => ExprInfo::Asr(Operation::new(function, op)), + LLIL_ROL => ExprInfo::Rol(Operation::new(function, op)), + LLIL_RLC => ExprInfo::Rlc(Operation::new(function, op)), + LLIL_ROR => ExprInfo::Ror(Operation::new(function, op)), + LLIL_RRC => ExprInfo::Rrc(Operation::new(function, op)), + LLIL_MUL => ExprInfo::Mul(Operation::new(function, op)), + + LLIL_MULU_DP => ExprInfo::MuluDp(Operation::new(function, op)), + LLIL_MULS_DP => ExprInfo::MulsDp(Operation::new(function, op)), + + LLIL_DIVU => ExprInfo::Divu(Operation::new(function, op)), + LLIL_DIVS => ExprInfo::Divs(Operation::new(function, op)), + + LLIL_DIVU_DP => ExprInfo::DivuDp(Operation::new(function, op)), + LLIL_DIVS_DP => ExprInfo::DivsDp(Operation::new(function, op)), + + LLIL_MODU => ExprInfo::Modu(Operation::new(function, op)), + LLIL_MODS => ExprInfo::Mods(Operation::new(function, op)), + + LLIL_MODU_DP => ExprInfo::ModuDp(Operation::new(function, op)), + LLIL_MODS_DP => ExprInfo::ModsDp(Operation::new(function, op)), + + LLIL_NEG => ExprInfo::Neg(Operation::new(function, op)), + LLIL_NOT => ExprInfo::Not(Operation::new(function, op)), + + LLIL_SX => ExprInfo::Sx(Operation::new(function, op)), + LLIL_ZX => ExprInfo::Zx(Operation::new(function, op)), + LLIL_LOW_PART => ExprInfo::LowPart(Operation::new(function, op)), + + LLIL_CMP_E => ExprInfo::CmpE(Operation::new(function, op)), + LLIL_CMP_NE => ExprInfo::CmpNe(Operation::new(function, op)), + LLIL_CMP_SLT => ExprInfo::CmpSlt(Operation::new(function, op)), + LLIL_CMP_ULT => ExprInfo::CmpUlt(Operation::new(function, op)), + LLIL_CMP_SLE => ExprInfo::CmpSle(Operation::new(function, op)), + LLIL_CMP_ULE => ExprInfo::CmpUle(Operation::new(function, op)), + LLIL_CMP_SGE => ExprInfo::CmpSge(Operation::new(function, op)), + LLIL_CMP_UGE => ExprInfo::CmpUge(Operation::new(function, op)), + LLIL_CMP_SGT => ExprInfo::CmpSgt(Operation::new(function, op)), + LLIL_CMP_UGT => ExprInfo::CmpUgt(Operation::new(function, op)), + + LLIL_BOOL_TO_INT => ExprInfo::BoolToInt(Operation::new(function, op)), + + LLIL_FADD => ExprInfo::Fadd(Operation::new(function, op)), + LLIL_FSUB => ExprInfo::Fsub(Operation::new(function, op)), + LLIL_FMUL => ExprInfo::Fmul(Operation::new(function, op)), + LLIL_FDIV => ExprInfo::Fdiv(Operation::new(function, op)), + + LLIL_FSQRT => ExprInfo::Fsqrt(Operation::new(function, op)), + LLIL_FNEG => ExprInfo::Fneg(Operation::new(function, op)), + LLIL_FABS => ExprInfo::Fabs(Operation::new(function, op)), + LLIL_FLOAT_TO_INT => ExprInfo::FloatToInt(Operation::new(function, op)), + LLIL_INT_TO_FLOAT => ExprInfo::IntToFloat(Operation::new(function, op)), + LLIL_FLOAT_CONV => ExprInfo::FloatConv(Operation::new(function, op)), + LLIL_ROUND_TO_INT => ExprInfo::RoundToInt(Operation::new(function, op)), + LLIL_FLOOR => ExprInfo::Floor(Operation::new(function, op)), + LLIL_CEIL => ExprInfo::Ceil(Operation::new(function, op)), + LLIL_FTRUNC => ExprInfo::Ftrunc(Operation::new(function, op)), + + LLIL_FCMP_E => ExprInfo::FcmpE(Operation::new(function, op)), + LLIL_FCMP_NE => ExprInfo::FcmpNE(Operation::new(function, op)), + LLIL_FCMP_LT => ExprInfo::FcmpLT(Operation::new(function, op)), + LLIL_FCMP_LE => ExprInfo::FcmpLE(Operation::new(function, op)), + LLIL_FCMP_GT => ExprInfo::FcmpGT(Operation::new(function, op)), + LLIL_FCMP_GE => ExprInfo::FcmpGE(Operation::new(function, op)), + LLIL_FCMP_O => ExprInfo::FcmpO(Operation::new(function, op)), + LLIL_FCMP_UO => ExprInfo::FcmpUO(Operation::new(function, op)), + + LLIL_UNIMPL => ExprInfo::Unimpl(Operation::new(function, op)), + LLIL_UNIMPL_MEM => ExprInfo::UnimplMem(Operation::new(function, op)), + + // TODO TEST_BIT ADD_OVERFLOW LLIL_REG_STACK_PUSH LLIL_REG_STACK_POP + _ => { + #[cfg(debug_assertions)] + log::error!( + "Got unexpected operation {:?} in value expr at 0x{:x}", + op.operation, + op.address + ); + + ExprInfo::Undef(Operation::new(function, op)) + } + } + } + /// Returns the size of the result of this expression /// /// If the expression is malformed or is `Unimpl` there @@ -591,6 +529,60 @@ where } } + pub fn visit_sub_expressions(&self, mut visitor: T) -> VisitorAction + where + T: FnMut(Expression<'func, A, M, F, ValueExpr>) -> VisitorAction, + { + use ExprInfo::*; + + macro_rules! visit { + ($expr:expr) => { + if let VisitorAction::Halt = visitor($expr) { + return VisitorAction::Halt; + } + }; + } + + match self { + CmpE(ref op) | CmpNe(ref op) | CmpSlt(ref op) | CmpUlt(ref op) | CmpSle(ref op) + | CmpUle(ref op) | CmpSge(ref op) | CmpUge(ref op) | CmpSgt(ref op) + | CmpUgt(ref op) | FcmpE(ref op) | FcmpNE(ref op) | FcmpLT(ref op) | FcmpLE(ref op) + | FcmpGE(ref op) | FcmpGT(ref op) | FcmpO(ref op) | FcmpUO(ref op) => { + visit!(op.left()); + visit!(op.right()); + } + Adc(ref op) | Sbb(ref op) | Rlc(ref op) | Rrc(ref op) => { + visit!(op.left()); + visit!(op.right()); + visit!(op.carry()); + } + Add(ref op) | Sub(ref op) | And(ref op) | Or(ref op) | Xor(ref op) | Lsl(ref op) + | Lsr(ref op) | Asr(ref op) | Rol(ref op) | Ror(ref op) | Mul(ref op) + | MulsDp(ref op) | MuluDp(ref op) | Divu(ref op) | Divs(ref op) | Modu(ref op) + | Mods(ref op) | Fadd(ref op) | Fsub(ref op) | Fmul(ref op) | Fdiv(ref op) => { + visit!(op.left()); + visit!(op.right()); + } + DivuDp(ref op) | DivsDp(ref op) | ModuDp(ref op) | ModsDp(ref op) => { + visit!(op.high()); + visit!(op.low()); + visit!(op.right()); + } + Neg(ref op) | Not(ref op) | Sx(ref op) | Zx(ref op) | LowPart(ref op) + | BoolToInt(ref op) | Fsqrt(ref op) | Fneg(ref op) | Fabs(ref op) + | FloatToInt(ref op) | IntToFloat(ref op) | FloatConv(ref op) | RoundToInt(ref op) + | Floor(ref op) | Ceil(ref op) | Ftrunc(ref op) => { + visit!(op.operand()); + } + UnimplMem(ref op) => { + visit!(op.mem_expr()); + } + _ => {} + } + + VisitorAction::Sibling + } + pub(crate) fn raw_struct(&self) -> &BNLowLevelILInstruction { use self::ExprInfo::*; @@ -701,161 +693,3 @@ where } } } - -impl<'func, A, M, V> fmt::Debug for ExprInfo<'func, A, M, NonSSA> -where - A: 'func + Architecture, - M: FunctionMutability, - V: NonSSAVariant, -{ - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use self::ExprInfo::*; - - match *self { - Undef(..) => f.write_str("undefined"), - - Unimpl(..) => f.write_str("unimplemented"), - - FlagCond(..) => f.write_str("some_flag_cond"), - FlagGroup(..) => f.write_str("some_flag_group"), - - CmpE(ref op) | CmpNe(ref op) | CmpSlt(ref op) | CmpUlt(ref op) | CmpSle(ref op) - | CmpUle(ref op) | CmpSge(ref op) | CmpUge(ref op) | CmpSgt(ref op) - | CmpUgt(ref op) | FcmpE(ref op) | FcmpNE(ref op) | FcmpLT(ref op) | FcmpLE(ref op) - | FcmpGE(ref op) | FcmpGT(ref op) | FcmpO(ref op) | FcmpUO(ref op) => { - let left = op.left(); - let right = op.right(); - - write!( - f, - "{:?}({}, {:?}, {:?})", - op.op.operation, - op.size(), - left, - right - ) - } - - Load(ref op) => { - let source = op.source_mem_expr(); - let size = op.size(); - - write!(f, "[{:?}].{}", source, size) - } - - Pop(ref op) => write!(f, "pop.{}", op.size()), - - Reg(ref op) => { - let reg = op.source_reg(); - let size = op.size(); - - let size = match reg { - Register::Temp(_) => Some(size), - Register::ArchReg(ref r) if r.info().size() != size => Some(size), - _ => None, - }; - - match size { - Some(s) => write!(f, "{:?}.{}", reg, s), - _ => write!(f, "{:?}", reg), - } - } - - RegSplit(ref op) => { - let low_reg = op.low_reg(); - let high_reg = op.high_reg(); - let size = op.size(); - - let low_size = match low_reg { - Register::Temp(_) => Some(size), - Register::ArchReg(ref r) if r.info().size() != size => Some(size), - _ => None, - }; - - let high_size = match high_reg { - Register::Temp(_) => Some(size), - Register::ArchReg(ref r) if r.info().size() != size => Some(size), - _ => None, - }; - - match (low_size, high_size) { - (Some(ls), Some(hs)) => write!(f, "{:?}.{}:{:?}.{}", high_reg, hs, low_reg, ls), - (Some(ls), None) => write!(f, "{:?}:{:?}.{}", high_reg, low_reg, ls), - (None, Some(hs)) => write!(f, "{:?}.{}:{:?}", high_reg, hs, low_reg), - _ => write!(f, "{:?}:{:?}", high_reg, low_reg), - } - } - - Flag(ref _op) => write!(f, "flag"), // TODO - - FlagBit(ref _op) => write!(f, "flag_bit"), // TODO - - Const(ref op) | ConstPtr(ref op) => write!(f, "0x{:x}", op.value()), - - ExternPtr(ref op) => write!(f, "0x{:x}", op.value()), - - Adc(ref op) | Sbb(ref op) | Rlc(ref op) | Rrc(ref op) => { - let left = op.left(); - let right = op.right(); - let carry = op.carry(); - - write!( - f, - "{:?}({}, {:?}, {:?}, carry: {:?})", - op.op.operation, - op.size(), - left, - right, - carry - ) - } - - Add(ref op) | Sub(ref op) | And(ref op) | Or(ref op) | Xor(ref op) | Lsl(ref op) - | Lsr(ref op) | Asr(ref op) | Rol(ref op) | Ror(ref op) | Mul(ref op) - | MulsDp(ref op) | MuluDp(ref op) | Divu(ref op) | Divs(ref op) | Modu(ref op) - | Mods(ref op) | Fadd(ref op) | Fsub(ref op) | Fmul(ref op) | Fdiv(ref op) => { - let left = op.left(); - let right = op.right(); - - write!( - f, - "{:?}({}, {:?}, {:?})", - op.op.operation, - op.size(), - left, - right - ) - } - - DivuDp(ref op) | DivsDp(ref op) | ModuDp(ref op) | ModsDp(ref op) => { - let high = op.high(); - let low = op.low(); - let right = op.right(); - - write!( - f, - "{:?}({}, {:?}:{:?},{:?})", - op.op.operation, - op.size(), - high, - low, - right - ) - } - - Neg(ref op) | Not(ref op) | Sx(ref op) | Zx(ref op) | LowPart(ref op) - | BoolToInt(ref op) | Fsqrt(ref op) | Fneg(ref op) | Fabs(ref op) - | FloatToInt(ref op) | IntToFloat(ref op) | FloatConv(ref op) | RoundToInt(ref op) - | Floor(ref op) | Ceil(ref op) | Ftrunc(ref op) => write!( - f, - "{:?}({}, {:?})", - op.op.operation, - op.size(), - op.operand() - ), - - UnimplMem(ref op) => write!(f, "unimplemented_mem({:?})", op.mem_expr()), - //TestBit(Operation<'func, A, M, F, operation::TestBit>), // TODO - } - } -} diff --git a/rust/src/llil/function.rs b/rust/src/llil/function.rs index cdb8744fe..013c54065 100644 --- a/rust/src/llil/function.rs +++ b/rust/src/llil/function.rs @@ -127,7 +127,7 @@ where } } - pub fn get_function(&self) -> Ref { + pub fn function(&self) -> Ref { unsafe { let func = BNGetLowLevelILOwnerFunction(self.handle); Function::ref_from_raw(func) @@ -240,12 +240,12 @@ impl PartialEq for LowLevelILFunction { fn eq(&self, rhs: &Self) -> bool { - self.get_function().eq(&rhs.get_function()) + self.function().eq(&rhs.function()) } } impl Hash for LowLevelILFunction { fn hash(&self, state: &mut H) { - self.get_function().hash(state) + self.function().hash(state) } } diff --git a/rust/src/llil/instruction.rs b/rust/src/llil/instruction.rs index 4017eae6e..07f3cdc43 100644 --- a/rust/src/llil/instruction.rs +++ b/rust/src/llil/instruction.rs @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -use binaryninjacore_sys::BNGetLowLevelILByIndex; -use binaryninjacore_sys::BNGetLowLevelILIndexForInstruction; -use binaryninjacore_sys::BNLowLevelILInstruction; -use std::fmt::{Display, Formatter}; - use super::operation; use super::operation::Operation; use super::*; - use crate::architecture::Architecture; +use binaryninjacore_sys::BNGetLowLevelILByIndex; +use binaryninjacore_sys::BNGetLowLevelILIndexForInstruction; +use binaryninjacore_sys::BNLowLevelILInstruction; +use std::fmt::{Debug, Display, Formatter}; + +use super::VisitorAction; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct InstructionIndex(pub usize); @@ -38,6 +38,22 @@ impl Display for InstructionIndex { } } +pub trait InstructionHandler<'func, A, M, F> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn info(&self) -> InstrInfo<'func, A, M, F>; + + /// Visit the sub expressions of this instruction. + /// + /// NOTE: This does not visit the root expression, i.e. the instruction. + fn visit_tree(&self, f: &mut T) -> VisitorAction + where + T: FnMut(&Expression<'func, A, M, F, ValueExpr>) -> VisitorAction; +} + pub struct Instruction<'func, A, M, F> where A: 'func + Architecture, @@ -59,144 +75,106 @@ where pub fn new(function: &'func LowLevelILFunction, index: InstructionIndex) -> Self { Self { function, index } } + + pub fn address(&self) -> u64 { + let expr_idx = + unsafe { BNGetLowLevelILIndexForInstruction(self.function.handle, self.index.0) }; + let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, expr_idx) }; + op.address + } } -fn common_info<'func, A, M, F>( - function: &'func LowLevelILFunction, - op: BNLowLevelILInstruction, -) -> Option> +impl<'func, A, M, F> Debug for Instruction<'func, A, M, F> where A: 'func + Architecture, M: FunctionMutability, F: FunctionForm, { - use binaryninjacore_sys::BNLowLevelILOperation::*; - - match op.operation { - LLIL_NOP => InstrInfo::Nop(Operation::new(function, op)).into(), - LLIL_JUMP => InstrInfo::Jump(Operation::new(function, op)).into(), - LLIL_JUMP_TO => InstrInfo::JumpTo(Operation::new(function, op)).into(), - LLIL_RET => InstrInfo::Ret(Operation::new(function, op)).into(), - LLIL_NORET => InstrInfo::NoRet(Operation::new(function, op)).into(), - LLIL_IF => InstrInfo::If(Operation::new(function, op)).into(), - LLIL_GOTO => InstrInfo::Goto(Operation::new(function, op)).into(), - LLIL_BP => InstrInfo::Bp(Operation::new(function, op)).into(), - LLIL_TRAP => InstrInfo::Trap(Operation::new(function, op)).into(), - LLIL_UNDEF => InstrInfo::Undef(Operation::new(function, op)).into(), - _ => None, + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Instruction") + .field("index", &self.index) + .field("address", &self.address()) + .finish() } } -use super::VisitorAction; - -macro_rules! visit { - ($f:expr, $($e:expr),*) => { - if let VisitorAction::Halt = $f($($e,)*) { - return VisitorAction::Halt; +impl<'func, A, M> InstructionHandler<'func, A, M, SSA> for Instruction<'func, A, M, SSA> +where + A: 'func + Architecture, + M: FunctionMutability, +{ + fn info(&self) -> InstrInfo<'func, A, M, SSA> { + #[allow(unused_imports)] + use binaryninjacore_sys::BNLowLevelILOperation::*; + let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, self.index.0) }; + #[allow(clippy::match_single_binding)] + match op.operation { + // Any invalid ops for Non-Lifted IL will be checked here. + // SAFETY: We have checked for illegal operations. + _ => unsafe { InstrInfo::from_raw(self.function, self.index, op) }, } } + + fn visit_tree(&self, f: &mut T) -> VisitorAction + where + T: FnMut(&Expression<'func, A, M, SSA, ValueExpr>) -> VisitorAction, + { + // Recursively visit sub expressions. + self.info().visit_sub_expressions(|e| e.visit_tree(f)) + } } -fn common_visit<'func, A, M, F, CB>(info: &InstrInfo<'func, A, M, F>, f: &mut CB) -> VisitorAction +impl<'func, A, M> InstructionHandler<'func, A, M, NonSSA> + for Instruction<'func, A, M, NonSSA> where A: 'func + Architecture, M: FunctionMutability, - F: FunctionForm, - CB: FnMut(&Expression<'func, A, M, F, ValueExpr>) -> VisitorAction, { - use self::InstrInfo::*; - - match *info { - Jump(ref op) => visit!(f, &op.target()), - JumpTo(ref op) => visit!(f, &op.target()), - Ret(ref op) => visit!(f, &op.target()), - If(ref op) => visit!(f, &op.condition()), - Value(ref e, _) => visit!(f, e), - _ => {} - }; - - VisitorAction::Sibling + fn info(&self) -> InstrInfo<'func, A, M, NonSSA> { + #[allow(unused_imports)] + use binaryninjacore_sys::BNLowLevelILOperation::*; + let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, self.index.0) }; + #[allow(clippy::match_single_binding)] + match op.operation { + // Any invalid ops for Non-Lifted IL will be checked here. + // SAFETY: We have checked for illegal operations. + _ => unsafe { InstrInfo::from_raw(self.function, self.index, op) }, + } + } + + fn visit_tree(&self, f: &mut T) -> VisitorAction + where + T: FnMut(&Expression<'func, A, M, NonSSA, ValueExpr>) -> VisitorAction, + { + // Recursively visit sub expressions. + self.info().visit_sub_expressions(|e| e.visit_tree(f)) + } } -impl<'func, A, M, V> Instruction<'func, A, M, NonSSA> +impl<'func, A, M> InstructionHandler<'func, A, M, NonSSA> + for Instruction<'func, A, M, NonSSA> where A: 'func + Architecture, M: FunctionMutability, - V: NonSSAVariant, { - pub fn address(&self) -> u64 { - let expr_idx = - unsafe { BNGetLowLevelILIndexForInstruction(self.function.handle, self.index.0) }; - let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, expr_idx) }; - op.address - } - - pub fn info(&self) -> InstrInfo<'func, A, M, NonSSA> { + fn info(&self) -> InstrInfo<'func, A, M, NonSSA> { + #[allow(unused_imports)] use binaryninjacore_sys::BNLowLevelILOperation::*; - - let expr_idx = - unsafe { BNGetLowLevelILIndexForInstruction(self.function.handle, self.index.0) }; - let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, expr_idx) }; - + let op = unsafe { BNGetLowLevelILByIndex(self.function.handle, self.index.0) }; + #[allow(clippy::match_single_binding)] match op.operation { - LLIL_SET_REG => InstrInfo::SetReg(Operation::new(self.function, op)), - LLIL_SET_REG_SPLIT => InstrInfo::SetRegSplit(Operation::new(self.function, op)), - LLIL_SET_FLAG => InstrInfo::SetFlag(Operation::new(self.function, op)), - LLIL_STORE => InstrInfo::Store(Operation::new(self.function, op)), - LLIL_PUSH => InstrInfo::Push(Operation::new(self.function, op)), - LLIL_CALL | LLIL_CALL_STACK_ADJUST => { - InstrInfo::Call(Operation::new(self.function, op)) - } - LLIL_TAILCALL => InstrInfo::TailCall(Operation::new(self.function, op)), - LLIL_SYSCALL => InstrInfo::Syscall(Operation::new(self.function, op)), - LLIL_INTRINSIC => InstrInfo::Intrinsic(Operation::new(self.function, op)), - _ => { - common_info(self.function, op).unwrap_or_else(|| { - // Hopefully this is a bare value. If it isn't (expression - // from wrong function form or similar) it won't really cause - // any problems as it'll come back as undefined when queried. - let expr = Expression::new(self.function, ExpressionIndex(expr_idx)); - - let info = unsafe { expr.info_from_op(op) }; - - InstrInfo::Value(expr, info) - }) - } + // Any invalid ops for Non-Lifted IL will be checked here. + // SAFETY: We have checked for illegal operations. + _ => unsafe { InstrInfo::from_raw(self.function, self.index, op) }, } } - pub fn visit_tree(&self, f: &mut F) -> VisitorAction + fn visit_tree(&self, f: &mut T) -> VisitorAction where - F: FnMut( - &Expression<'func, A, M, NonSSA, ValueExpr>, - &ExprInfo<'func, A, M, NonSSA>, - ) -> VisitorAction, + T: FnMut(&Expression<'func, A, M, NonSSA, ValueExpr>) -> VisitorAction, { - use self::InstrInfo::*; - let info = self.info(); - - let fb = &mut |e: &Expression<'func, A, M, NonSSA, ValueExpr>| e.visit_tree(f); - - match info { - SetReg(ref op) => visit!(fb, &op.source_expr()), - SetRegSplit(ref op) => visit!(fb, &op.source_expr()), - SetFlag(ref op) => visit!(fb, &op.source_expr()), - Store(ref op) => { - visit!(fb, &op.dest_mem_expr()); - visit!(fb, &op.source_expr()); - } - Push(ref op) => visit!(fb, &op.operand()), - Call(ref op) | TailCall(ref op) => visit!(fb, &op.target()), - Intrinsic(ref _op) => { - // TODO: Use this when we support expression lists - // for expr in op.source_exprs() { - // visit!(fb, expr); - // } - } - _ => visit!(common_visit, &info, fb), - } - - VisitorAction::Sibling + // Recursively visit sub expressions. + self.info().visit_sub_expressions(|e| e.visit_tree(f)) } } @@ -211,7 +189,8 @@ where SetRegSplit(Operation<'func, A, M, F, operation::SetRegSplit>), SetFlag(Operation<'func, A, M, F, operation::SetFlag>), Store(Operation<'func, A, M, F, operation::Store>), - Push(Operation<'func, A, M, F, operation::UnaryOp>), // TODO needs a real op + // TODO needs a real op + Push(Operation<'func, A, M, F, operation::UnaryOp>), Jump(Operation<'func, A, M, F, operation::Jump>), JumpTo(Operation<'func, A, M, F, operation::JumpTo>), @@ -231,8 +210,95 @@ where Trap(Operation<'func, A, M, F, operation::Trap>), Undef(Operation<'func, A, M, F, operation::NoArgs>), - Value( - Expression<'func, A, M, F, ValueExpr>, - ExprInfo<'func, A, M, F>, - ), + /// The instruction is an expression. + Value(Expression<'func, A, M, F, ValueExpr>), +} + +impl<'func, A, M, F> InstrInfo<'func, A, M, F> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + pub(crate) unsafe fn from_raw( + function: &'func LowLevelILFunction, + index: InstructionIndex, + op: BNLowLevelILInstruction, + ) -> Self { + use binaryninjacore_sys::BNLowLevelILOperation::*; + + match op.operation { + LLIL_NOP => InstrInfo::Nop(Operation::new(function, op)), + LLIL_SET_REG | LLIL_SET_REG_SSA => InstrInfo::SetReg(Operation::new(function, op)), + LLIL_SET_REG_SPLIT | LLIL_SET_REG_SPLIT_SSA => { + InstrInfo::SetRegSplit(Operation::new(function, op)) + } + LLIL_SET_FLAG | LLIL_SET_FLAG_SSA => InstrInfo::SetFlag(Operation::new(function, op)), + LLIL_STORE | LLIL_STORE_SSA => InstrInfo::Store(Operation::new(function, op)), + LLIL_PUSH => InstrInfo::Push(Operation::new(function, op)), + + LLIL_JUMP => InstrInfo::Jump(Operation::new(function, op)), + LLIL_JUMP_TO => InstrInfo::JumpTo(Operation::new(function, op)), + + LLIL_CALL | LLIL_CALL_STACK_ADJUST | LLIL_CALL_SSA => { + InstrInfo::Call(Operation::new(function, op)) + } + LLIL_TAILCALL | LLIL_TAILCALL_SSA => InstrInfo::TailCall(Operation::new(function, op)), + + LLIL_RET => InstrInfo::Ret(Operation::new(function, op)), + LLIL_NORET => InstrInfo::NoRet(Operation::new(function, op)), + + LLIL_IF => InstrInfo::If(Operation::new(function, op)), + LLIL_GOTO => InstrInfo::Goto(Operation::new(function, op)), + + LLIL_SYSCALL | LLIL_SYSCALL_SSA => InstrInfo::Syscall(Operation::new(function, op)), + LLIL_INTRINSIC | LLIL_INTRINSIC_SSA => { + InstrInfo::Intrinsic(Operation::new(function, op)) + } + LLIL_BP => InstrInfo::Bp(Operation::new(function, op)), + LLIL_TRAP => InstrInfo::Trap(Operation::new(function, op)), + LLIL_UNDEF => InstrInfo::Undef(Operation::new(function, op)), + // Could not identify an instruction, therefor must be a value expression. + // The conversion from instruction index to expression index is safe here. + _ => InstrInfo::Value(Expression::new(function, ExpressionIndex(index.0))), + } + } + + fn visit_sub_expressions(&self, mut visitor: T) -> VisitorAction + where + T: FnMut(&Expression<'func, A, M, F, ValueExpr>) -> VisitorAction, + { + use InstrInfo::*; + + macro_rules! visit { + ($expr:expr) => { + if let VisitorAction::Halt = visitor($expr) { + return VisitorAction::Halt; + } + }; + } + + match self { + SetReg(ref op) => visit!(&op.source_expr()), + SetRegSplit(ref op) => visit!(&op.source_expr()), + SetFlag(ref op) => visit!(&op.source_expr()), + Store(ref op) => { + visit!(&op.dest_mem_expr()); + visit!(&op.source_expr()); + } + Push(ref op) => visit!(&op.operand()), + Jump(ref op) => visit!(&op.target()), + JumpTo(ref op) => visit!(&op.target()), + Call(ref op) | TailCall(ref op) => visit!(&op.target()), + Ret(ref op) => visit!(&op.target()), + If(ref op) => visit!(&op.condition()), + Intrinsic(ref _op) => { + // TODO: Visit when we support expression lists + } + Value(e) => visit!(e), + _ => {} + } + + VisitorAction::Sibling + } } diff --git a/rust/src/llil/lifting.rs b/rust/src/llil/lifting.rs index 261f8880d..aa1f3648b 100644 --- a/rust/src/llil/lifting.rs +++ b/rust/src/llil/lifting.rs @@ -20,10 +20,7 @@ use crate::architecture::{ Flag, FlagClass, FlagCondition, FlagGroup, FlagRole, FlagWrite, Intrinsic, }; use crate::function::Location; -use crate::llil::{ - Expression, ExpressionIndex, ExpressionResultType, LiftedExpr, LiftedNonSSA, Lifter, - LowLevelILFunction, Mutable, NonSSA, Register, ValueExpr, VoidExpr, -}; +use crate::llil::{Expression, ExpressionIndex, ExpressionResultType, LiftedExpr, LiftedNonSSA, Lifter, LowLevelILFunction, Mutable, NonSSA, Register, ValueExpr, VoidExpr}; use binaryninjacore_sys::{BNAddLowLevelILLabelForAddress, BNLowLevelILOperation}; use binaryninjacore_sys::{BNLowLevelILLabel, BNRegisterOrConstant}; @@ -554,6 +551,7 @@ impl<'a, A: 'a + Architecture> LiftableWithSize<'a, A> ) -> Expression<'a, A, Mutable, NonSSA, Self::Result> { #[cfg(debug_assertions)] { + use crate::llil::ExpressionHandler; if let Some(expr_size) = expr.info().size() { if expr_size != _size { log::warn!( diff --git a/rust/src/llil/operation.rs b/rust/src/llil/operation.rs index 07b03aead..71dc6a710 100644 --- a/rust/src/llil/operation.rs +++ b/rust/src/llil/operation.rs @@ -15,14 +15,15 @@ use binaryninjacore_sys::{BNGetLowLevelILByIndex, BNLowLevelILInstruction}; use super::*; -use crate::architecture::{FlagGroupId, FlagWriteId, IntrinsicId}; +use crate::architecture::{FlagGroupId, FlagId, FlagWriteId, IntrinsicId}; use std::collections::BTreeMap; +use std::fmt::{Debug, Formatter}; use std::marker::PhantomData; use std::mem; pub struct Operation<'func, A, M, F, O> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, O: OperationArguments, @@ -34,7 +35,7 @@ where impl<'func, A, M, F, O> Operation<'func, A, M, F, O> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, O: OperationArguments, @@ -55,9 +56,9 @@ where } } -impl<'func, A, M, O> Operation<'func, A, M, NonSSA, O> +impl Operation<'_, A, M, NonSSA, O> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, O: OperationArguments, { @@ -72,12 +73,23 @@ where // LLIL_NOP, LLIL_NORET, LLIL_BP, LLIL_UNDEF, LLIL_UNIMPL pub struct NoArgs; +impl Debug for Operation<'_, A, M, F, NoArgs> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("NoArgs").finish() + } +} + // LLIL_POP pub struct Pop; -impl<'func, A, M, F> Operation<'func, A, M, F, Pop> +impl Operation<'_, A, M, F, Pop> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -86,17 +98,42 @@ where } } +impl Debug for Operation<'_, A, M, F, Pop> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Pop") + .field("address", &self.address()) + .field("size", &self.size()) + .finish() + } +} + // LLIL_SYSCALL, LLIL_SYSCALL_SSA pub struct Syscall; +impl Debug for Operation<'_, A, M, F, Syscall> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Syscall").finish() + } +} + // LLIL_INTRINSIC, LLIL_INTRINSIC_SSA pub struct Intrinsic; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, Intrinsic> +impl Operation<'_, A, M, F, Intrinsic> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { // TODO: Support register and expression lists pub fn intrinsic(&self) -> Option { @@ -105,14 +142,28 @@ where } } +impl Debug for Operation<'_, A, M, F, Intrinsic> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Intrinsic") + .field("address", &self.address()) + .field("size", &self.intrinsic()) + .finish() + } +} + // LLIL_SET_REG, LLIL_SET_REG_SSA, LLIL_SET_REG_PARTIAL_SSA pub struct SetReg; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, SetReg> +impl<'func, A, M, F> Operation<'func, A, M, F, SetReg> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { pub fn size(&self) -> usize { self.op.size @@ -139,19 +190,35 @@ where } } - pub fn source_expr(&self) -> Expression<'func, A, M, NonSSA, ValueExpr> { + pub fn source_expr(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[1] as usize)) } } +impl Debug for Operation<'_, A, M, F, SetReg> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("SetReg") + .field("address", &self.address()) + .field("size", &self.size()) + .field("dest_reg", &self.dest_reg()) + .field("source_expr", &self.source_expr()) + .finish() + } +} + // LLIL_SET_REG_SPLIT, LLIL_SET_REG_SPLIT_SSA pub struct SetRegSplit; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, SetRegSplit> +impl<'func, A, M, F> Operation<'func, A, M, F, SetRegSplit> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { pub fn size(&self) -> usize { self.op.size @@ -199,73 +266,145 @@ where } } - pub fn source_expr(&self) -> Expression<'func, A, M, NonSSA, ValueExpr> { + pub fn source_expr(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[2] as usize)) } } +impl Debug for Operation<'_, A, M, F, SetRegSplit> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("SetRegSplit") + .field("address", &self.address()) + .field("size", &self.size()) + .field("dest_reg_high", &self.dest_reg_high()) + .field("dest_reg_low", &self.dest_reg_low()) + .field("source_expr", &self.source_expr()) + .finish() + } +} + // LLIL_SET_FLAG, LLIL_SET_FLAG_SSA pub struct SetFlag; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, SetFlag> +impl<'func, A, M, F> Operation<'func, A, M, F, SetFlag> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { - pub fn source_expr(&self) -> Expression<'func, A, M, NonSSA, ValueExpr> { + pub fn dest_flag(&self) -> A::Flag { + // TODO: Error handling? + // TODO: Test this. + self.function + .arch() + .flag_from_id(FlagId(self.op.operands[0] as u32)) + .unwrap() + } + + pub fn source_expr(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[1] as usize)) } } +impl Debug for Operation<'_, A, M, F, SetFlag> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("SetFlag") + .field("address", &self.address()) + .field("dest_flag", &self.dest_flag()) + .field("source_expr", &self.source_expr()) + .finish() + } +} + // LLIL_LOAD, LLIL_LOAD_SSA pub struct Load; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, Load> +impl<'func, A, M, F> Operation<'func, A, M, F, Load> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { pub fn size(&self) -> usize { self.op.size } - pub fn source_mem_expr(&self) -> Expression<'func, A, M, NonSSA, ValueExpr> { + pub fn source_mem_expr(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[0] as usize)) } } +impl Debug for Operation<'_, A, M, F, Load> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Load") + .field("address", &self.address()) + .field("size", &self.size()) + .field("source_mem_expr", &self.source_mem_expr()) + .finish() + } +} + // LLIL_STORE, LLIL_STORE_SSA pub struct Store; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, Store> +impl<'func, A, M, F> Operation<'func, A, M, F, Store> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { pub fn size(&self) -> usize { self.op.size } - pub fn dest_mem_expr(&self) -> Expression<'func, A, M, NonSSA, ValueExpr> { + pub fn dest_mem_expr(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[0] as usize)) } - pub fn source_expr(&self) -> Expression<'func, A, M, NonSSA, ValueExpr> { + pub fn source_expr(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[1] as usize)) } } +impl Debug for Operation<'_, A, M, F, Store> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Store") + .field("address", &self.address()) + .field("size", &self.size()) + .field("dest_mem_expr", &self.dest_mem_expr()) + .field("source_expr", &self.source_expr()) + .finish() + } +} + // LLIL_REG, LLIL_REG_SSA, LLIL_REG_SSA_PARTIAL pub struct Reg; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, Reg> +impl Operation<'_, A, M, F, Reg> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { pub fn size(&self) -> usize { self.op.size @@ -293,14 +432,29 @@ where } } -// LLIL_REG_SPLIT +impl Debug for Operation<'_, A, M, F, Reg> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Reg") + .field("address", &self.address()) + .field("size", &self.size()) + .field("source_reg", &self.source_reg()) + .finish() + } +} + +// LLIL_REG_SPLIT, LLIL_REG_SPLIT_SSA pub struct RegSplit; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, RegSplit> +impl Operation<'_, A, M, F, RegSplit> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { pub fn size(&self) -> usize { self.op.size @@ -349,18 +503,56 @@ where } } +impl Debug for Operation<'_, A, M, F, RegSplit> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("RegSplit") + .field("address", &self.address()) + .field("size", &self.size()) + .field("low_reg", &self.low_reg()) + .field("high_reg", &self.high_reg()) + .finish() + } +} + // LLIL_FLAG, LLIL_FLAG_SSA pub struct Flag; +impl Debug for Operation<'_, A, M, F, Flag> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Flag").finish() + } +} + // LLIL_FLAG_BIT, LLIL_FLAG_BIT_SSA pub struct FlagBit; +impl Debug for Operation<'_, A, M, F, FlagBit> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("FlagBit").finish() + } +} + // LLIL_JUMP pub struct Jump; impl<'func, A, M, F> Operation<'func, A, M, F, Jump> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -369,12 +561,25 @@ where } } +impl Debug for Operation<'_, A, M, F, Jump> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Jump") + .field("target", &self.target()) + .finish() + } +} + // LLIL_JUMP_TO pub struct JumpTo; struct TargetListIter<'func, A, M, F> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -383,9 +588,9 @@ where cursor_operand: usize, } -impl<'func, A, M, F> TargetListIter<'func, A, M, F> +impl TargetListIter<'_, A, M, F> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -404,7 +609,7 @@ where impl<'func, A, M, F> Operation<'func, A, M, F, JumpTo> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -433,16 +638,30 @@ where } } +impl Debug for Operation<'_, A, M, F, JumpTo> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("JumpTo") + .field("target", &self.target()) + .field("target_list", &self.target_list()) + .finish() + } +} + // LLIL_CALL, LLIL_CALL_SSA pub struct Call; -impl<'func, A, M, V> Operation<'func, A, M, NonSSA, Call> +impl<'func, A, M, F> Operation<'func, A, M, F, Call> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, - V: NonSSAVariant, + F: FunctionForm, { - pub fn target(&self) -> Expression<'func, A, M, NonSSA, ValueExpr> { + pub fn target(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[0] as usize)) } @@ -457,12 +676,26 @@ where } } +impl Debug for Operation<'_, A, M, F, Call> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Call") + .field("target", &self.target()) + .field("stack_adjust", &self.stack_adjust()) + .finish() + } +} + // LLIL_RET pub struct Ret; impl<'func, A, M, F> Operation<'func, A, M, F, Ret> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -471,12 +704,25 @@ where } } +impl Debug for Operation<'_, A, M, F, Ret> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Ret") + .field("target", &self.target()) + .finish() + } +} + // LLIL_IF pub struct If; impl<'func, A, M, F> Operation<'func, A, M, F, If> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -499,12 +745,27 @@ where } } +impl Debug for Operation<'_, A, M, F, If> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("If") + .field("condition", &self.condition()) + .field("true_target", &self.true_target()) + .field("false_target", &self.false_target()) + .finish() + } +} + // LLIL_GOTO pub struct Goto; impl<'func, A, M, F> Operation<'func, A, M, F, Goto> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -516,15 +777,41 @@ where } } +impl Debug for Operation<'_, A, M, F, Goto> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Goto") + .field("target", &self.target()) + .finish() + } +} + // LLIL_FLAG_COND +// Valid only in Lifted IL pub struct FlagCond; +impl Debug for Operation<'_, A, M, F, FlagCond> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("FlagCond").finish() + } +} + // LLIL_FLAG_GROUP +// Valid only in Lifted IL pub struct FlagGroup; -impl<'func, A, M> Operation<'func, A, M, NonSSA, FlagGroup> +impl Operation<'_, A, M, NonSSA, FlagGroup> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, { pub fn flag_group(&self) -> A::FlagGroup { @@ -536,12 +823,34 @@ where } } +impl Debug for Operation<'_, A, M, NonSSA, FlagGroup> +where + A: Architecture, + M: FunctionMutability, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("FlagGroup") + .field("flag_group", &self.flag_group()) + .finish() + } +} + +impl Debug for Operation<'_, A, M, SSA, FlagGroup> +where + A: Architecture, + M: FunctionMutability, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("FlagGroup").finish() + } +} + // LLIL_TRAP pub struct Trap; -impl<'func, A, M, F> Operation<'func, A, M, F, Trap> +impl Operation<'_, A, M, F, Trap> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -550,21 +859,67 @@ where } } +impl Debug for Operation<'_, A, M, F, Trap> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Trap") + .field("vector", &self.vector()) + .finish() + } +} + // LLIL_REG_PHI pub struct RegPhi; +impl Debug for Operation<'_, A, M, F, RegPhi> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("RegPhi").finish() + } +} + // LLIL_FLAG_PHI pub struct FlagPhi; +impl Debug for Operation<'_, A, M, F, FlagPhi> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("FlagPhi").finish() + } +} + // LLIL_MEM_PHI pub struct MemPhi; +impl Debug for Operation<'_, A, M, F, MemPhi> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("MemPhi").finish() + } +} + // LLIL_CONST, LLIL_CONST_PTR pub struct Const; -impl<'func, A, M, F> Operation<'func, A, M, F, Const> +impl Operation<'_, A, M, F, Const> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -603,12 +958,26 @@ where } } +impl Debug for Operation<'_, A, M, F, Const> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Const") + .field("size", &self.size()) + .field("value", &self.value()) + .finish() + } +} + // LLIL_EXTERN_PTR pub struct Extern; -impl<'func, A, M, F> Operation<'func, A, M, F, Extern> +impl Operation<'_, A, M, F, Extern> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -647,6 +1016,20 @@ where } } +impl Debug for Operation<'_, A, M, F, Extern> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Extern") + .field("size", &self.size()) + .field("value", &self.value()) + .finish() + } +} + // LLIL_ADD, LLIL_SUB, LLIL_AND, LLIL_OR // LLIL_XOR, LLIL_LSL, LLIL_LSR, LLIL_ASR // LLIL_ROL, LLIL_ROR, LLIL_MUL, LLIL_MULU_DP, @@ -656,7 +1039,7 @@ pub struct BinaryOp; impl<'func, A, M, F> Operation<'func, A, M, F, BinaryOp> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -673,12 +1056,27 @@ where } } +impl Debug for Operation<'_, A, M, F, BinaryOp> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("BinaryOp") + .field("size", &self.size()) + .field("left", &self.left()) + .field("right", &self.right()) + .finish() + } +} + // LLIL_ADC, LLIL_SBB, LLIL_RLC, LLIL_RRC pub struct BinaryOpCarry; impl<'func, A, M, F> Operation<'func, A, M, F, BinaryOpCarry> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -699,12 +1097,28 @@ where } } +impl Debug for Operation<'_, A, M, F, BinaryOpCarry> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("BinaryOpCarry") + .field("size", &self.size()) + .field("left", &self.left()) + .field("right", &self.right()) + .field("carry", &self.carry()) + .finish() + } +} + // LLIL_DIVS_DP, LLIL_DIVU_DP, LLIL_MODU_DP, LLIL_MODS_DP pub struct DoublePrecDivOp; impl<'func, A, M, F> Operation<'func, A, M, F, DoublePrecDivOp> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -720,18 +1134,36 @@ where Expression::new(self.function, ExpressionIndex(self.op.operands[1] as usize)) } + // TODO: I don't think this actually exists? pub fn right(&self) -> Expression<'func, A, M, F, ValueExpr> { Expression::new(self.function, ExpressionIndex(self.op.operands[2] as usize)) } } +impl Debug for Operation<'_, A, M, F, DoublePrecDivOp> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("DoublePrecDivOp") + .field("size", &self.size()) + .field("high", &self.high()) + .field("low", &self.low()) + // TODO: I don't think this actually is used... + .field("right", &self.right()) + .finish() + } +} + // LLIL_PUSH, LLIL_NEG, LLIL_NOT, LLIL_SX, // LLIL_ZX, LLIL_LOW_PART, LLIL_BOOL_TO_INT, LLIL_UNIMPL_MEM pub struct UnaryOp; impl<'func, A, M, F> Operation<'func, A, M, F, UnaryOp> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -744,12 +1176,26 @@ where } } +impl Debug for Operation<'_, A, M, F, UnaryOp> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("UnaryOp") + .field("size", &self.size()) + .field("operand", &self.operand()) + .finish() + } +} + // LLIL_CMP_X pub struct Condition; impl<'func, A, M, F> Operation<'func, A, M, F, Condition> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -766,12 +1212,27 @@ where } } +impl Debug for Operation<'_, A, M, F, Condition> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Condition") + .field("size", &self.size()) + .field("left", &self.left()) + .field("right", &self.right()) + .finish() + } +} + // LLIL_UNIMPL_MEM pub struct UnimplMem; impl<'func, A, M, F> Operation<'func, A, M, F, UnimplMem> where - A: 'func + Architecture, + A: Architecture, M: FunctionMutability, F: FunctionForm, { @@ -784,6 +1245,20 @@ where } } +impl Debug for Operation<'_, A, M, F, UnimplMem> +where + A: Architecture, + M: FunctionMutability, + F: FunctionForm, +{ + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("UnimplMem") + .field("size", &self.size()) + .field("mem_expr", &self.mem_expr()) + .finish() + } +} + // TODO TEST_BIT pub trait OperationArguments: 'static {} diff --git a/rust/src/mlil/function.rs b/rust/src/mlil/function.rs index 5db55d37f..4affd3300 100644 --- a/rust/src/mlil/function.rs +++ b/rust/src/mlil/function.rs @@ -85,7 +85,7 @@ impl MediumLevelILFunction { MediumLevelILFunction { handle: ssa } } - pub fn get_function(&self) -> Ref { + pub fn function(&self) -> Ref { unsafe { let func = BNGetMediumLevelILOwnerFunction(self.handle); Function::ref_from_raw(func) @@ -102,7 +102,7 @@ impl MediumLevelILFunction { unsafe { Array::new(blocks, count, context) } } - pub fn get_var_definitions(&self, var: &Variable) -> Array { + pub fn var_definitions(&self, var: &Variable) -> Array { let mut count = 0; let raw_var = BNVariable::from(var); let raw_instr_idxs = @@ -121,7 +121,7 @@ impl MediumLevelILFunction { let name = name.into_bytes_with_nul(); unsafe { BNCreateUserStackVariable( - self.get_function().handle, + self.function().handle, offset, &mut owned_raw_var_ty, name.as_ref().as_ptr() as *const c_char, @@ -130,7 +130,7 @@ impl MediumLevelILFunction { } pub fn delete_user_stack_var(self, offset: i64) { - unsafe { BNDeleteUserStackVariable(self.get_function().handle, offset) } + unsafe { BNDeleteUserStackVariable(self.function().handle, offset) } } pub fn create_user_var<'a, S: BnStrCompatible, C: Into>>( @@ -145,7 +145,7 @@ impl MediumLevelILFunction { let name = name.into_bytes_with_nul(); unsafe { BNCreateUserVariable( - self.get_function().handle, + self.function().handle, &raw_var, &mut owned_raw_var_ty, name.as_ref().as_ptr() as *const _, @@ -156,12 +156,12 @@ impl MediumLevelILFunction { pub fn delete_user_var(&self, var: &Variable) { let raw_var = BNVariable::from(var); - unsafe { BNDeleteUserVariable(self.get_function().handle, &raw_var) } + unsafe { BNDeleteUserVariable(self.function().handle, &raw_var) } } pub fn is_var_user_defined(&self, var: &Variable) -> bool { let raw_var = BNVariable::from(var); - unsafe { BNIsVariableUserDefined(self.get_function().handle, &raw_var) } + unsafe { BNIsVariableUserDefined(self.function().handle, &raw_var) } } /// Allows the user to specify a PossibleValueSet value for an MLIL @@ -196,14 +196,14 @@ impl MediumLevelILFunction { value: PossibleValueSet, ) -> Result<(), ()> { let Some(_def_site) = self - .get_var_definitions(var) + .var_definitions(var) .iter() .find(|def| def.address == addr) else { // Error "No definition for Variable found at given address" return Err(()); }; - let function = self.get_function(); + let function = self.function(); let def_site = BNArchitectureAndAddress { arch: function.arch().handle, address: addr, @@ -221,7 +221,7 @@ impl MediumLevelILFunction { /// * `def_addr` - Address of the definition site of the variable pub fn clear_user_var_value(&self, var: &Variable, addr: u64) -> Result<(), ()> { let Some(_var_def) = self - .get_var_definitions(var) + .var_definitions(var) .iter() .find(|site| site.address == addr) else { @@ -229,7 +229,7 @@ impl MediumLevelILFunction { return Err(()); }; - let function = self.get_function(); + let function = self.function(); let raw_var = BNVariable::from(var); let def_site = BNArchitectureAndAddress { arch: function.arch().handle, @@ -244,7 +244,7 @@ impl MediumLevelILFunction { /// Returns a Map of user current defined user variable values and their definition sites. pub fn user_var_values(&self) -> Array { let mut count = 0; - let function = self.get_function(); + let function = self.function(); let var_values = unsafe { BNGetAllUserVariableValues(function.handle, &mut count) }; assert!(!var_values.is_null()); unsafe { Array::new(var_values, count, ()) } @@ -269,7 +269,7 @@ impl MediumLevelILFunction { let name_c_str = name.as_ref(); unsafe { BNCreateAutoStackVariable( - self.get_function().handle, + self.function().handle, offset, &mut owned_raw_var_ty, name_c_str.as_ptr() as *const c_char, @@ -278,7 +278,7 @@ impl MediumLevelILFunction { } pub fn delete_auto_stack_var(&self, offset: i64) { - unsafe { BNDeleteAutoStackVariable(self.get_function().handle, offset) } + unsafe { BNDeleteAutoStackVariable(self.function().handle, offset) } } pub fn create_auto_var<'a, S: BnStrCompatible, C: Into>>( @@ -294,7 +294,7 @@ impl MediumLevelILFunction { let name_c_str = name.as_ref(); unsafe { BNCreateAutoVariable( - self.get_function().handle, + self.function().handle, &raw_var, &mut owned_raw_var_ty, name_c_str.as_ptr() as *const c_char, @@ -324,11 +324,7 @@ impl MediumLevelILFunction { let mut count = 0; let mut raw_var = BNVariable::from(var); let refs = unsafe { - BNGetMediumLevelILVariableReferences( - self.get_function().handle, - &mut raw_var, - &mut count, - ) + BNGetMediumLevelILVariableReferences(self.function().handle, &mut raw_var, &mut count) }; assert!(!refs.is_null()); unsafe { Array::new(refs, count, ()) } @@ -348,7 +344,7 @@ impl MediumLevelILFunction { .arch .map(|a| a.handle) .unwrap_or(std::ptr::null_mut()); - let function = self.get_function(); + let function = self.function(); let mut count = 0; let refs = if let Some(length) = length { @@ -596,7 +592,10 @@ unsafe impl RefCountable for MediumLevelILFunction { impl Debug for MediumLevelILFunction { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - write!(f, "", self.handle) + f.debug_struct("MediumLevelILFunction") + .field("arch", &self.function().arch()) + .field("instruction_count", &self.instruction_count()) + .finish() } } @@ -606,13 +605,13 @@ unsafe impl Sync for MediumLevelILFunction {} impl Eq for MediumLevelILFunction {} impl PartialEq for MediumLevelILFunction { fn eq(&self, rhs: &Self) -> bool { - self.get_function().eq(&rhs.get_function()) + self.function().eq(&rhs.function()) } } impl Hash for MediumLevelILFunction { fn hash(&self, state: &mut H) { - self.get_function().hash(state) + self.function().hash(state) } } diff --git a/rust/src/mlil/instruction.rs b/rust/src/mlil/instruction.rs index 5c070779c..f022c6eee 100644 --- a/rust/src/mlil/instruction.rs +++ b/rust/src/mlil/instruction.rs @@ -748,7 +748,7 @@ impl MediumLevelILInstruction { ConstData(op) => Lifted::ConstData(LiftedConstData { constant_data: ConstantData::new( - self.function.get_function(), + self.function.function(), RegisterValue { // TODO: Replace with a From for RegisterValueType. // TODO: We might also want to change the type of `op.constant_data_kind` @@ -912,7 +912,7 @@ impl MediumLevelILInstruction { .vars() .collect(), intrinsic: CoreIntrinsic::new( - self.function.get_function().arch(), + self.function.function().arch(), IntrinsicId(op.intrinsic), ) .expect("Valid intrinsic"), @@ -935,7 +935,7 @@ impl MediumLevelILInstruction { .ssa_vars() .collect(), intrinsic: CoreIntrinsic::new( - self.function.get_function().arch(), + self.function.function().arch(), IntrinsicId(op.intrinsic), ) .expect("Valid intrinsic"), @@ -1053,7 +1053,7 @@ impl MediumLevelILInstruction { assert!(unsafe { BNGetMediumLevelILExprText( self.function.handle, - self.function.get_function().arch().handle, + self.function.function().arch().handle, self.index, &mut tokens, &mut count, diff --git a/rust/src/references.rs b/rust/src/references.rs index e79bbd007..52fb67136 100644 --- a/rust/src/references.rs +++ b/rust/src/references.rs @@ -1,47 +1,70 @@ +#![allow(dead_code)] use crate::architecture::CoreArchitecture; use crate::function::Function; -use crate::rc::{CoreArrayProvider, CoreArrayProviderInner, Guard, Ref}; +use crate::rc::{CoreArrayProvider, CoreArrayProviderInner, Ref}; use binaryninjacore_sys::{BNFreeCodeReferences, BNFreeDataReferences, BNReferenceSource}; -use std::mem::ManuallyDrop; /// A struct representing a single code cross-reference. -/// Taking a cue from [`crate::linearview::LinearDisassemblyLine`], this struct uses [ManuallyDrop] to -/// prevent destructors from being run on the [`Function`] object allocated by -/// the core in `BNGetCodeReferences` (et al). The reference is cleaned up on [Drop] of -/// the enclosing array object. #[derive(Debug)] pub struct CodeReference { - arch: CoreArchitecture, - // TODO: What about when we construct a code ref? - func: ManuallyDrop>, + pub arch: Option, + pub func: Option>, pub address: u64, } impl CodeReference { - pub(crate) unsafe fn new(handle: &BNReferenceSource) -> Self { - let func = ManuallyDrop::new(Function::ref_from_raw(handle.func)); - let arch = CoreArchitecture::from_raw(handle.arch); - let address = handle.addr; + pub(crate) fn from_raw(value: &BNReferenceSource) -> Self { Self { - func, - arch, - address, + func: match value.func.is_null() { + false => Some(unsafe { Function::from_raw(value.func) }.to_owned()), + true => None, + }, + arch: match value.func.is_null() { + false => Some(unsafe { CoreArchitecture::from_raw(value.arch) }), + true => None, + }, + address: value.addr, } } -} -impl<'a> CodeReference { - /// A handle to the referenced function bound by the [CodeReference] object's lifetime. - /// A user can call `.to_owned()` to promote this into its own ref-counted struct - /// and use it after the lifetime of the [CodeReference]. - pub fn function(&'a self) -> &'a Function { - self.func.as_ref() + pub(crate) fn from_owned_raw(value: BNReferenceSource) -> Self { + let owned = Self::from_raw(&value); + Self::free_raw(value); + owned } - /// A handle to the [CodeReference]'s [CoreArchitecture]. This type is [Copy] so reference - /// shenanigans are not needed here. - pub fn architecture(&self) -> CoreArchitecture { - self.arch + pub(crate) fn into_raw(value: Self) -> BNReferenceSource { + BNReferenceSource { + func: match value.func { + Some(func) => unsafe { Ref::into_raw(func) }.handle, + None => std::ptr::null_mut(), + }, + arch: value.arch.map(|a| a.handle).unwrap_or(std::ptr::null_mut()), + addr: value.address, + } + } + + pub(crate) fn into_owned_raw(value: &Self) -> BNReferenceSource { + BNReferenceSource { + func: match &value.func { + Some(func) => func.handle, + None => std::ptr::null_mut(), + }, + arch: value.arch.map(|a| a.handle).unwrap_or(std::ptr::null_mut()), + addr: value.address, + } + } + + pub(crate) fn free_raw(value: BNReferenceSource) { + let _ = unsafe { Function::ref_from_raw(value.func) }; + } + + pub fn new(address: u64, func: Option>, arch: Option) -> Self { + Self { + func, + arch, + address, + } } } @@ -50,7 +73,7 @@ impl<'a> CodeReference { impl CoreArrayProvider for CodeReference { type Raw = BNReferenceSource; type Context = (); - type Wrapped<'a> = Guard<'a, CodeReference>; + type Wrapped<'a> = Self; } unsafe impl CoreArrayProviderInner for CodeReference { @@ -59,8 +82,7 @@ unsafe impl CoreArrayProviderInner for CodeReference { } unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { - // TODO: Cant remove this guard until we get rid of that manual drop, INSANE! - Guard::new(CodeReference::new(raw), &()) + CodeReference::from_raw(raw) } } diff --git a/rust/src/types.rs b/rust/src/types.rs index b5a7d3de3..8345f3a87 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -1895,7 +1895,7 @@ impl NamedTypeReference { } fn target_helper(&self, bv: &BinaryView, visited: &mut HashSet) -> Option> { - let ty = bv.get_type_by_id(self.id())?; + let ty = bv.type_by_id(self.id())?; match ty.type_class() { TypeClass::NamedTypeReferenceClass => { // Recurse into the NTR type until we get the target type. diff --git a/rust/src/variable.rs b/rust/src/variable.rs index e0bbc2f43..e11080b2a 100644 --- a/rust/src/variable.rs +++ b/rust/src/variable.rs @@ -365,7 +365,7 @@ unsafe impl CoreArrayProviderInner for SSAVariable { /// Variables exist within functions at Medium Level IL or higher. /// /// As such, they are to be used within the context of a [`Function`]. -/// See [`Function::get_variable_name`] as an example of how to interact with variables. +/// See [`Function::variable_name`] as an example of how to interact with variables. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Variable { pub ty: VariableSourceType, diff --git a/view/bintxt/Cargo.toml b/view/bintxt/Cargo.toml index 0ec7a9c15..02f463dc2 100644 --- a/view/bintxt/Cargo.toml +++ b/view/bintxt/Cargo.toml @@ -6,14 +6,10 @@ edition = "2021" [dependencies] binaryninja = { path = "../../rust" } +binaryninjacore-sys = { path = "../../rust/binaryninjacore-sys" } ihex = "3.0.0" log = "*" srec = "0.2.0" [lib] -crate-type = ["cdylib"] - -[profile.release] -panic = "abort" -lto = true -debug = 1 +crate-type = ["cdylib"] \ No newline at end of file diff --git a/plugins/minidump/build.rs b/view/bintxt/build.rs similarity index 100% rename from plugins/minidump/build.rs rename to view/bintxt/build.rs diff --git a/view/bintxt/src/ihex.rs b/view/bintxt/src/ihex.rs index bb694941e..c8ded1463 100644 --- a/view/bintxt/src/ihex.rs +++ b/view/bintxt/src/ihex.rs @@ -1,15 +1,15 @@ -use binaryninja::binaryview::*; -use binaryninja::custombinaryview::*; -use binaryninja::rc::Ref; -use binaryninja::segment::SegmentBuilder; -use ihex::Record; -use binaryninja::platform::Platform; -use binaryninja::settings::Settings; use crate::segment_after_address; use crate::segment_from_address; use crate::sort_and_merge_segments; use crate::MergedSegment; use crate::UnmergedSegment; +use binaryninja::binaryview::*; +use binaryninja::custombinaryview::*; +use binaryninja::platform::Platform; +use binaryninja::rc::Ref; +use binaryninja::segment::SegmentBuilder; +use binaryninja::settings::Settings; +use ihex::Record; fn parse_ihex(string: &str) -> Result<(Vec, IHexViewData)> { let mut reader = ihex::Reader::new(&string); @@ -216,7 +216,7 @@ unsafe impl CustomBinaryView for IHexView { .contains_code(true), ); } - + // TODO: Because we detached from the raw view this setting will never be set. let _ = self.core.load_settings(self.type_name()).map(|s| { let platform_name = s.get_string("loader.platform", Some(&self.core), None); @@ -224,7 +224,7 @@ unsafe impl CustomBinaryView for IHexView { self.set_default_platform(&platform); } }); - + Ok(()) } } diff --git a/view/bintxt/src/lib.rs b/view/bintxt/src/lib.rs index 392fe4ce9..ef806bbcd 100644 --- a/view/bintxt/src/lib.rs +++ b/view/bintxt/src/lib.rs @@ -7,9 +7,9 @@ use ihex::*; use srec::*; use titxt::*; -use std::ops::Range; -use log::LevelFilter; use binaryninja::logger::Logger; +use log::LevelFilter; +use std::ops::Range; #[no_mangle] #[allow(non_snake_case)] diff --git a/plugins/minidump/.gitignore b/view/minidump/.gitignore similarity index 100% rename from plugins/minidump/.gitignore rename to view/minidump/.gitignore diff --git a/plugins/minidump/Cargo.toml b/view/minidump/Cargo.toml similarity index 77% rename from plugins/minidump/Cargo.toml rename to view/minidump/Cargo.toml index f38240052..9b224f48d 100644 --- a/plugins/minidump/Cargo.toml +++ b/view/minidump/Cargo.toml @@ -10,8 +10,4 @@ crate-type = ["cdylib"] binaryninja = { path = "../../rust" } binaryninjacore-sys = { path="../../rust/binaryninjacore-sys" } log = "0.4.20" -minidump = "0.23.0" - -[profile.release] -lto = true -debug = "full" +minidump = "0.23.0" \ No newline at end of file diff --git a/plugins/minidump/README.md b/view/minidump/README.md similarity index 100% rename from plugins/minidump/README.md rename to view/minidump/README.md diff --git a/view/minidump/build.rs b/view/minidump/build.rs new file mode 100644 index 000000000..ed6cec7d2 --- /dev/null +++ b/view/minidump/build.rs @@ -0,0 +1,15 @@ +fn main() { + let link_path = std::env::var_os("DEP_BINARYNINJACORE_PATH") + .expect("DEP_BINARYNINJACORE_PATH not specified"); + + println!("cargo::rustc-link-lib=dylib=binaryninjacore"); + println!("cargo::rustc-link-search={}", link_path.to_str().unwrap()); + + #[cfg(not(target_os = "windows"))] + { + println!( + "cargo::rustc-link-arg=-Wl,-rpath,{0},-L{0}", + link_path.to_string_lossy() + ); + } +} diff --git a/plugins/minidump/images/loaded-minidump-screenshot-border.png b/view/minidump/images/loaded-minidump-screenshot-border.png similarity index 100% rename from plugins/minidump/images/loaded-minidump-screenshot-border.png rename to view/minidump/images/loaded-minidump-screenshot-border.png diff --git a/plugins/minidump/images/minidump-binary-view-type-screenshot-border.png b/view/minidump/images/minidump-binary-view-type-screenshot-border.png similarity index 100% rename from plugins/minidump/images/minidump-binary-view-type-screenshot-border.png rename to view/minidump/images/minidump-binary-view-type-screenshot-border.png diff --git a/plugins/minidump/images/minidump-segments-sections-screenshot-border.png b/view/minidump/images/minidump-segments-sections-screenshot-border.png similarity index 100% rename from plugins/minidump/images/minidump-segments-sections-screenshot-border.png rename to view/minidump/images/minidump-segments-sections-screenshot-border.png diff --git a/plugins/minidump/src/command.rs b/view/minidump/src/command.rs similarity index 100% rename from plugins/minidump/src/command.rs rename to view/minidump/src/command.rs diff --git a/plugins/minidump/src/lib.rs b/view/minidump/src/lib.rs similarity index 100% rename from plugins/minidump/src/lib.rs rename to view/minidump/src/lib.rs diff --git a/plugins/minidump/src/view.rs b/view/minidump/src/view.rs similarity index 100% rename from plugins/minidump/src/view.rs rename to view/minidump/src/view.rs