Question: objectCode5: file format elf32-i386 Disassembly of section .init: 080482d8 : 80482d8: 53 push %ebx 80482d9: 83 ec 08 sub $0x8,%esp 80482dc: e8 9f 00 00

objectCode5: file format elf32-i386

Disassembly of section .init:

080482d8 <_init>: 80482d8: 53 push %ebx 80482d9: 83 ec 08 sub $0x8,%esp 80482dc: e8 9f 00 00 00 call 8048380 <__x86.get_pc_thunk.bx> 80482e1: 81 c3 1f 1d 00 00 add $0x1d1f,%ebx 80482e7: 8b 83 fc ff ff ff mov -0x4(%ebx),%eax 80482ed: 85 c0 test %eax,%eax 80482ef: 74 05 je 80482f6 <_init+0x1e> 80482f1: e8 2a 00 00 00 call 8048320 <__gmon_start__@plt> 80482f6: 83 c4 08 add $0x8,%esp 80482f9: 5b pop %ebx 80482fa: c3 ret

Disassembly of section .plt:

08048300 : 8048300: ff 35 04 a0 04 08 pushl 0x804a004 8048306: ff 25 08 a0 04 08 jmp *0x804a008 804830c: 00 00 add %al,(%eax) ...

08048310 : 8048310: ff 25 0c a0 04 08 jmp *0x804a00c 8048316: 68 00 00 00 00 push $0x0 804831b: e9 e0 ff ff ff jmp 8048300 <_init+0x28>

08048320 <__gmon_start__@plt>: 8048320: ff 25 10 a0 04 08 jmp *0x804a010 8048326: 68 08 00 00 00 push $0x8 804832b: e9 d0 ff ff ff jmp 8048300 <_init+0x28>

08048330 <__libc_start_main@plt>: 8048330: ff 25 14 a0 04 08 jmp *0x804a014 8048336: 68 10 00 00 00 push $0x10 804833b: e9 c0 ff ff ff jmp 8048300 <_init+0x28>

08048340 : 8048340: ff 25 18 a0 04 08 jmp *0x804a018 8048346: 68 18 00 00 00 push $0x18 804834b: e9 b0 ff ff ff jmp 8048300 <_init+0x28>

Disassembly of section .text:

08048350 <_start>: 8048350: 31 ed xor %ebp,%ebp 8048352: 5e pop %esi 8048353: 89 e1 mov %esp,%ecx 8048355: 83 e4 f0 and $0xfffffff0,%esp 8048358: 50 push %eax 8048359: 54 push %esp 804835a: 52 push %edx 804835b: 68 60 85 04 08 push $0x8048560 8048360: 68 f0 84 04 08 push $0x80484f0 8048365: 51 push %ecx 8048366: 56 push %esi 8048367: 68 7f 84 04 08 push $0x804847f 804836c: e8 bf ff ff ff call 8048330 <__libc_start_main@plt> 8048371: f4 hlt 8048372: 66 90 xchg %ax,%ax 8048374: 66 90 xchg %ax,%ax 8048376: 66 90 xchg %ax,%ax 8048378: 66 90 xchg %ax,%ax 804837a: 66 90 xchg %ax,%ax 804837c: 66 90 xchg %ax,%ax 804837e: 66 90 xchg %ax,%ax

08048380 <__x86.get_pc_thunk.bx>: 8048380: 8b 1c 24 mov (%esp),%ebx 8048383: c3 ret 8048384: 66 90 xchg %ax,%ax 8048386: 66 90 xchg %ax,%ax 8048388: 66 90 xchg %ax,%ax 804838a: 66 90 xchg %ax,%ax 804838c: 66 90 xchg %ax,%ax 804838e: 66 90 xchg %ax,%ax

08048390 : 8048390: b8 27 a0 04 08 mov $0x804a027,%eax 8048395: 2d 24 a0 04 08 sub $0x804a024,%eax 804839a: 83 f8 06 cmp $0x6,%eax 804839d: 76 1a jbe 80483b9 804839f: b8 00 00 00 00 mov $0x0,%eax 80483a4: 85 c0 test %eax,%eax 80483a6: 74 11 je 80483b9 80483a8: 55 push %ebp 80483a9: 89 e5 mov %esp,%ebp 80483ab: 83 ec 14 sub $0x14,%esp 80483ae: 68 24 a0 04 08 push $0x804a024 80483b3: ff d0 call *%eax 80483b5: 83 c4 10 add $0x10,%esp 80483b8: c9 leave 80483b9: f3 c3 repz ret 80483bb: 90 nop 80483bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi

