diff options
| author | Mason Reed <mason@vector35.com> | 2026-02-19 11:19:16 -0800 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-02-23 00:09:44 -0800 |
| commit | 69a9f9e48d6bc76e91eec2a18cd8fee73a496b93 (patch) | |
| tree | 05753a93eccb3d1c2614b3365f620a2bf17e704b /plugins/bntl_utils/src/diff.rs | |
| parent | 65c217ae27e6b0abe26d5baea40f2bab695a3651 (diff) | |
[BNTL] Misc improvements
Diffstat (limited to 'plugins/bntl_utils/src/diff.rs')
| -rw-r--r-- | plugins/bntl_utils/src/diff.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/bntl_utils/src/diff.rs b/plugins/bntl_utils/src/diff.rs index 18d4dce8..f55e8446 100644 --- a/plugins/bntl_utils/src/diff.rs +++ b/plugins/bntl_utils/src/diff.rs @@ -1,5 +1,6 @@ use crate::dump::TILDump; use crate::helper::path_to_type_libraries; +use binaryninja::rc::Ref; use binaryninja::types::TypeLibrary; use similar::{Algorithm, TextDiff}; use std::path::{Path, PathBuf}; @@ -48,9 +49,17 @@ impl TILDiff { .parent() .ok_or_else(|| TILDiffError::InvalidPath(b_path.to_path_buf()))?; - let a_dependencies = path_to_type_libraries(a_parent); - let b_dependencies = path_to_type_libraries(b_parent); + self.diff_with_dependencies( + (&a_type_lib, path_to_type_libraries(a_parent)), + (&b_type_lib, path_to_type_libraries(b_parent)), + ) + } + pub fn diff_with_dependencies( + &self, + (a_type_lib, a_dependencies): (&TypeLibrary, Vec<Ref<TypeLibrary>>), + (b_type_lib, b_dependencies): (&TypeLibrary, Vec<Ref<TypeLibrary>>), + ) -> Result<DiffResult, TILDiffError> { let dumped_a = TILDump::new() .with_type_libs(a_dependencies) .dump(a_type_lib) @@ -70,8 +79,8 @@ impl TILDiff { .unified_diff() .context_radius(3) .header( - a_path.to_string_lossy().as_ref(), - b_path.to_string_lossy().as_ref(), + &format!("A/{}", a_type_lib.name()), + &format!("B/{}", b_type_lib.name()), ) .to_string(); |
