Use Linux executable objectCode5 for this question. These files are on syccuxas01.pcc.edu in directory ~michael.trigoboff/cs201/quiz02LinuxFiles. The file is run from the Linux command line, and takes...




Use Linux executableobjectCode5 for this question. These files are onsyccuxas01.pcc.edu in directory ~michael.trigoboff/cs201/quiz02LinuxFiles.


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.)


Command line arguments are passed toint main(int argc, char** argv) as argumentsargc andargv. You should assume thatargc is at ebp+8 andargv is at ebp+12.


This code contains a function namedwhat. Usinggdb, figure out what the function named what computes:





Question options:






































1)


the absolute value of n




















2)


n squared




















3)


the sum of the integers from 1 through n




















4)


factorial of n






Оx804847f <main><br>Оx8048483 <main+4><br>ex8048486 <main+7> _pushl -0x4(%ecx)<br>Өx8048489 <main+10> push<br>Оx804848а <main+11> mov<br>Оx804848с <main+13> push<br>Ox804848d <main+14> push<br>Оx804848е <main+15> sub<br>Оx8048491 <main+18> mov<br>Өx8048493 <main+20> cmpl<br>Оx8048496 <main+23> je<br>Оx8048498 <main+25> sub<br>Оx804849b <main+28> рush<br>Оx80484а0 <main+33> сall<br>Оx80484a5 <main+38> add<br>Оx80484a8 <main+41> mov<br>Оx80484ad <main+46> jmp<br>Оx80484af <main+48> mov<br>Оx80484b2 <main+51> add<br>Оx80484b5 <main+54> mov<br>Оx80484b7 <main+56> sub<br>Өx4(%esp),%eсх<br>$0xfffffff0,%esp<br>lea<br>and<br>%ebp<br>%esp,%ebp<br>%ebx<br>%есх<br>$0x10,%esp<br>%есх,%eax<br>$0x2, (%eax)<br>Оx80484af <main+48><br>$0xc,%esp<br>$0x8048580<br>Оx8048310 <puts@plt><br>$0x10,%esp<br>$0xffffffff ,%eax<br>Оx80484db <main+92><br>Өx4(%eax),%eax<br>$0x4,%eax<br>(%eax),%eax<br>$0xc,%esp<br>

Extracted text: Оx804847f
Оx8048483 ex8048486 _pushl -0x4(%ecx) Өx8048489 push Оx804848а mov Оx804848с push Ox804848d push Оx804848е sub Оx8048491 mov Өx8048493 cmpl Оx8048496 je Оx8048498 sub Оx804849b рush Оx80484а0 сall Оx80484a5 add Оx80484a8 mov Оx80484ad jmp Оx80484af mov Оx80484b2 add Оx80484b5 mov Оx80484b7 sub Өx4(%esp),%eсх $0xfffffff0,%esp lea and %ebp %esp,%ebp %ebx %есх $0x10,%esp %есх,%eax $0x2, (%eax) Оx80484af $0xc,%esp $0x8048580 Оx8048310 $0x10,%esp $0xffffffff ,%eax Оx80484db Өx4(%eax),%eax $0x4,%eax (%eax),%eax $0xc,%esp
Ox80484c0 <main+65><br>Ox80484c3 <main+68><br>Ox80484c5 <main+70><br>Ox80484c7 <main+72><br>Ox80484ca <main+75><br>Ox80484cb <main+76><br>x80484d0 <main+81><br>Ox80484d3 <main+84><br>Ox80484d6 <main+87><br>Ox80484db <main+92><br>Ox80484de <main+95><br>Ox80484df <main+96><br>Ox80484e0 <main+97><br>Ox80484e1 <main+98><br>Ox80484e4 <main+101><br>$0x10,%esp<br>%eax,%ebx<br>%ebx,%eax<br>$0xc,%esp<br>add<br>mov<br>mov<br>sub<br>push<br>%eax<br>call<br>Ox804844c <what><br>$0x10,%esp<br>%eax,-0xc(%ebp)<br>$0x0,%eax<br>-0x8(%ebp),%esp<br>add<br>mov<br>mov<br>lea<br>pop<br>%ecx<br>pop<br>%ebx<br>pop<br>lea<br>%ebp<br>-0x4(%eсx),%esp<br>ret<br>Yoha<br>

Extracted text: Ox80484c0 Ox80484c3 Ox80484c5 Ox80484c7 Ox80484ca Ox80484cb x80484d0 Ox80484d3 Ox80484d6 Ox80484db Ox80484de Ox80484df Ox80484e0 Ox80484e1 Ox80484e4 $0x10,%esp %eax,%ebx %ebx,%eax $0xc,%esp add mov mov sub push %eax call Ox804844c $0x10,%esp %eax,-0xc(%ebp) $0x0,%eax -0x8(%ebp),%esp add mov mov lea pop %ecx pop %ebx pop lea %ebp -0x4(%eсx),%esp ret Yoha
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here