ft_nm/src/header.c

21 lines
464 B
C
Raw Normal View History

2024-03-15 14:58:57 +00:00
#include "ft_nm.h"
2024-03-25 10:06:09 +00:00
int get_header64(t_mapped_file mapped_file, Elf64_Ehdr *header) {
void *header_ptr = fetch(mapped_file, 0, 64);
if (!header_ptr) {
return FT_NM_FAILURE;
}
ft_memcpy(header, header_ptr, 64);
2024-03-15 14:58:57 +00:00
return FT_NM_SUCCESS;
}
2024-03-19 10:22:37 +00:00
2024-10-25 10:36:52 +00:00
int get_header32(t_mapped_file mapped_file, Elf32_Ehdr *header) {
void *header_ptr = fetch(mapped_file, 0, 52);
if (!header_ptr) {
return FT_NM_FAILURE;
}
ft_memcpy(header, header_ptr, 52);
return FT_NM_SUCCESS;
}