Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

help with assembly x86 questions

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

' Which areas are you most dependent on to get your work done?

Answered: 1 week ago

Question

1. Identify six different types of history.

Answered: 1 week ago

Question

2. Define the grand narrative.

Answered: 1 week ago

Question

4. Describe the role of narratives in constructing history.

Answered: 1 week ago