start tests

This commit is contained in:
nora 2025-03-09 16:35:54 +01:00
parent ca565ddeb3
commit 0af012d43a
10 changed files with 412 additions and 118 deletions

View file

@ -1,7 +1,7 @@
use eyre::{Result, bail};
pub struct Elf {
pub content: Vec<u8>,
pub struct Elf<'a> {
pub content: &'a [u8],
}
#[derive(Debug)]
@ -30,7 +30,7 @@ pub struct Phdr {
pub p_align: u32,
}
impl Elf {
impl<'a> Elf<'a> {
pub fn header(&self) -> Result<Header> {
let (ident, rest) = self.content.split_bytes(16)?;
if ident[..4] != *b"\x7fELF" {