From 1e85844d6407db817db25fd43f1dd9756ef0c3ae Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 20 Jan 2026 14:30:34 -0800 Subject: IDB Import refactor --- plugins/idb_import/src/addr_info.rs | 53 ------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 plugins/idb_import/src/addr_info.rs (limited to 'plugins/idb_import/src/addr_info.rs') diff --git a/plugins/idb_import/src/addr_info.rs b/plugins/idb_import/src/addr_info.rs deleted file mode 100644 index 9a05e6d3..00000000 --- a/plugins/idb_import/src/addr_info.rs +++ /dev/null @@ -1,53 +0,0 @@ -use std::borrow::Cow; -use std::collections::HashMap; - -use anyhow::Result; - -use idb_rs::addr_info::all_address_info; -use idb_rs::id0::{ID0Section, Netdelta}; -use idb_rs::id1::ID1Section; -use idb_rs::id2::ID2Section; -use idb_rs::{til, Address, IDAKind}; - -#[derive(Default)] -pub struct AddrInfo<'a> { - // TODO does binja differentiate comments types on the API? - pub comments: Vec>, - pub label: Option>, - // TODO make this a ref - pub ty: Option, -} - -pub fn get_info<'a, K: IDAKind>( - id0: &'a ID0Section, - id1: &ID1Section, - id2: Option<&ID2Section>, - netdelta: Netdelta, -) -> Result, AddrInfo<'a>>> { - let mut addr_info: HashMap, AddrInfo> = HashMap::new(); - - // comments defined on the address information - for (info, _info_size) in all_address_info(id0, id1, id2, netdelta) { - let entry = addr_info.entry(info.address()).or_default(); - if let Some(comment) = info.comment() { - entry.comments.push(comment.to_vec()); - } - if let Some(comment) = info.comment_repeatable() { - entry.comments.push(comment.to_vec()); - } - if let Some(comment) = info.comment_pre() { - entry.comments.extend(comment.map(|line| line.to_vec())); - } - if let Some(comment) = info.comment_post() { - entry.comments.extend(comment.map(|line| line.to_vec())); - } - if let Some(label) = info.label()? { - entry.label = Some(label); - } - if let Some(ty) = info.tinfo()? { - entry.ty = Some(ty); - } - } - - Ok(addr_info) -} -- cgit v1.3.1