Beispiel #1
0
char		*get_str(pid_t pid, unsigned long reg, unsigned long size)
{
  char		*peek;
  size_t	i;
  size_t	total;
  int		cont;
  int		max;
  char		*str;

  cont = get_str_init(&str, &max, &size, &total);
  strnadd(&str, "\"", 1);
  while (cont)
    {
      peek = (char*)my_ptrace(PTRACE_PEEKDATA, pid, (char*)(reg + total), 0);
      i = 0;
      while (i < 8 && ((((char*)&peek + i)[0] != '\0'
			&& size == 0) || size != 0))
	{
	  get_one_char(&str, ((char*)&peek + i)[0]);
	  ++i;
	}
      total += i;
      if ((i < 8 && size == 0) || (total >= size && size > 0))
	cont = 0;
    }
  get_str_end(&str, max);
  return (str);
}
//int my_epoll_wait_arm(int epfd, struct epoll_event *events, int maxevents, int timeout)
int my_ptrace_arm(int request, int pid, void* addr, void* data)
{
	//return my_epoll_wait(epfd, events, maxevents, timeout);
	return my_ptrace(request, pid, addr, data);
}