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

6.4

binary bomb phase 3

Asked by braker15 in Assembly Programming Language, C Programming Language, Miscellaneous Programming

i am having trouble with these two lines

0x08048ef2 <phase_3+49>:        cmpl   $0x7,-0x4(%ebp)
0x08048ef6 <phase_3+53>:        ja     0x8048f61 <phase_3+160>


i'm not sure what the first line is.... it looks like it compares something to 7.  I am afraid the bomb is going to blow up if i don't understand it... can someone help?
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:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
This GDB was configured as "i486-linux-gnu"...
(gdb) break *0x08048ee8
Breakpoint 1 at 0x8048ee8
(gdb) break *0x08048f6b
Breakpoint 2 at 0x8048f6b
(gdb) break *0x08048f71
Breakpoint 3 at 0x8048f71
(gdb) break *0x08048ef2
Breakpoint 4 at 0x8048ef2
(gdb) break *0x08048eed
Breakpoint 5 at 0x8048eed
(gdb) break *0x08048f61
Breakpoint 6 at 0x8048f61
(gdb) break *0x08048f76
Breakpoint 7 at 0x8048f76
 
Breakpoint 1, 0x08048ee8 in phase_3 ()
Current language:  auto; currently asm
(gdb) disas
Dump of assembler code for function phase_3:
0x08048ec1 <phase_3+0>: push   %ebp
0x08048ec2 <phase_3+1>: mov    %esp,%ebp
0x08048ec4 <phase_3+3>: sub    $0x28,%esp
0x08048ec7 <phase_3+6>: lea    -0x8(%ebp),%eax
0x08048eca <phase_3+9>: mov    %eax,0xc(%esp)
0x08048ece <phase_3+13>:        lea    -0x4(%ebp),%eax
0x08048ed1 <phase_3+16>:        mov    %eax,0x8(%esp)
0x08048ed5 <phase_3+20>:        movl   $0x8049be5,0x4(%esp)
0x08048edd <phase_3+28>:        mov    0x8(%ebp),%eax
0x08048ee0 <phase_3+31>:        mov    %eax,(%esp)
0x08048ee3 <phase_3+34>:        call   0x80489d4 <sscanf@plt>
0x08048ee8 <phase_3+39>:        cmp    $0x1,%eax
0x08048eeb <phase_3+42>:        jg     0x8048ef2 <phase_3+49>
0x08048eed <phase_3+44>:        call   0x8049351 <explode_bomb>
0x08048ef2 <phase_3+49>:        cmpl   $0x7,-0x4(%ebp)
0x08048ef6 <phase_3+53>:        ja     0x8048f61 <phase_3+160>
0x08048ef8 <phase_3+55>:        mov    -0x4(%ebp),%eax
0x08048efb <phase_3+58>:        jmp    *0x8049a00(,%eax,4)
0x08048f02 <phase_3+65>:        mov    $0x0,%eax
0x08048f07 <phase_3+70>:        jmp    0x8048f5a <phase_3+153>
0x08048f09 <phase_3+72>:        mov    $0x0,%eax
0x08048f0e <phase_3+77>:        xchg   %ax,%ax
0x08048f10 <phase_3+79>:        jmp    0x8048f55 <phase_3+148>
0x08048f12 <phase_3+81>:        mov    $0x0,%eax
0x08048f17 <phase_3+86>:        jmp    0x8048f50 <phase_3+143>
0x08048f19 <phase_3+88>:        mov    $0x0,%eax
0x08048f1e <phase_3+93>:        xchg   %ax,%ax
0x08048f20 <phase_3+95>:        jmp    0x8048f4b <phase_3+138>
0x08048f22 <phase_3+97>:        mov    $0x0,%eax
0x08048f27 <phase_3+102>:       jmp    0x8048f48 <phase_3+135>
0x08048f29 <phase_3+104>:       mov    $0x0,%eax
0x08048f2e <phase_3+109>:       xchg   %ax,%ax
0x08048f30 <phase_3+111>:       jmp    0x8048f43 <phase_3+130>
0x08048f32 <phase_3+113>:       mov    $0x304,%eax
0x08048f37 <phase_3+118>:       jmp    0x8048f3e <phase_3+125>
0x08048f39 <phase_3+120>:       mov    $0x0,%eax
0x08048f3e <phase_3+125>:       sub    $0x3ba,%eax
0x08048f43 <phase_3+130>:       add    $0x134,%eax
0x08048f48 <phase_3+135>:       sub    $0x74,%eax
0x08048f4b <phase_3+138>:       add    $0x118,%eax
0x08048f50 <phase_3+143>:       sub    $0x308,%eax
0x08048f55 <phase_3+148>:       add    $0x308,%eax
0x08048f5a <phase_3+153>:       sub    $0xa4,%eax
0x08048f5f <phase_3+158>:       jmp    0x8048f6b <phase_3+170>
0x08048f61 <phase_3+160>:       call   0x8049351 <explode_bomb>
0x08048f66 <phase_3+165>:       mov    $0x0,%eax
0x08048f6b <phase_3+170>:       cmpl   $0x5,-0x4(%ebp)
---Type <return> to continue, or q <return> to quit---
0x08048f6f <phase_3+174>:       jg     0x8048f76 <phase_3+181>
0x08048f71 <phase_3+176>:       cmp    -0x8(%ebp),%eax
0x08048f74 <phase_3+179>:       je     0x8048f7b <phase_3+186>
0x08048f76 <phase_3+181>:       call   0x8049351 <explode_bomb>
0x08048f7b <phase_3+186>:       leave
0x08048f7c <phase_3+187>:       lea    0x0(%esi,%eiz,1),%esi
0x08048f80 <phase_3+191>:       ret
End of assembler dump.
(gdb) info registers
eax            0x2      2
ecx            0x1      1
edx            0xffffff8c       -116
ebx            0xbffff8d4       -1073743660
esp            0xbffff7f0       0xbffff7f0
ebp            0xbffff818       0xbffff818
esi            0xb7ffece0       -1207964448
edi            0x0      0
eip            0x8048ee8        0x8048ee8 <phase_3+39>
eflags         0x286    [ PF SF IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb) ni
0x08048eeb in phase_3 ()
(gdb) c
Continuing.
 
Breakpoint 4, 0x08048ef2 in phase_3 ()
(gdb) ni
0x08048ef6 in phase_3 ()
(gdb) info registers
eax            0x2      2
ecx            0x1      1
edx            0xffffff8c       -116
ebx            0xbffff8d4       -1073743660
esp            0xbffff7f0       0xbffff7f0
ebp            0xbffff818       0xbffff818
esi            0xb7ffece0       -1207964448
edi            0x0      0
eip            0x8048ef6        0x8048ef6 <phase_3+53>
eflags         0x297    [ CF PF AF SF IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
[+][-]05/15/09 09:10 PM, ID: 24401198Accepted 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, Miscellaneous Programming
Sign Up Now!
Solution Provided By: braker15
Participating Experts: 0
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625