-
Notifications
You must be signed in to change notification settings - Fork 248
update idb_import idb-rs to 0.1.12 #7236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Seems like |
We added a reader / writer impl recently in the rust bindings, maybe those work? I recall you asking for them @rbran binaryninja-api/rust/src/binary_view/reader.rs Lines 101 to 138 in cde1c38
https://github.com/Vector35/binaryninja-api/blob/dev/rust/tests/binary_reader.rs |
Humm... I forgot about that, that wold had worked too. |
@@ -86,10 +86,9 @@ struct BinaryViewReader<'a> { | |||
impl std::io::Read for BinaryViewReader<'_> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binaryninja-api/rust/src/binary_view/reader.rs
Lines 101 to 138 in cde1c38
impl Seek for BinaryReader { | |
/// Seek to the specified position. | |
fn seek(&mut self, pos: SeekFrom) -> std::io::Result<u64> { | |
match pos { | |
SeekFrom::Current(offset) => self.seek_to_relative_offset(offset), | |
SeekFrom::Start(offset) => self.seek_to_offset(offset), | |
SeekFrom::End(end_offset) => { | |
// We do NOT need to add the image base here as | |
// the reader (unlike the writer) can set the virtual base. | |
let offset = | |
self.view | |
.len() | |
.checked_add_signed(end_offset) | |
.ok_or(std::io::Error::new( | |
ErrorKind::Other, | |
"Seeking from end overflowed", | |
))?; | |
self.seek_to_offset(offset); | |
} | |
}; | |
Ok(self.offset()) | |
} | |
} | |
impl Read for BinaryReader { | |
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> { | |
let len = buf.len(); | |
let result = unsafe { BNReadData(self.handle, buf.as_mut_ptr() as *mut _, len) }; | |
if !result { | |
Err(std::io::Error::new(ErrorKind::Other, "Read out of bounds")) | |
} else { | |
Ok(len) | |
} | |
} | |
} |
As per the discussion we had in this PR swap BinaryViewReader out for the one in bindings
I'm unable to use |
Unfortunately I'm unable to test this on the latest dev release of Binary Ninja, it seems that something on the BinaryViewReader changed (likely
BinaryView::offset_valid
) and it broke all the versions of idb_import.I'm investigating.