Compare commits

..
4 Commits
3 changed files with 6 additions and 5 deletions
Generated
+1 -1
View File
@@ -2165,7 +2165,7 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "lemur"
version = "0.7.3"
version = "0.8.1"
dependencies = [
"anyhow",
"atoi",
+1 -1
View File
@@ -4,7 +4,7 @@ description = "An emulator for the Virtual Boy."
repository = "https://git.virtual-boy.com/PVB/lemur"
publish = false
license = "MIT"
version = "0.7.3"
version = "0.8.1"
edition = "2024"
[dependencies]
+4 -3
View File
@@ -86,12 +86,13 @@ fn parse_elf_program<Elf: object::read::elf::FileHeader<Endian = object::Endiann
let mut bytes = vec![];
let mut pstart = None;
for phdr in header.program_headers(endian, data).ok()? {
if phdr.p_filesz(endian).into() == 0 {
let pma = phdr.p_paddr(endian).into();
if pma < 0x07000000 || phdr.p_filesz(endian).into() == 0 {
continue;
}
let start = pstart.unwrap_or(phdr.p_paddr(endian).into());
let start = pstart.unwrap_or(pma);
pstart = Some(start);
bytes.resize((phdr.p_paddr(endian).into() - start) as usize, 0);
bytes.resize((pma - start) as usize, 0);
let data = phdr.data(endian, data).ok()?;
bytes.extend_from_slice(data);
}