Question: Command-line arguments are passed to int main(int argc, char** argv) as arguments argc and argv. You should assume that argc is at ebp+8 and argv

Command-line arguments are passed to int main(int argc, char** argv) as arguments argc and argv. You should assume that argc is at ebp+8 and argv is at ebp+12.

0x401050 
: push %ebp 0x401051 : mov %esp,%ebp 0x401053 : sub $0x8,%esp 0x401056 : and $0xfffffff0,%esp 0x401059 : mov $0x0,%eax 0x40105e : mov %eax,0xfffffffc(%ebp) 0x401061 : mov 0xfffffffc(%ebp),%eax 0x401064 : call 0x4013a0 <_alloca> 0x401069 : call 0x401430 <__main> 0x40106e : mov $0x0,%edx 0x401073 : add 0x8(%ebp),%edx 0x401076 : mov %edx,%eax 0x401078 : leave 0x401079 : ret

This code returns the following value from main (in register eax):

A. Product of the command line arguments

B. Number of characters in the command line arguments

C. How many command-line arguments were provided

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!