Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I need help with this phase 4 of deactivating a bomb. So far I know that the scanf function that gets called needs my

Hello, I need help with this phase 4 of deactivating a bomb. So far I know that the scanf function that gets called needs my input to be of type %d %d. I also know that my func4 that gets called is a recursive function. I believe it is doing some type of binary search thing but am getting lost in func4. The last thing I've gleaned is that it is checking to see if my %eax is equal to 0x15. So I'm imagining 21 is a number I'm shooting for. Any help would be really appreciated so I can get back on track.

below is a snapshot of the disassembly for this phase:

image text in transcribed

and below is the disassembly of func4 that is being called in phase_4

image text in transcribed

Any help would be appreciated. Thanks.

LU) I JUS lea guri net abo the ugh gur Dump of assembler code for function phase 4: Ox0000000000401015 : sub $0x18,%rsp 33 P Ox0000000000401019 : 0x8(%rsp),%rcx Ox000000000040101e : lea Oxc (%rsp),%rdx Ox0000000000401023 : mov $0x4027cd , %esi Ox0000000000401028 : mov $ 0x0,%eax be Ox000000000040102 d : callq 0x400c30 <_isoc99_sscanf> 24d Ox0000000000401032 : cmp $0x2,%eax Ox0000000000401035 : jne 0x40103e Ox0000000000401037 : cmpl $0xe, Oxc (%rsp) Ox0000000000401030 : jbe OX401043 Ox000000000040103 e ; calla Ox401554 Ox0000000000401043 mov $0xe , %edx Ox0000000000401048 : mov Doxo, les $0x0,%esi Ox000000000040104d ; mov Oxc(%rsp),%edi Ox0000000000401051 : callq 0x400fe2 Ox0000000000401056 ; cmp $0x15,%eax Ox0000000000401059 : jne 0x401062 Ox000000000040105b : cmpl $0x15, 0x8 (%rsp), Ox0000000000401060 : je 0x401067 Ox0000000000401062 ; callq Ox401554 Ox0000000000401067 ; add $0x18,%rsp Ox000000000040106b : reta, ---Type to continue, or a to quit--- 'End of assembler dump. ruin 3P guri shr he Ilgdb) disas Dump of assembler code for function func4 : Ox0000000000400fe2 : push. %rbx Ox0000000000400fe3 : mov %edx , %eax Ox0000000000400fe5 : sub %esi,%eax 'Ox0000000000400fe7 : mov %eax , %ebx Ox0000000000400 fe9 : $0x1f,%ebx et Ox0000000000400fec : X add %ebx , %eax be 0x0000000000400fee : sar %eax -40 =>_Ox0000000000400ffo : ,, lea (%rax,%rsi,1),%ebx "abo 'Ox0000000000400ff3 : cmp %edi,%ebx Ox0000000000400ff5 ; jle 'Ox401003 Ox0000000000400ff7 : lea gh - 0x1(%rbx),%edx Ox0000000000400ffa : calla Ox400fe2 'Ox0000000000400fff ; add %ebx , %eax uin Ox0000000000401001 : jmp 'Ox401013 Ox0000000000401003 : mov %ebx , %eax Ox0000000000401005 : cmp %edi , %ebx 'Ox0000000000401007 : jge '0x401013 Ox0000000000401009 ; Ox1(%rbx),%esi Ox000000000040100C : calla 0x400fe2 Ox0000000000401011 : add %ebx, %eax Ox0000000000401013 : pop %rbx Ox0000000000401014 : retgi ---Type to continue, or g to quit--- Sur lea

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

Transactions On Large Scale Data And Knowledge Centered Systems X Special Issue On Database And Expert Systems Applications Lncs 8220

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2013th Edition

ISBN: 3642412203, 978-3642412202

More Books

Students also viewed these Databases questions