reassign woody pointers after codecave creation

This commit is contained in:
pbonilla 2024-03-19 17:44:54 +01:00
parent 11bbe38aa4
commit 2c4bdfeeec
1 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,9 @@ size_t create_codecave(t_efl_content *woody, Elf64_Phdr *load_segment)
munmap(woody->file, woody->file_size);
woody->file = new_woody;
woody->file_size += padding_size;
woody->Ehdr = (Elf64_Ehdr *)new_woody;
woody->Phdr = (Elf64_Phdr *)fetch(woody->file, woody->file_size, woody->Ehdr->e_phoff, sizeof(Elf64_Phdr));
woody->Shdr = (Elf64_Shdr *)fetch(woody->file, woody->file_size, woody->Ehdr->e_shoff, sizeof(Elf64_Shdr));
return codecave_start;
}