From 2c4bdfeeecb8509b6782efc65f3fc749a14b8612 Mon Sep 17 00:00:00 2001 From: pbonilla Date: Tue, 19 Mar 2024 17:44:54 +0100 Subject: [PATCH] reassign woody pointers after codecave creation --- srcs/woody.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/srcs/woody.c b/srcs/woody.c index 0748f6b..c7d5778 100644 --- a/srcs/woody.c +++ b/srcs/woody.c @@ -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; }