diff options
| author | Mason Reed <mason@vector35.com> | 2026-01-20 14:30:34 -0800 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-03-23 21:50:02 -0700 |
| commit | 1e85844d6407db817db25fd43f1dd9756ef0c3ae (patch) | |
| tree | d6d2df2c3ed9403604fecff294be88d70fce5cf7 /plugins/idb_import/src/addr_info.rs | |
| parent | 1f98e7ca7cce35ae4c2b4741f33e9892dd695534 (diff) | |
IDB Import refactor
Diffstat (limited to 'plugins/idb_import/src/addr_info.rs')
| -rw-r--r-- | plugins/idb_import/src/addr_info.rs | 53 |
1 files changed, 0 insertions, 53 deletions
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<Vec<u8>>, - pub label: Option<Cow<'a, [u8]>>, - // TODO make this a ref - pub ty: Option<til::Type>, -} - -pub fn get_info<'a, K: IDAKind>( - id0: &'a ID0Section<K>, - id1: &ID1Section, - id2: Option<&ID2Section<K>>, - netdelta: Netdelta<K>, -) -> Result<HashMap<Address<K>, AddrInfo<'a>>> { - let mut addr_info: HashMap<Address<K>, 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) -} |
