Question: Help with assembly questions start PUSH EBP MOV EBP, ESP MOV EDX, [EBPtarg_0] MOV ESI, [EBPtarg_4] MOV EDI, 0x1A XOREAX, EAX loc 1: MOV ECX,

Help with assembly questions

Help with assembly questions start PUSH EBP MOV EBP, ESP MOV EDX,

start PUSH EBP MOV EBP, ESP MOV EDX, [EBPtarg_0] MOV ESI, [EBPtarg_4] MOV EDI, 0x1A XOREAX, EAX loc 1: MOV ECX, byte ptz [EDX] MOV EBX, byte ptr ESI] SUB ECX, EBX SUB ECX, EAX MOV[EDX], cx SHR ECX, 0x10 AND ECX, 0x1 MOV EAX, ECX INC EDX INC ESI DEC EDI TEST EDI, EDI JNZ loc 1 loc2 : XOREAX, EAX MOV ESP, EBP POP EBP RETN 3.1) In a few sentences, explain what this function does 3.2) Write a function in C that is equivalent to the assembly above int func3(char* arg_0, char* arg_4) // Your code goes here 3.3) Let arg_0 be a pointer to the null-terminated string d1\xe2\xd1lxcf\xd1lx0a" and let arg-4 be a pointer to the null-terminated string "gwertyuiopasdfghiklzxcvbnm". What is the value of the string pointed to by arg_0 when the function completes? start PUSH EBP MOV EBP, ESP MOV EDX, [EBPtarg_0] MOV ESI, [EBPtarg_4] MOV EDI, 0x1A XOREAX, EAX loc 1: MOV ECX, byte ptz [EDX] MOV EBX, byte ptr ESI] SUB ECX, EBX SUB ECX, EAX MOV[EDX], cx SHR ECX, 0x10 AND ECX, 0x1 MOV EAX, ECX INC EDX INC ESI DEC EDI TEST EDI, EDI JNZ loc 1 loc2 : XOREAX, EAX MOV ESP, EBP POP EBP RETN 3.1) In a few sentences, explain what this function does 3.2) Write a function in C that is equivalent to the assembly above int func3(char* arg_0, char* arg_4) // Your code goes here 3.3) Let arg_0 be a pointer to the null-terminated string d1\xe2\xd1lxcf\xd1lx0a" and let arg-4 be a pointer to the null-terminated string "gwertyuiopasdfghiklzxcvbnm". What is the value of the string pointed to by arg_0 when the function completes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!