080483c0 : 80483c0: b8 24 a0 04 08 mov $0x804a024,%eax 80483c5: 2d 24 a0 04 08 sub $0x804a024,%eax 80483ca: c1 f8 02 sar $0x2,%eax 80483cd: 89 c2 mov %eax,%edx 80483cf: c1 ea 1f shr $0x1f,%edx 80483d2: 01 d0 add %edx,%eax 80483d4: d1 f8 sar %eax 80483d6: 74 1b je 80483f3 80483d8: ba 00 00 00 00 mov $0x0,%edx 80483dd: 85 d2 test %edx,%edx 80483df: 74 12 je 80483f3 80483e1: 55 push %ebp 80483e2: 89 e5 mov %esp,%ebp 80483e4: 83 ec 10 sub $0x10,%esp 80483e7: 50 push %eax 80483e8: 68 24 a0 04 08 push $0x804a024 80483ed: ff d2 call *%edx 80483ef: 83 c4 10 add $0x10,%esp 80483f2: c9 leave 80483f3: f3 c3 repz ret 80483f5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80483f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi

08048400 <__do_global_dtors_aux>: 8048400: 80 3d 24 a0 04 08 00 cmpb $0x0,0x804a024 8048407: 75 13 jne 804841c <__do_global_dtors_aux+0x1c> 8048409: 55 push %ebp 804840a: 89 e5 mov %esp,%ebp 804840c: 83 ec 08 sub $0x8,%esp 804840f: e8 7c ff ff ff call 8048390 8048414: c6 05 24 a0 04 08 01 movb $0x1,0x804a024 804841b: c9 leave 804841c: f3 c3 repz ret 804841e: 66 90 xchg %ax,%ax

08048420 : 8048420: b8 08 9f 04 08 mov $0x8049f08,%eax 8048425: 8b 10 mov (%eax),%edx 8048427: 85 d2 test %edx,%edx 8048429: 75 05 jne 8048430 804842b: eb 93 jmp 80483c0 804842d: 8d 76 00 lea 0x0(%esi),%esi 8048430: ba 00 00 00 00 mov $0x0,%edx 8048435: 85 d2 test %edx,%edx 8048437: 74 f2 je 804842b 8048439: 55 push %ebp 804843a: 89 e5 mov %esp,%ebp 804843c: 83 ec 14 sub $0x14,%esp 804843f: 50 push %eax 8048440: ff d2 call *%edx 8048442: 83 c4 10 add $0x10,%esp 8048445: c9 leave 8048446: e9 75 ff ff ff jmp 80483c0 804844b: 90 nop

0804844c : 804844c: 55 push %ebp 804844d: 89 e5 mov %esp,%ebp 804844f: 83 ec 18 sub $0x18,%esp 8048452: 83 7d 08 01 cmpl $0x1,0x8(%ebp) 8048456: 7f 09 jg 8048461 8048458: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp) 804845f: eb 19 jmp 804847a 8048461: 8b 45 08 mov 0x8(%ebp),%eax 8048464: 83 e8 01 sub $0x1,%eax 8048467: 83 ec 0c sub $0xc,%esp 804846a: 50 push %eax 804846b: e8 dc ff ff ff call 804844c 8048470: 83 c4 10 add $0x10,%esp 8048473: 0f af 45 08 imul 0x8(%ebp),%eax 8048477: 89 45 f4 mov %eax,-0xc(%ebp) 804847a: 8b 45 f4 mov -0xc(%ebp),%eax 804847d: c9 leave 804847e: c3 ret

0804847f

