Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help with assembly questions x86 start: PUSH EBP MOV EBP, ESP MOV ECX, [EBPtarg_0] MOV ESI, [EBP+arg-4 ] MOV[EBP+var1], 0 UMP loc 2 loc 1
help with assembly questions x86
start: PUSH EBP MOV EBP, ESP MOV ECX, [EBPtarg_0] MOV ESI, [EBP+arg-4 ] MOV[EBP+var1], 0 UMP loc 2 loc 1 MOV EAX, [EBP+ar 1] ADDEAX, ECX MOV EDX, byte ptr [EAX] XOREDX, ESI MOV [EAX], DL ADD [EBP+var_1], 0x1 loc 2: MOV EAX, [EBP+var 1] CMP byte ptr [ECX EAX], 0 JNZloc 1 MOV ESP, EBP POP EBP RETN 2.1)In a few sentences, explain what this function does 2.2)Write a function in C that is equivalent to the assembly above int func2(char arg_0, int arg_4) // Your code goes here 2.3) Let arg_0 be a pointer to the null-terminated string xa1 xd7 xd7 xae xff xe5 xfcle4 xa0xc5\xdblxe1" and let arg_4 be the integer 0x96 What is the value of the string pointed to by arg 0 when the function completes? What value does the function return? start: PUSH EBP MOV EBP, ESP MOV ECX, [EBPtarg_0] MOV ESI, [EBP+arg-4 ] MOV[EBP+var1], 0 UMP loc 2 loc 1 MOV EAX, [EBP+ar 1] ADDEAX, ECX MOV EDX, byte ptr [EAX] XOREDX, ESI MOV [EAX], DL ADD [EBP+var_1], 0x1 loc 2: MOV EAX, [EBP+var 1] CMP byte ptr [ECX EAX], 0 JNZloc 1 MOV ESP, EBP POP EBP RETN 2.1)In a few sentences, explain what this function does 2.2)Write a function in C that is equivalent to the assembly above int func2(char arg_0, int arg_4) // Your code goes here 2.3) Let arg_0 be a pointer to the null-terminated string xa1 xd7 xd7 xae xff xe5 xfcle4 xa0xc5\xdblxe1" and let arg_4 be the integer 0x96 What is the value of the string pointed to by arg 0 when the function completes? What value does the function returnStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started