fix: add base address to elf entrypoint during process scanning (#1989)

As is done for PE, the entrypoint computed during process memory
scanning should be added to the base address of the block, so that the
returned value is the process address of the entrypoint.
This commit is contained in:
Vincent Thiberville
2023-11-16 09:38:40 +01:00
committed by GitHub
parent 12566310ea
commit 587c10ada7
+2 -2
View File
@@ -405,7 +405,7 @@ uint64_t yr_get_entry_point_address(
elf_header32 = (elf32_header_t*) buffer;
if (elf_header32->type == ELF_ET_EXEC)
return elf_header32->entry;
return base_address + elf_header32->entry;
break;
@@ -413,7 +413,7 @@ uint64_t yr_get_entry_point_address(
elf_header64 = (elf64_header_t*) buffer;
if (elf_header64->type == ELF_ET_EXEC)
return elf_header64->entry;
return base_address + elf_header64->entry;
break;
}