subject

Consider the functions below, with both C code and compiled assembly provided. Recall that gets(buf) simply copies input in to buf. The inintial values of rsp, rbp, and rip are provided. The initial value of rip tells you the first instruction which will start to execute: the push at the start of test\_func. You can assume that the leaveq instruction is equivalent to movq $rbp, $rsp followed by popq $rbp. Initial State 000000000040002e 40002e: push %rbp 40002f: mov %rsp , %rbp 4000 32 : sub $0x10,%rsp 400036: movl S0xaddedfee,-0x10 (%rbp) 40003d: movl S0xfadedace, -0xc(rbp) 400044 : mov! SOxcedeface ,-0x8 (%rbp) 40004b: movl SOxabaddeed,-0x4(%rbp) 400052: lea 4000 56: callq 400016«get-buffer> 40005b mov 4000 5e : mov $0x400794 ,%esi 40006d: callq 4004f0 400072: eavec 400073: retq %rip = 0X4000 2e %rbp 0xff0088 %rsp 0xff0068 void test_funcO int localArr[4] - {Oxaddedfee, 0x10 (%rbp) ,%rdi Oxfadedace, Oxcedeface, Oxabaddeed). -0x10 (%rbp), %eax get buffer); print f("%2\n", loca!Arr [0]); 0000000000400016 : 400016: push %rbp 4000 17: mov %rsp , %rbp 40001a: sub $0x08 ,%rsp 40001e: lea 400022:mov SOx0,%eax 400027: callq 4000e0 40002c: leaveq 40002d: retq void get bufferO char buf[8]; gets(buf) -0x08 (%rbp), %rdi void magic)i 0000000000400074 : printf("+1\n); 400074: 400075: 400078: 40007d: 400082: 400083: push mov mov callq pop retq %rbp %rsp , %rbp $0x400798 ,%edi 4004c0 %rbp

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
These tools give presenters more freedom to move about the room and interact with their audience. laptop computer laser pointer lcd projector remote control
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
You know the right answer?
Consider the functions below, with both C code and compiled assembly provided. Recall that gets(buf)...
Questions
question
English, 23.03.2021 19:30
question
Mathematics, 23.03.2021 19:30