Add checks for invalid addresses

This commit is contained in:
Alex
2023-05-08 05:27:16 +03:00
parent e57195ef51
commit c9e2d99570
2 changed files with 13 additions and 8 deletions

View File

@ -27,6 +27,12 @@ namespace SymbolResolver
{
Symbols::Symbols(uintptr_t ImageAddress)
{
if (ImageAddress == 0 || Memory::Virtual().Check((void *)ImageAddress) == false)
{
error("Invalid image address %#lx", ImageAddress);
return;
}
this->Image = (void *)ImageAddress;
debug("Solving symbols for address: %#llx", ImageAddress);
Elf64_Ehdr *Header = (Elf64_Ehdr *)ImageAddress;