MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / seek

Method seek

rust/src/binary_writer.rs:83–100  ·  view source on GitHub ↗

Seek to the specified position.

(&mut self, pos: SeekFrom)

Source from the content-addressed store, hash-verified

81impl Seek for BinaryWriter {
82 /// Seek to the specified position.
83 fn seek(&mut self, pos: SeekFrom) -> std::io::Result<u64> {
84 match pos {
85 SeekFrom::Current(offset) => self.seek_to_relative_offset(offset),
86 SeekFrom::Start(offset) => self.seek_to_offset(offset),
87 SeekFrom::End(end_offset) => {
88 let view_end = self.view.original_image_base() + self.view.len();
89 let offset = view_end
90 .checked_add_signed(end_offset)
91 .ok_or(std::io::Error::new(
92 ErrorKind::Other,
93 "Seeking from end overflowed",
94 ))?;
95 self.seek_to_offset(offset);
96 }
97 };
98
99 Ok(self.offset())
100 }
101}
102
103impl Write for BinaryWriter {

Callers

nothing calls this directly

Calls 5

seek_to_offsetMethod · 0.45
original_image_baseMethod · 0.45
lenMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected