mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
patterns/elf: Fixed p_data definition in Phdr structs
This commit is contained in:
@@ -563,7 +563,7 @@ struct Elf32_Phdr {
|
||||
PF p_flags;
|
||||
Elf32_Word p_align;
|
||||
|
||||
if (p_offset > 0 && p_filesz > 0 && (p_offset + p_filesz) < std::mem::size() && p_filesz < std::mem::size())
|
||||
if (p_offset >= 0 && p_filesz > 0 && (p_offset + p_filesz) <= std::mem::size() && p_filesz <= std::mem::size())
|
||||
u8 p_data[p_filesz] @ p_offset [[sealed]];
|
||||
};
|
||||
|
||||
@@ -577,7 +577,7 @@ struct Elf64_Phdr {
|
||||
Elf64_Xword p_memsz;
|
||||
Elf64_Xword p_align;
|
||||
|
||||
if (p_offset > 0 && p_filesz > 0 && (p_offset + p_filesz) < std::mem::size() && p_filesz < std::mem::size())
|
||||
if (p_offset >= 0 && p_filesz > 0 && (p_offset + p_filesz) <= std::mem::size() && p_filesz <= std::mem::size())
|
||||
u8 p_data[p_filesz] @ p_offset [[sealed]];
|
||||
};
|
||||
|
||||
@@ -819,4 +819,4 @@ fn main() {
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user