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, 23.06.2019 21:40
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
question
Computers and Technology, 25.06.2019 02:30
On the pie chart below, which “slice” represents 30% of the budget?
Answers: 2
question
Computers and Technology, 25.06.2019 08:00
The heart of a computer.basic input/output systemselectmain memoryserial portcentral processing unit (cpu)
Answers: 3
question
Computers and Technology, 25.06.2019 12:00
Understanding the or how each piece of the production process leads to customer satisfaction at the end is another important skill related to workflow.
Answers: 1
You know the right answer?
Consider the functions below, with both C code and compiled assembly provided. Recall that gets(buf)...
Questions
question
Computers and Technology, 24.07.2019 19:00
question
Mathematics, 24.07.2019 19:00
question
Social Studies, 24.07.2019 19:00
question
Mathematics, 24.07.2019 19:00
Questions on the website: 13722361