Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have a binary bomb homework and currently in PHASE_4: please help trace through the following assembly code to get the resutl. I am confusing

I have a binary bomb homework and currently in PHASE_4:

please help trace through the following assembly code to get the resutl. I am confusing on how this phase work.

I know that I need two interger inputs to defuse this phase:

0x0000000000401105 <+0>: sub $0x18,%rsp 0x0000000000401109 <+4>: lea 0xc(%rsp),%rcx 0x000000000040110e <+9>: lea 0x8(%rsp),%rdx 0x0000000000401113 <+14>: mov $0x40254a,%esi 0x0000000000401118 <+19>: mov $0x0,%eax 0x000000000040111d <+24>: callq 0x400ac8 <__isoc99_sscanf@plt> 0x0000000000401122 <+29>: cmp $0x2,%eax 0x0000000000401125 <+32>: jne 0x401135 0x0000000000401127 <+34>: mov 0xc(%rsp),%eax 0x000000000040112b <+38>: cmp $0x1,%eax 0x000000000040112e <+41>: jle 0x401135 0x0000000000401130 <+43>: cmp $0x4,%eax 0x0000000000401133 <+46>: jle 0x40113a 0x0000000000401135 <+48>: callq 0x40143c 0x000000000040113a <+53>: mov 0xc(%rsp),%esi 0x000000000040113e <+57>: mov $0x8,%edi 0x0000000000401143 <+62>: callq 0x400e70 0x0000000000401148 <+67>: cmp 0x8(%rsp),%eax 0x000000000040114c <+71>: je 0x401153 0x000000000040114e <+73>: callq 0x40143c 0x0000000000401153 <+78>: add $0x18,%rsp 0x0000000000401157 <+82>: retq

This is what inside Func4

Func 4: 0x400e70 mov %rbx,-0x18(%rsp) 0x400e75 mov %rbp,-0x10(%rsp) 0x400e7a mov %r12,-0x8(%rsp) 0x400e7f sub $0x18,%rsp 0x400e83 mov %edi,%ebx 0x400e85 mov %esi,%ebp 0x400e87 test %edi,%edi 0x400e89 jg 0x400e92 0x400e8b mov $0x0,%ebp 0x400e90 jmp 0x400eb2 0x400e92 cmp $0x1,%edi 0x400e95 je 0x400eb2 0x400e97 lea -0x1(%rbx),%edi 0x400e9a callq 0x400e70 0x400e9f mov %eax,%r12d 0x400ea2 lea -0x2(%rbx),%edi 0x400ea5 mov %ebp,%esi 0x400ea7 callq 0x400e70 0x400eac add %eax,%r12d 0x400eaf add %r12d,%ebp 0x400eb2 mov %ebp,%eax 0x400eb4 mov (%rsp),%rbx 0x400eb8 mov 0x8(%rsp),%rbp 0x400ebd mov 0x10(%rsp),%r12 0x400ec2 add $0x18,%rsp 0x400ec6 retq

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago