MCPcopy Index your code
hub / github.com/MagnetForensics/dumpit-linux / read_offset

Method read_offset

src/main.rs:189–200  ·  view source on GitHub ↗

Read data inside /proc/kcore at a given file offset.

(&self, offset: u64, size: usize)

Source from the content-addressed store, hash-verified

187
188 // Read data inside /proc/kcore at a given file offset.
189 fn read_offset(&self, offset: u64, size: usize) -> Result<Vec<u8>> {
190 let mut buf = vec![0u8; size];
191
192 // Keep scoped to avoid accidental deadlocks.
193 {
194 let mut rdr = BufReader::new(&self.kcore);
195 rdr.seek(SeekFrom::Start(offset as u64))?;
196 rdr.read_exact(&mut buf)?;
197 }
198
199 Ok(buf)
200 }
201
202 // Read a buffer at a given kernel virtual address.
203 fn read_virtual(&self, va: u64, size: usize) -> Result<Vec<u8>> {

Callers 1

read_virtualMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected