Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 03:00, 2020IRodriguez385
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
image
Computers and Technology, 24.06.2019 07:30, LuckyCharms988
Consider the folloeing website url: what does the "http: //" represent? a. protocal identifier. b. ftp. c. domain name d. resource name
Answers: 2
image
Computers and Technology, 24.06.2019 10:00, shrafe
Which two technologies support the building of single-page applications?
Answers: 2
image
Computers and Technology, 24.06.2019 18:30, brendahndz8676
Is a type of bullying that takes place when a person intentionally posts negative information about another person that is not true.
Answers: 2
Do you know the correct answer?
Consider the functions below, with both C code and compiled assembly provided. Recall that gets(buf)...

Questions in other subjects:

Konu
Social Studies, 27.01.2020 23:31