mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-12 02:10:00 +00:00
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:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user