Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi Lab 2 Please I need to convert this code also from assembly code to C code please find the attachment below for the question

Hi

Lab 2 Please I need to convert this code also from assembly code to C code please find the attachment below for the question

image text in transcribed

image text in transcribed

image text in transcribed

[0x80484eb] (fcn) main 224 main (int arg_4h); | ; var int local2ch @ ebp-0x2c | ; var unsigned int local24h @ ebp-0x24 var signed int local 20h @ ebp-0x20 var int local_1ch @ ebp-0x1c var int local_18h @ ebp-0x18 var int local_ch @ ebp-0xc var int local_4h @ ebp-0x4 :arg int arg 4h a esp+0x4 DATA XREF from 0x08048407 (entry) 4 lea ecx, [arg_4h] and esp, 0xfffffffe push dword [ecx - 4] push ebp mov ebp, esp push ecx sub esp, 0x34 mov eax ecx [0x4:4]--1 4 mov eax, dword [eax + 4] mov dword [local_2ch], eax [0x14:4]--1 20 mov eax, dword gs: [0x14] mov dword [local_ch], eax xor eax eax mov dword [local_24h], 1 0x804865 "thatwaseasy mov dword [local 1chl, str.thatwaseasy sub esp, 0xc :const char *format 0x804865c "Enter the password: push str. Enter_the_password: call sym.imp.printf; [ga] add esp, 0x10 sub esp, 8 lea eax, [local-18h] push eax ; const char *format I push 0x8048671 call sym.imp. isoc99_scanf; [gb] add esp, 0x10 mov dword [local 20h], 0 jmp 0x884857f; [gc] [0x80484eb] (fcn) main 224 main (int arg_4h); | ; var int local2ch @ ebp-0x2c | ; var unsigned int local24h @ ebp-0x24 var signed int local 20h @ ebp-0x20 var int local_1ch @ ebp-0x1c var int local_18h @ ebp-0x18 var int local_ch @ ebp-0xc var int local_4h @ ebp-0x4 :arg int arg 4h a esp+0x4 DATA XREF from 0x08048407 (entry) 4 lea ecx, [arg_4h] and esp, 0xfffffffe push dword [ecx - 4] push ebp mov ebp, esp push ecx sub esp, 0x34 mov eax ecx [0x4:4]--1 4 mov eax, dword [eax + 4] mov dword [local_2ch], eax [0x14:4]--1 20 mov eax, dword gs: [0x14] mov dword [local_ch], eax xor eax eax mov dword [local_24h], 1 0x804865 "thatwaseasy mov dword [local 1chl, str.thatwaseasy sub esp, 0xc :const char *format 0x804865c "Enter the password: push str. Enter_the_password: call sym.imp.printf; [ga] add esp, 0x10 sub esp, 8 lea eax, [local-18h] push eax ; const char *format I push 0x8048671 call sym.imp. isoc99_scanf; [gb] add esp, 0x10 mov dword [local 20h], 0 jmp 0x884857f; [gc]

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

More Books

Students also viewed these Databases questions