Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1- Hi Looking to get help to convert this assembly code to approximation of the C code [0x80484eb] (fcn) main 213 main (int arg_4h); var

1- Hi Looking to get help to convert this assembly code to approximation of the C code

image text in transcribed

image text in transcribed

image text in transcribed

[0x80484eb] (fcn) main 213 main (int arg_4h); var int local_2ch @ ebp-0x2c var unsigned int local_24h @ 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 @ esp+0x4 DATA XREF from 8x88048407 (entrye) 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 0x804864 "thatwaseasy mov dword [local 1chl, str.thatwaseasy sub esp, 0xc ; const char *format 0x804864 "Enter the password:" push str. Enter_the_password: call sym.imp.printf; [ga] add esp, 0x18 sub esp, 8 lea eax, [local_18h] push eax :const char *format push 0x8048661 call sym.imp. isoc99_scanf; [gb] add esp, 0x18 mov dword [local 20h], 0 jmp 0x8048574; [gc] [0x80484eb] (fcn) main 213 main (int arg_4h); var int local_2ch @ ebp-0x2c var unsigned int local_24h @ 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 @ esp+0x4 DATA XREF from 8x88048407 (entrye) 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 0x804864 "thatwaseasy mov dword [local 1chl, str.thatwaseasy sub esp, 0xc ; const char *format 0x804864 "Enter the password:" push str. Enter_the_password: call sym.imp.printf; [ga] add esp, 0x18 sub esp, 8 lea eax, [local_18h] push eax :const char *format push 0x8048661 call sym.imp. isoc99_scanf; [gb] add esp, 0x18 mov dword [local 20h], 0 jmp 0x8048574; [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