: 804847f: 8d 4c 24 04 lea 0x4(%esp),%ecx 8048483: 83 e4 f0 and $0xfffffff0,%esp 8048486: ff 71 fc pushl -0x4(%ecx) 8048489: 55 push %ebp 804848a: 89 e5 mov %esp,%ebp 804848c: 53 push %ebx 804848d: 51 push %ecx 804848e: 83 ec 10 sub $0x10,%esp 8048491: 89 c8 mov %ecx,%eax 8048493: 83 38 02 cmpl $0x2,(%eax) 8048496: 74 17 je 80484af 8048498: 83 ec 0c sub $0xc,%esp 804849b: 68 80 85 04 08 push $0x8048580 80484a0: e8 6b fe ff ff call 8048310 80484a5: 83 c4 10 add $0x10,%esp 80484a8: b8 ff ff ff ff mov $0xffffffff,%eax 80484ad: eb 2c jmp 80484db 80484af: 8b 40 04 mov 0x4(%eax),%eax 80484b2: 83 c0 04 add $0x4,%eax 80484b5: 8b 00 mov (%eax),%eax 80484b7: 83 ec 0c sub $0xc,%esp 80484ba: 50 push %eax 80484bb: e8 80 fe ff ff call 8048340 80484c0: 83 c4 10 add $0x10,%esp 80484c3: 89 c3 mov %eax,%ebx 80484c5: 89 d8 mov %ebx,%eax 80484c7: 83 ec 0c sub $0xc,%esp 80484ca: 50 push %eax 80484cb: e8 7c ff ff ff call 804844c 80484d0: 83 c4 10 add $0x10,%esp 80484d3: 89 45 f4 mov %eax,-0xc(%ebp) 80484d6: b8 00 00 00 00 mov $0x0,%eax 80484db: 8d 65 f8 lea -0x8(%ebp),%esp 80484de: 59 pop %ecx 80484df: 5b pop %ebx 80484e0: 5d pop %ebp 80484e1: 8d 61 fc lea -0x4(%ecx),%esp 80484e4: c3 ret 80484e5: 66 90 xchg %ax,%ax 80484e7: 66 90 xchg %ax,%ax 80484e9: 66 90 xchg %ax,%ax 80484eb: 66 90 xchg %ax,%ax 80484ed: 66 90 xchg %ax,%ax 80484ef: 90 nop

080484f0 <__libc_csu_init>: 80484f0: 55 push %ebp 80484f1: 57 push %edi 80484f2: 31 ff xor %edi,%edi 80484f4: 56 push %esi 80484f5: 53 push %ebx 80484f6: e8 85 fe ff ff call 8048380 <__x86.get_pc_thunk.bx> 80484fb: 81 c3 05 1b 00 00 add $0x1b05,%ebx 8048501: 83 ec 1c sub $0x1c,%esp 8048504: 8b 6c 24 30 mov 0x30(%esp),%ebp 8048508: 8d b3 04 ff ff ff lea -0xfc(%ebx),%esi 804850e: e8 c5 fd ff ff call 80482d8 <_init> 8048513: 8d 83 00 ff ff ff lea -0x100(%ebx),%eax 8048519: 29 c6 sub %eax,%esi 804851b: c1 fe 02 sar $0x2,%esi 804851e: 85 f6 test %esi,%esi 8048520: 74 27 je 8048549 <__libc_csu_init+0x59> 8048522: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8048528: 8b 44 24 38 mov 0x38(%esp),%eax 804852c: 89 2c 24 mov %ebp,(%esp) 804852f: 89 44 24 08 mov %eax,0x8(%esp) 8048533: 8b 44 24 34 mov 0x34(%esp),%eax 8048537: 89 44 24 04 mov %eax,0x4(%esp) 804853b: ff 94 bb 00 ff ff ff call *-0x100(%ebx,%edi,4) 8048542: 83 c7 01 add $0x1,%edi 8048545: 39 f7 cmp %esi,%edi 8048547: 75 df jne 8048528 <__libc_csu_init+0x38> 8048549: 83 c4 1c add $0x1c,%esp 804854c: 5b pop %ebx 804854d: 5e pop %esi 804854e: 5f pop %edi 804854f: 5d pop %ebp 8048550: c3 ret 8048551: eb 0d jmp 8048560 <__libc_csu_fini> 8048553: 90 nop 8048554: 90 nop 8048555: 90 nop 8048556: 90 nop 8048557: 90 nop 8048558: 90 nop 8048559: 90 nop 804855a: 90 nop 804855b: 90 nop 804855c: 90 nop 804855d: 90 nop 804855e: 90 nop 804855f: 90 nop

08048560 <__libc_csu_fini>: 8048560: f3 c3 repz ret 8048562: 66 90 xchg %ax,%ax

Disassembly of section .fini:

08048564 <_fini>: 8048564: 53 push %ebx 8048565: 83 ec 08 sub $0x8,%esp 8048568: e8 13 fe ff ff call 8048380 <__x86.get_pc_thunk.bx> 804856d: 81 c3 93 1a 00 00 add $0x1a93,%ebx 8048573: 83 c4 08 add $0x8,%esp 8048576: 5b pop %ebx 8048577: c3 ret

The file is run from the Linux command line, and takes one positive numerical argument, like this:

./objectCode5 3

(You can enter any small positive integer instead of 3.)

This code contains a function named what. Using gdb, figure out what the function named what computes:

Question 13 options:

1)

the absolute value of n

2)

n squared

3)

the sum of the integers from 1 through n

4)

factorial of n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!