diff options
| author | Mason Reed <mason@vector35.com> | 2026-04-21 18:10:51 -0700 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-05-10 17:13:08 -0700 |
| commit | c4ba6d79ae3b96d56cc6b3744e7c64e004ecd161 (patch) | |
| tree | 5762fc3ff58b57caec5f42176faf6635c464b4f3 /view/minidump/src/command.rs | |
| parent | 8269a8ac29e59c7949af753dac5c1f36bb700903 (diff) | |
[Rust] Refactor `binary_view` module
- Remove the "viral" `BinaryViewExt` trait and its blanket impl
- Split up the binary view type from the custom trait impl
- Simplify and fix bugs regarding custom binary view initialization
- Rewrite Minidump binary view example, parses the PE headers to create proper sections now
- Add some extra documentation
- Add unit test for custom binary view
Diffstat (limited to 'view/minidump/src/command.rs')
| -rw-r--r-- | view/minidump/src/command.rs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/view/minidump/src/command.rs b/view/minidump/src/command.rs deleted file mode 100644 index ca7ce4c5..00000000 --- a/view/minidump/src/command.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::str; - -use minidump::{Minidump, MinidumpMemoryInfoList}; - -use binaryninja::binary_view::{BinaryView, BinaryViewBase, BinaryViewExt}; - -pub fn print_memory_information(bv: &BinaryView) { - tracing::debug!("Printing memory information"); - if let Some(minidump_bv) = bv.parent_view() { - if let Some(read_buffer) = minidump_bv.read_buffer(0, minidump_bv.len() as usize) { - if let Ok(minidump_obj) = Minidump::read(read_buffer.get_data()) { - if let Ok(memory_info_list) = minidump_obj.get_stream::<MinidumpMemoryInfoList>() { - let mut memory_info_list_writer = Vec::new(); - match memory_info_list.print(&mut memory_info_list_writer) { - Ok(_) => { - if let Ok(memory_info_str) = str::from_utf8(&memory_info_list_writer) { - tracing::info!("{memory_info_str}"); - } else { - tracing::error!("Could not convert the memory information description from minidump into a valid string"); - } - } - Err(_) => { - tracing::error!("Could not get memory information from minidump"); - } - } - } else { - tracing::error!( - "Could not parse a valid MinidumpMemoryInfoList stream from the minidump" - ); - } - } else { - tracing::error!("Could not parse a valid minidump file from the parent binary view's data buffer"); - } - } else { - tracing::error!("Could not read data from parent binary view"); - } - } else { - tracing::error!("Could not get the parent binary view"); - } -} |
