Skip to content

Commit

Permalink
Support loading IDBs from projects in idb_import
Browse files Browse the repository at this point in the history
  • Loading branch information
negasora committed Oct 14, 2024
1 parent f95056e commit a9d3753
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions rust/examples/idb_import/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ use anyhow::Result;
struct IDBDebugInfoParser;
impl CustomDebugInfoParser for IDBDebugInfoParser {
fn is_valid(&self, view: &BinaryView) -> bool {
view.file().filename().as_str().ends_with(".i64")
|| view.file().filename().as_str().ends_with(".idb")
if let Some(project_file) = view.file().get_project_file() {
project_file.name().as_str().ends_with(".i64")
|| project_file.name().as_str().ends_with(".idb")
}
else {
view.file().filename().as_str().ends_with(".i64")
|| view.file().filename().as_str().ends_with(".idb")
}
}

fn parse_info(
Expand All @@ -44,7 +50,12 @@ impl CustomDebugInfoParser for IDBDebugInfoParser {
struct TILDebugInfoParser;
impl CustomDebugInfoParser for TILDebugInfoParser {
fn is_valid(&self, view: &BinaryView) -> bool {
view.file().filename().as_str().ends_with(".til")
if let Some(project_file) = view.file().get_project_file() {
project_file.name().as_str().ends_with(".til")
}
else {
view.file().filename().as_str().ends_with(".til")
}
}

fn parse_info(
Expand Down

0 comments on commit a9d3753

Please sign in to comment.