Do not use on any
shared computer
July 24, 2008 07:47pm pdt
null
[x]
Attachment Details

Binary Bomb Final Phase

Tags:

Assembly

Alright, on the last phase of the binary bomb.  I have the code commented and just wanted to know if what I think is happening really is.  So far I just think it is a bunch of nested loops and that the input will be 5 or less numbers.  Alright any feedback would be very appreciated.  Thanks

Dump of assembler code for function phase_6:
0x08048cbd <phase_6+0>: push   %ebp
0x08048cbe <phase_6+1>: mov    %esp,%ebp
0x08048cc0 <phase_6+3>: push   %edi
0x08048cc1 <phase_6+4>: push   %esi
0x08048cc2 <phase_6+5>: push   %ebx
0x08048cc3 <phase_6+6>: sub    $0x64,%esp      // esp = esp-100
0x08048cc6 <phase_6+9>: movl   $0x804a61c,0xffffffa4(%ebp) // *(ebp-28)=0x804a61c
0x08048ccd <phase_6+16>:        lea    0xffffffc8(%ebp),%eax      //eax=ebp-0xffffffc8
0x08048cd0 <phase_6+19>:        push   %eax
0x08048cd1 <phase_6+20>:        pushl  0x8(%ebp)
0x08048cd4 <phase_6+23>:        call   0x8048e9d <read_six_numbers>
0x08048cd9 <phase_6+28>:        mov    $0x0,%edi      //edi=0
0x08048cde <phase_6+33>:        add    $0x10,%esp      //esp=esp+16
0x08048ce1 <phase_6+36>:        mov    0xffffffc8(%ebp,%edi,4),%eax      //eax=*(ebp+4*edi-0xfffffc8) start of loop
0x08048ce5 <phase_6+40>:        dec    %eax      //eax=eax-1
0x08048ce6 <phase_6+41>:        cmp    $0x5,%eax      // if eax is below or equal to 5
0x08048ce9 <phase_6+44>:        jbe    0x8048cf0 <phase_6+51>      // jump past explosion
0x08048ceb <phase_6+46>:        call   0x80493be <explode_bomb>
0x08048cf0 <phase_6+51>:        lea    0x1(%edi),%ebx      // ebx=edi+1
0x08048cf3 <phase_6+54>:        cmp    $0x5,%ebx      // if ebx>5
0x08048cf6 <phase_6+57>:        jg     0x8048d0d <phase_6+80>      // then jump to edi++
0x08048cf8 <phase_6+59>:        mov    0xffffffc8(%ebp,%edi,4),%eax      // else eax=(ebp+4*edi+0xffffffc8) start of nested loop
0x08048cfc <phase_6+63>:        cmp    0xffffffc8(%ebp,%ebx,4),%eax      // if eax!=(ebp+4*ebx+0xffffffc8)
0x08048d00 <phase_6+67>:        jne    0x8048d07 <phase_6+74>       // jump after explosion
0x08048d02 <phase_6+69>:        call   0x80493be <explode_bomb>
0x08048d07 <phase_6+74>:        inc    %ebx      // ebx=ebx+1
0x08048d08 <phase_6+75>:        cmp    $0x5,%ebx      // if ebx<=5
0x08048d0b <phase_6+78>:        jle    0x8048cf8 <phase_6+59>      // then jump back up to spot 59
0x08048d0d <phase_6+80>:        inc    %edi      // edi=edi+1
0x08048d0e <phase_6+81>:        cmp    $0x5,%edi      // if jump<=5 loop back
0x08048d11 <phase_6+84>:        jle    0x8048ce1 <phase_6+36>            // spot 36
0x08048d13 <phase_6+86>:        mov    $0x0,%edi      // edi=0
0x08048d18 <phase_6+91>:        mov    0xffffffa4(%ebp),%esi      //esi=*(ebp-28)
0x08048d1b <phase_6+94>:        mov    $0x1,%ebx      // ebx=1
0x08048d20 <phase_6+99>:        cmpl   $0x1,0xffffffc8(%ebp,%edi,4)      // if *(ebp+4*edi+xffffffc8)<=1
0x08048d25 <phase_6+104>:       jle    0x8048d33 <phase_6+118>      // jump down to spot 118
0x08048d27 <phase_6+106>:       mov    0xffffffc8(%ebp,%edi,4),%eax      // else eax=*(ebp+4*edi+0xffffffc8)
0x08048d2b <phase_6+110>:       mov    0x8(%esi),%esi      esi=*(esi+8)
0x08048d2e <phase_6+113>:       inc    %ebx      // ebx=ebx+1
0x08048d2f <phase_6+114>:       cmp    %ebx,%eax      // if eax>ebx
0x08048d31 <phase_6+116>:       jg     0x8048d2b <phase_6+110>      // jump back to spot 110
0x08048d33 <phase_6+118>:       mov    %esi,0xffffffa8(%ebp,%edi,4) // (ebp+4*edi-24)=esi
0x08048d37 <phase_6+122>:       inc    %edi      // edi=edi+1
0x08048d38 <phase_6+123>:       cmp    $0x5,%edi      // if edi<=5 then
0x08048d3b <phase_6+126>:       jle    0x8048d18 <phase_6+91>      // jump back to spot 91
0x08048d3d <phase_6+128>:       mov    0xffffffa8(%ebp),%esi      // esi=*(ebp+0xffffffa8)
0x08048d40 <phase_6+131>:       mov    %esi,0xffffffa4(%ebp)      // (ebp+0xffffffa4)=*(esi)
0x08048d43 <phase_6+134>:       mov    $0x1,%edi      // edi=1
0x08048d48 <phase_6+139>:       mov    0xffffffa8(%ebp,%edi,4),%eax      // eax=*(ebp+4*edi+0xffffffa8)
0x08048d4c <phase_6+143>:       mov    %eax,0x8(%esi)      // (esi+8)=*(eax)
0x08048d4f <phase_6+146>:       mov    %eax,%esi      // esi=*(eax)
0x08048d51 <phase_6+148>:       inc    %edi            // edi=edi+1
0x08048d52 <phase_6+149>:       cmp    $0x5,%edi      // if edi<=5 then
0x08048d55 <phase_6+152>:       jle    0x8048d48 <phase_6+139>      // jump back to 139
0x08048d57 <phase_6+154>:       movl   $0x0,0x8(%eax)      //(eax+8)=0
0x08048d5e <phase_6+161>:       mov    0xffffffa4(%ebp),%esi      // esi=*(ebp+0xfffffa4)
0x08048d61 <phase_6+164>:       mov    $0x0,%edi      // edi=0
0x08048d66 <phase_6+169>:       mov    0x8(%esi),%edx      // edx=*(esi+8)
0x08048d69 <phase_6+172>:       mov    (%esi),%eax      //eax=(*esi)
0x08048d6b <phase_6+174>:       cmp    (%edx),%eax      // if *(eax)>=*(edx)
0x08048d6d <phase_6+176>:       jge    0x8048d74 <phase_6+183>      // jump over explode bomb
0x08048d6f <phase_6+178>:       call   0x80493be <explode_bomb>
0x08048d74 <phase_6+183>:       mov    0x8(%esi),%esi      // esi=*(esi+8)
0x08048d77 <phase_6+186>:       inc    %edi            // edi=edi+1
0x08048d78 <phase_6+187>:       cmp    $0x4,%edi      // if edi<= 4
0x08048d7b <phase_6+190>:       jle    0x8048d66 <phase_6+169>      // jump back to 169
0x08048d7d <phase_6+192>:       lea    0xfffffff4(%ebp),%esp      //esp=(ebp-12)
0x08048d80 <phase_6+195>:       pop    %ebx
0x08048d81 <phase_6+196>:       pop    %esi
0x08048d82 <phase_6+197>:       pop    %edi
0x08048d83 <phase_6+198>:       leave
0x08048d84 <phase_6+199>:       ret
End of assembler dump.
Start your free trial to view this solution
[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!

Question Stats
Zone: Programming
Question Asked By: Risifo
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Infinity08

Rank: Master

Expert Comment by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Risifo
Author Comment by Risifo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by Infinity08

Rank: Master

Accepted Solution by Infinity08:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628