[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.5

need help with binary bomb phase_2

Asked by errang in Assembly Programming Language, Miscellaneous Programming

Tags: binary bomb, phase_2

Hey, I need to diffuse a binary bomb, I'm not an assembly language expert... so I'd appreciate any help =)

080519e5 <phase_2>:
 80519e5:       55                      push   %ebp
 80519e6:       89 e5                   mov    %esp,%ebp
 80519e8:       53                      push   %ebx
 80519e9:       83 ec 2c                sub    $0x2c,%esp
 80519ec:       8d 45 d8                lea    0xffffffd8(%ebp),%eax
 80519ef:       50                      push   %eax
 80519f0:       ff 75 08                pushl  0x8(%ebp)
 80519f3:       e8 5f 03 00 00          call   8051d57 <read_six_numbers>
 80519f8:       bb 01 00 00 00          mov    $0x1,%ebx
 80519fd:       83 c4 10                add    $0x10,%esp
 8051a00:       8b 44 9d d4             mov    0xffffffd4(%ebp,%ebx,4),%eax
 8051a04:       83 c0 05                add    $0x5,%eax
 8051a07:       39 44 9d d8             cmp    %eax,0xffffffd8(%ebp,%ebx,4)
 8051a0b:       74 05                   je     8051a12 <phase_2+0x2d>
 8051a0d:       e8 9a 07 00 00          call   80521ac <explode_bomb>
 8051a12:       43                      inc    %ebx
 8051a13:       83 fb 05                cmp    $0x5,%ebx
 8051a16:       7e e8                   jle    8051a00 <phase_2+0x1b>
 8051a18:       8b 5d fc                mov    0xfffffffc(%ebp),%ebx
 8051a1b:       c9                      leave
 8051a1c:       c3                      ret

08051d57 <read_six_numbers>:
 8051d57:       55                      push   %ebp
 8051d58:       89 e5                   mov    %esp,%ebp
 8051d5a:       83 ec 08                sub    $0x8,%esp
 8051d5d:       8b 55 0c                mov    0xc(%ebp),%edx
 8051d60:       8d 42 14                lea    0x14(%edx),%eax
 8051d63:       50                      push   %eax
 8051d64:       8d 42 10                lea    0x10(%edx),%eax
 8051d67:       50                      push   %eax
 8051d68:       8d 42 0c                lea    0xc(%edx),%eax
 8051d6b:       50                      push   %eax
 8051d6c:       8d 42 08                lea    0x8(%edx),%eax
 8051d6f:       50                      push   %eax
 8051d70:       8d 42 04                lea    0x4(%edx),%eax
 8051d73:       50                      push   %eax
 8051d74:       52                      push   %edx
 8051d75:       68 72 23 05 08          push   $0x8052372
 8051d7a:       ff 75 08                pushl  0x8(%ebp)
 8051d7d:       e8 d6 f7 ff ff          call   8051558 <_PROCEDURE_LINKAGE_TABLE_+0xb0>
 8051d82:       83 c4 20                add    $0x20,%esp
 8051d85:       83 f8 05                cmp    $0x5,%eax
 8051d88:       7f 05                   jg     8051d8f <read_six_numbers+0x38>
 8051d8a:       e8 1d 04 00 00          call   80521ac <explode_bomb>
 8051d8f:       c9                      leave
 8051d90:       c3                      ret


This is what I know about phase 2
080519e5 <phase_2>:
 80519e5:      55                         push   %ebp <------------------------Pushes ebp onto the stack
 80519e6:      89 e5                      mov    %esp,%ebp <-------------------ebp = esp
 80519e8:      53                         push   %ebx <------------------------Pushes ebx onto the stack
 80519e9:      83 ec 2c                   sub    $0x2c,%esp <------------------esp = esp-44
 80519ec:      8d 45 d8                   lea    0xffffffd8(%ebp),%eax <-------load effective address eax = 0xffffffd8(%ebp)?
 80519ef:      50                         push   %eax <------------------------Pushes eax onto the stack
 80519f0:      ff 75 08                   pushl  0x8(%ebp) <-------------------Push ebp onto the stack offset by 8
 80519f3:      e8 5f 03 00 00             call   8051d57 <read_six_numbers> <--Call the function with the parameters already there
 80519f8:      bb 01 00 00 00             mov    $0x1,%ebx <-------------------ebx = 1
 80519fd:      83 c4 10                   add    $0x10,%esp <------------------esp = esp + 10
 8051a00:      8b 44 9d d4                mov    0xffffffd4(%ebp,%ebx,4),%eax<-eax = 0xffffffd4(%ebp,%ebx,4)
 8051a04:      83 c0 05                   add    $0x5,%eax <-------------------eax = eax + 5
 8051a07:      39 44 9d d8                cmp    %eax,0xffffffd8(%ebp,%ebx,4)<-compares eax with that huge offset thing
 8051a0b:      74 05                      je     8051a12 <phase_2+0x2d> <------jumps if the compare works out right
 8051a0d:      e8 9a 07 00 00             call   80521ac <explode_bomb> <------explodes bomb, have to avoid this
 8051a12:      43                         inc    %ebx <------------------------increment ebx by 1?
 8051a13:      83 fb 05                   cmp    $0x5,%ebx <-------------------compare ebx to 5
 8051a16:      7e e8                      jle    8051a00 <phase_2+0x1b> <------jump less than phase 2 + the offset 8051A00
 8051a18:      8b 5d fc                   mov    0xfffffffc(%ebp),%ebx <-------ebx = the huge offset of ebp
 8051a1b:      c9                         leave  <-----------------------------breaks down the current stack frame
 8051a1c:      c3                         ret    <-----------------------------It goes back to the calling code

And this is what I think the C code should look like, not 100% sure its right:

void phase_2(char *input)
{
    int ii;
    int numbers[6];

    read_six_numbers(input, numbers);

    for (ii = 1; ii < 6; ii++) {
        if (numbers[ii] != numbers[ii-1] + 5)
            explode_bomb();
    }
}

I've gotta diffuse 4 more phases after this so I'd appreciate any hints to get this done.  Thanks in advance!!
 
Related Solutions
 
Loading Advertisement...
 
[+][-]04/26/09 11:53 PM, ID: 24239345Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 12:26 AM, ID: 24239461Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 12:34 AM, ID: 24239490Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 01:11 AM, ID: 24239646Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 08:41 AM, ID: 24242900Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 09:32 AM, ID: 24243344Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 09:38 AM, ID: 24243400Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 09:43 AM, ID: 24243452Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 11:07 AM, ID: 24244131Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 12:33 PM, ID: 24244926Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 02:00 PM, ID: 24245628Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 02:21 PM, ID: 24245796Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 02:46 PM, ID: 24245978Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 02:58 PM, ID: 24246072Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 04:10 PM, ID: 24246529Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 07:25 PM, ID: 24247157Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 10:57 PM, ID: 24247934Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Assembly Programming Language, Miscellaneous Programming
Tags: binary bomb, phase_2
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
[+][-]04/27/09 10:59 PM, ID: 24247937Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 11:07 PM, ID: 24247959Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/09 11:08 PM, ID: 24247964Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625