/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_nm_otool.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/20 14:36:10 by jhalford #+# #+# */ /* Updated: 2017/11/07 16:02:32 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef FT_NM_OTOOL_H # define FT_NM_OTOOL_H # include "libft.h" # include # include # include # include # include # include # include # include # include # include # include "ft_nm.h" # include "ft_otool.h" # include "mach_64.h" # include "mach.h" # include "ppc.h" typedef struct s_fdata t_fdata; typedef unsigned int t_u; # define IS_MACH_64(x) (*(t_u*)x == MH_MAGIC_64||*(t_u*)x == MH_CIGAM_64) # define IS_MACH_32(x) (*(t_u*)x == MH_MAGIC||*(t_u*)x == MH_CIGAM) # define IS_FAT(x) (*(t_u*)x == FAT_MAGIC||*(t_u*)x == FAT_CIGAM) # define IS_REV(x) ({t_u m=*(t_u*)x;m==MH_CIGAM||m==MH_CIGAM_64||m==FAT_CIGAM;}) # define MC(ptr) memcheck(data->file, ptr, sizeof(ptr)) struct s_fdata { t_flag flag; char **av_data; void *file; void *eof; char *filename; }; void *fat_extract(struct fat_header *fat, char *aname); uint64_t endian(uint64_t n, uint8_t size); void memcheck(t_fdata *file, void *ptr, size_t size); #endif