From 8820fd7a7a553d8bceea870997cce3c12eeb9427 Mon Sep 17 00:00:00 2001 From: rbran Date: Thu, 22 May 2025 21:12:43 +0000 Subject: update idb_import idb-rs to 0.1.10 --- plugins/idb_import/src/addr_info.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (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 index 8d1b1c1b..cb977496 100644 --- a/plugins/idb_import/src/addr_info.rs +++ b/plugins/idb_import/src/addr_info.rs @@ -1,30 +1,32 @@ +use std::borrow::Cow; use std::collections::HashMap; use anyhow::Result; use idb_rs::id0::ID0Section; -use idb_rs::til; +use idb_rs::{til, IDAKind}; #[derive(Default)] pub struct AddrInfo<'a> { // TODO does binja diferenciate comments types on the API? pub comments: Vec<&'a [u8]>, - pub label: Option<&'a str>, + pub label: Option>, // TODO make this a ref pub ty: Option, } -pub fn get_info(id0: &ID0Section, version: u16) -> Result>> { - let mut addr_info: HashMap = HashMap::new(); +pub fn get_info( + id0: &ID0Section, + version: u16, +) -> Result>> { + use idb_rs::id0::FunctionsAndComments::*; + let mut addr_info: HashMap = HashMap::new(); // the old style comments, most likely empty on new versions - let old_comments = id0.functions_and_comments()?.filter_map(|fc| { - use idb_rs::id0::FunctionsAndComments::*; - match fc { - Err(e) => Some(Err(e)), - Ok(Comment { address, comment }) => Some(Ok((address, comment))), - Ok(Name | Function(_) | Unknown { .. }) => None, - } + let old_comments = id0.functions_and_comments()?.filter_map(|fc| match fc { + Err(e) => Some(Err(e)), + Ok(Comment { address, comment }) => Some(Ok((address, comment))), + Ok(Name | Function(_) | Unknown { .. }) => None, }); for old_comment in old_comments { let (addr, comment) = old_comment?; @@ -50,6 +52,7 @@ pub fn get_info(id0: &ID0Section, version: u16) -> Result {} + DefinedStruct(_) => {} } } -- cgit v1.3.1