summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-12-03 11:05:06 -0500
committerMason Reed <mason@vector35.com>2024-12-03 11:08:39 -0500
commit9b22a138793d31972cf2c8b3350eb2025505befe (patch)
treee132d96bebd89a08f5f401e994f77a6fe5859851
parentd14513b4abcd436082a768b73de9932fe67646e6 (diff)
IDB Import: Bump idb-rs dependency
Fixes many of the known parsing failures
-rw-r--r--rust/Cargo.lock16
-rw-r--r--rust/examples/idb_import/Cargo.toml2
-rw-r--r--rust/examples/idb_import/src/lib.rs10
-rw-r--r--rust/examples/idb_import/src/types.rs12
4 files changed, 13 insertions, 27 deletions
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 7069dd72..7a1284ef 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -513,15 +513,14 @@ dependencies = [
[[package]]
name = "idb-rs"
-version = "0.1.4"
-source = "git+https://github.com/Vector35/idb-rs#3317c6c1c2e94949365b7aee1b76c10b0cff23fc"
+version = "0.1.5"
+source = "git+https://github.com/Vector35/idb-rs#ce6a16395970d21eceea61a3105ea7a5f718cc53"
dependencies = [
"anyhow",
"bincode",
"clap",
"flate2",
"serde",
- "serde_repr",
]
[[package]]
@@ -965,17 +964,6 @@ dependencies = [
]
[[package]]
-name = "serde_repr"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.52",
-]
-
-[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/rust/examples/idb_import/Cargo.toml b/rust/examples/idb_import/Cargo.toml
index dd1e6c69..4e6acbad 100644
--- a/rust/examples/idb_import/Cargo.toml
+++ b/rust/examples/idb_import/Cargo.toml
@@ -10,5 +10,5 @@ crate-type = ["cdylib"]
[dependencies]
anyhow = { version = "1.0.86", features = ["backtrace"] }
binaryninja = { path = "../../" }
-idb-rs = { git = "https://github.com/Vector35/idb-rs", version = "0.1.4" }
+idb-rs = { git = "https://github.com/Vector35/idb-rs", version = "0.1.5" }
log = "0.4.20"
diff --git a/rust/examples/idb_import/src/lib.rs b/rust/examples/idb_import/src/lib.rs
index 3308f905..4adf04ca 100644
--- a/rust/examples/idb_import/src/lib.rs
+++ b/rust/examples/idb_import/src/lib.rs
@@ -23,8 +23,7 @@ impl CustomDebugInfoParser for IDBDebugInfoParser {
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 {
+ } else {
view.file().filename().as_str().ends_with(".i64")
|| view.file().filename().as_str().ends_with(".idb")
}
@@ -52,8 +51,7 @@ impl CustomDebugInfoParser for TILDebugInfoParser {
fn is_valid(&self, view: &BinaryView) -> bool {
if let Some(project_file) = view.file().get_project_file() {
project_file.name().as_str().ends_with(".til")
- }
- else {
+ } else {
view.file().filename().as_str().ends_with(".til")
}
}
@@ -337,7 +335,9 @@ fn parse_id0_section_info(
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn CorePluginInit() -> bool {
- Logger::new("IDB Import").with_level(LevelFilter::Error).init();
+ Logger::new("IDB Import")
+ .with_level(LevelFilter::Error)
+ .init();
DebugInfoParser::register("IDB Parser", IDBDebugInfoParser);
DebugInfoParser::register("TIL Parser", TILDebugInfoParser);
true
diff --git a/rust/examples/idb_import/src/types.rs b/rust/examples/idb_import/src/types.rs
index 360aa119..01cc5ff3 100644
--- a/rust/examples/idb_import/src/types.rs
+++ b/rust/examples/idb_import/src/types.rs
@@ -137,11 +137,7 @@ impl<F: Fn(usize, usize) -> Result<(), ()>> TranslateIDBTypes<'_, F> {
b"Unkown" | b"uint8_t" => Some(TranslateTypeResult::Translated(Type::int(1, false))),
b"IUnkown" | b"int8_t" => Some(TranslateTypeResult::Translated(Type::int(1, true))),
b"SHORT" | b"USHORT" => Some(TranslateTypeResult::Translated(Type::int(
- self.til
- .sizes
- .map(|x| x.size_short.get())
- .unwrap_or(2)
- .into(),
+ self.til.size_short.get() as usize,
name == b"SHORT",
))),
b"int16_t" => Some(TranslateTypeResult::Translated(Type::int(2, true))),
@@ -558,11 +554,13 @@ pub fn translate_ephemeral_type(debug_file: &BinaryView, ty: &TILType) -> Transl
cm: 0,
def_align: 1,
symbols: vec![],
- type_ordinal_numbers: None,
+ type_ordinal_alias: None,
types: vec![],
size_i: 4.try_into().unwrap(),
size_b: 1.try_into().unwrap(),
- sizes: None,
+ size_short: 2.try_into().unwrap(),
+ size_long: 4.try_into().unwrap(),
+ size_long_long: 8.try_into().unwrap(),
size_long_double: None,
macros: None,
is_universal: false,