Eastern Michigan University Reverse Engineering Exercises

User Generated

inzcverxvat189

Programming

Eastern Michigan University

Description

These 2 questions i am stuck in and i cant understand them. please help.

Unformatted Attachment Preview

Problem 3: Reverse Engineering (20%) Explain what each of the following assembly codes does. I need a high-level explanation, not interpretation of the code instruction by instruction. Think about the overall objective of the code. For example, your answer may be something like: “this code calculates the factorial of an integer”, “this code reverses a string”, etc. Again, don't explain all the instructions one-by-one. You can find out what the codes do in two ways: • Read, understand the code, and describe the logic/objective behind it. • Or execute the code in VS, observe how the registers and variables change during and after the execution to infer the objective of the code. • If required, you can change the values of the variables/lists to confirm your findings. a. .data arr BYTE "A test TEXT!", O • Hint. Observe how the content of arr change during debugging and see how the values change during the program execution. .code main PROC mov esi, OFFSET arr L1: mov al, (esi) cmp al,0 je EXIT cmp al, 'A' jb next cmp al, 'z' ja L2 or BYTE PTR [esi], 00100000b jmp next L2: and BYTE PTR [esi), 11011111b next: inc esi jmp L1 EXIT: invoke Exit Process, 0 main endp b. .data buf SBYTE 100, -50, -30, 25, 10 .code main PROC mov edx, OFFSET buf mov ecx, LENGTHOF buf mov esi, 0 xor eax, eax xor ebx, ebx Hint. Think of what the instruction and al, 80h checks for? • Hint. What is being calculated in ebx? Ll: mov al, buf[esi) and al, 80h jz NO neg buf[esi] inc ebx NO: inc esi loop L1 main endp
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

I am attaching the final answers here. If you want me to do any revisions/changes, you can still message me here. I have included both pdf as well as the doc files.😊

(a)

The given assembly program processes the string present in ‘arr’, character by character,
and does the following things:
(i) If an uppercase letter is encountered, it is replaced by its corresponding lowercase.
(Ex: A -> a, B -> b, etc.)
(ii) If a lowercase letter is encountered, it is r...

Related Tags