Skip to content

Commit

Permalink
fix default endianness
Browse files Browse the repository at this point in the history
  • Loading branch information
rbran committed Aug 6, 2024
1 parent c5ab90d commit 4027cd0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions view/ihex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use core::cmp::Ordering;
use binaryninja::binaryview::*;
use binaryninja::custombinaryview::*;
use binaryninja::rc::Ref;
use binaryninja::section::SectionBuilder;
use binaryninja::segment::SegmentBuilder;

pub struct IHexViewConstructor {
Expand Down Expand Up @@ -279,16 +278,15 @@ unsafe impl CustomBinaryView for IHexView {
fn init(&mut self, IHexViewData { data, start }: Self::Args) -> Result<()> {
self.data = data;
self.start = start;
//TODO this will cause a Segmentation Fault
//for chunk in self.data.iter() {
// self.add_segment(
// SegmentBuilder::new(chunk.address.into()..chunk.end().into())
// .executable(true)
// .readable(true)
// .contains_data(true)
// .contains_code(true),
// );
//}
for chunk in self.data.iter() {
self.add_segment(
SegmentBuilder::new(chunk.address.into()..chunk.end().into())
.executable(true)
.readable(true)
.contains_data(true)
.contains_code(true),
);
}
Ok(())
}
}
Expand All @@ -303,7 +301,7 @@ impl BinaryViewBase for IHexView {
}

fn default_endianness(&self) -> binaryninja::Endianness {
self.core.default_endianness()
binaryninja::Endianness::LittleEndian
}

fn address_size(&self) -> usize {
Expand Down

0 comments on commit 4027cd0

Please sign in to comment.