Question

In: Computer Science

I am working on bomb lab phase 4, but I was thinking the first number may...

I am working on bomb lab phase 4, but I was thinking the first number may be equal to zero. but I have no idea how to figure out the second number, hope someone could help me out

Dump of assembler code for function phase_4:

0x00000000004010e8 <+0>:   sub $0x18,%rsp

   0x00000000004010ec <+4>:   lea 0x8(%rsp),%rcx

   0x00000000004010f1 <+9>:   lea 0xc(%rsp),%rdx

   0x00000000004010f6 <+14>:   mov $0x40256a,%esi

   0x00000000004010fb <+19>:   mov $0x0,%eax

   0x0000000000401100 <+24>:   callq 0x400ac8 <__isoc99_sscanf@plt>

   0x0000000000401105 <+29>:   cmp $0x2,%eax

   0x0000000000401108 <+32>:   jne 0x401117 <phase_4+47>

   0x000000000040110a <+34>:   mov 0xc(%rsp),%eax

   0x000000000040110e <+38>:   test %eax,%eax

   0x0000000000401110 <+40>:   js 0x401117 <phase_4+47>

   0x0000000000401112 <+42>:   cmp $0xe,%eax

   0x0000000000401115 <+45>:   jle 0x40111c <phase_4+52>

   0x0000000000401117 <+47>:   callq 0x40148f <explode_bomb>

   0x000000000040111c <+52>:   mov $0xe,%edx

   0x0000000000401121 <+57>:   mov $0x0,%esi

   0x0000000000401126 <+62>:   mov 0xc(%rsp),%edi

   0x000000000040112a <+66>:   callq 0x400e70 <func4>

   0x000000000040112f <+71>:   cmp $0x2,%eax

   0x0000000000401132 <+74>:   jne 0x40113b <phase_4+83>

   0x0000000000401134 <+76>:   cmpl $0x2,0x8(%rsp)

   0x0000000000401139 <+81>:   je 0x401140 <phase_4+88>

---Type <return> to continue, or q <return> to quit---

   0x000000000040113b <+83>:   callq 0x40148f <explode_bomb>

   0x0000000000401140 <+88>:   add $0x18,%rsp

   0x0000000000401144 <+92>:   retq

Dump of assembler code for function func4:

   0x0000000000400e70 <+0>:   sub $0x8,%rsp

   0x0000000000400e74 <+4>:   mov %edx,%eax

   0x0000000000400e76 <+6>:   sub %esi,%eax

   0x0000000000400e78 <+8>:   mov %eax,%ecx

   0x0000000000400e7a <+10>:   shr $0x1f,%ecx

   0x0000000000400e7d <+13>:   lea (%rcx,%rax,1),%eax

   0x0000000000400e80 <+16>:   sar %eax

   0x0000000000400e82 <+18>:   lea (%rax,%rsi,1),%ecx

   0x0000000000400e85 <+21>:   cmp %edi,%ecx

   0x0000000000400e87 <+23>:   jle 0x400e95 <func4+37>

   0x0000000000400e89 <+25>:   lea -0x1(%rcx),%edx

   0x0000000000400e8c <+28>:   callq 0x400e70 <func4>

   0x0000000000400e91 <+33>:   add %eax,%eax

   0x0000000000400e93 <+35>:   jmp 0x400eaa <func4+58>

   0x0000000000400e95 <+37>:   mov $0x0,%eax

   0x0000000000400e9a <+42>:   cmp %edi,%ecx

   0x0000000000400e9c <+44>:   jge 0x400eaa <func4+58>

   0x0000000000400e9e <+46>:   lea 0x1(%rcx),%esi

   0x0000000000400ea1 <+49>:   callq 0x400e70 <func4>

   0x0000000000400ea6 <+54>:   lea 0x1(%rax,%rax,1),%eax

   0x0000000000400eaa <+58>:   add $0x8,%rsp

   0x0000000000400eae <+62>:   retq

Solutions

Expert Solution

