: 0: lea 0x4(%esp),%ecx 4: and $0xfffffff0,%esp 7: pushl -0x4(%ecx) a: push %ebp b: mov %esp,%ebp d: push %ebx e: push %ecx f: sub $0x10,%esp 12: mov %ecx,%ebx 14: movl $0x0,-0xc(%ebp) 1b: movl $0x1,-0x10(%ebp) 22: jmp 48 24: mov -0x10(%ebp),%eax 27: lea 0x0(,%eax,4),%edx 2e: mov 0x4(%ebx),%eax 31: add %edx,%eax 33: mov (%eax),%eax 35: sub $0xc,%esp 38: push %eax 39: call 3a 3e: add $0x10,%esp 41: add %eax,-0xc(%ebp) 44: addl $0x1,-0x10(%ebp) 48: mov -0x10(%ebp),%eax 4b: cmp (%ebx),%eax 4d: jl 24 4f: mov -0xc(%ebp),%eax 52: lea -0x8(%ebp),%esp 55: pop %ecx 56: pop %ebx 57: pop %ebp 58: lea -0x4(%ecx),%esp 5b: ret Command line arguments are passed to int main(int argc, char** argv) as arguments argc and argv. You should assume that argc is at ebp+8 and argv is at ebp+12. This code returns the following value from main (in register eax): 1) 6,8 2) 7,8 3) 7,5
00000000 <main>:
0: lea 0x4(%esp),%ecx
4: and $0xfffffff0,%esp
7: pushl -0x4(%ecx)
a: push %ebp
b: mov %esp,%ebp
d: push %ebx
e: push %ecx
f: sub $0x10,%esp
12: mov %ecx,%ebx
14: movl $0x0,-0xc(%ebp)
1b: movl $0x1,-0x10(%ebp)
22: jmp 48 <main+0x48>
24: mov -0x10(%ebp),%eax
27: lea 0x0(,%eax,4),%edx
2e: mov 0x4(%ebx),%eax
31: add %edx,%eax
33: mov (%eax),%eax
35: sub $0xc,%esp
38: push %eax
39: call 3a <main+0x3a>
3e: add $0x10,%esp
41: add %eax,-0xc(%ebp)
44: addl $0x1,-0x10(%ebp)
48: mov -0x10(%ebp),%eax
4b: cmp (%ebx),%eax
4d: jl 24 <main+0x24>
4f: mov -0xc(%ebp),%eax
52: lea -0x8(%ebp),%esp
55: pop %ecx
56: pop %ebx
57: pop %ebp
58: lea -0x4(%ecx),%esp
5b: ret
Command line arguments are passed to int main(int argc, char** argv) as arguments argc and argv. You should assume that argc is at ebp+8 and argv is at ebp+12.
This code returns the following value from main (in register eax):
1) 6,8
2) 7,8
3) 7,5
Step by step
Solved in 2 steps