From 6a63c17853009ce7a0071458e39c140a09440230 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 22 Dec 2024 01:21:02 -0500 Subject: [PATCH] Rust refactor Moves a bunch of stuff out of src/types.rs that did not belong: - Confidence - Variable - Function specific stuff - Refactored InstructionInfo, see the msp430 and riscv examples. - Renamed Function::from_raw to Function::ref_from_raw and fixed places where the ref was incremented twice - Fixed FunctionRecognizer leaking functions (see above) - Fixed some apis incorrectly returning Result where Option is clearer - Started to move destructured types to the From trait for converting to an from ffi types, see Location for an example - Started to remove bad module level imports (importing std modules like mem all over the place) - Moved some wrapper handle types to named handle field (this improves readability), see CoreArchitecture for an example - Removed some unintuitive getters, this is bad practice for Rust code, just access the field directly, see DataVariable for an example - General code cleanup, purposely did not run rustfmt, that will be a single seperate commit More rust cleanup - Fixed invalid views being able to invoke UB when dealing with databases - Cleaned up some helper code in dwarf_import - Fixed inverted is_null checks causing crashes! Oops! More rust cleanup Still a WIP, I think branch info is still invalid, need to figure out the issue there. - Fixed some invalid Ref lifetimes when constructing indirectly, see Array for example - Added some more comments - Removed some "magic" functions like MLIL Function::ssa_variables There are still a bunch of invalid lifetimes that aren't crashing us due to the usage of those API's not living long enough. But they ARE an issue. More rust cleanup Trying to comment more TODO's as I go along. - Renamed llil::Function to llil::LowLevelILFunction for clarity and consistency - Take base structures by ref in StructureBuilder::set_base_structures to prevent premature drops - Added more raw to wrapper conversions - Removed UB prone apis - Getting rid of more core module references, use std! - Removed improper Guard usage in array impls for wrapper types with no context - Untangling the UB of the Label api, still only half done :/ More rust cleanup - Misc formatting - Made Logger ref counted - Fixed leaking name of logger every time something was logged - Fixed the last (hopefully) of the unresolved labels - Simplified some code Fix leak in DebugInfo::AddType componentArray was never freed Add more HLIL related functions to rust More rust cleanup improve the CustomBinaryView init process Canonicalize path in `create_delete_empty` test Link core in rust When linking you must depend on the -sys crate. This is because linker arguments (what says where to find binaryninjacore) are NOT transitive. The top level application crate MUST provide it. For more information see: - https://github.com/rust-lang/cargo/issues/9554#issuecomment-857882964 - https://github.com/oxidecomputer/omicron/pull/225 Remove vendored pdb crate Use cargo to manage the git repo ref instead Fix misc rustdoc warnings Move actual plugins out of `rust/examples` and into `plugins` This is where all shipped public plugins that are not arch/view/platform/lang will be at from now on Originally they were in the rust workspace, meaning they all shared a Cargo.lock which is ill-advised. More rust cleanup - More clarification on plugin/executable requirements - Made examples actually rust examples - Add Display impl for InstructionTextToken - Renamed feature "noexports" to "no_exports" Move under_construction.png to assets directory This really did bother me Remove unneeded `extern crate bindgen` Replace nop'd log::info with println We don't register a compatible log sink so they will just get sent into the void Move inline tests into tests directory This is being done in the hopes of curbing the multi-thousand line files that will occur once we flesh out the tests Format rust code Update rust ci Still need to add support for running tests in ci More rust cleanup - Architecture id's are now typed accordingly - Fix some clippy lints - Make instruction index public in LLIL - Removed useless helper functions - LLIL expressions and instruction indexes are now typed accordingly Generate binaryninjacore-sys documentation This should show binaryninjacore-sys alongside binaryninja crate More rust cleanup - Remove lazy_static dependency - Remove hacky impl Debug for Type and just use the display impl - Add more debug impls - Reorder some top level namespace items - Add first type test Remove unneeded script helper in rust api More rust cleanup - Added main thread handler api - Register a headless main thread handler by default in initialization - Refactor QualifiedName to be properly owned - Loosened some type constraints on some apis involving QualifiedName - Fixed some apis that were crashing due to incorrect param types - Removed extern crate cruft for log crate - Simplified headless initialization using more wrapper apis - Fixed segments leaking because of no ref wrapper, see BinaryViewExt::segment_at - Added rstest to manage headless init in unit tests - Added some more unit tests - Refactored demangler api to be more ergonomic - Fixed minidump plugin not building More rust cleanup - Fixup usage of QualifiedName in plugins - Make QualifiedName more usable Implement rust TypeParser fix Platform TypeParser related functions separate User and System implementations of TypeParserResult Implement rust TypeContainer More rust cleanup - Hopefully fixed the rust.yml CI - Added TypePrinter API (this is still WIP and will crash) - Added TypeParser API - Added TypeContainer API - More work around QualifiedName apis Oh your suppose to do this Add workflow_dispatch trigger to rust.yml More rust fixes - Swapped some usage of raw 255 to MAX_CONFIDENCE, no one likes magic numbers - New InstructionTextToken API, complete with owned data, this still needs a lot of testing. - InstructionTextTokenKind describes a destructured InstructionTextToken, this should make token usage much clearer, some docs pending - Added some misc Default and Debug impls - Updated TypePrinter and architectures to use new InstructionTextToken API Misc formatting changes More rust cleanup - Fixed MANY memory leaks (most due to QualifiedName) - Made StructureBuilder more builder and less structure - Fixed CMakeLists.txt that were globbing entire api, resulting in 100 second slowdown on cmake generation - Added more Debug impl's - Added some more tests - Fixed TypeParserResult UB - Moved the From impls to blank impl for clarity, we have multiple different variants of core to rust for some structures, it should be explicit which one you are choosing. - PossibleValueSet should now be able to allocate so we can go from rust to core with those variants that require allocation - Misc doc code formatting Misc clippy lints and clippy CI Co-authored-by: Michael Krasnitski Fix typo in rust CI Misc rust formatting Fix misc typos and add typos to rust CI Add cargo workspace This will help tooling and external contributors get a map of the rust crates within binaryninja-api More rust cleanup - Format all rust plugins - Fix some tests that were out of date - Simplify WARP tests to only binaries, building object files from source is a pain - Link to core in all rust plugins - Fix some memory leaks - Update warp insta snapshots - Fix some misc clippy lints Run rust tests in CI This commit also coincides with the creation of the "testing" environment which exposes a BN_SERIAL secret for pulling a headless Binary Ninja Install missing wayland dependency in github CI Apparently its needed for linux file picker for the WARP integration Set the BINARYNINJADIR so rust can find binaryninjacore in CI The chances of this working are low Misc remove unused dependency Rust misc formatting fixes Improve initialization in rust headless scripts Provide sensible errors and validation to rust headless scripts, solves https://github.com/Vector35/binaryninja-api/issues/5796 Add BN_LICENSE environment variable to rust CI We pass the serial to download binary ninja, but we never provided the license for core initialization Fix typo More rust cleanup - Improved binary view initialization (see init_with_opts) - Allow floating license to free itself before initialization - Add initialization unit test - Add better Debug impls for some common types - Use Path api for opening binary views, this is not breaking as it uses the AsRef impl - Bump rayon dependency and constrain dependencies to x.x Update readme and include that directly in the rustdocs More rust documentation changes Add format comment to InitializationOptions::with_license Misc formatting and clippy lint allow More rust cleanup - Remove under_construction.png from the build.rs it has been removed - Use InstructionIndex in more places - Add missing PartialOrd and Ord impls for id types More rust cleanup - Make workflow cloning explicit - Add workflow tests - Add missing property string list getting for settings - Remove IntoActivityName (see https://github.com/Vector35/binaryninja-api/pull/6257) More rust cleanup This commit is half done Misc rust formatting More rust cleanup - Renamed common name conflictions (I will put my justification in the PR) - Fixed invalid instruction retrieval for LLIL - Added common aliases for llil function, instruction and expression types (see my comment in the PR) - Refactored the instruction retrieval for LLIL, MLIL and HLIL - Added instruction index types to MLIL and HLIL - Moved llil module to lowlevelil module (mlil and hlil will be moved as well) - Added preliminary LLIL unit testing Fix typos Misc clippy fixes More rust cleanup - Normalized modules - Split some code out into own files - Fixed some UB in type archive and projects - Improved API around type archives and projects substantially - Added ProgressExecutor abstraction for functions which have a progress callback - Improved background task documentation and added unit tests - Added worker thread api and unit tests - Moved some owned types to ref types, this is still not complete, but this is the path forward. - Add external location/library accessors to the binary view - Added some misc documentation - Replaced mod.rs with the module name source file Still need to normalize some paths and also update some documentation surrounding that change. Update some tests and examples Fix background task tests colliding We were creating multiple background tasks with the same progress text on multiple threads More rust cleanup - Fixed progress executor freeing itself after one iteration - Updated the last of the doc imports - Moved mainthread to main_thread - Made project creation and opening failable We could probably AsRef to get around the allocation and free inside the function bodies, not high priority as those functions are long running anyways. Move binary view initialization into function body for LLIL test Normalize test file names More rust cleanup - Updated README to clarify offline documentation - Refactored settings api - Added settings example to show dumping settings value and specific properties - Use the workspace to depend on binaryninja and binaryninjacore-sys - Remove binaryninjacore-sys as a workspace member (its not really required) Update workflow test to new settings api More rust cleanup - Rename Label to LowLevelILLabel - Update the functions label map automatically This fixed a major api blunder where the label map is returned as a reference and originally resulted in UB prone lifetime semantics. It was temporarily "fixed" with explicit label updates in the architecture implementation code. But that was less than ideal and was easy to mess up. Now the label map will be updated automatically as the location of labels is now tracked. Misc clippy lints More rust cleanup - Get rid of RawFunctionViewType - Add better Debug impl for Function More rust cleanup - Fixed the documentation icon using local files (thank you @mkrasnitski) - Fixed labels being updated and overwriting the label location used to update the label map More rust cleanup - Added unit tests for MLIL and HLIL - "Fixed" MLIL, LLIL, and HLIL having issues regarding Instruction vs Expression indexes - Renamed CallingConvention to CoreCallingConvention and removed architecture generic - Renamed CallingConventionBase to CallingConvention - Simplified calling convention code and fixed some bugs with implicit registers - Added impl Debug to MLIL and HLIL instructions Still need to at some point add an Expression to MLIL and HLIL. We also might want to look into having the Instruction kind just return the expression kind. Misc clippy lint More rust cleanup - Allow calling conventions to be registered for multiple architectures - Swapped a unreachable statement to an unimplemented statement More rust cleanup - Fixed the issue with PDB types, this has caused me an insane amount of grief - Fixed LLIL visit_tree missing LLIL_LOAD expressions - Added LLIL visitor test - Made all WARP file pickers use the rfd crate Use the dev branch of Binary Ninja in rust CI Misc rust fmt More rust cleanup - Refactored BinaryReader and BinaryWriter - Added some warnings to high_level_il and medium_level_il modules that they are unstable - Add BinaryReader and BinaryWriter tests - Changed BinaryView len to return u64 (that is what the core returns) - Misc formatting changes - Remove extern uses in lib.rs Add impl Debug for BinaryReader and BinaryWriter Turn off broken tests Add more info to the rust README.md More rust cleanup - Make EdgeStyle type not wrap raw - Regression tests for WARP will run on all bins in the out dir now impl rust Collaboration and Remote API Fix typo Update collaboration API Makes collaboration more in line with the refactor. Still a lot of work to do. Namely still need: - Proper errors - _with_opts functions - More ergonomic api - Better connection procedure - Updated documentation - A LOT of unit tests - An example - Typed id's for everything (i dont want BnString as the id!!!) - NEED to refactor the progress callbacks into the new progress api, but we should pull in some of the stuff the collab progress has - Elimination of apis that are dumb helpers Separate out the rust testing and use pull_request_target pull_request_target allows PR's to access the headless license, for this to be safe we need to prevent people from running the job. To prevent the job from being ran we add an environment requirement on testing that a reviewer must review the code and then manually approve it to run. More rust cleanup - Use GroupId instead of u64 - Use ProgressCallback in place of ProgressExecutor - Misc cleanup of FileMetadata - Add `save_to_path` and `save_to_accessor` to save modified binaries - Added binary_view unit tests - Added collaboration unit tests - Fixed a few issues with the collaboration apis - Renamed Command registration functions so that there is no import ambiguity - Split out RemoteUndoEntry - Collaboration apis now have a explicit `_with_progress` set of apis - Misc clippy lint fixes Fix some typos More rust cleanup - Add extra info to README.md - Refactor components api - Add components unit test Add testing and documentation to contributing section in README.md Fix misc doc comments --- .github/workflows/rust.yml | 72 +- .github/workflows/rust_testing.yml | 47 + .gitmodules | 3 - Cargo.lock | 3525 +++++++++++++++++ Cargo.toml | 28 + arch/msp430/Cargo.lock | 19 +- arch/msp430/Cargo.toml | 8 +- arch/msp430/build.rs | 15 + arch/msp430/src/architecture.rs | 318 +- arch/msp430/src/flag.rs | 26 +- arch/msp430/src/lib.rs | 22 +- arch/msp430/src/lift.rs | 64 +- arch/msp430/src/register.rs | 25 +- arch/riscv/Cargo.lock | 31 +- arch/riscv/Cargo.toml | 10 +- arch/riscv/build.rs | 15 + arch/riscv/disasm/src/lib.rs | 29 +- arch/riscv/src/lib.rs | 494 +-- debuginfo.cpp | 4 +- .../dwarf/dwarf_export/CMakeLists.txt | 12 +- .../dwarf/dwarf_export/Cargo.toml | 5 +- .../dwarf/dwarf_export/README.md | 0 plugins/dwarf/dwarf_export/build.rs | 15 + .../dwarf/dwarf_export/src/edit_distance.rs | 0 .../dwarf/dwarf_export/src/lib.rs | 60 +- .../dwarf/dwarf_import/CMakeLists.txt | 12 +- .../dwarf/dwarf_import/Cargo.toml | 7 +- plugins/dwarf/dwarf_import/build.rs | 15 + .../dwarf/dwarf_import/src/die_handlers.rs | 68 +- .../dwarf/dwarf_import/src/dwarfdebuginfo.rs | 198 +- .../dwarf/dwarf_import/src/functions.rs | 76 +- .../dwarf/dwarf_import/src/helpers.rs | 253 +- .../dwarf/dwarf_import/src/lib.rs | 226 +- .../dwarf/dwarf_import/src/types.rs | 116 +- .../dwarf/dwarfdump/Cargo.toml | 3 +- .../dwarf/dwarfdump/README.md | 0 plugins/dwarf/dwarfdump/build.rs | 15 + .../dwarf/dwarfdump/src/lib.rs | 99 +- .../dwarf/shared/Cargo.toml | 3 +- plugins/dwarf/shared/build.rs | 15 + .../dwarf/shared/src/lib.rs | 54 +- .../idb_import/CMakeLists.txt | 12 +- .../idb_import/Cargo.toml | 7 +- plugins/idb_import/build.rs | 15 + .../idb_import/src/addr_info.rs | 0 .../idb_import/src/lib.rs | 10 +- .../idb_import/src/types.rs | 53 +- {rust/examples => plugins}/pdb-ng/.gitignore | 0 .../pdb-ng/CMakeLists.txt | 12 +- {rust/examples => plugins}/pdb-ng/Cargo.toml | 9 +- plugins/pdb-ng/build.rs | 15 + .../pdb-ng/demo/Cargo.toml | 4 +- {rust/examples => plugins}/pdb-ng/src/lib.rs | 133 +- .../examples => plugins}/pdb-ng/src/parser.rs | 131 +- .../pdb-ng/src/struct_grouper.rs | 34 +- .../pdb-ng/src/symbol_parser.rs | 262 +- .../pdb-ng/src/type_parser.rs | 434 +- plugins/warp/Cargo.toml | 33 +- plugins/warp/benches/convert.rs | 7 +- plugins/warp/benches/function.rs | 4 +- plugins/warp/benches/guid.rs | 4 +- plugins/warp/build.rs | 121 +- plugins/warp/fixtures/src/library.c | 33 - plugins/warp/fixtures/src/library.h | 11 - plugins/warp/fixtures/src/simple.c | 15 - plugins/warp/src/bin/sigem.rs | 25 +- plugins/warp/src/cache.rs | 44 +- plugins/warp/src/convert.rs | 123 +- plugins/warp/src/lib.rs | 111 +- plugins/warp/src/matcher.rs | 21 +- plugins/warp/src/plugin.rs | 26 +- plugins/warp/src/plugin/add.rs | 2 +- plugins/warp/src/plugin/copy.rs | 2 +- plugins/warp/src/plugin/create.rs | 7 +- plugins/warp/src/plugin/find.rs | 7 +- plugins/warp/src/plugin/load.rs | 10 +- plugins/warp/src/plugin/types.rs | 18 +- plugins/warp/src/plugin/workflow.rs | 19 +- .../warp_ninja__tests__insta_signatures.snap | 39 - .../warp_ninja__tests__snapshot__ctype.snap | 126 + .../warp_ninja__tests__snapshot__fptostr.snap | 9 + .../warp_ninja__tests__snapshot__mbslen.snap | 39 + .../warp_ninja__tests__snapshot__memicmp.snap | 9 + .../warp_ninja__tests__snapshot__strnicm.snap | 9 + .../warp_ninja__tests__snapshot__wctype.snap | 117 + .../warp_ninja__tests__snapshot_atof.snap | 390 ++ .../warp_ninja__tests__snapshot_atoldbl.snap | 192 + .../warp_ninja__tests__snapshot_atox.snap | 186 + rust/CMakeLists.txt | 12 +- rust/Cargo.lock | 883 +---- rust/Cargo.toml | 39 +- rust/README.md | 152 +- rust/binaryninjacore-sys/Cargo.toml | 1 + rust/binaryninjacore-sys/build.rs | 12 +- rust/binaryninjacore-sys/src/lib.rs | 1 + rust/build.rs | 42 +- rust/examples/basic_script/CMakeLists.txt | 105 - rust/examples/basic_script/Cargo.toml | 7 - rust/examples/basic_script/build.rs | 68 - rust/examples/decompile.rs | 49 + rust/examples/decompile/Cargo.toml | 10 - rust/examples/decompile/build.rs | 68 - rust/examples/decompile/src/main.rs | 54 - rust/examples/demangler.rs | 59 + rust/examples/dump_settings.rs | 21 + rust/examples/dwarf/dwarf_export/build.rs | 68 - rust/examples/flowgraph.rs | 56 + rust/examples/flowgraph/Cargo.toml | 11 - rust/examples/flowgraph/src/lib.rs | 50 - rust/examples/high_level_il.rs | 124 + rust/examples/hlil_lifter/Cargo.toml | 16 - rust/examples/hlil_lifter/build.rs | 68 - rust/examples/hlil_lifter/src/main.rs | 52 - rust/examples/hlil_visitor/Cargo.toml | 16 - rust/examples/hlil_visitor/build.rs | 68 - rust/examples/hlil_visitor/src/main.rs | 124 - rust/examples/medium_level_il.rs | 145 + rust/examples/minidump/build.rs | 68 - rust/examples/mlil_lifter/Cargo.toml | 16 - rust/examples/mlil_lifter/build.rs | 68 - rust/examples/mlil_lifter/src/main.rs | 49 - rust/examples/mlil_visitor/Cargo.toml | 16 - rust/examples/mlil_visitor/build.rs | 68 - rust/examples/mlil_visitor/src/main.rs | 137 - rust/examples/pdb-ng/pdb-0.8.0-patched | 1 - .../{basic_script/src/main.rs => simple.rs} | 18 +- rust/examples/template/Cargo.toml | 16 - rust/examples/template/README.md | 19 - rust/examples/template/build.rs | 68 - rust/examples/template/src/main.rs | 40 - rust/examples/test_demangler/Cargo.toml | 17 - rust/examples/test_demangler/src/lib.rs | 65 - rust/examples/type_printer.rs | 39 + rust/examples/workflow.rs | 89 + rust/examples/workflow/Cargo.toml | 11 - rust/examples/workflow/build.rs | 68 - rust/examples/workflow/src/lib.rs | 70 - rust/src/architecture.rs | 1587 +++++--- .../{backgroundtask.rs => background_task.rs} | 40 +- rust/src/{basicblock.rs => basic_block.rs} | 106 +- rust/src/binary_reader.rs | 173 + rust/src/{binaryview.rs => binary_view.rs} | 976 +++-- rust/src/binary_writer.rs | 152 + rust/src/binaryreader.rs | 101 - rust/src/binarywriter.rs | 99 - ...ingconvention.rs => calling_convention.rs} | 475 +-- rust/src/collaboration.rs | 153 + rust/src/collaboration/changeset.rs | 116 + rust/src/collaboration/file.rs | 647 +++ rust/src/collaboration/folder.rs | 180 + rust/src/collaboration/group.rs | 196 + rust/src/collaboration/merge.rs | 204 + rust/src/collaboration/permission.rs | 159 + rust/src/collaboration/project.rs | 1001 +++++ rust/src/collaboration/remote.rs | 959 +++++ rust/src/collaboration/snapshot.rs | 368 ++ rust/src/collaboration/sync.rs | 941 +++++ rust/src/collaboration/undo.rs | 166 + rust/src/collaboration/user.rs | 154 + rust/src/command.rs | 42 +- rust/src/component.rs | 199 +- rust/src/confidence.rs | 299 ++ ...tombinaryview.rs => custom_binary_view.rs} | 304 +- rust/src/{databuffer.rs => data_buffer.rs} | 107 +- rust/src/database.rs | 623 +-- rust/src/database/kvs.rs | 135 + rust/src/database/snapshot.rs | 277 ++ rust/src/database/undo.rs | 168 + rust/src/debuginfo.rs | 338 +- rust/src/demangle.rs | 325 +- rust/src/disassembly.rs | 1224 ++++-- ...wnloadprovider.rs => download_provider.rs} | 7 +- rust/src/enterprise.rs | 90 +- rust/src/external_library.rs | 224 ++ rust/src/externallibrary.rs | 209 - rust/src/ffi.rs | 9 +- .../src/{fileaccessor.rs => file_accessor.rs} | 2 +- .../src/{filemetadata.rs => file_metadata.rs} | 207 +- rust/src/flowgraph.rs | 145 +- rust/src/function.rs | 1171 ++++-- ...onrecognizer.rs => function_recognizer.rs} | 47 +- rust/src/headless.rs | 335 +- rust/src/{hlil/mod.rs => high_level_il.rs} | 1 + rust/src/{hlil => high_level_il}/block.rs | 29 +- rust/src/high_level_il/function.rs | 293 ++ .../{hlil => high_level_il}/instruction.rs | 421 +- rust/src/{hlil => high_level_il}/lift.rs | 11 +- rust/src/{hlil => high_level_il}/operation.rs | 106 +- rust/src/hlil/function.rs | 152 - rust/src/interaction.rs | 14 +- rust/src/lib.rs | 660 +-- rust/src/{linearview.rs => linear_view.rs} | 157 +- rust/src/llil/block.rs | 103 - rust/src/llil/expression.rs | 851 ---- rust/src/llil/instruction.rs | 209 - rust/src/llil/mod.rs | 95 - rust/src/llil/operation.rs | 825 ---- rust/src/logger.rs | 64 +- rust/src/low_level_il.rs | 99 + rust/src/low_level_il/block.rs | 108 + rust/src/low_level_il/expression.rs | 715 ++++ rust/src/{llil => low_level_il}/function.rs | 200 +- rust/src/low_level_il/instruction.rs | 348 ++ rust/src/{llil => low_level_il}/lifting.rs | 869 ++-- rust/src/low_level_il/operation.rs | 1367 +++++++ rust/src/main_thread.rs | 129 + rust/src/{mlil/mod.rs => medium_level_il.rs} | 4 +- rust/src/{mlil => medium_level_il}/block.rs | 71 +- rust/src/medium_level_il/function.rs | 718 ++++ .../{mlil => medium_level_il}/instruction.rs | 740 ++-- rust/src/{mlil => medium_level_il}/lift.rs | 18 +- .../{mlil => medium_level_il}/operation.rs | 92 +- rust/src/metadata.rs | 8 +- rust/src/mlil/function.rs | 727 ---- rust/src/operand_iter.rs | 69 +- rust/src/platform.rs | 273 +- rust/src/progress.rs | 271 ++ rust/src/project.rs | 1142 ++---- rust/src/project/file.rs | 167 + rust/src/project/folder.rs | 165 + rust/src/rc.rs | 57 +- rust/src/references.rs | 98 +- rust/src/relocation.rs | 35 +- rust/src/section.rs | 36 +- rust/src/segment.rs | 33 +- rust/src/settings.rs | 469 ++- rust/src/string.rs | 92 +- rust/src/symbol.rs | 20 +- rust/src/tags.rs | 110 +- ...tesimplifier.rs => template_simplifier.rs} | 2 +- rust/src/type_archive.rs | 1231 ++++++ rust/src/type_container.rs | 439 ++ rust/src/{typelibrary.rs => type_library.rs} | 45 +- rust/src/type_parser.rs | 697 ++++ rust/src/type_printer.rs | 981 +++++ rust/src/typearchive.rs | 947 ----- rust/src/types.rs | 3304 +++++---------- rust/src/update.rs | 274 +- rust/src/variable.rs | 910 +++++ rust/src/worker_thread.rs | 71 + rust/src/workflow.rs | 237 +- rust/tests/background_task.rs | 49 + rust/tests/binary_reader.rs | 88 + rust/tests/binary_view.rs | 64 + rust/tests/binary_writer.rs | 79 + rust/tests/collaboration.rs | 209 + rust/tests/component.rs | 26 + rust/tests/data_buffer.rs | 88 + rust/tests/demangler.rs | 85 + rust/tests/high_level_il.rs | 41 + rust/tests/initialization.rs | 37 + rust/tests/low_level_il.rs | 230 ++ rust/tests/main_thread.rs | 29 + rust/tests/medium_level_il.rs | 88 + rust/tests/platform.rs | 32 + rust/tests/project.rs | 350 ++ rust/tests/type_archive.rs | 31 + rust/tests/type_container.rs | 137 + rust/tests/type_parser.rs | 85 + rust/tests/types.rs | 50 + rust/tests/worker_thread.rs | 45 + rust/tests/workflow.rs | 93 + rust/under_construction.png | Bin 101136 -> 0 bytes view/bintxt/Cargo.lock | 7 - view/bintxt/Cargo.toml | 12 +- view/bintxt/build.rs | 15 + view/bintxt/src/ihex.rs | 23 +- view/bintxt/src/lib.rs | 10 +- view/bintxt/src/srec.rs | 6 +- view/bintxt/src/titxt.rs | 6 +- {rust/examples => view}/minidump/.gitignore | 0 {rust/examples => view}/minidump/Cargo.toml | 7 +- {rust/examples => 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 .../examples => view}/minidump/src/command.rs | 6 +- {rust/examples => view}/minidump/src/lib.rs | 14 +- {rust/examples => view}/minidump/src/view.rs | 10 +- 280 files changed, 33962 insertions(+), 18145 deletions(-) create mode 100644 .github/workflows/rust_testing.yml create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 arch/msp430/build.rs create mode 100644 arch/riscv/build.rs rename {rust/examples => plugins}/dwarf/dwarf_export/CMakeLists.txt (91%) rename {rust/examples => plugins}/dwarf/dwarf_export/Cargo.toml (70%) rename {rust/examples => plugins}/dwarf/dwarf_export/README.md (100%) create mode 100644 plugins/dwarf/dwarf_export/build.rs rename {rust/examples => plugins}/dwarf/dwarf_export/src/edit_distance.rs (100%) rename {rust/examples => plugins}/dwarf/dwarf_export/src/lib.rs (95%) rename {rust/examples => plugins}/dwarf/dwarf_import/CMakeLists.txt (91%) rename {rust/examples => plugins}/dwarf/dwarf_import/Cargo.toml (69%) create mode 100644 plugins/dwarf/dwarf_import/build.rs rename {rust/examples => plugins}/dwarf/dwarf_import/src/die_handlers.rs (89%) rename {rust/examples => plugins}/dwarf/dwarf_import/src/dwarfdebuginfo.rs (80%) rename {rust/examples => plugins}/dwarf/dwarf_import/src/functions.rs (82%) rename {rust/examples => plugins}/dwarf/dwarf_import/src/helpers.rs (77%) rename {rust/examples => plugins}/dwarf/dwarf_import/src/lib.rs (82%) rename {rust/examples => plugins}/dwarf/dwarf_import/src/types.rs (89%) rename {rust/examples => plugins}/dwarf/dwarfdump/Cargo.toml (76%) rename rust/examples/dwarf/dwarfdump/readme.md => plugins/dwarf/dwarfdump/README.md (100%) create mode 100644 plugins/dwarf/dwarfdump/build.rs rename {rust/examples => plugins}/dwarf/dwarfdump/src/lib.rs (76%) rename {rust/examples => plugins}/dwarf/shared/Cargo.toml (72%) create mode 100644 plugins/dwarf/shared/build.rs rename {rust/examples => plugins}/dwarf/shared/src/lib.rs (80%) rename {rust/examples => plugins}/idb_import/CMakeLists.txt (91%) rename {rust/examples => plugins}/idb_import/Cargo.toml (59%) create mode 100644 plugins/idb_import/build.rs rename {rust/examples => plugins}/idb_import/src/addr_info.rs (100%) rename {rust/examples => plugins}/idb_import/src/lib.rs (96%) rename {rust/examples => plugins}/idb_import/src/types.rs (94%) rename {rust/examples => plugins}/pdb-ng/.gitignore (100%) rename {rust/examples => plugins}/pdb-ng/CMakeLists.txt (94%) rename {rust/examples => plugins}/pdb-ng/Cargo.toml (53%) create mode 100644 plugins/pdb-ng/build.rs rename {rust/examples => plugins}/pdb-ng/demo/Cargo.toml (77%) rename {rust/examples => plugins}/pdb-ng/src/lib.rs (90%) rename {rust/examples => plugins}/pdb-ng/src/parser.rs (81%) rename {rust/examples => plugins}/pdb-ng/src/struct_grouper.rs (98%) rename {rust/examples => plugins}/pdb-ng/src/symbol_parser.rs (92%) rename {rust/examples => plugins}/pdb-ng/src/type_parser.rs (89%) delete mode 100644 plugins/warp/fixtures/src/library.c delete mode 100644 plugins/warp/fixtures/src/library.h delete mode 100644 plugins/warp/fixtures/src/simple.c delete mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__insta_signatures.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot__ctype.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot__fptostr.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot__mbslen.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot__memicmp.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot__strnicm.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot__wctype.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atof.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atoldbl.snap create mode 100644 plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atox.snap delete mode 100644 rust/examples/basic_script/CMakeLists.txt delete mode 100644 rust/examples/basic_script/Cargo.toml delete mode 100644 rust/examples/basic_script/build.rs create mode 100644 rust/examples/decompile.rs delete mode 100644 rust/examples/decompile/Cargo.toml delete mode 100644 rust/examples/decompile/build.rs delete mode 100644 rust/examples/decompile/src/main.rs create mode 100644 rust/examples/demangler.rs create mode 100644 rust/examples/dump_settings.rs delete mode 100644 rust/examples/dwarf/dwarf_export/build.rs create mode 100644 rust/examples/flowgraph.rs delete mode 100644 rust/examples/flowgraph/Cargo.toml delete mode 100644 rust/examples/flowgraph/src/lib.rs create mode 100644 rust/examples/high_level_il.rs delete mode 100644 rust/examples/hlil_lifter/Cargo.toml delete mode 100644 rust/examples/hlil_lifter/build.rs delete mode 100644 rust/examples/hlil_lifter/src/main.rs delete mode 100644 rust/examples/hlil_visitor/Cargo.toml delete mode 100644 rust/examples/hlil_visitor/build.rs delete mode 100644 rust/examples/hlil_visitor/src/main.rs create mode 100644 rust/examples/medium_level_il.rs delete mode 100644 rust/examples/minidump/build.rs delete mode 100644 rust/examples/mlil_lifter/Cargo.toml delete mode 100644 rust/examples/mlil_lifter/build.rs delete mode 100644 rust/examples/mlil_lifter/src/main.rs delete mode 100644 rust/examples/mlil_visitor/Cargo.toml delete mode 100644 rust/examples/mlil_visitor/build.rs delete mode 100644 rust/examples/mlil_visitor/src/main.rs delete mode 160000 rust/examples/pdb-ng/pdb-0.8.0-patched rename rust/examples/{basic_script/src/main.rs => simple.rs} (61%) delete mode 100644 rust/examples/template/Cargo.toml delete mode 100644 rust/examples/template/README.md delete mode 100644 rust/examples/template/build.rs delete mode 100644 rust/examples/template/src/main.rs delete mode 100644 rust/examples/test_demangler/Cargo.toml delete mode 100644 rust/examples/test_demangler/src/lib.rs create mode 100644 rust/examples/type_printer.rs create mode 100644 rust/examples/workflow.rs delete mode 100644 rust/examples/workflow/Cargo.toml delete mode 100644 rust/examples/workflow/build.rs delete mode 100644 rust/examples/workflow/src/lib.rs rename rust/src/{backgroundtask.rs => background_task.rs} (80%) rename rust/src/{basicblock.rs => basic_block.rs} (80%) create mode 100644 rust/src/binary_reader.rs rename rust/src/{binaryview.rs => binary_view.rs} (67%) create mode 100644 rust/src/binary_writer.rs delete mode 100644 rust/src/binaryreader.rs delete mode 100644 rust/src/binarywriter.rs rename rust/src/{callingconvention.rs => calling_convention.rs} (64%) create mode 100644 rust/src/collaboration.rs create mode 100644 rust/src/collaboration/changeset.rs create mode 100644 rust/src/collaboration/file.rs create mode 100644 rust/src/collaboration/folder.rs create mode 100644 rust/src/collaboration/group.rs create mode 100644 rust/src/collaboration/merge.rs create mode 100644 rust/src/collaboration/permission.rs create mode 100644 rust/src/collaboration/project.rs create mode 100644 rust/src/collaboration/remote.rs create mode 100644 rust/src/collaboration/snapshot.rs create mode 100644 rust/src/collaboration/sync.rs create mode 100644 rust/src/collaboration/undo.rs create mode 100644 rust/src/collaboration/user.rs create mode 100644 rust/src/confidence.rs rename rust/src/{custombinaryview.rs => custom_binary_view.rs} (74%) rename rust/src/{databuffer.rs => data_buffer.rs} (63%) create mode 100644 rust/src/database/kvs.rs create mode 100644 rust/src/database/snapshot.rs create mode 100644 rust/src/database/undo.rs rename rust/src/{downloadprovider.rs => download_provider.rs} (98%) create mode 100644 rust/src/external_library.rs delete mode 100644 rust/src/externallibrary.rs rename rust/src/{fileaccessor.rs => file_accessor.rs} (97%) rename rust/src/{filemetadata.rs => file_metadata.rs} (55%) rename rust/src/{functionrecognizer.rs => function_recognizer.rs} (59%) rename rust/src/{hlil/mod.rs => high_level_il.rs} (68%) rename rust/src/{hlil => high_level_il}/block.rs (61%) create mode 100644 rust/src/high_level_il/function.rs rename rust/src/{hlil => high_level_il}/instruction.rs (87%) rename rust/src/{hlil => high_level_il}/lift.rs (97%) rename rust/src/{hlil => high_level_il}/operation.rs (86%) delete mode 100644 rust/src/hlil/function.rs rename rust/src/{linearview.rs => linear_view.rs} (72%) delete mode 100644 rust/src/llil/block.rs delete mode 100644 rust/src/llil/expression.rs delete mode 100644 rust/src/llil/instruction.rs delete mode 100644 rust/src/llil/mod.rs delete mode 100644 rust/src/llil/operation.rs create mode 100644 rust/src/low_level_il.rs create mode 100644 rust/src/low_level_il/block.rs create mode 100644 rust/src/low_level_il/expression.rs rename rust/src/{llil => low_level_il}/function.rs (54%) create mode 100644 rust/src/low_level_il/instruction.rs rename rust/src/{llil => low_level_il}/lifting.rs (57%) create mode 100644 rust/src/low_level_il/operation.rs create mode 100644 rust/src/main_thread.rs rename rust/src/{mlil/mod.rs => medium_level_il.rs} (60%) rename rust/src/{mlil => medium_level_il}/block.rs (55%) create mode 100644 rust/src/medium_level_il/function.rs rename rust/src/{mlil => medium_level_il}/instruction.rs (82%) rename rust/src/{mlil => medium_level_il}/lift.rs (97%) rename rust/src/{mlil => medium_level_il}/operation.rs (88%) delete mode 100644 rust/src/mlil/function.rs create mode 100644 rust/src/progress.rs create mode 100644 rust/src/project/file.rs create mode 100644 rust/src/project/folder.rs rename rust/src/{templatesimplifier.rs => template_simplifier.rs} (90%) create mode 100644 rust/src/type_archive.rs create mode 100644 rust/src/type_container.rs rename rust/src/{typelibrary.rs => type_library.rs} (90%) create mode 100644 rust/src/type_parser.rs create mode 100644 rust/src/type_printer.rs delete mode 100644 rust/src/typearchive.rs create mode 100644 rust/src/variable.rs create mode 100644 rust/src/worker_thread.rs create mode 100644 rust/tests/background_task.rs create mode 100644 rust/tests/binary_reader.rs create mode 100644 rust/tests/binary_view.rs create mode 100644 rust/tests/binary_writer.rs create mode 100644 rust/tests/collaboration.rs create mode 100644 rust/tests/component.rs create mode 100644 rust/tests/data_buffer.rs create mode 100644 rust/tests/demangler.rs create mode 100644 rust/tests/high_level_il.rs create mode 100644 rust/tests/initialization.rs create mode 100644 rust/tests/low_level_il.rs create mode 100644 rust/tests/main_thread.rs create mode 100644 rust/tests/medium_level_il.rs create mode 100644 rust/tests/platform.rs create mode 100644 rust/tests/project.rs create mode 100644 rust/tests/type_archive.rs create mode 100644 rust/tests/type_container.rs create mode 100644 rust/tests/type_parser.rs create mode 100644 rust/tests/types.rs create mode 100644 rust/tests/worker_thread.rs create mode 100644 rust/tests/workflow.rs delete mode 100644 rust/under_construction.png create mode 100644 view/bintxt/build.rs rename {rust/examples => view}/minidump/.gitignore (100%) rename {rust/examples => view}/minidump/Cargo.toml (53%) rename {rust/examples => view}/minidump/README.md (100%) create mode 100644 view/minidump/build.rs rename {rust/examples => view}/minidump/images/loaded-minidump-screenshot-border.png (100%) rename {rust/examples => view}/minidump/images/minidump-binary-view-type-screenshot-border.png (100%) rename {rust/examples => view}/minidump/images/minidump-segments-sections-screenshot-border.png (100%) rename {rust/examples => view}/minidump/src/command.rs (91%) rename {rust/examples => view}/minidump/src/lib.rs (78%) rename {rust/examples => view}/minidump/src/view.rs (98%) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 69fc90104..4c0d50128 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,44 +1,54 @@ -name: Rust PR Checks +name: Rust CI + +# TODO: The paths need to include all rust projects. Those exist outside the rust directory. on: + workflow_dispatch: + push: + paths: + - 'rust/**' pull_request: paths: - 'rust/**' jobs: - build_and_lint: - name: cargo check & cargo clippy + # Check lints with clippy + clippy: + name: cargo clippy runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + # Ensure clippy is installed + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - submodules: true - - - name: Install Clang - run: | - sudo apt update - sudo apt install clang -y - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.83.0 - profile: minimal - override: true components: clippy + - name: Clippy Check + uses: clechasseur/rs-clippy-check@v4 + with: + # We do not run clippy on plugins. + working-directory: ./rust + args: --all-features - - name: cargo check - working-directory: ./rust - run: cargo check --workspace --all-features - - - name: cargo doc test - working-directory: ./rust - run: cargo test --doc -- --show-output + # Check formatting with rustfmt + formatting: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Ensure rustfmt is installed + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + - name: Rustfmt Check + uses: actions-rust-lang/rustfmt@v1 - - name: cargo clippy - working-directory: ./rust - run: cargo clippy -- -D warnings - continue-on-error: true - # If this step fails, it will warn (?) + # Check spelling with typos + spelling: + name: typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Typo Check + uses: crate-ci/typos@v1.29.4 + with: + files: ./rust \ No newline at end of file diff --git a/.github/workflows/rust_testing.yml b/.github/workflows/rust_testing.yml new file mode 100644 index 000000000..05ecde755 --- /dev/null +++ b/.github/workflows/rust_testing.yml @@ -0,0 +1,47 @@ +name: Rust Testing + +# This workflow will have access to two secrets, `BN_SERIAL` and `BN_LICENSE`, they are exposed only for the test job +# and only if workflow has been approved to run. If there is no approval they workflow won't run. +# What security issues arise from this? If a person makes a PR that leaks the `BN_SERIAL` or `BN_LICENSE` and a maintainer +# approves it than the those secrets would leak. + +on: + workflow_dispatch: + push: + paths: + - 'rust/**' + # Pull request target allows us to use the bn license and serial for PR's + # to insure we do not leak the license the workflow is required to be approved manually. + pull_request_target: + paths: + - 'rust/**' + +jobs: + # Check that code compiles and tests pass + test: + # Using the testing environment gives us the needed secrets, it also requires a maintainer to approve it to run. + environment: testing + name: cargo test + runs-on: ubuntu-latest + permissions: + issues: read + steps: + - uses: actions/checkout@v4 + # We need to add wayland as it's used for file picker in the WARP integration + - name: Install system dependencies + run: sudo apt-get install libwayland-dev + # Pull in Binary Ninja + - name: Setup Binary Ninja + id: setup-binja + uses: Vector35/setup-binary-ninja@v1-beta + with: + license: '${{ secrets.BN_SERIAL }}' + python-support: 'false' + dev-branch: 'true' + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Test + # For now, we run the tests single threaded, there are some data races in core around platform types + run: cargo test --all-features -- --test-threads=1 + env: + BINARYNINJADIR: ${{ steps.setup-binja.outputs.install-path }} + BN_LICENSE: ${{ secrets.BN_LICENSE }} \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 13b8e29cc..2b095e57f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,6 +16,3 @@ [submodule "arch/x86/mbuild"] path = arch/x86/mbuild url = https://github.com/intelxed/mbuild.git -[submodule "rust/examples/pdb-ng/pdb-0.8.0-patched"] - path = rust/examples/pdb-ng/pdb-0.8.0-patched - url = https://github.com/Vector35/pdb-rs.git diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..aedd08d6b --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3525 @@ +# 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", + "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 new file mode 100644 index 000000000..41a208d86 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,28 @@ +# This is the workspace for all rust projects in binaryninja-api +# This is not a part of the build process, rather a way to link all rust code together so that external +# contributors have a map of all rust code. The main benefit to providing this workspace is tooling, as cloning +# binaryninja-api will result in this root workspace being picked up and used for LSP and cargo commands automatically. +[workspace] +resolver = "2" +members = [ + "rust", + "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/pdb-ng", + "plugins/warp" +] + +[workspace.dependencies] +binaryninja = { path = "rust" } +binaryninjacore-sys = { path = "rust/binaryninjacore-sys" } + +[profile.release] +lto = true +debug = "full" diff --git a/arch/msp430/Cargo.lock b/arch/msp430/Cargo.lock index 515b6ccfe..22f7d7a36 100644 --- a/arch/msp430/Cargo.lock +++ b/arch/msp430/Cargo.lock @@ -25,7 +25,6 @@ name = "binaryninja" version = "0.1.0" dependencies = [ "binaryninjacore-sys", - "lazy_static", "log", ] @@ -110,12 +109,6 @@ dependencies = [ "either", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.158" @@ -187,9 +180,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -237,9 +230,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "syn" -version = "2.0.75" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", @@ -248,9 +241,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "windows-targets" diff --git a/arch/msp430/Cargo.toml b/arch/msp430/Cargo.toml index d97b8fc8d..ddc442e8a 100644 --- a/arch/msp430/Cargo.toml +++ b/arch/msp430/Cargo.toml @@ -5,14 +5,10 @@ authors = ["jrozner"] edition = "2021" [dependencies] -binaryninja = { path = "../../rust" } +binaryninja.workspace = true +binaryninjacore-sys.workspace = true log = "0.4" msp430-asm = "^0.2" [lib] crate-type = ["cdylib"] - -[profile.release] -panic = "abort" -lto = true -debug = 1 diff --git a/arch/msp430/build.rs b/arch/msp430/build.rs new file mode 100644 index 000000000..ed6cec7d2 --- /dev/null +++ b/arch/msp430/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/arch/msp430/src/architecture.rs b/arch/msp430/src/architecture.rs index c37358eac..938e9ec58 100644 --- a/arch/msp430/src/architecture.rs +++ b/arch/msp430/src/architecture.rs @@ -4,11 +4,10 @@ use crate::register::Register; use binaryninja::{ architecture::{ - Architecture, BranchInfo, CoreArchitecture, CustomArchitectureHandle, FlagCondition, - InstructionInfo, UnusedIntrinsic, UnusedRegisterStack, UnusedRegisterStackInfo, + Architecture, CoreArchitecture, CustomArchitectureHandle, FlagCondition, InstructionInfo, + UnusedIntrinsic, UnusedRegisterStack, UnusedRegisterStackInfo, }, - disassembly::{InstructionTextToken, InstructionTextTokenContents}, - llil::{LiftedExpr, Lifter}, + disassembly::{InstructionTextToken, InstructionTextTokenKind}, Endianness, }; @@ -17,6 +16,11 @@ use msp430_asm::{ single_operand::SingleOperand, two_operand::TwoOperand, }; +use binaryninja::architecture::{ + BranchKind, FlagClassId, FlagGroupId, FlagId, FlagWriteId, RegisterId, +}; +use binaryninja::low_level_il::expression::ValueExpr; +use binaryninja::low_level_il::{MutableLiftedILExpr, MutableLiftedILFunction}; use log::error; const MIN_MNEMONIC: usize = 9; @@ -71,7 +75,7 @@ impl Architecture for Msp430 { self.max_instr_len() } - fn associated_arch_by_addr(&self, _addr: &mut u64) -> CoreArchitecture { + fn associated_arch_by_addr(&self, _addr: u64) -> CoreArchitecture { self.handle } @@ -82,137 +86,81 @@ impl Architecture for Msp430 { match inst { Instruction::Jnz(inst) => { - info.add_branch( - BranchInfo::True(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); - info.add_branch( - BranchInfo::False(addr + inst.size() as u64), - Some(self.handle), - ); + info.add_branch(BranchKind::True(offset_to_absolute(addr, inst.offset()))); + info.add_branch(BranchKind::False(addr + inst.size() as u64)); } Instruction::Jz(inst) => { - info.add_branch( - BranchInfo::True(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); - info.add_branch( - BranchInfo::False(addr + inst.size() as u64), - Some(self.handle), - ); + info.add_branch(BranchKind::True(offset_to_absolute(addr, inst.offset()))); + info.add_branch(BranchKind::False(addr + inst.size() as u64)); } Instruction::Jlo(inst) => { - info.add_branch( - BranchInfo::True(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); - info.add_branch( - BranchInfo::False(addr + inst.size() as u64), - Some(self.handle), - ); + info.add_branch(BranchKind::True(offset_to_absolute(addr, inst.offset()))); + info.add_branch(BranchKind::False(addr + inst.size() as u64)); } Instruction::Jc(inst) => { - info.add_branch( - BranchInfo::True(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); - info.add_branch( - BranchInfo::False(addr + inst.size() as u64), - Some(self.handle), - ); + info.add_branch(BranchKind::True(offset_to_absolute(addr, inst.offset()))); + info.add_branch(BranchKind::False(addr + inst.size() as u64)); } Instruction::Jn(inst) => { - info.add_branch( - BranchInfo::True(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); - info.add_branch( - BranchInfo::False(addr + inst.size() as u64), - Some(self.handle), - ); + info.add_branch(BranchKind::True(offset_to_absolute(addr, inst.offset()))); + info.add_branch(BranchKind::False(addr + inst.size() as u64)); } Instruction::Jge(inst) => { - info.add_branch( - BranchInfo::True(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); - info.add_branch( - BranchInfo::False(addr + inst.size() as u64), - Some(self.handle), - ); + info.add_branch(BranchKind::True(offset_to_absolute(addr, inst.offset()))); + info.add_branch(BranchKind::False(addr + inst.size() as u64)); } Instruction::Jl(inst) => { - info.add_branch( - BranchInfo::True(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); - info.add_branch( - BranchInfo::False(addr + inst.size() as u64), - Some(self.handle), - ); + info.add_branch(BranchKind::True(offset_to_absolute(addr, inst.offset()))); + info.add_branch(BranchKind::False(addr + inst.size() as u64)); } Instruction::Jmp(inst) => { - info.add_branch( - BranchInfo::Unconditional(offset_to_absolute(addr, inst.offset())), - Some(self.handle), - ); + info.add_branch(BranchKind::Unconditional(offset_to_absolute( + addr, + inst.offset(), + ))); } Instruction::Br(inst) => match inst.destination() { - Some(Operand::RegisterDirect(_)) => { - info.add_branch(BranchInfo::Indirect, Some(self.handle)) - } - Some(Operand::Indexed(_)) => { - info.add_branch(BranchInfo::Indirect, Some(self.handle)) + Some(Operand::RegisterDirect(_)) => info.add_branch(BranchKind::Indirect), + Some(Operand::Indexed(_)) => info.add_branch(BranchKind::Indirect), + Some(Operand::Absolute(value)) => { + info.add_branch(BranchKind::Unconditional(*value as u64)) } - Some(Operand::Absolute(value)) => info.add_branch( - BranchInfo::Unconditional(*value as u64), - Some(self.handle), - ), Some(Operand::Symbolic(offset)) => info.add_branch( - BranchInfo::Unconditional((addr as i64 + *offset as i64) as u64), - Some(self.handle), + BranchKind::Unconditional((addr as i64 + *offset as i64) as u64), ), - Some(Operand::Immediate(addr)) => info - .add_branch(BranchInfo::Unconditional(*addr as u64), Some(self.handle)), + Some(Operand::Immediate(addr)) => { + info.add_branch(BranchKind::Unconditional(*addr as u64)) + } Some(Operand::Constant(_)) => { - info.add_branch(BranchInfo::Unconditional(addr), Some(self.handle)) + info.add_branch(BranchKind::Unconditional(addr)) } Some(Operand::RegisterIndirect(_)) | Some(Operand::RegisterIndirectAutoIncrement(_)) => { - info.add_branch(BranchInfo::Indirect, Some(self.handle)) + info.add_branch(BranchKind::Indirect) } None => {} }, Instruction::Call(inst) => match inst.source() { - Operand::RegisterDirect(_) => { - info.add_branch(BranchInfo::Indirect, Some(self.handle)) - } - Operand::Indexed(_) => { - info.add_branch(BranchInfo::Indirect, Some(self.handle)) - } + Operand::RegisterDirect(_) => info.add_branch(BranchKind::Indirect), + Operand::Indexed(_) => info.add_branch(BranchKind::Indirect), Operand::Absolute(value) => { - info.add_branch(BranchInfo::Call(*value as u64), Some(self.handle)) - } - Operand::Symbolic(offset) => info.add_branch( - BranchInfo::Call((addr as i64 + *offset as i64) as u64), - Some(self.handle), - ), - Operand::Immediate(addr) => { - info.add_branch(BranchInfo::Call(*addr as u64), Some(self.handle)) + info.add_branch(BranchKind::Call(*value as u64)) } - Operand::Constant(_) => { - info.add_branch(BranchInfo::Call(addr), Some(self.handle)) + Operand::Symbolic(offset) => { + info.add_branch(BranchKind::Call((addr as i64 + *offset as i64) as u64)) } + Operand::Immediate(addr) => info.add_branch(BranchKind::Call(*addr as u64)), + Operand::Constant(_) => info.add_branch(BranchKind::Call(addr)), Operand::RegisterIndirect(_) | Operand::RegisterIndirectAutoIncrement(_) => { - info.add_branch(BranchInfo::Indirect, Some(self.handle)) + info.add_branch(BranchKind::Indirect) } }, Instruction::Reti(_) => { - info.add_branch(BranchInfo::FunctionReturn, Some(self.handle)); + info.add_branch(BranchKind::FunctionReturn); } Instruction::Ret(_) => { - info.add_branch(BranchInfo::FunctionReturn, Some(self.handle)); + info.add_branch(BranchKind::FunctionReturn); } _ => {} } @@ -245,7 +193,7 @@ impl Architecture for Msp430 { &self, data: &[u8], addr: u64, - il: &mut Lifter, + il: &mut MutableLiftedILFunction, ) -> Option<(usize, bool)> { match msp430_asm::decode(data) { Ok(inst) => { @@ -277,8 +225,8 @@ impl Architecture for Msp430 { fn flag_group_llil<'a>( &self, _group: Self::FlagGroup, - _il: &'a mut Lifter, - ) -> Option> { + _il: &'a mut MutableLiftedILFunction, + ) -> Option> { None } @@ -361,14 +309,14 @@ impl Architecture for Msp430 { None } - fn register_from_id(&self, id: u32) -> Option { + fn register_from_id(&self, id: RegisterId) -> Option { match id.try_into() { Ok(register) => Some(register), Err(_) => None, } } - fn flag_from_id(&self, id: u32) -> Option { + fn flag_from_id(&self, id: FlagId) -> Option { match id.try_into() { Ok(flag) => Some(flag), Err(_) => { @@ -378,7 +326,7 @@ impl Architecture for Msp430 { } } - fn flag_write_from_id(&self, id: u32) -> Option { + fn flag_write_from_id(&self, id: FlagWriteId) -> Option { match id.try_into() { Ok(flag_write) => Some(flag_write), Err(_) => { @@ -388,11 +336,11 @@ impl Architecture for Msp430 { } } - fn flag_class_from_id(&self, _: u32) -> Option { + fn flag_class_from_id(&self, _: FlagClassId) -> Option { None } - fn flag_group_from_id(&self, _: u32) -> Option { + fn flag_group_from_id(&self, _: FlagGroupId) -> Option { None } @@ -417,7 +365,7 @@ fn generate_tokens(inst: &Instruction, addr: u64) -> Vec { Instruction::Call(inst) => generate_single_operand_tokens(inst, addr, true), Instruction::Reti(_) => vec![InstructionTextToken::new( "reti", - InstructionTextTokenContents::Instruction, + InstructionTextTokenKind::Instruction, )], // Jxx instructions @@ -479,14 +427,14 @@ fn generate_single_operand_tokens( ) -> Vec { let mut res = vec![InstructionTextToken::new( inst.mnemonic(), - InstructionTextTokenContents::Instruction, + InstructionTextTokenKind::Instruction, )]; if inst.mnemonic().len() < MIN_MNEMONIC { let padding = " ".repeat(MIN_MNEMONIC - inst.mnemonic().len()); res.push(InstructionTextToken::new( - &padding, - InstructionTextTokenContents::Text, + padding, + InstructionTextTokenKind::Text, )) } @@ -500,20 +448,23 @@ fn generate_jxx_tokens(inst: &impl Jxx, addr: u64) -> Vec let mut res = vec![InstructionTextToken::new( inst.mnemonic(), - InstructionTextTokenContents::Instruction, + InstructionTextTokenKind::Instruction, )]; if inst.mnemonic().len() < MIN_MNEMONIC { let padding = " ".repeat(MIN_MNEMONIC - inst.mnemonic().len()); res.push(InstructionTextToken::new( - &padding, - InstructionTextTokenContents::Text, + padding, + InstructionTextTokenKind::Text, )) } res.push(InstructionTextToken::new( - &format!("0x{fixed_addr:4x}"), - InstructionTextTokenContents::CodeRelativeAddress(fixed_addr), + format!("0x{fixed_addr:4x}"), + InstructionTextTokenKind::CodeRelativeAddress { + value: fixed_addr, + size: None, + }, )); res @@ -522,21 +473,21 @@ fn generate_jxx_tokens(inst: &impl Jxx, addr: u64) -> Vec fn generate_two_operand_tokens(inst: &impl TwoOperand, addr: u64) -> Vec { let mut res = vec![InstructionTextToken::new( inst.mnemonic(), - InstructionTextTokenContents::Instruction, + InstructionTextTokenKind::Instruction, )]; if inst.mnemonic().len() < MIN_MNEMONIC { let padding = " ".repeat(MIN_MNEMONIC - inst.mnemonic().len()); res.push(InstructionTextToken::new( - &padding, - InstructionTextTokenContents::Text, + padding, + InstructionTextTokenKind::Text, )) } res.extend_from_slice(&generate_operand_tokens(inst.source(), addr, false)); res.push(InstructionTextToken::new( ", ", - InstructionTextTokenContents::OperandSeparator, + InstructionTextTokenKind::OperandSeparator, )); res.extend_from_slice(&generate_operand_tokens(inst.destination(), addr, false)); @@ -550,14 +501,14 @@ fn generate_emulated_tokens( ) -> Vec { let mut res = vec![InstructionTextToken::new( inst.mnemonic(), - InstructionTextTokenContents::Instruction, + InstructionTextTokenKind::Instruction, )]; if inst.mnemonic().len() < MIN_MNEMONIC { let padding = " ".repeat(MIN_MNEMONIC - inst.mnemonic().len()); res.push(InstructionTextToken::new( &padding, - InstructionTextTokenContents::Text, + InstructionTextTokenKind::Text, )) } @@ -577,23 +528,23 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec match r { 0 => vec![InstructionTextToken::new( "pc", - InstructionTextTokenContents::Register, + InstructionTextTokenKind::Register, )], 1 => vec![InstructionTextToken::new( "sp", - InstructionTextTokenContents::Register, + InstructionTextTokenKind::Register, )], 2 => vec![InstructionTextToken::new( "sr", - InstructionTextTokenContents::Register, + InstructionTextTokenKind::Register, )], 3 => vec![InstructionTextToken::new( "cg", - InstructionTextTokenContents::Register, + InstructionTextTokenKind::Register, )], _ => vec![InstructionTextToken::new( - &format!("r{r}"), - InstructionTextTokenContents::Register, + format!("r{r}"), + InstructionTextTokenKind::Register, )], }, Operand::Indexed((r, i)) => match r { @@ -606,11 +557,14 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec { @@ -622,11 +576,14 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec { @@ -638,11 +595,14 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec { @@ -654,11 +614,14 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec { @@ -670,14 +633,14 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec Vec { @@ -701,41 +664,53 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec { - let val = (addr as i64 + *i as i64) as u64; + let value = (addr as i64 + *i as i64) as u64; vec![InstructionTextToken::new( - &format!("{val:#x}"), - InstructionTextTokenContents::CodeRelativeAddress(val), + format!("{value:#x}"), + InstructionTextTokenKind::CodeRelativeAddress { value, size: None }, )] } Operand::Immediate(i) => { if call { vec![InstructionTextToken::new( - &format!("{i:#x}"), - InstructionTextTokenContents::CodeRelativeAddress(*i as u64), + format!("{i:#x}"), + InstructionTextTokenKind::CodeRelativeAddress { + value: *i as u64, + size: None, + }, )] } else { vec![InstructionTextToken::new( - &format!("{i:#x}"), - InstructionTextTokenContents::PossibleAddress(*i as u64), + format!("{i:#x}"), + InstructionTextTokenKind::PossibleAddress { + value: *i as u64, + size: None, + }, )] } } Operand::Absolute(a) => { if call { vec![InstructionTextToken::new( - &format!("{a:#x}"), - InstructionTextTokenContents::CodeRelativeAddress(*a as u64), + format!("{a:#x}"), + InstructionTextTokenKind::CodeRelativeAddress { + value: *a as u64, + size: None, + }, )] } else { vec![InstructionTextToken::new( - &format!("{a:#x}"), - InstructionTextTokenContents::PossibleAddress(*a as u64), + format!("{a:#x}"), + InstructionTextTokenKind::PossibleAddress { + value: *a as u64, + size: None, + }, )] } } @@ -747,10 +722,13 @@ fn generate_operand_tokens(source: &Operand, addr: u64, call: bool) -> Vec) -> architecture::FlagRole { + fn role(&self, _class: Option) -> FlagRole { match self { Self::C => FlagRole::CarryFlagRole, Self::Z => FlagRole::ZeroFlagRole, @@ -34,20 +34,21 @@ impl architecture::Flag for Flag { } } - fn id(&self) -> u32 { + fn id(&self) -> FlagId { match self { Self::C => 0, Self::Z => 1, Self::N => 2, Self::V => 8, } + .into() } } -impl TryFrom for Flag { +impl TryFrom for Flag { type Error = (); - fn try_from(flag: u32) -> Result { - match flag { + fn try_from(flag: FlagId) -> Result { + match flag.0 { 0 => Ok(Self::C), 1 => Ok(Self::Z), 2 => Ok(Self::N), @@ -65,7 +66,7 @@ impl architecture::FlagClass for FlagClass { unimplemented!() } - fn id(&self) -> u32 { + fn id(&self) -> FlagClassId { unimplemented!() } } @@ -81,7 +82,7 @@ impl architecture::FlagGroup for FlagGroup { unimplemented!() } - fn id(&self) -> u32 { + fn id(&self) -> FlagGroupId { unimplemented!() } @@ -119,13 +120,14 @@ impl architecture::FlagWrite for FlagWrite { None } - fn id(&self) -> u32 { + fn id(&self) -> FlagWriteId { match self { Self::All => 1, Self::Nz => 2, Self::Nvz => 3, Self::Cnz => 4, } + .into() } fn flags_written(&self) -> Vec { @@ -138,11 +140,11 @@ impl architecture::FlagWrite for FlagWrite { } } -impl TryFrom for FlagWrite { +impl TryFrom for FlagWrite { type Error = (); - fn try_from(value: u32) -> Result { - match value { + fn try_from(value: FlagWriteId) -> Result { + match value.0 { 1 => Ok(Self::All), 2 => Ok(Self::Nz), 3 => Ok(Self::Nvz), diff --git a/arch/msp430/src/lib.rs b/arch/msp430/src/lib.rs index 7654b33c2..b54655547 100644 --- a/arch/msp430/src/lib.rs +++ b/arch/msp430/src/lib.rs @@ -2,8 +2,14 @@ extern crate binaryninja; extern crate log; extern crate msp430_asm; +use binaryninja::{ + add_optional_plugin_dependency, + architecture::ArchitectureExt, + calling_convention, + custom_binary_view::{BinaryViewType, BinaryViewTypeExt}, + Endianness, +}; use log::LevelFilter; -use binaryninja::{add_optional_plugin_dependency, architecture::ArchitectureExt, callingconvention, custombinaryview::{BinaryViewType, BinaryViewTypeExt}, Endianness}; mod architecture; mod flag; @@ -17,10 +23,10 @@ use binaryninja::logger::Logger; #[allow(non_snake_case)] pub extern "C" fn CorePluginInit() -> bool { Logger::new("MSP430").with_level(LevelFilter::Info).init(); - let arch = binaryninja::architecture::register_architecture( - "msp430", - |custom_handle, handle| Msp430::new(handle, custom_handle), - ); + let arch = + binaryninja::architecture::register_architecture("msp430", |custom_handle, handle| { + Msp430::new(handle, custom_handle) + }); // we may need to introduce additional calling conventions here to // support additional ABIs. MSPGCC's calling convention (what @@ -30,13 +36,13 @@ pub extern "C" fn CorePluginInit() -> bool { // https://www.ti.com/lit/an/slaa664/slaa664.pdf?ts=1613210655081. MSPGCC // appears to be a legacy calling convention while EABI is the newer // standardized one that is compatible with TI's compiler - let default = callingconvention::ConventionBuilder::new(arch) + let default = calling_convention::ConventionBuilder::new(arch) .is_eligible_for_heuristics(true) .int_arg_registers(&["r15", "r14", "r13", "r12"]) .return_int_reg("r15") .return_hi_int_reg("r14") .register("default"); - callingconvention::ConventionBuilder::new(arch) + calling_convention::ConventionBuilder::new(arch) .is_eligible_for_heuristics(true) .return_int_reg("r15") .return_hi_int_reg("r14") @@ -55,4 +61,4 @@ pub extern "C" fn CorePluginInit() -> bool { #[allow(non_snake_case)] pub extern "C" fn CorePluginDependencies() { add_optional_plugin_dependency("view_elf"); -} \ No newline at end of file +} diff --git a/arch/msp430/src/lift.rs b/arch/msp430/src/lift.rs index feb8ce357..6ad7b67bd 100644 --- a/arch/msp430/src/lift.rs +++ b/arch/msp430/src/lift.rs @@ -3,10 +3,7 @@ use crate::flag::{Flag, FlagWrite}; use crate::register::Register; use crate::Msp430; -use binaryninja::{ - architecture::FlagCondition, - llil::{Label, LiftedNonSSA, Lifter, Mutable, NonSSA}, -}; +use binaryninja::{architecture::FlagCondition, low_level_il::lifting::LowLevelILLabel}; use msp430_asm::emulate::Emulated; use msp430_asm::instruction::Instruction; @@ -15,6 +12,8 @@ use msp430_asm::operand::{Operand, OperandWidth}; use msp430_asm::single_operand::SingleOperand; use msp430_asm::two_operand::TwoOperand; +use binaryninja::low_level_il::expression::ValueExpr; +use binaryninja::low_level_il::{MutableLiftedILExpr, MutableLiftedILFunction}; use log::info; macro_rules! auto_increment { @@ -138,31 +137,38 @@ macro_rules! conditional_jump { ($addr:ident, $inst:ident, $cond:ident, $il:ident) => { let true_addr = offset_to_absolute($addr, $inst.offset()); let false_addr = $addr + $inst.size() as u64; - let mut new_true = Label::new(); - let mut new_false = Label::new(); + let mut new_true = true; + let mut new_false = false; - let true_label = $il.label_for_address(true_addr); - let false_label = $il.label_for_address(false_addr); + let mut true_label = $il.label_for_address(true_addr).unwrap_or_else(|| { + new_true = true; + LowLevelILLabel::new() + }); - $il.if_expr( - $cond, - true_label.unwrap_or_else(|| &new_true), - false_label.unwrap_or_else(|| &new_false), - ) - .append(); - - if true_label.is_none() { - $il.mark_label(&mut new_true); + let mut false_label = $il.label_for_address(false_addr).unwrap_or_else(|| { + new_false = true; + LowLevelILLabel::new() + }); + + $il.if_expr($cond, &mut true_label, &mut false_label) + .append(); + + if new_true { + $il.mark_label(&mut true_label); $il.jump($il.const_ptr(true_addr)).append(); } - if false_label.is_none() { - $il.mark_label(&mut new_false); + if new_false { + $il.mark_label(&mut false_label); } }; } -pub(crate) fn lift_instruction(inst: &Instruction, addr: u64, il: &Lifter) { +pub(crate) fn lift_instruction( + inst: &Instruction, + addr: u64, + il: &MutableLiftedILFunction, +) { match inst { Instruction::Rrc(inst) => { let size = match inst.operand_width() { @@ -277,8 +283,8 @@ pub(crate) fn lift_instruction(inst: &Instruction, addr: u64, il: &Lifter { - il.goto(label).append(); + Some(mut label) => { + il.goto(&mut label).append(); } None => { il.jump(il.const_ptr(fixed_addr)).append(); @@ -411,8 +417,8 @@ pub(crate) fn lift_instruction(inst: &Instruction, addr: u64, il: &Lifter { let dest = if let Some(Operand::Immediate(dest)) = inst.destination() { - if let Some(label) = il.label_for_address(*dest as u64) { - il.goto(label).append(); + if let Some(mut label) = il.label_for_address(*dest as u64) { + il.goto(&mut label).append(); return; } else { il.const_ptr(*dest as u64) @@ -622,14 +628,8 @@ pub(crate) fn lift_instruction(inst: &Instruction, addr: u64, il: &Lifter( operand: &Operand, size: usize, - il: &'a Lifter, -) -> binaryninja::llil::Expression< - 'a, - Msp430, - Mutable, - NonSSA, - binaryninja::llil::ValueExpr, -> { + il: &'a MutableLiftedILFunction, +) -> MutableLiftedILExpr<'a, Msp430, ValueExpr> { match operand { Operand::RegisterDirect(r) => il.reg(size, Register::try_from(*r as u32).unwrap()), Operand::Indexed((r, offset)) => il diff --git a/arch/msp430/src/register.rs b/arch/msp430/src/register.rs index 20a5dff86..0886e537b 100644 --- a/arch/msp430/src/register.rs +++ b/arch/msp430/src/register.rs @@ -1,6 +1,7 @@ use binaryninja::architecture; -use binaryninja::architecture::ImplicitRegisterExtend; +use binaryninja::architecture::{ImplicitRegisterExtend, RegisterId}; +use binaryninja::low_level_il::LowLevelILRegister; use std::borrow::Cow; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -23,15 +24,15 @@ pub enum Register { R15, } -impl TryFrom for Register { +impl TryFrom for Register { type Error = (); - fn try_from(id: u32) -> Result { + fn try_from(id: RegisterId) -> Result { // TODO: we should return separate errors if the id is between 0x7fff_ffff and 0xffff_ffff // vs outside of that range. Temporary registers have have the high bit set which we // shouldn't get, unless there is a bug in core. An id that isn't within that range but we // don't handle is a bug in the architecture. - match id { + match id.0 { 0 => Ok(Self::Pc), 1 => Ok(Self::Sp), 2 => Ok(Self::Sr), @@ -53,6 +54,15 @@ impl TryFrom for Register { } } +// TODO: Get rid of this and lift all u32 vals to a proper register id. +impl TryFrom for Register { + type Error = (); + + fn try_from(id: u32) -> Result { + Register::try_from(RegisterId(id)) + } +} + impl architecture::Register for Register { type InfoType = Self; @@ -81,7 +91,7 @@ impl architecture::Register for Register { *self } - fn id(&self) -> u32 { + fn id(&self) -> RegisterId { match self { Self::Pc => 0, Self::Sp => 1, @@ -100,6 +110,7 @@ impl architecture::Register for Register { Self::R14 => 14, Self::R15 => 15, } + .into() } } @@ -123,8 +134,8 @@ impl architecture::RegisterInfo for Register { } } -impl From for binaryninja::llil::Register { +impl From for LowLevelILRegister { fn from(register: Register) -> Self { - binaryninja::llil::Register::ArchReg(register) + LowLevelILRegister::ArchReg(register) } } diff --git a/arch/riscv/Cargo.lock b/arch/riscv/Cargo.lock index de9ca95e8..e7c74d5d7 100644 --- a/arch/riscv/Cargo.lock +++ b/arch/riscv/Cargo.lock @@ -32,7 +32,6 @@ name = "binaryninja" version = "0.1.0" dependencies = [ "binaryninjacore-sys", - "lazy_static", "log", "rayon", ] @@ -156,12 +155,6 @@ dependencies = [ "either", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" version = "0.2.151" @@ -236,9 +229,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -265,9 +258,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -277,9 +270,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -288,9 +281,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "riscv-dis" @@ -313,9 +306,9 @@ checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "syn" -version = "2.0.41" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", @@ -324,9 +317,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "winapi" diff --git a/arch/riscv/Cargo.toml b/arch/riscv/Cargo.toml index 974535b77..1c0979e91 100644 --- a/arch/riscv/Cargo.toml +++ b/arch/riscv/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Ryan Snyder "] edition = "2021" [dependencies] -binaryninja = { path = "../../rust" } +binaryninja.workspace = true +binaryninjacore-sys.workspace = true riscv-dis = { path = "disasm" } log = "0.4" rayon = { version = "1.0", optional = true } @@ -15,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/build.rs b/arch/riscv/build.rs new file mode 100644 index 000000000..ed6cec7d2 --- /dev/null +++ b/arch/riscv/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/arch/riscv/disasm/src/lib.rs b/arch/riscv/disasm/src/lib.rs index ad612e7af..a25516a62 100644 --- a/arch/riscv/disasm/src/lib.rs +++ b/arch/riscv/disasm/src/lib.rs @@ -4,10 +4,9 @@ // finish transition to from_instr32 from 'new' // make the various component structs smaller (8 bit IntReg/FloatReg etc.) -extern crate byteorder; - use std::borrow::Cow; use std::fmt; +use std::fmt::Debug; use std::marker::PhantomData; use std::mem; @@ -292,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; @@ -345,21 +344,21 @@ pub enum Operand { impl fmt::Display for Operand { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - &Operand::R(ref r) => write!(f, "x{}", r.id()), - &Operand::F(ref r) => write!(f, "f{}", r.id()), - &Operand::I(i) => match i { + match *self { + Operand::R(r) => write!(f, "x{}", r.id()), + Operand::F(r) => write!(f, "f{}", r.id()), + Operand::I(i) => match i { -0x80000..=-1 => write!(f, "-{:x}", -i), _ => write!(f, "{:x}", i), }, - &Operand::M(i, ref r) => { + Operand::M(i, r) => { if i < 0 { write!(f, "-{:x}(x{})", -i, r.id()) } else { write!(f, "{:x}(x{})", i, r.id()) } } - &Operand::RM(ref r) => write!(f, "{}", r.name()), + Operand::RM(r) => write!(f, "{}", r.name()), } } } @@ -1777,7 +1776,7 @@ pub enum Instr { impl Instr { pub fn mnem(&self) -> Mnem { - Mnem(&self) + Mnem(self) } pub fn operands(&self) -> Vec> { @@ -2300,7 +2299,7 @@ impl<'a, D: RiscVDisassembler + 'a> Mnem<'a, D> { } } -impl<'a, D: RiscVDisassembler> fmt::Display for Mnem<'a, D> { +impl fmt::Display for Mnem<'_, D> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match (self.mnem(), self.suffix()) { (m, None) => f.pad(m), @@ -2332,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; @@ -3141,9 +3140,7 @@ pub trait RiscVDisassembler: Sized + Copy + Clone { f if (f & 0xfe0) == 0x120 => { Op::SfenceVma(RTypeIntInst::new(inst)?) } - 0x104 => { - Op::SfenceVm(RTypeIntInst::new(inst)?) - } + 0x104 => Op::SfenceVm(RTypeIntInst::new(inst)?), 0x000 => Op::Ecall, 0x001 => Op::Ebreak, @@ -3171,7 +3168,7 @@ pub trait RiscVDisassembler: Sized + Copy + Clone { Ok(Instr::Rv32(decoded)) } - _ => return Err(TooShort), + _ => Err(TooShort), } } } diff --git a/arch/riscv/src/lib.rs b/arch/riscv/src/lib.rs index ca2774ca3..1abce973a 100644 --- a/arch/riscv/src/lib.rs +++ b/arch/riscv/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::unusual_byte_groupings)] // Option -> Result // rework operands/instruction text // helper func for reading/writing to registers @@ -13,24 +14,19 @@ use binaryninja::{ LlvmServicesRelocMode, Register as Reg, RegisterInfo, UnusedFlag, UnusedRegisterStack, UnusedRegisterStackInfo, }, - binaryview::{BinaryView, BinaryViewExt}, - callingconvention::{register_calling_convention, CallingConventionBase, ConventionBuilder}, - custombinaryview::{BinaryViewType, BinaryViewTypeExt}, - disassembly::{InstructionTextToken, InstructionTextTokenContents}, + binary_view::{BinaryView, BinaryViewExt}, + calling_convention::{register_calling_convention, CallingConvention, ConventionBuilder}, + custom_binary_view::{BinaryViewType, BinaryViewTypeExt}, + disassembly::{InstructionTextToken, InstructionTextTokenKind}, function::Function, - functionrecognizer::FunctionRecognizer, - llil, - llil::{ - ExprInfo, InstrInfo, Label, Liftable, LiftableWithSize, LiftedNonSSA, Lifter, Mutable, - NonSSA, - }, + function_recognizer::FunctionRecognizer, rc::Ref, relocation::{ CoreRelocationHandler, CustomRelocationHandlerHandle, RelocationHandler, RelocationInfo, RelocationType, }, symbol::{Symbol, SymbolType}, - types::{max_confidence, min_confidence, Conf, NameAndType, Type}, + types::{NameAndType, Type}, }; use log::LevelFilter; use std::borrow::Cow; @@ -38,7 +34,18 @@ use std::fmt; use std::hash::Hash; use std::marker::PhantomData; +use binaryninja::architecture::{BranchKind, IntrinsicId, RegisterId}; +use binaryninja::confidence::{Conf, MAX_CONFIDENCE, MIN_CONFIDENCE}; use binaryninja::logger::Logger; +use binaryninja::low_level_il::expression::{LowLevelILExpressionKind, ValueExpr}; +use binaryninja::low_level_il::instruction::LowLevelILInstructionKind; +use binaryninja::low_level_il::lifting::{ + LiftableLowLevelIL, LiftableLowLevelILWithSize, LowLevelILLabel, +}; +use binaryninja::low_level_il::{ + expression::ExpressionHandler, instruction::InstructionHandler, LowLevelILRegister, + MutableLiftedILExpr, MutableLiftedILFunction, RegularLowLevelILFunction, +}; use riscv_dis::{ FloatReg, FloatRegType, Instr, IntRegType, Op, RegFile, Register as RiscVRegister, RiscVDisassembler, RoundMode, @@ -82,18 +89,18 @@ enum Intrinsic { #[derive(Copy, Clone)] struct Register { - id: u32, + id: RegisterId, _dis: PhantomData, } -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] struct RiscVIntrinsic { id: Intrinsic, _dis: PhantomData, } impl Register { - fn new(id: u32) -> Self { + fn new(id: RegisterId) -> Self { Self { id, _dis: PhantomData, @@ -103,10 +110,10 @@ impl Register { fn reg_type(&self) -> RegType { let int_reg_count = ::int_reg_count(); - if self.id < int_reg_count { - RegType::Integer(self.id) + if self.id.0 < int_reg_count { + RegType::Integer(self.id.0) } else { - RegType::Float(self.id - int_reg_count) + RegType::Float(self.id.0 - int_reg_count) } } } @@ -114,7 +121,7 @@ impl Register { impl From> for Register { fn from(reg: riscv_dis::IntReg) -> Self { Self { - id: reg.id(), + id: RegisterId(reg.id()), _dis: PhantomData, } } @@ -125,15 +132,15 @@ impl From> for Register { let int_reg_count = ::int_reg_count(); Self { - id: reg.id() + int_reg_count, + id: RegisterId(reg.id() + int_reg_count), _dis: PhantomData, } } } -impl Into>> for Register { - fn into(self) -> llil::Register> { - llil::Register::ArchReg(self) +impl From> for LowLevelILRegister> { + fn from(reg: Register) -> Self { + LowLevelILRegister::ArchReg(reg) } } @@ -192,18 +199,20 @@ impl architecture::Register for Register { *self } - fn id(&self) -> u32 { + fn id(&self) -> RegisterId { self.id } } -impl<'a, D: 'static + RiscVDisassembler + Send + Sync> Liftable<'a, RiscVArch> for Register { - type Result = llil::ValueExpr; +impl<'a, D: 'static + RiscVDisassembler + Send + Sync> LiftableLowLevelIL<'a, RiscVArch> + for Register +{ + type Result = ValueExpr; fn lift( - il: &'a llil::Lifter>, + il: &'a MutableLiftedILFunction>, reg: Self, - ) -> llil::Expression<'a, RiscVArch, Mutable, NonSSA, Self::Result> { + ) -> MutableLiftedILExpr<'a, RiscVArch, Self::Result> { match reg.reg_type() { RegType::Integer(0) => il.const_int(reg.size(), 0), RegType::Integer(_) => il.reg(reg.size(), reg), @@ -212,14 +221,14 @@ impl<'a, D: 'static + RiscVDisassembler + Send + Sync> Liftable<'a, RiscVArch } } -impl<'a, D: 'static + RiscVDisassembler + Send + Sync> LiftableWithSize<'a, RiscVArch> +impl<'a, D: 'static + RiscVDisassembler + Send + Sync> LiftableLowLevelILWithSize<'a, RiscVArch> for Register { fn lift_with_size( - il: &'a llil::Lifter>, + il: &'a MutableLiftedILFunction>, reg: Self, size: usize, - ) -> llil::Expression<'a, RiscVArch, Mutable, NonSSA, llil::ValueExpr> { + ) -> MutableLiftedILExpr<'a, RiscVArch, ValueExpr> { #[cfg(debug_assertions)] { if reg.size() < size { @@ -262,14 +271,19 @@ impl PartialEq for Register { impl Eq for Register {} -impl fmt::Debug for Register { +impl fmt::Debug for Register { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(self.name().as_ref()) } } impl RiscVIntrinsic { - fn id_from_parts(id: u32, sz1: Option, sz2: Option, rm: Option) -> u32 { + fn id_from_parts( + id: u32, + sz1: Option, + sz2: Option, + rm: Option, + ) -> IntrinsicId { let sz1 = sz1.unwrap_or(0); let sz2 = sz2.unwrap_or(0); let rm = match rm { @@ -285,10 +299,11 @@ impl RiscVIntrinsic { id |= sz1 as u32; id |= (sz2 as u32) << 8; id |= (rm as u32) << 16; - id + IntrinsicId(id) } - fn parts_from_id(id: u32) -> Option<(u32, u8, u8, RoundMode)> { + fn parts_from_id(id: IntrinsicId) -> Option<(u32, u8, u8, RoundMode)> { + let id = id.0; let sz1 = (id & 0xff) as u8; let sz2 = ((id >> 8) & 0xff) as u8; let rm = match (id >> 16) & 0xf { @@ -303,7 +318,7 @@ impl RiscVIntrinsic { Some(((id >> 20) & 0xfff, sz1, sz2, rm)) } - fn from_id(id: u32) -> Option> { + fn from_id(id: IntrinsicId) -> Option> { match Self::parts_from_id(id) { Some((0, _, _, _)) => Some(Intrinsic::Uret.into()), Some((1, _, _, _)) => Some(Intrinsic::Sret.into()), @@ -468,7 +483,7 @@ impl architecture::Intrinsic for RiscVIntrinsic { } } - fn id(&self) -> u32 { + fn id(&self) -> IntrinsicId { match self.id { Intrinsic::Uret => Self::id_from_parts(0, None, None, None), Intrinsic::Sret => Self::id_from_parts(1, None, None, None), @@ -509,7 +524,7 @@ impl architecture::Intrinsic for RiscVIntrinsic { } } - fn inputs(&self) -> Vec> { + fn inputs(&self) -> Vec { match self.id { Intrinsic::Uret | Intrinsic::Sret | Intrinsic::Mret | Intrinsic::Wfi => { vec![] @@ -517,17 +532,18 @@ impl architecture::Intrinsic for RiscVIntrinsic { Intrinsic::Csrrd => { vec![NameAndType::new( "csr", - &Type::int(4, false), - max_confidence(), + Conf::new(Type::int(4, false), MAX_CONFIDENCE), )] } Intrinsic::Csrrw | Intrinsic::Csrwr | Intrinsic::Csrrs | Intrinsic::Csrrc => { vec![ - NameAndType::new("csr", &Type::int(4, false), max_confidence()), + NameAndType::new("csr", Conf::new(Type::int(4, false), MAX_CONFIDENCE)), NameAndType::new( "value", - &Type::int(::Int::width(), false), - min_confidence(), + Conf::new( + Type::int(::Int::width(), false), + MIN_CONFIDENCE, + ), ), ] } @@ -541,8 +557,8 @@ impl architecture::Intrinsic for RiscVIntrinsic { | Intrinsic::Fmin(size) | Intrinsic::Fmax(size) => { vec![ - NameAndType::new("", &Type::float(size as usize), max_confidence()), - NameAndType::new("", &Type::float(size as usize), max_confidence()), + NameAndType::new("", Conf::new(Type::float(size as usize), MAX_CONFIDENCE)), + NameAndType::new("", Conf::new(Type::float(size as usize), MAX_CONFIDENCE)), ] } Intrinsic::Fsqrt(size, _) @@ -552,26 +568,26 @@ impl architecture::Intrinsic for RiscVIntrinsic { | Intrinsic::FcvtFToU(size, _, _) => { vec![NameAndType::new( "", - &Type::float(size as usize), - max_confidence(), + Conf::new(Type::float(size as usize), MAX_CONFIDENCE), )] } Intrinsic::FcvtIToF(size, _, _) => { vec![NameAndType::new( "", - &Type::int(size as usize, true), - max_confidence(), + Conf::new(Type::int(size as usize, true), MAX_CONFIDENCE), )] } Intrinsic::FcvtUToF(size, _, _) => { vec![NameAndType::new( "", - &Type::int(size as usize, false), - max_confidence(), + Conf::new(Type::int(size as usize, false), MAX_CONFIDENCE), )] } Intrinsic::Fence => { - vec![NameAndType::new("", &Type::int(4, false), min_confidence())] + vec![NameAndType::new( + "", + Conf::new(Type::int(4, false), MIN_CONFIDENCE), + )] } } } @@ -589,7 +605,7 @@ impl architecture::Intrinsic for RiscVIntrinsic { Intrinsic::Csrrw | Intrinsic::Csrrd | Intrinsic::Csrrs | Intrinsic::Csrrc => { vec![Conf::new( Type::int(::Int::width(), false), - min_confidence(), + MIN_CONFIDENCE, )] } Intrinsic::Fadd(size, _) @@ -605,16 +621,16 @@ impl architecture::Intrinsic for RiscVIntrinsic { | Intrinsic::FcvtFToF(_, size, _) | Intrinsic::FcvtIToF(_, size, _) | Intrinsic::FcvtUToF(_, size, _) => { - vec![Conf::new(Type::float(size as usize), max_confidence())] + vec![Conf::new(Type::float(size as usize), MAX_CONFIDENCE)] } Intrinsic::Fclass(_) => { - vec![Conf::new(Type::int(4, false), min_confidence())] + vec![Conf::new(Type::int(4, false), MIN_CONFIDENCE)] } Intrinsic::FcvtFToI(_, size, _) => { - vec![Conf::new(Type::int(size as usize, true), max_confidence())] + vec![Conf::new(Type::int(size as usize, true), MAX_CONFIDENCE)] } Intrinsic::FcvtFToU(_, size, _) => { - vec![Conf::new(Type::int(size as usize, false), max_confidence())] + vec![Conf::new(Type::int(size as usize, false), MAX_CONFIDENCE)] } } } @@ -671,13 +687,11 @@ impl architecture::Architecture fo self.max_instr_len() } - fn associated_arch_by_addr(&self, _addr: &mut u64) -> CoreArchitecture { + fn associated_arch_by_addr(&self, _addr: u64) -> CoreArchitecture { self.handle } fn instruction_info(&self, data: &[u8], addr: u64) -> Option { - use architecture::BranchInfo; - let (inst_len, op) = match D::decode(addr, data) { Ok(Instr::Rv16(op)) => (2, op), Ok(Instr::Rv32(op)) => (4, op), @@ -691,23 +705,23 @@ impl architecture::Architecture fo let target = addr.wrapping_add(j.imm() as i64 as u64); let branch = if j.rd().id() == 0 { - BranchInfo::Unconditional(target) + BranchKind::Unconditional(target) } else { - BranchInfo::Call(target) + BranchKind::Call(target) }; - res.add_branch(branch, None); + res.add_branch(branch); } Op::Jalr(ref i) => { // TODO handle the calls with rs1 == 0? if i.rd().id() == 0 { let branch_type = if i.rs1().id() == 1 { - BranchInfo::FunctionReturn + BranchKind::FunctionReturn } else { - BranchInfo::Unresolved + BranchKind::Unresolved }; - res.add_branch(branch_type, None); + res.add_branch(branch_type); } } Op::Beq(ref b) @@ -716,21 +730,18 @@ impl architecture::Architecture fo | Op::Bge(ref b) | Op::BltU(ref b) | Op::BgeU(ref b) => { - res.add_branch(BranchInfo::False(addr.wrapping_add(inst_len as u64)), None); - res.add_branch( - BranchInfo::True(addr.wrapping_add(b.imm() as i64 as u64)), - None, - ); + res.add_branch(BranchKind::False(addr.wrapping_add(inst_len as u64))); + res.add_branch(BranchKind::True(addr.wrapping_add(b.imm() as i64 as u64))); } Op::Ecall => { - res.add_branch(BranchInfo::SystemCall, None); + res.add_branch(BranchKind::SystemCall); } Op::Ebreak => { // TODO is this valid, or should lifting handle this? - res.add_branch(BranchInfo::Unresolved, None); + res.add_branch(BranchKind::Unresolved); } Op::Uret | Op::Sret | Op::Mret => { - res.add_branch(BranchInfo::FunctionReturn, None); + res.add_branch(BranchKind::FunctionReturn); } _ => {} } @@ -744,7 +755,7 @@ impl architecture::Architecture fo addr: u64, ) -> Option<(usize, Vec)> { use riscv_dis::Operand; - use InstructionTextTokenContents::*; + use InstructionTextTokenKind::*; let inst = match D::decode(addr, data) { Ok(i) => i, @@ -982,12 +993,12 @@ impl architecture::Architecture fo Operand::R(r) => { let reg = self::Register::from(r); - res.push(InstructionTextToken::new(®.name(), Register)); + res.push(InstructionTextToken::new(reg.name(), Register)); } Operand::F(r) => { let reg = self::Register::from(r); - res.push(InstructionTextToken::new(®.name(), Register)); + res.push(InstructionTextToken::new(reg.name(), Register)); } Operand::I(i) => { match op { @@ -1002,8 +1013,11 @@ impl architecture::Architecture fo let target = addr.wrapping_add(i as i64 as u64); res.push(InstructionTextToken::new( - &format!("0x{:x}", target), - CodeRelativeAddress(target), + format!("0x{:x}", target), + CodeRelativeAddress { + value: target, + size: Some(self.address_size()), + }, )); } _ => { @@ -1012,7 +1026,10 @@ impl architecture::Architecture fo -0x8_0000..=-1 => format!("-0x{:x}", -i), _ => format!("0x{:x}", i), }, - Integer(i as u64), + Integer { + value: i as u64, + size: None, + }, )); } } @@ -1027,12 +1044,15 @@ impl architecture::Architecture fo } else { format!("0x{:x}", i) }, - Integer(i as u64), + Integer { + value: i as u64, + size: None, + }, )); - res.push(InstructionTextToken::new("(", Brace)); - res.push(InstructionTextToken::new(®.name(), Register)); - res.push(InstructionTextToken::new(")", Brace)); + res.push(InstructionTextToken::new("(", Brace { hash: None })); + res.push(InstructionTextToken::new(reg.name(), Register)); + res.push(InstructionTextToken::new(")", Brace { hash: None })); res.push(InstructionTextToken::new("", EndMemoryOperand)); } Operand::RM(r) => { @@ -1048,7 +1068,7 @@ impl architecture::Architecture fo &self, data: &[u8], addr: u64, - il: &mut llil::Lifter, + il: &mut MutableLiftedILFunction, ) -> Option<(usize, bool)> { let max_width = self.default_integer_size(); @@ -1061,7 +1081,7 @@ impl architecture::Architecture fo macro_rules! set_reg_or_append_fallback { ($op:ident, $t:expr, $f:expr) => {{ let rd = Register::from($op.rd()); - match rd.id { + match rd.id.0 { 0 => $f.append(), _ => il.set_reg(rd.size(), rd, $t).append(), } @@ -1202,7 +1222,7 @@ impl architecture::Architecture fo let target = addr.wrapping_add(j.imm() as i64 as u64); match (j.rd().id(), il.label_for_address(target)) { - (0, Some(l)) => il.goto(l), + (0, Some(mut l)) => il.goto(&mut l), (0, None) => il.jump(il.const_ptr(target)), (_, _) => il.call(il.const_ptr(target)), } @@ -1221,7 +1241,7 @@ impl architecture::Architecture fo (0, _, _) => il.jump(target).append(), // indirect jump (rd_id, rs1_id, _) if rd_id == rs1_id => { // store the target in a temporary register so we don't clobber it when rd == rs1 - let tmp_reg: llil::Register> = llil::Register::Temp(0); + let tmp_reg: LowLevelILRegister> = LowLevelILRegister::Temp(0); il.set_reg(max_width, tmp_reg, target).append(); // indirect jump with storage of next address to non-`ra` register il.set_reg( @@ -1259,34 +1279,31 @@ impl architecture::Architecture fo _ => unreachable!(), }; - let mut new_false: Option