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, 21.06.2019 18:30
What type of weird relationship this is analogy show? dissolve: solidify: : noise: silence
Answers: 2
question
Computers and Technology, 22.06.2019 11:10
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 16:50
15: 28read the summary of "an indian's view of indian affairs."15 betterin "an indian's view of indian affairs," it is asserted that conflicts could be reduced if white americansunderstood native americans..pswhich of the following would make this summary more complete? eleo the fact that chief joseph believes the great spirit sees everythinthe fact that chief joseph was born in oregon and is thirty-eight years oldo the fact that chief joseph states that he speaks from the hearthehehethe fact that chief joseph of the nez percé tribe made this claimebell- ==feetle===-felsefe ==submitmark this and retum.=
Answers: 3
You know the right answer?
Consider the functions below, with both C code and compiled assembly provided. Recall that gets(buf)...
Questions
question
Mathematics, 12.11.2020 21:10
question
Computers and Technology, 12.11.2020 21:10
question
English, 12.11.2020 21:10
question
Mathematics, 12.11.2020 21:10
Questions on the website: 13722361