Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions plugins/dwarf/dwarf_export/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,14 @@ fn present_form(bv_arch: &str) -> Vec<FormResponses> {
"Wasm32",
"Xtensa",
];
interaction::FormInputBuilder::new()
.save_file_field(
let mut form = [
interaction::FormInput::save_file_field::<_, _, &str, &str>(
"Save Location",
Some("Debug Files (*.dwo *.debug);;All Files (*)"),
None,
None,
)
.choice_field(
),
interaction::FormInput::choice_field(
"Architecture",
&archs,
archs
Expand All @@ -646,14 +646,15 @@ fn present_form(bv_arch: &str) -> Vec<FormResponses> {
.cmp(&edit_distance::distance(bv_arch, arch_name_2))
})
.map(|(index, _)| index),
)
),
// Add actual / better support for formats other than elf?
// .choice_field(
// "Container Format",
// &["Coff", "Elf", "MachO", "Pe", "Wasm", "Xcoff"],
// None,
// )
.get_form_input("Export as DWARF")
//interaction::FormInput::choice_field(
// "Container Format",
// &["Coff", "Elf", "MachO", "Pe", "Wasm", "Xcoff"],
// None,
//),
];
interaction::get_form_input("Export as DWARF", &mut form)
}

fn write_dwarf<T: gimli::Endianity>(
Expand Down
54 changes: 54 additions & 0 deletions rust/src/binary_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,60 @@ pub trait BinaryViewExt: BinaryViewBase {
unsafe { BNApplyDebugInfo(self.as_ref().handle, debug_info.handle) }
}

fn show_plaintext_report<S1: BnStrCompatible, S2: BnStrCompatible>(
&self,
title: S1,
plaintext: S2,
) {
let title = title.into_bytes_with_nul();
let plaintext = plaintext.into_bytes_with_nul();
unsafe {
BNShowPlainTextReport(
self.as_ref().handle,
title.as_ref().as_ptr() as *mut _,
plaintext.as_ref().as_ptr() as *mut _,
)
}
}

fn show_markdown_report<S1: BnStrCompatible, S2: BnStrCompatible, S3: BnStrCompatible>(
&self,
title: S1,
contents: S2,
plaintext: S3,
) {
let title = title.into_bytes_with_nul();
let contents = contents.into_bytes_with_nul();
let plaintext = plaintext.into_bytes_with_nul();
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<S1: BnStrCompatible, S2: BnStrCompatible, S3: BnStrCompatible>(
&self,
title: S1,
contents: S2,
plaintext: S3,
) {
let title = title.into_bytes_with_nul();
let contents = contents.into_bytes_with_nul();
let plaintext = plaintext.into_bytes_with_nul();
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<S: BnStrCompatible>(&self, raw_name: S, graph: &FlowGraph) {
let raw_name = raw_name.into_bytes_with_nul();
unsafe {
Expand Down
Loading
Loading