1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#include <stdio.h>
#include <sys/param.h>
#include <sys/file.h>
#include <aouthdr.h>
#include <sys/ptrace.h>
struct ptrace_user u;
main(argc,argv)
int argc;
char *argv[];
{
int fd;
if (argc < 2) {
printf("give me a break, and a file...\n");
exit(0);
}
fd = open(argv[1],O_RDONLY);
read(fd,&u,sizeof (struct ptrace_user));
printf("sizeof ptrace: %o\n",sizeof(struct ptrace_user));
printf("dsize: %lo\n",u.pt_dsize);
printf("ssize: %lo\n",u.pt_ssize);
printf("magic: %o\n",u.pt_aouthdr.magic);
printf("vstamp: %o\n",u.pt_aouthdr.vstamp);
printf("tsize: %lo\n",u.pt_aouthdr.tsize);
printf("dsize: %lo\n",u.pt_aouthdr.dsize);
printf("bsize: %lo\n",u.pt_aouthdr.bsize);
printf("msize: %lo\n",u.pt_aouthdr.msize);
printf("mod_start: %lo\n",u.pt_aouthdr.mod_start);
printf("entry: %lo\n",u.pt_aouthdr.entry);
printf("text_start: %lo\n",u.pt_aouthdr.text_start);
printf("data_start: %lo\n",u.pt_aouthdr.data_start);
printf("entry_mod: %lo\n",u.pt_aouthdr.entry_mod);
printf("flags: %o\n",u.pt_aouthdr.flags);
printf("\n");
close(fd);
}
|