[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.3

Binary Bomb Phase 5

Asked by Cosmonaut in Assembly Programming Language, C Programming Language

Tags: Binary Bomb Phase 6

Hello,
I am working on the bomblab and am really struggling with the 6th phase.
I understand that it is a linked list and it is looking for the numbers 1-6 in some order.
This is the section that is really confusing me:

0x08048d72 <phase_6+145>:       mov    -0x3c(%ebp),%ecx
0x08048d75 <phase_6+148>:       mov    -0x38(%ebp),%eax
0x08048d78 <phase_6+151>:       mov    %eax,0x8(%ecx)
0x08048d7b <phase_6+154>:       mov    -0x34(%ebp),%edx
0x08048d7e <phase_6+157>:       mov    %edx,0x8(%eax)
0x08048d81 <phase_6+160>:       mov    -0x30(%ebp),%eax
0x08048d84 <phase_6+163>:       mov    %eax,0x8(%edx)
0x08048d87 <phase_6+166>:       mov    -0x2c(%ebp),%edx
0x08048d8a <phase_6+169>:       mov    %edx,0x8(%eax)
0x08048d8d <phase_6+172>:       mov    -0x28(%ebp),%eax
0x08048d90 <phase_6+175>:       mov    %eax,0x8(%edx)
0x08048d93 <phase_6+178>:       movl   $0x0,0x8(%eax)
0x08048d9a <phase_6+185>:       mov    %ecx,%ebx
0x08048d9c <phase_6+187>:       mov    $0x0,%esi
0x08048da1 <phase_6+192>:       mov    0x8(%ebx),%edx
0x08048da4 <phase_6+195>:       mov    (%ebx),%eax
0x08048da6 <phase_6+197>:       cmp    (%edx),%eax
0x08048da8 <phase_6+199>:       jge    0x8048daf <phase_6+206>

I've been able to figure out the numeric values to each node in the linked list that are compared here "cmp    (%edx),%eax"  however, I haven't had any luck figuring out which node goes with what number from the 1-6 set.
I'm also confused about what order they are compared in, at first I thought that eax was the last number and edx was the first and it worked towards the center but that isn't right....
I hope I'm being clear, and any push in the right direction would be greatly appreciated!
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:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
Dump of assembler code for function phase_6:
0x08048ce1 <phase_6+0>: push   %ebp
0x08048ce2 <phase_6+1>: mov    %esp,%ebp
0x08048ce4 <phase_6+3>: push   %edi
0x08048ce5 <phase_6+4>: push   %esi
0x08048ce6 <phase_6+5>: push   %ebx
0x08048ce7 <phase_6+6>: sub    $0x3c,%esp
0x08048cea <phase_6+9>: lea    -0x24(%ebp),%eax
0x08048ced <phase_6+12>:        mov    %eax,0x4(%esp)
0x08048cf1 <phase_6+16>:        mov    0x8(%ebp),%eax
0x08048cf4 <phase_6+19>:        mov    %eax,(%esp)
0x08048cf7 <phase_6+22>:        call   0x8049383 <read_six_numbers>
0x08048cfc <phase_6+27>:        mov    $0x0,%ebx
0x08048d01 <phase_6+32>:        mov    -0x24(%ebp,%ebx,4),%eax
0x08048d05 <phase_6+36>:        sub    $0x1,%eax
0x08048d08 <phase_6+39>:        cmp    $0x5,%eax
0x08048d0b <phase_6+42>:        jbe    0x8048d12 <phase_6+49>
0x08048d0d <phase_6+44>:        call   0x8049341 <explode_bomb>
0x08048d12 <phase_6+49>:        lea    0x1(%ebx),%edi
0x08048d15 <phase_6+52>:        cmp    $0x6,%edi
0x08048d18 <phase_6+55>:        jne    0x8048d2b <phase_6+74>
0x08048d1a <phase_6+57>:        mov    $0x804a5fc,%ecx
0x08048d1f <phase_6+62>:        mov    $0x1,%eax
0x08048d24 <phase_6+67>:        mov    $0x0,%edx
0x08048d29 <phase_6+72>:        jmp    0x8048d54 <phase_6+115>
 
 
0x08048d2b <phase_6+74>:        lea    -0x24(%ebp,%ebx,4),%esi
0x08048d2f <phase_6+78>:        mov    %edi,%ebx
0x08048d31 <phase_6+80>:        mov    -0x28(%ebp,%edi,4),%eax
0x08048d35 <phase_6+84>:        cmp    0x4(%esi),%eax
0x08048d38 <phase_6+87>:        jne    0x8048d3f <phase_6+94>
0x08048d3a <phase_6+89>:        call   0x8049341 <explode_bomb>
 
0x08048d3f <phase_6+94>:        add    $0x1,%ebx
0x08048d42 <phase_6+97>:        add    $0x4,%esi
0x08048d45 <phase_6+100>:       cmp    $0x5,%ebx
0x08048d48 <phase_6+103>:       jle    0x8048d31 <phase_6+80>
0x08048d4a <phase_6+105>:       mov    %edi,%ebx
0x08048d4c <phase_6+107>:       jmp    0x8048d01 <phase_6+32>
 
0x08048d4e <phase_6+109>:       mov    0x8(%ecx),%ecx
0x08048d51 <phase_6+112>:       add    $0x1,%eax
0x08048d54 <phase_6+115>:       cmp    -0x24(%ebp,%edx,4),%eax
0x08048d58 <phase_6+119>:       jl     0x8048d4e <phase_6+109>
0x08048d5a <phase_6+121>:       mov    %ecx,-0x3c(%ebp,%edx,4)
0x08048d5e <phase_6+125>:       add    $0x1,%edx
0x08048d61 <phase_6+128>:       cmp    $0x5,%edx
0x08048d64 <phase_6+131>:       jg     0x8048d72 <phase_6+145>
0x08048d66 <phase_6+133>:       mov    $0x804a5fc,%ecx
0x08048d6b <phase_6+138>:       mov    $0x1,%eax
0x08048d70 <phase_6+143>:       jmp    0x8048d54 <phase_6+115>
 
0x08048d72 <phase_6+145>:       mov    -0x3c(%ebp),%ecx
0x08048d75 <phase_6+148>:       mov    -0x38(%ebp),%eax
0x08048d78 <phase_6+151>:       mov    %eax,0x8(%ecx)
0x08048d7b <phase_6+154>:       mov    -0x34(%ebp),%edx
0x08048d7e <phase_6+157>:       mov    %edx,0x8(%eax)
0x08048d81 <phase_6+160>:       mov    -0x30(%ebp),%eax
0x08048d84 <phase_6+163>:       mov    %eax,0x8(%edx)
0x08048d87 <phase_6+166>:       mov    -0x2c(%ebp),%edx
0x08048d8a <phase_6+169>:       mov    %edx,0x8(%eax)
0x08048d8d <phase_6+172>:       mov    -0x28(%ebp),%eax
0x08048d90 <phase_6+175>:       mov    %eax,0x8(%edx)
0x08048d93 <phase_6+178>:       movl   $0x0,0x8(%eax)
 
0x08048d9a <phase_6+185>:       mov    %ecx,%ebx
0x08048d9c <phase_6+187>:       mov    $0x0,%esi
0x08048da1 <phase_6+192>:       mov    0x8(%ebx),%edx
0x08048da4 <phase_6+195>:       mov    (%ebx),%eax
0x08048da6 <phase_6+197>:       cmp    (%edx),%eax
0x08048da8 <phase_6+199>:       jge    0x8048daf <phase_6+206>
0x08048daa <phase_6+201>:       call   0x8049341 <explode_bomb>
0x08048daf <phase_6+206>:       mov    0x8(%ebx),%ebx
0x08048db2 <phase_6+209>:       add    $0x1,%esi
0x08048db5 <phase_6+212>:       cmp    $0x5,%esi
0x08048db8 <phase_6+215>:       jne    0x8048da1 <phase_6+192>
0x08048dba <phase_6+217>:       add    $0x3c,%esp
0x08048dbd <phase_6+220>:       pop    %ebx
0x08048dbe <phase_6+221>:       pop    %esi
0x08048dbf <phase_6+222>:       pop    %edi
0x08048dc0 <phase_6+223>:       pop    %ebp
0x08048dc1 <phase_6+224>:       ret
End of assembler dump.
 
Loading Advertisement...
 
[+][-]10/27/09 04:20 AM, ID: 25671025Accepted 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
Tags: Binary Bomb Phase 6
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
[+][-]10/27/09 05:01 AM, ID: 25671355Author 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/27/09 05:14 AM, ID: 25671475Expert 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/27/09 05:16 AM, ID: 25671497Author 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/27/09 05:22 AM, ID: 25671541Author 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/27/09 05:28 AM, ID: 25671600Expert 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