0x00000000004010e8 <+0>:   sub $0x18,%rsp

   0x00000000004010ec <+4>:   lea 0x8(%rsp),%rcx

   0x00000000004010f1 <+9>:   lea 0xc(%rsp),%rdx

   0x00000000004010f6 <+14>:   mov $0x40256a,%esi

   0x00000000004010fb <+19>:   mov $0x0,%eax

   0x0000000000401100 <+24>:   callq 0x400ac8 <__isoc99_sscanf@plt>

   0x0000000000401105 <+29>:   cmp $0x2,%eax

   0x0000000000401108 <+32>:   jne 0x401117 <phase_4+47>

   0x000000000040110a <+34>:   mov 0xc(%rsp),%eax

   0x000000000040110e <+38>:   test %eax,%eax

   0x0000000000401110 <+40>:   js 0x401117 <phase_4+47>

   0x0000000000401112 <+42>:   cmp $0xe,%eax

   0x0000000000401115 <+45>:   jle 0x40111c <phase_4+52>

   0x0000000000401117 <+47>:   callq 0x40148f <explode_bomb>

   0x000000000040111c <+52>:   mov $0xe,%edx

   0x0000000000401121 <+57>:   mov $0x0,%esi

   0x0000000000401126 <+62>:   mov 0xc(%rsp),%edi

   0x000000000040112a <+66>:   callq 0x400e70 <func4>

   0x000000000040112f <+71>:   cmp $0x2,%eax

   0x0000000000401132 <+74>:   jne 0x40113b <phase_4+83>

   0x0000000000401134 <+76>:   cmpl $0x2,0x8(%rsp)

   0x0000000000401139 <+81>:   je 0x401140 <phase_4+88>

---Type <return> to continue, or q <return> to quit---

   0x000000000040113b <+83>:   callq 0x40148f <explode_bomb>

   0x0000000000401140 <+88>:   add $0x18,%rsp

   0x0000000000401144 <+92>:   retq

Dump of assembler code for function func4:

   0x0000000000400e70 <+0>:   sub $0x8,%rsp

   0x0000000000400e74 <+4>:   mov %edx,%eax

   0x0000000000400e76 <+6>:   sub %esi,%eax

   0x0000000000400e78 <+8>:   mov %eax,%ecx

   0x0000000000400e7a <+10>:   shr $0x1f,%ecx

   0x0000000000400e7d <+13>:   lea (%rcx,%rax,1),%eax

   0x0000000000400e80 <+16>:   sar %eax

   0x0000000000400e82 <+18>:   lea (%rax,%rsi,1),%ecx

   0x0000000000400e85 <+21>:   cmp %edi,%ecx

   0x0000000000400e87 <+23>:   jle 0x400e95 <func4+37>

   0x0000000000400e89 <+25>:   lea -0x1(%rcx),%edx

   0x0000000000400e8c <+28>:   callq 0x400e70 <func4>

   0x0000000000400e91 <+33>:   add %eax,%eax

   0x0000000000400e93 <+35>:   jmp 0x400eaa <func4+58>

   0x0000000000400e95 <+37>:   mov $0x0,%eax

   0x0000000000400e9a <+42>:   cmp %edi,%ecx

   0x0000000000400e9c <+44>:   jge 0x400eaa <func4+58>

   0x0000000000400e9e <+46>:   lea 0x1(%rcx),%esi

   0x0000000000400ea1 <+49>:   callq 0x400e70 <func4>

   0x0000000000400ea6 <+54>:   lea 0x1(%rax,%rax,1),%eax

   0x0000000000400eaa <+58>:   add $0x8,%rsp

   0x0000000000400eae <+62>:   retq


Related Solutions

