/*
** interp.c for libelfsh
** 
** Started on  Sun Jun 10 20:29:18 2001 mayhem
** Last update Wed Feb 27 00:59:27 2002 mayhem
*/
#include "libelfsh.h"



/* Find the interpreter (pht lookup method) */
char		*elfsh_get_interp(Elfsh32_Obj *file)
{
  Elfsh32_Sect	*new;

  if (!file->interp)
    {
      
      new = elfsh_get_section_by_name(file, ELFSH_SECTION_NAME_INTERP, NULL, NULL, NULL);
      if (!new)
	return (NULL);

      new->nbr = new->shdr->sh_size;

      new->data = elfsh_load_section(file, new->shdr);
      if (!new->data)
	return (NULL);
      
      file->interp = new;

    }
  
  return ((char *) new->data);
}

