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

Method get_slice

rust/src/data_buffer.rs:59–65  ·  view source on GitHub ↗

Create a copy of a especified part of the data

(&self, start: usize, len: usize)

Source from the content-addressed store, hash-verified

57
58 /// Create a copy of a especified part of the data
59 pub fn get_slice(&self, start: usize, len: usize) -> Option<Self> {
60 if start + len > self.len() {
61 return None;
62 }
63 let ptr = unsafe { BNGetDataBufferSlice(self.0, start, len) };
64 (!ptr.is_null()).then(|| Self(ptr))
65 }
66
67 /// change the size of the allocated data, if new size is bigger data is
68 /// need to be initialized

Callers 1

get_sliceFunction · 0.80

Calls 1

lenMethod · 0.45

Tested by 1

get_sliceFunction · 0.64