Hi! I am working on a lab for Organic Chemistry and I want to make sure...
Hi! I am working on a lab for Organic Chemistry and I want to make sure my answers are correct before submitting it! Thank you in advance! Stereoisomerism: A Model Exercise In this experiment you will construct models with your molecular model set that illustrate the concepts of chirality, chiral center (stereogenic center, asymmetric carbon atom), enantiomers, diastereomers, and meso forms. You will also learn about two conventions, R-S and Fischer, for designating the configurations of chiral molecules. You will...
I am working on a lab practical write up in which we have to measure the...
I am working on a lab practical write up in which we have to measure the acceleration due to gravity by observing carts rolling down an incline. I have to plot a scatter plot and use a program with Linear Least Squares Fit to calculate the gradient of the graph and uncertainty for this value. This program works but I don't know how to combine the uncertainty given for the Linear Fit with the uncertainties associated with my input x...
You've devised a new twist on the traditional 'What number am I thinking of?' game to...
You've devised a new twist on the traditional 'What number am I thinking of?' game to help your cousins learn their 7 times tables! Write a game that asks the user to guess the number you are thinking of. (For this game, the number will always be 42.) The user is allowed 10 guesses, and makes a 'Mistake!' if they guess a number that isn't a multiple of 7. A user can make a maximum of one mistake, otherwise they...
I am doing a post lab for a acid and base buffers lab. I was asked...
I am doing a post lab for a acid and base buffers lab. I was asked to find the theoretical pH (what the pH should actually be) for each of my pH's in my data please help it is due tonight and that is the only question I cannot figure out. I just need one of the theoretical pHsd' one and I can do the rest. Background: 30 mL of sodium dihydrogen phosphate and 20 mL k2HPO4 was added to...
Hello, I am working on an assignment but I am unsure of how to solve it....
Hello, I am working on an assignment but I am unsure of how to solve it. Please help me. The assignment details are below. Consider this scenario: Your friend starts a website, nothingbutflags.com, which is not making money. Your friend asks you to help generate more traffic. You ask your friend how much traffic the website had last month? And your friend replies and says only 500 visits. You also ask how many flags did you sell? Your friend replies...
Hello, I am working on an assignment but I am unsure of how to solve it....
Hello, I am working on an assignment but I am unsure of how to solve it. Please help me. The assignment details are below. Consider this scenario: Your friend starts a website, nothingbutflags.com, which is not making money. Your friend asks you to help generate more traffic. You ask your friend how much traffic the website had last month? And your friend replies and says only 500 visits. You also ask how many flags did you sell? Your friend replies...
I am working on this problem for the company AT & T and am not sure...
I am working on this problem for the company AT & T and am not sure how to start it. Draw a chart of the main inter-organizational linkage mechanisms (e.g., long -term contacts, strategic alliances, mergers) that your organization uses to manage its symbiotic resource interdependencies. Using resource dependence theory and transaction cost theory, discuss why the organization to manage its interdependencies in this way. Do you think the organization has selected the most appropriate linkage mechanisms? Why or why...
I am working on creating a Broadcast Receiver. I am extremely new to Android development and...
I am working on creating a Broadcast Receiver. I am extremely new to Android development and Java. I added my code at the bottom. Whenever I press the button the app crashes. I'm assuming something is wrong with connecting the broadcastIntent() function. I appreciate any help :) Here are the directions from my professor: Create an empty project Create a method in MainActivity.java which creates a Broadcast. public void broadcastIntent(View view){        Intent intent = new Intent();        intent.setAction("my.CUSTOM_INTENT"); sendBroadcast(intent);...
Explain applying for a position that I am currently working as a para-educator, however, I am...
Explain applying for a position that I am currently working as a para-educator, however, I am hired as an adult assistant. We are a new school short staff so I am needed to do more of the Para-educator's work alongside taking care of my student. How do I explain that showing I am qualified to do the new posting of Para-educator?
I am working on creating a Broadcast Receiver. I am extremely new to Android development and...
I am working on creating a Broadcast Receiver. I am extremely new to Android development and Java. I added my code at the bottom of this, but whenever I press the button the app crashes. I'm assuming something is wrong with connecting the broadcastIntent() function. If you could really focus on the first part that would be great!! I appreciate any help :) Here are the directions from my professor: Create an empty project Create a method in MainActivity.java which...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT