[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!

9.1

Binary Bomb Phase 3

Asked by purewin in Assembly Programming Language, C Programming Language, Algorithms

I'm working on phase three of the bomb and I think I have a general idea on what kind of input I need was wondering if someone could verify.

It looks like I need to pass two inputs and the inputs can vary. The first input would be stored at
0x08048cd7 <phase_3+6>: lea    -0x8(%ebp),%eax
stored at (ebp-8)

then the second input would be stored at
0x08048cde <phase_3+13>:        lea    -0x4(%ebp),%eax
stored at (ebp-4)

then if input 2 at (ebp-4) <= 7
switch(*(ebp-4))
which switches to one of the statements depending on what the value of *(ebp-4) is.
which would then set the value of eax depending on the statement switched to.
which would then jump to the memory location referenced in the switch case which then performs an operation on eax and sets eax equal to the result.
then if *(ebp - 4) > 5 or eax != *(ebp - 8)
bomb_explode is called
otherwise phase is diffused

Am i interpreting this correctly?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
Dump of assembler code for function phase_3:
0x08048cd1 <phase_3+0>: push   %ebp
0x08048cd2 <phase_3+1>: mov    %esp,%ebp
0x08048cd4 <phase_3+3>: sub    $0x28,%esp
0x08048cd7 <phase_3+6>: lea    -0x8(%ebp),%eax
0x08048cda <phase_3+9>: mov    %eax,0xc(%esp)
0x08048cde <phase_3+13>:        lea    -0x4(%ebp),%eax
0x08048ce1 <phase_3+16>:        mov    %eax,0x8(%esp)
0x08048ce5 <phase_3+20>:        movl   $0x80497bb,0x4(%esp)
0x08048ced <phase_3+28>:        mov    0x8(%ebp),%eax
0x08048cf0 <phase_3+31>:        mov    %eax,(%esp)
0x08048cf3 <phase_3+34>:        call   0x8048828 <sscanf@plt>
0x08048cf8 <phase_3+39>:        cmp    $0x1,%eax
0x08048cfb <phase_3+42>:        jg     0x8048d02 <phase_3+49>
0x08048cfd <phase_3+44>:        call   0x8048f2c <explode_bomb>
0x08048d02 <phase_3+49>:        cmpl   $0x7,-0x4(%ebp)
0x08048d06 <phase_3+53>:        ja     0x8048d73 <phase_3+162>
0x08048d08 <phase_3+55>:        mov    -0x4(%ebp),%eax
0x08048d0b <phase_3+58>:        jmp    *0x804974c(,%eax,4)
0x08048d12 <phase_3+65>:        mov    $0x0,%eax
0x08048d17 <phase_3+70>:        jmp    0x8048d6c <phase_3+155>
0x08048d19 <phase_3+72>:        mov    $0x0,%eax
0x08048d1e <phase_3+77>:        xchg   %ax,%ax
0x08048d20 <phase_3+79>:        jmp    0x8048d67 <phase_3+150>
0x08048d22 <phase_3+81>:        mov    $0x0,%eax
0x08048d27 <phase_3+86>:        jmp    0x8048d62 <phase_3+145>
0x08048d29 <phase_3+88>:        mov    $0x0,%eax
0x08048d2e <phase_3+93>:        xchg   %ax,%ax
0x08048d30 <phase_3+95>:        jmp    0x8048d5d <phase_3+140>
0x08048d32 <phase_3+97>:        mov    $0x0,%eax
0x08048d37 <phase_3+102>:       jmp    0x8048d58 <phase_3+135>
0x08048d39 <phase_3+104>:       mov    $0x0,%eax
0x08048d3e <phase_3+109>:       xchg   %ax,%ax
0x08048d40 <phase_3+111>:       jmp    0x8048d53 <phase_3+130>
0x08048d42 <phase_3+113>:       mov    $0x6a,%eax
0x08048d47 <phase_3+118>:       jmp    0x8048d4e <phase_3+125>
0x08048d49 <phase_3+120>:       mov    $0x0,%eax
0x08048d4e <phase_3+125>:       sub    $0x363,%eax
0x08048d53 <phase_3+130>:       add    $0x396,%eax
0x08048d58 <phase_3+135>:       sub    $0x39d,%eax
0x08048d5d <phase_3+140>:       add    $0x1d2,%eax
0x08048d62 <phase_3+145>:       sub    $0x2ed,%eax
0x08048d67 <phase_3+150>:       add    $0x2ed,%eax
0x08048d6c <phase_3+155>:       sub    $0x331,%eax
0x08048d71 <phase_3+160>:       jmp    0x8048d7d <phase_3+172>
0x08048d73 <phase_3+162>:       call   0x8048f2c <explode_bomb>
---Type <return> to continue, or q <return> to quit---
0x08048d78 <phase_3+167>:       mov    $0x0,%eax
0x08048d7d <phase_3+172>:       cmpl   $0x5,-0x4(%ebp)
0x08048d81 <phase_3+176>:       jg     0x8048d88 <phase_3+183>
0x08048d83 <phase_3+178>:       cmp    -0x8(%ebp),%eax
0x08048d86 <phase_3+181>:       je     0x8048d8d <phase_3+188>
0x08048d88 <phase_3+183>:       call   0x8048f2c <explode_bomb>
0x08048d8d <phase_3+188>:       leave  
0x08048d8e <phase_3+189>:       xchg   %ax,%ax
0x08048d90 <phase_3+191>:       ret    
End of assembler dump.
 
Loading Advertisement...
 
[+][-]10/19/09 10:37 PM, ID: 25611256Accepted 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, C Programming Language, Algorithms
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 2
Solution Grade: A
 
[+][-]10/19/09 03:28 PM, ID: 25609563Expert 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.

 
[+][-]10/19/09 03:43 PM, ID: 25609632Author 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.

 
[+][-]10/19/09 05:00 PM, ID: 25609990Author 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.

 
[+][-]10/19/09 05:58 PM, ID: 25610234Author 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.

 
[+][-]10/20/09 12:23 PM, ID: 25617496Expert 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.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625