質問編集履歴
4
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,19 +10,43 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
+
int sub();
|
14
|
+
|
15
|
+
|
16
|
+
|
13
17
|
int main(void){
|
18
|
+
|
19
|
+
sub();
|
20
|
+
|
21
|
+
return 0;
|
22
|
+
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
int sub(){
|
14
28
|
|
15
29
|
char moji[15];
|
16
30
|
|
31
|
+
scanf("%s\n",moji);
|
32
|
+
|
17
33
|
int * p;
|
18
34
|
|
19
|
-
|
35
|
+
int *subp;
|
20
36
|
|
21
|
-
p =
|
37
|
+
subp = main;
|
22
38
|
|
23
|
-
int
|
39
|
+
printf("This is main ReturnAddress: %p\n",subp);
|
24
40
|
|
41
|
+
printf("%d\n",sizeof(subp));
|
42
|
+
|
43
|
+
int *p;
|
44
|
+
|
45
|
+
p = (int*)moji;
|
46
|
+
|
47
|
+
int ebpofs;
|
48
|
+
|
25
|
-
for(
|
49
|
+
for(ebpofs=-32;ebpofs<80;ebpofs++){
|
26
50
|
|
27
51
|
printf("addr%p price:%x",p + count,p[count]);
|
28
52
|
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -73,3 +73,9 @@
|
|
73
73
|
![イメージ説明](911e6c812618bb27f7ab248e6e06f784.png)
|
74
74
|
|
75
75
|
![イメージ説明](8751c449be0900293932375f7a093bae.png)
|
76
|
+
|
77
|
+
sub関数逆アセンブル
|
78
|
+
|
79
|
+
![イメージ説明](f3270cf963d884a718b11d9a21f0b85f.png)
|
80
|
+
|
81
|
+
![イメージ説明](739ed9191f08e630acbf0dbaf55e9398.png)
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -69,3 +69,7 @@
|
|
69
69
|
CentOSではできないようでもなっているのでしょうか?
|
70
70
|
|
71
71
|
分からないのでお願いします。
|
72
|
+
|
73
|
+
![イメージ説明](911e6c812618bb27f7ab248e6e06f784.png)
|
74
|
+
|
75
|
+
![イメージ説明](8751c449be0900293932375f7a093bae.png)
|
1
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,15 +16,15 @@
|
|
16
16
|
|
17
17
|
int * p;
|
18
18
|
|
19
|
-
scanf("%s",moji);
|
19
|
+
scanf("%s\n",moji);
|
20
20
|
|
21
21
|
p = (int *)moji;
|
22
22
|
|
23
23
|
int count;
|
24
24
|
|
25
|
-
for(count=-
|
25
|
+
for(count=-32;count<80;count++){
|
26
26
|
|
27
|
-
printf("%p:%x",p + count,p[count]);
|
27
|
+
printf("addr%p price:%x",p + count,p[count]);
|
28
28
|
|
29
29
|
}
|
30
30
|
|