gdb-peda$ disassemble main

Dump of assembler code for function main:

[ 스택 프롤로그 ]

   0x0804843c <+0>: push   ebp

   0x0804843d <+1>: mov    ebp,esp

   0x0804843f <+3>: sub    esp,0x8

////////////////////////////////////////////////////////////////////

   0x08048442 <+6>: mov    DWORD PTR [ebp-0x4],0xa
// int v1 = 10;

   0x08048449 <+13>: mov    DWORD PTR [ebp-0x8],0x14

// int v2 = 20;

   0x08048450 <+20>: push   DWORD PTR [ebp-0x8]

// 20

   0x08048453 <+23>: push   DWORD PTR [ebp-0x4]

// 10

   0x08048456 <+26>: call   0x804840b <f1>

// f1(10, 20)

   0x0804845b <+31>: add    esp,0x8

////////////////////////////////////////////////////////////////////

[ 스택 에필로그 ]
   0x0804845e <+34>: mov    eax,0x0

   0x08048463 <+39>: leave  

   0x08048464 <+40>: ret    

End of assembler dump.

////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////

gdb-peda$ disassemble f1
Dump of assembler code for function f1:
[ 스택 프롤로그 ]
   0x0804840b <+0>: push   ebp
   0x0804840c <+1>: mov    ebp,esp
   0x0804840e <+3>: sub    esp,0x8

////////////////////////////////////////////////////////////////////

   0x08048411 <+6>: mov    eax,DWORD PTR [ebp+0x8]
   0x08048414 <+9>: mov    DWORD PTR [ebp-0x4],eax
   0x08048417 <+12>: mov    eax,DWORD PTR [ebp+0xc]
   0x0804841a <+15>: mov    DWORD PTR [ebp-0x8],eax
   0x0804841d <+18>: mov    edx,DWORD PTR [ebp-0x4]
   0x08048420 <+21>: mov    eax,DWORD PTR [ebp-0x8]
   0x08048423 <+24>: add    eax,edx
   0x08048425 <+26>: push   eax
   0x08048426 <+27>: push   DWORD PTR [ebp-0x8]
   0x08048429 <+30>: push   DWORD PTR [ebp-0x4]
   0x0804842c <+33>: push   0x80484f0
   0x08048431 <+38>: call   0x80482e0 <printf@plt>

////////////////////////////////////////////////////////////////////

[ 스택 에필로그 ]
   0x08048436 <+43>: add    esp,0x10
   0x08048439 <+46>: nop
   0x0804843a <+47>: leave  
   0x0804843b <+48>: ret    
End of assembler dump.



'어셈블리' 카테고리의 다른 글

인라인 어셈블리  (0) 2017.10.15
제곱 어셈블리  (0) 2017.10.13
배열 어셈블리  (0) 2017.09.28
인라인 어셈 함수 인자 전달  (0) 2017.09.27
어셈블리 문자열 복사 stos  (0) 2017.09.27