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

Binary Bomb Final Phase

Asked by pummer in Assembly Programming Language, C Programming Language

Tags: Assembly

I am working through the CS:APP textbook (auditing a class at the local state U) and I'm trying to complete the final phase of the binary bomb lab.  Basically, I need to figure out what string to send to this function (in C) so that the "bomb" doesn't "explode..." and all I have to work with is the assembly code.  

One way to get the answers, I've found, is to try to convert the assembly logic into C.  But here, I'm really at a loss as to what this code does... I think there's a linked list with defined nodes and then somehow they're incremented through in some kind of loop, but I can't figure out what it is I need to type in to keep the bomb from detonating.  I thought it was simply a value in one of the nodes but that doesn't seem to be working.


Anyway, here's the code.  Any help you can offer is much appreciated, I feel like my head's about to explode after going through phases 1-5 :(
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:
08048f33 <phase_6>:
 8048f33:	55                   	push   %ebp
 8048f34:	89 e5                	mov    %esp,%ebp
 8048f36:	83 ec 18             	sub    $0x18,%esp
 8048f39:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
 8048f40:	00 
 8048f41:	c7 44 24 08 0a 00 00 	movl   $0xa,0x8(%esp)
 8048f48:	00 
 8048f49:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
 8048f50:	00 
 8048f51:	8b 45 08             	mov    0x8(%ebp),%eax
 8048f54:	89 04 24             	mov    %eax,(%esp)
 8048f57:	e8 50 f9 ff ff       	call   80488ac <__strtol_internal@plt>
 8048f5c:	a3 2c a6 04 08       	mov    %eax,0x804a62c
 8048f61:	c7 04 24 2c a6 04 08 	movl   $0x804a62c,(%esp)
 8048f68:	e8 bb fc ff ff       	call   8048c28 <fun6>
 8048f6d:	ba 01 00 00 00       	mov    $0x1,%edx
 8048f72:	8b 40 08             	mov    0x8(%eax),%eax
 8048f75:	83 c2 01             	add    $0x1,%edx
 8048f78:	83 fa 07             	cmp    $0x7,%edx
 8048f7b:	75 f5                	jne    8048f72 <phase_6+0x3f>
 8048f7d:	8b 00                	mov    (%eax),%eax
 8048f7f:	3b 05 2c a6 04 08    	cmp    0x804a62c,%eax
 8048f85:	74 05                	je     8048f8c <phase_6+0x59>
 8048f87:	e8 67 03 00 00       	call   80492f3 <explode_bomb>
 8048f8c:	c9                   	leave  
 8048f8d:	c3                   	ret    
 8048f8e:	90                   	nop    
 8048f8f:	90                   	nop    
 
08048c28 <fun6>:
 8048c28:	55                   	push   %ebp
 8048c29:	89 e5                	mov    %esp,%ebp
 8048c2b:	56                   	push   %esi
 8048c2c:	53                   	push   %ebx
 8048c2d:	8b 4d 08             	mov    0x8(%ebp),%ecx
 8048c30:	8b 59 08             	mov    0x8(%ecx),%ebx
 8048c33:	c7 41 08 00 00 00 00 	movl   $0x0,0x8(%ecx)
 8048c3a:	89 ce                	mov    %ecx,%esi
 8048c3c:	89 c8                	mov    %ecx,%eax
 8048c3e:	89 ca                	mov    %ecx,%edx
 8048c40:	85 db                	test   %ebx,%ebx
 8048c42:	75 2a                	jne    8048c6e <fun6+0x46>
 8048c44:	eb 34                	jmp    8048c7a <fun6+0x52>
 8048c46:	89 d0                	mov    %edx,%eax
 8048c48:	8b 52 08             	mov    0x8(%edx),%edx
 8048c4b:	85 d2                	test   %edx,%edx
 8048c4d:	74 04                	je     8048c53 <fun6+0x2b>
 8048c4f:	39 0a                	cmp    %ecx,(%edx)
 8048c51:	7f f3                	jg     8048c46 <fun6+0x1e>
 8048c53:	39 d0                	cmp    %edx,%eax
 8048c55:	75 04                	jne    8048c5b <fun6+0x33>
 8048c57:	89 de                	mov    %ebx,%esi
 8048c59:	eb 03                	jmp    8048c5e <fun6+0x36>
 8048c5b:	89 58 08             	mov    %ebx,0x8(%eax)
 8048c5e:	8b 43 08             	mov    0x8(%ebx),%eax
 8048c61:	89 53 08             	mov    %edx,0x8(%ebx)
 8048c64:	89 c3                	mov    %eax,%ebx
 8048c66:	89 f2                	mov    %esi,%edx
 8048c68:	89 f0                	mov    %esi,%eax
 8048c6a:	85 db                	test   %ebx,%ebx
 8048c6c:	74 0c                	je     8048c7a <fun6+0x52>
 8048c6e:	85 d2                	test   %edx,%edx
 8048c70:	74 e1                	je     8048c53 <fun6+0x2b>
 8048c72:	8b 0b                	mov    (%ebx),%ecx
 8048c74:	39 0a                	cmp    %ecx,(%edx)
 8048c76:	7f ce                	jg     8048c46 <fun6+0x1e>
 8048c78:	eb d9                	jmp    8048c53 <fun6+0x2b>
 8048c7a:	89 f0                	mov    %esi,%eax
 8048c7c:	5b                   	pop    %ebx
 8048c7d:	5e                   	pop    %esi
 8048c7e:	5d                   	pop    %ebp
 8048c7f:	90                   	nop    
 8048c80:	c3                   	ret
[+][-]05/05/08 06:58 AM, ID: 21500049Accepted 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: Assembly
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
[+][-]05/05/08 02:46 PM, ID: 21503287Author 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 / EE_QW_2_20070628