回答編集履歴
1
VC++ x86 のコンパイル結果を追加
test
CHANGED
@@ -119,3 +119,117 @@
|
|
119
119
|
testB[1] は testB[1][0] のアドレスに、そして、
|
120
120
|
|
121
121
|
testB[2] は testB[2][0] のアドレスに変換されます。
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
**追記**
|
126
|
+
|
127
|
+
Visual C++ の 32ビット版で -FAオプションでコンパイルすると、
|
128
|
+
|
129
|
+
```
|
130
|
+
|
131
|
+
_DATA SEGMENT
|
132
|
+
|
133
|
+
COMM _testA:DWORD:05H
|
134
|
+
|
135
|
+
COMM _testB:DWORD:06H
|
136
|
+
|
137
|
+
_DATA ENDS
|
138
|
+
|
139
|
+
PUBLIC _main
|
140
|
+
|
141
|
+
EXTRN _f:PROC
|
142
|
+
|
143
|
+
EXTRN _g:PROC
|
144
|
+
|
145
|
+
EXTRN @__security_check_cookie@4:PROC
|
146
|
+
|
147
|
+
EXTRN ___security_cookie:DWORD
|
148
|
+
|
149
|
+
; Function compile flags: /Odtp
|
150
|
+
|
151
|
+
_TEXT SEGMENT
|
152
|
+
|
153
|
+
_b$ = -48 ; size = 24
|
154
|
+
|
155
|
+
_a$ = -24 ; size = 20
|
156
|
+
|
157
|
+
__$ArrayPad$ = -4 ; size = 4
|
158
|
+
|
159
|
+
_main PROC
|
160
|
+
|
161
|
+
; File c:\tmp\c\a.c
|
162
|
+
|
163
|
+
; Line 10
|
164
|
+
|
165
|
+
push ebp
|
166
|
+
|
167
|
+
mov ebp, esp
|
168
|
+
|
169
|
+
sub esp, 48 ; 00000030H
|
170
|
+
|
171
|
+
mov eax, DWORD PTR ___security_cookie
|
172
|
+
|
173
|
+
xor eax, ebp
|
174
|
+
|
175
|
+
mov DWORD PTR __$ArrayPad$[ebp], eax
|
176
|
+
|
177
|
+
; Line 13
|
178
|
+
|
179
|
+
push OFFSET _testA
|
180
|
+
|
181
|
+
call _f
|
182
|
+
|
183
|
+
add esp, 4
|
184
|
+
|
185
|
+
; Line 14
|
186
|
+
|
187
|
+
push OFFSET _testB
|
188
|
+
|
189
|
+
call _g
|
190
|
+
|
191
|
+
add esp, 4
|
192
|
+
|
193
|
+
; Line 15
|
194
|
+
|
195
|
+
lea eax, DWORD PTR _a$[ebp]
|
196
|
+
|
197
|
+
push eax
|
198
|
+
|
199
|
+
call _f
|
200
|
+
|
201
|
+
add esp, 4
|
202
|
+
|
203
|
+
; Line 16
|
204
|
+
|
205
|
+
lea ecx, DWORD PTR _b$[ebp]
|
206
|
+
|
207
|
+
push ecx
|
208
|
+
|
209
|
+
call _g
|
210
|
+
|
211
|
+
add esp, 4
|
212
|
+
|
213
|
+
; Line 17
|
214
|
+
|
215
|
+
xor eax, eax
|
216
|
+
|
217
|
+
mov ecx, DWORD PTR __$ArrayPad$[ebp]
|
218
|
+
|
219
|
+
xor ecx, ebp
|
220
|
+
|
221
|
+
call @__security_check_cookie@4
|
222
|
+
|
223
|
+
mov esp, ebp
|
224
|
+
|
225
|
+
pop ebp
|
226
|
+
|
227
|
+
ret 0
|
228
|
+
|
229
|
+
_main ENDP
|
230
|
+
|
231
|
+
_TEXT ENDS
|
232
|
+
|
233
|
+
END
|
234
|
+
|
235
|
+
```
|