반응형
답
- 기본 지식
- cdecl: 마지막 인자부터 첫 번째 인자 순으로거꾸로 push 된다.
- 답
- sum 함수 전에 거꾸로 push된다.
- a에는 push 3이 들어 갔고
- 그래서 b에는 push 2이 들어간다.
참고
https://iloveprogramming.tistory.com/181
[호출 규약] cdecl
cdecl인자 정달 방식:'cdecl'에서는 인자를 스택을 통해 전달한다. 이때 인자들은 호출이 이루어지기 전에 스택에 push 되느넫마지막 인자부터 첫 번째 인자 순으로 거꾸로 push 된다. 사용하는 이유:
iloveprogramming.tistory.com
끝
반응형
'hacking > pwnable' 카테고리의 다른 글
[Dream hack] Quiz: Calling Convention-4 (0) | 2024.05.27 |
---|---|
[Dream hack] Quiz: Calling Convention-3 (0) | 2024.05.27 |
[Dream hack] Quiz: Calling Convention-1 (0) | 2024.05.27 |
[Dream hack] Background: Calling Convention(완성 안ㄷ룀) (0) | 2024.05.23 |
[Dream hack] Quiz: Shellcode-3 (0) | 2024.05.23 |