32bit if, ft_nm displays all symbols thats it

This commit is contained in:
Jack Halford 2017-02-19 05:33:28 +01:00
parent 480c592c5b
commit 6319a23950
2 changed files with 13 additions and 4 deletions

View file

@ -6,7 +6,7 @@
# By: jhalford <jack@crans.org> +#+ +:+ +#+ # # By: jhalford <jack@crans.org> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2017/02/19 03:29:38 by jhalford #+# #+# # # Created: 2017/02/19 03:29:38 by jhalford #+# #+# #
# Updated: 2017/02/19 03:56:22 by jhalford ### ########.fr # # Updated: 2017/02/19 03:59:47 by jhalford ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/19 03:09:12 by jhalford #+# #+# */ /* Created: 2017/02/19 03:09:12 by jhalford #+# #+# */
/* Updated: 2017/02/19 03:56:34 by jhalford ### ########.fr */ /* Updated: 2017/02/19 05:32:56 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -55,11 +55,20 @@ void nm(char *ptr)
unsigned int magic_number; unsigned int magic_number;
magic_number = *(int *)ptr; magic_number = *(int *)ptr;
if (magic_number == MH_MAGIC_64) if (magic_number == MH_MAGIC_64 || magic_number == MH_CIGAM_64)
{ {
/* ft_printf("je suis un binaire 64 bits\n"); */ ft_printf("I'm a 64 it binary\n");
handle_64(ptr); handle_64(ptr);
} }
else if (magic_number == MH_MAGIC)
{
ft_printf("I'm a 32 it binary\n");
/* handle_32(ptr); */
}
else
{
ft_printf("unknown architecure\n");
}
} }
int main(int ac, char **av) int main(int ac, char **av)