summaryrefslogtreecommitdiff
path: root/rust/src/binary_view.rs
diff options
context:
space:
mode:
authorrbran <git@rubens.io>2025-04-23 19:24:45 +0000
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commitc2d90f2e5a010546d0e1f1deeb1a6d8531ea4d4f (patch)
tree20a6c6268943154fdda6a4d6884f2f29d9d4de50 /rust/src/binary_view.rs
parent4a4a8488269922269b20a12a7b71272b925b9f18 (diff)
[Rust] Implement custom interactive handler
Diffstat (limited to 'rust/src/binary_view.rs')
-rw-r--r--rust/src/binary_view.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/rust/src/binary_view.rs b/rust/src/binary_view.rs
index 55b0d4db..65bab463 100644
--- a/rust/src/binary_view.rs
+++ b/rust/src/binary_view.rs
@@ -1103,6 +1103,46 @@ pub trait BinaryViewExt: BinaryViewBase {
unsafe { BNApplyDebugInfo(self.as_ref().handle, debug_info.handle) }
}
+ fn show_plaintext_report(&self, title: &str, plaintext: &str) {
+ let title = title.to_cstr();
+ let plaintext = plaintext.to_cstr();
+ unsafe {
+ BNShowPlainTextReport(
+ self.as_ref().handle,
+ title.as_ref().as_ptr() as *mut _,
+ plaintext.as_ref().as_ptr() as *mut _,
+ )
+ }
+ }
+
+ fn show_markdown_report(&self, title: &str, contents: &str, plaintext: &str) {
+ let title = title.to_cstr();
+ let contents = contents.to_cstr();
+ let plaintext = plaintext.to_cstr();
+ unsafe {
+ BNShowMarkdownReport(
+ self.as_ref().handle,
+ title.as_ref().as_ptr() as *mut _,
+ contents.as_ref().as_ptr() as *mut _,
+ plaintext.as_ref().as_ptr() as *mut _,
+ )
+ }
+ }
+
+ fn show_html_report(&self, title: &str, contents: &str, plaintext: &str) {
+ let title = title.to_cstr();
+ let contents = contents.to_cstr();
+ let plaintext = plaintext.to_cstr();
+ unsafe {
+ BNShowHTMLReport(
+ self.as_ref().handle,
+ title.as_ref().as_ptr() as *mut _,
+ contents.as_ref().as_ptr() as *mut _,
+ plaintext.as_ref().as_ptr() as *mut _,
+ )
+ }
+ }
+
fn show_graph_report(&self, raw_name: &str, graph: &FlowGraph) {
let raw_name = raw_name.to_cstr();
unsafe {