Question

Diffusing A Binary Bomb

Asked by: braker15

I am having trouble with this bomb.  I know i need to feed it six numbers

when   eax = *(esi + ebx * 4 - 8) + 5;

how can this be true?
eax = *(esi + ebx * 4 - 4)

I did some math incrementing ebx and found the equations are always 1 different from each other:
eax = *(esi + ebx * 4 - 8) + 5;
2 = 8 - 8 = 0 + 5 = 5  (2 would be ebx here)
      - 4  = 4    = 4
3 = 12 - 8 = 4 + 5 = 9 (3 would be ebx here)
       - 4 = 8     = 8
4 = 16 - 8 = 8 + 5 = 13 (4 would be ebx here)
    16 - 4 = 12    = 12




        /* unknown */ void  ebx;
      /* unknown */ void  esi;
      /* unknown */ void  Vfffffff8;

    Vfffffff8 = ebp - 0x20;
    *esp = A8;
    read_six_numbers();
    ebx = 2;
    esi = ebp - 0x20;
    do {
        eax = *(esi + ebx * 4 - 8) + 5;
        if(*(esi + ebx * 4 - 4) != eax) {
            eax = explode_bomb();
        }
        ebx = ebx + 1;
    } while(ebx != 7);
}

Could someone push me in the right direction?  

I have IDA Pro, and Recstudio... but i don't know how to assign values to the variables and take the loops for a "test run".

also i don't understand how to figure out ebp?

thank you!

Here is the ASM representation:
 Address  Mnemonic                                 SP In  SP Out  SP offs  Intermediate Representation
08048dc0: push ebp                                     0      60      0   (save)ebp
08048dc1: mov ebp,esp                                                 4   ebp = esp
08048dc3: push esi                                                    4   (save)esi
08048dc4: push ebx                                                    8   (save)ebx
08048dc5: sub esp,byte +0x30                                         12   esp = esp - 0x30
08048dc8: lea eax,[ebp-0x20]                                         60   eax = ebp - 0x20
08048dcb: mov [esp+0x4],eax                                          60   *(esp + 4) = eax
08048dcf: mov eax,[ebp+0x8]                                          60   eax = *(ebp + 8)
08048dd2: mov [esp],eax                                              60   *esp = eax
08048dd5: call 0x8049393                                             60   eax = read_six_numbers()
08048dda: mov ebx,0x2                                                60   ebx = 2
08048ddf: lea esi,[ebp-0x20]                                         60   esi = ebp - 0x20
08048de2: mov eax,[esi+ebx*4-0x8]                     60      60     60   eax = *(esi + ebx * 4 - 8)
08048de6: add eax,byte +0x5                                          60   eax = eax + 5
08048de9: cmp [esi+ebx*4-0x4],eax                                    60   *(esi + ebx * 4 - 4) :: eax
08048ded: jz 0x8048df4                                               60   == ? L08048df4 : 
08048def: call 0x8049351                              60      60     60   eax = explode_bomb()
08048df4: add ebx,byte +0x1                           60      60     60   ebx = ebx + 1
08048df7: cmp ebx,byte +0x7                                          60   ebx :: 7
08048dfa: jnz 0x8048de2                                              60   != ? 0x8048de2 : 
08048dfc: add esp,byte +0x30                          60       0     60   esp = esp + 0x30
08048dff: pop ebx                                                    12   (restore)ebx
08048e00: pop esi                                                     8   (restore)esi
08048e01: pop ebp                                                     4   (restore)ebp
08048e02: ret                                                         0   return
 
 
And the code converted to C (using RecStudio):
 
/*	Procedure: 0x08048DC0 - 0x08048E02
 *	Argument size: 4
 *	Local size: 0
 *	Save regs size: 48
 *	Called by:
 *		main()
 */
 
phase_2(A8)
/* unknown */ void  A8;
{
	/* unknown */ void  ebx;
	/* unknown */ void  esi;
	/* unknown */ void  Vfffffff8;
 
    Vfffffff8 = ebp - 0x20;
    *esp = A8;
    read_six_numbers();
    ebx = 2;
    esi = ebp - 0x20;
    do {
        eax = *(esi + ebx * 4 - 8) + 5;
        if(*(esi + ebx * 4 - 4) != eax) {
            eax = explode_bomb();
        }
        ebx = ebx + 1;
    } while(ebx != 7);
}
 
 
--------
read_six_numbers(A8, Ac)
/* unknown */ void  A8;
/* unknown */ void  Ac;
{
	/* unknown */ void  V0;
	/* unknown */ void  V4;
	/* unknown */ void  V8;
	/* unknown */ void  Vc;
	/* unknown */ void  V10;
	/* unknown */ void  V14;
	/* unknown */ void  V18;
 
    V18 = Ac + 0x14;
    V14 = Ac + 0x10;
    V10 = Ac + 0xc;
    Vc = Ac + 8;
    V8 = Ac + 4;
    V4 = Ac;
    V0 = "%d %d %d %d %d %d";
    *esp = A8;
    eax = L080489D4();
    if(eax <= 5) {
        eax = explode_bomb();
    }
}
----------------
/*	Procedure: 0x080489D4 - 0x080489E3
 *	Argument size: 0
 *	Local size: 0
 *	Save regs size: 0
 *	Called by:
 *		phase_5()
 *		phase_4()
 *		phase_3()
 *		phase_defused()
 *		read_six_numbers()
 */
 
L080489d4()
{
 
    goto ( *L0804a16c);
    (save)0xf0;
    goto L080487E4;
}
--------------------
/*	Procedure: 0x080487E4 - 0x080487F3
 *	Argument size: 0
 *	Local size: 0
 *	Save regs size: 0
 */
 
L080487e4()
{
 
    (save)M0804a0ec;
    goto ( *L0804a0f0);
    *eax = *eax + al;
    *eax = *eax + al;
}

                                  
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:
119:
120:
121:
122:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-05-08 at 11:36:29ID24393400
Topics

Assembly Programming Language

,

C Programming Language

,

C++ Programming Language

Participating Experts
1
Points
500
Comments
8

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Math equations in database
    Hi Experts I want to develop a database where I want to store math equations or some pictures with text. How and in which datatype I can store. I want to use MS equation Editor for equations
  2. Binary Bomb
    I am trying to defuse a binary bomb and this is the code for phase one Dump of assembler code for function phase_1: 0x08048b08 <phase_1+0>: push %ebp 0x08048b09 <phase_1+1>: mov %esp,%ebp 0x08048b0b <phase_1+3>: sub $0x10,%esp 0x08048b0e <phase_1...
  3. Binary Bomb Phase 4
    Alright i'm on phase 4 of the binary bomb problem, have analyzed the assembly and this is what I have. Dump of assembler code for function phase_4: 0x08048c2c <phase_4+0>: push %ebp 0x08048c2d <phase_4+1>: mov %esp,%ebp 0x08048c2f <phase_4+3>: sub $...
  4. Binary Bomb Final Phase
    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 appre...
  5. Binary Bomb - Phase_5 - Assembly
    Hi everyone, It's the classic binary bomb lab, and I'm completely stuck on phase 5. Here's what I got:
  6. Binary Bomb Phase One
    I am working on the cvlassic binary bomb assignment, and I am having a little bit of difficulty on the first phase. I have a pretty good understanding of what each individual line of code represents and does, but the logic flow is confusing, and I don't know how to paste the...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Infinity08Posted on 2009-05-09 at 01:03:24ID: 24342788

>> when   eax = *(esi + ebx * 4 - 8) + 5;
>> 
>> how can this be true?
>> eax = *(esi + ebx * 4 - 4)

Well, it's quite straightforward, if you realize what esi is. What does it point to ?


>> I did some math incrementing ebx and found the equations are always 1 different from each other:

To be more exact, the calculated addresses have a difference of 4 == sizeof(int).


>> Could someone push me in the right direction?  

Let me give you a hint : which arguments does read_six_numbers take ? What does the function do ? Where does it place its result ?


>> but i don't know how to assign values to the variables and take the loops for a "test run".

You can actually run the application - you'll be asked for input data, and you'll see the result of that.
If you want to observe the registry and stack contents while the code runs, you can run it inside a debugger, like gdb for example.


>> also i don't understand how to figure out ebp?

ebp is the base pointer. It points to the start of the current stack frame. A stack frame is set up at the beginning of each function call, and contains all local stack data for that function, as well as the return address, the saved ebp of the previous stack frame, etc.

This is where the stack frame is set up :

>> 08048dc0: push ebp
>> 08048dc1: mov ebp,esp

ie. the old base pointer is saved on the stack, so it can be restored when the function ends.
And the new base pointer is set to the current top of the stack to start a new stack frame.

At the end of the function, the stack frame is destroyed again, and we go back to the previous stack frame :

>> 08048e01: pop ebp
>> 08048e02: ret

ie. the saved base pointer is restored, and the code jumps to the return address (using ret)

 

by: braker15Posted on 2009-05-11 at 22:38:26ID: 24361452

i am at a loss here, i don't even understand what this is:
.text:08049393 var_28          = dword ptr -28h
.text:08049393 var_24          = dword ptr -24h
.text:08049393 var_20          = dword ptr -20h
.text:08049393 var_1C          = dword ptr -1Ch
.text:08049393 var_18          = dword ptr -18h
.text:08049393 var_14          = dword ptr -14h
.text:08049393 var_10          = dword ptr -10h
.text:08049393 var_C           = dword ptr -0Ch
.text:08049393 arg_0           = dword ptr  8
.text:08049393 arg_4           = dword ptr  0Ch

it seems like variables are being assigned memory locations... why are they negative?

i guess i am having trouble understanding "the big picture".

Is there maybe something with pictures, arrows, and code that could give me the basics here?

.text:08049393                 public read_six_numbers
.text:08049393 read_six_numbers proc near              ; CODE XREF: phase_6+16p
.text:08049393                                         ; phase_2+15p
.text:08049393 
.text:08049393 var_28          = dword ptr -28h
.text:08049393 var_24          = dword ptr -24h
.text:08049393 var_20          = dword ptr -20h
.text:08049393 var_1C          = dword ptr -1Ch
.text:08049393 var_18          = dword ptr -18h
.text:08049393 var_14          = dword ptr -14h
.text:08049393 var_10          = dword ptr -10h
.text:08049393 var_C           = dword ptr -0Ch
.text:08049393 arg_0           = dword ptr  8
.text:08049393 arg_4           = dword ptr  0Ch
.text:08049393 
.text:08049393                 push    ebp
.text:08049394                 mov     ebp, esp
.text:08049396                 sub     esp, 28h
.text:08049399                 mov     edx, [ebp+arg_4]
.text:0804939C                 lea     eax, [edx+14h]
.text:0804939F                 mov     [esp+28h+var_C], eax
.text:080493A3                 lea     eax, [edx+10h]
.text:080493A6                 mov     [esp+28h+var_10], eax
.text:080493AA                 lea     eax, [edx+0Ch]
.text:080493AD                 mov     [esp+28h+var_14], eax
.text:080493B1                 lea     eax, [edx+8]
.text:080493B4                 mov     [esp+28h+var_18], eax
.text:080493B8                 lea     eax, [edx+4]
.text:080493BB                 mov     [esp+28h+var_1C], eax
.text:080493BF                 mov     [esp+28h+var_20], edx
.text:080493C3                 mov     [esp+28h+var_24], offset unk_8049BD9
.text:080493CB                 mov     eax, [ebp+arg_0]
.text:080493CE                 mov     [esp+28h+var_28], eax
.text:080493D1                 call    sub_80489D4
.text:080493D6                 cmp     eax, 5
.text:080493D9                 jg      short locret_80493E0
.text:080493DB                 call    explode_bomb
.text:080493E0 
.text:080493E0 locret_80493E0:                         ; CODE XREF: read_six_numbers+46j
.text:080493E0                 leave
.text:080493E1                 retn
                                              
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:

Select allOpen in new window

 

by: Infinity08Posted on 2009-05-12 at 00:56:11ID: 24362057

>> i am at a loss here, i don't even understand what this is:

It looks like you're using IDA to analyze the code. That's ok, but it might be better to use an actual debugger, so you can analyze the code while it's running (as I suggested earlier).

In any case :

>> it seems like variables are being assigned memory locations...

That's right. All local variables for the function are assigned a certain location on the stack (within the current stack frame). The list you posted are just all those local variables, and IDA gave them a human readable name that is used in the rest of the function code (which should theoretically make it easier to read the code).
Be aware though that IDA doesn't have all information, and in this case, I think that it will confuse you rather than help you. So, I really suggest to concentrate on the code, and use a debugger to see what's happening, and where the values you give as input go.


>> why are they negative?

Do you know what two's complement is ?

    http://en.wikipedia.org/wiki/Two%27s_complement

The reason WHY they are negative, is because the stack grows downwards (towards lower memory addresses). So, to move UP in the stack, the memory addresses get smaller.


>> i guess i am having trouble understanding "the big picture".

The idea of this kind of assignment is to help you get comfortable with assembly, and with the memory model. It's normal that you don't see the big picture yet, but with time, you will. For now, maybe it's best to read up on stack layout, and stack frames.
If you have course notes, then consult those. Otherwise, take a look at this :

        http://en.wikipedia.org/wiki/Call_stack

(and especially the "Structure" paragraph which talks about stack frames). A good understanding of the stack is necessary to solve this assignment. So, read up on it, and if you have any questions, don't hesitate to ask them here ...

 

by: braker15Posted on 2009-05-13 at 17:36:15ID: 24380893

I don't understand what i should be typing in gdb to view the registers adresses and values before, during, and after the loop

here's what i tried:

user@bomb:~/bomb23$ gdb bomb
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
T
his is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) break phase_2
Breakpoint 1 at 0x8048dc5
(gdb) run
Starting program: /home/user/bomb23/bomb
Welcome to my fiendish little bomb. You have 6 phases with
which to blow yourself up. Have a nice day!
(gdb)x 0x8048dc4

BOOM!!!
The bomb has blown up.
Your instructor has been notified.

Program exited with code 010.
(gdb)

08048dc0 <phase_2>:
 8048dc0:       55                      push   %ebp
 8048dc1:       89 e5                   mov    %esp,%ebp
 8048dc3:       56                      push   %esi
 8048dc4:       53                      push   %ebx
 8048dc5:       83 ec 30                sub    $0x30,%esp
 8048dc8:       8d 45 e0                lea    -0x20(%ebp),%eax
 8048dcb:       89 44 24 04             mov    %eax,0x4(%esp)
 8048dcf:       8b 45 08                mov    0x8(%ebp),%eax
 8048dd2:       89 04 24                mov    %eax,(%esp)
 8048dd5:       e8 b9 05 00 00          call   8049393 <read_six_numbers>
 8048dda:       bb 02 00 00 00          mov    $0x2,%ebx
 8048ddf:       8d 75 e0                lea    -0x20(%ebp),%esi
 8048de2:       8b 44 9e f8             mov    -0x8(%esi,%ebx,4),%eax
 8048de6:       83 c0 05                add    $0x5,%eax
 8048de9:       39 44 9e fc             cmp    %eax,-0x4(%esi,%ebx,4)
 8048ded:       74 05                   je     8048df4 <phase_2+0x34>
 8048def:       e8 5d 05 00 00          call   8049351 <explode_bomb>
 8048df4:       83 c3 01                add    $0x1,%ebx
 8048df7:       83 fb 07                cmp    $0x7,%ebx
 8048dfa:       75 e6                   jne    8048de2 <phase_2+0x22>
 8048dfc:       83 c4 30                add    $0x30,%esp
 8048dff:       5b                      pop    %ebx
 8048e00:       5e                      pop    %esi
 8048e01:       5d                      pop    %ebp
 8048e02:       c3                      ret
                                              
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:

Select allOpen in new window

 

by: braker15Posted on 2009-05-13 at 18:08:26ID: 24381018

okay, i made some progress, i wasn't specifying my input file when i used command 'run'

sol.txt has my answers

(gdb) break phase_2
(gdb) run sol.txt
(gdb) disas
(gdb) break *0x08048de9
Breakpoint 2 at 0x8048de9
(gdb) ni
0x08048dc8 in phase_2 ()
0x08048dc8 in phase_2 ()
(gdb) step
Single stepping until exit from function phase_2,
which has no line number information.

Breakpoint 2, 0x08048de9 in phase_2 ()
(gdb)
(gdb) info registers
eax            0x9      9
ecx            0x0      0
edx            0x20     32
ebx            0x2      2
esp            0xbffff7e0       0xbffff7e0
ebp            0xbffff818       0xbffff818
esi            0xbffff7f8       -1073743880
edi            0x0      0
eip            0x8048de9        0x8048de9 <phase_2+41>
eflags         0x206    [ PF IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb)

since %eax is 9... should the first of my six numbers be 9?

Breakpoint 1, 0x08048dc5 in phase_2 ()
Current language:  auto; currently asm
(gdb) disas
Dump of assembler code for function phase_2:
0x08048dc0 <phase_2+0>: push   %ebp
0x08048dc1 <phase_2+1>: mov    %esp,%ebp
0x08048dc3 <phase_2+3>: push   %esi
0x08048dc4 <phase_2+4>: push   %ebx
0x08048dc5 <phase_2+5>: sub    $0x30,%esp
0x08048dc8 <phase_2+8>: lea    -0x20(%ebp),%eax
0x08048dcb <phase_2+11>:        mov    %eax,0x4(%esp)
0x08048dcf <phase_2+15>:        mov    0x8(%ebp),%eax
0x08048dd2 <phase_2+18>:        mov    %eax,(%esp)
0x08048dd5 <phase_2+21>:        call   0x8049393 <read_six_numbers>
0x08048dda <phase_2+26>:        mov    $0x2,%ebx
0x08048ddf <phase_2+31>:        lea    -0x20(%ebp),%esi
0x08048de2 <phase_2+34>:        mov    -0x8(%esi,%ebx,4),%eax
0x08048de6 <phase_2+38>:        add    $0x5,%eax
0x08048de9 <phase_2+41>:        cmp    %eax,-0x4(%esi,%ebx,4)
0x08048ded <phase_2+45>:        je     0x8048df4 <phase_2+52>
0x08048def <phase_2+47>:        call   0x8049351 <explode_bomb>
0x08048df4 <phase_2+52>:        add    $0x1,%ebx
0x08048df7 <phase_2+55>:        cmp    $0x7,%ebx
0x08048dfa <phase_2+58>:        jne    0x8048de2 <phase_2+34>
0x08048dfc <phase_2+60>:        add    $0x30,%esp
0x08048dff <phase_2+63>:        pop    %ebx
0x08048e00 <phase_2+64>:        pop    %esi
0x08048e01 <phase_2+65>:        pop    %ebp
0x08048e02 <phase_2+66>:        ret
End of assembler dump.
(gdb)
                                              
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:

Select allOpen in new window

 

by: braker15Posted on 2009-05-13 at 18:25:30ID: 24381093

YESS!!!!!!!!!!!!!!!!!!!!!! I GOT IT

I kept doing
(gdb) break *0x08048de9
(gdb) info registers

until i had all the values in eax!!!

This is freaking sweeet!!!!!!!!!!!!!!

Breakpoint 2, 0x08048de9 in phase_2 ()
(gdb) info registers
eax            0xb      11
ecx            0x0      0
edx            0x1f     31
ebx            0x2      2
esp            0xbffff7e0       0xbffff7e0
ebp            0xbffff818       0xbffff818
esi            0xbffff7f8       -1073743880
edi            0x0      0
eip            0x8048de9        0x8048de9 <phase_2+41>
eflags         0x202    [ IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb)
 
Breakpoint 2, 0x08048de9 in phase_2 ()
(gdb) info registers
eax            0x10     16
ecx            0x0      0
edx            0x1f     31
ebx            0x3      3
esp            0xbffff7e0       0xbffff7e0
ebp            0xbffff818       0xbffff818
esi            0xbffff7f8       -1073743880
edi            0x0      0
eip            0x8048de9        0x8048de9 <phase_2+41>
eflags         0x212    [ AF IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
 
Breakpoint 2, 0x08048de9 in phase_2 ()
(gdb) info registers
eax            0x15     21
ecx            0x0      0
edx            0x1f     31
ebx            0x4      4
esp            0xbffff7e0       0xbffff7e0
ebp            0xbffff818       0xbffff818
esi            0xbffff7f8       -1073743880
edi            0x0      0
eip            0x8048de9        0x8048de9 <phase_2+41>
eflags         0x202    [ IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
 
 
Breakpoint 2, 0x08048de9 in phase_2 ()
(gdb) info registers
eax            0x1a     26
ecx            0x0      0
edx            0x1f     31
ebx            0x5      5
esp            0xbffff7e0       0xbffff7e0
ebp            0xbffff818       0xbffff818
esi            0xbffff7f8       -1073743880
edi            0x0      0
eip            0x8048de9        0x8048de9 <phase_2+41>
eflags         0x202    [ IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb)
Breakpoint 2, 0x08048de9 in phase_2 ()
(gdb) info registers
eax            0x1f     31
ecx            0x0      0
edx            0x1f     31
ebx            0x6      6
esp            0xbffff7e0       0xbffff7e0
ebp            0xbffff818       0xbffff818
esi            0xbffff7f8       -1073743880
edi            0x0      0
eip            0x8048de9        0x8048de9 <phase_2+41>
eflags         0x202    [ IF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb)
                                              
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:

Select allOpen in new window

 

by: braker15Posted on 2009-05-13 at 18:26:13ID: 31579584

thank you so much for all your help!

 

by: Infinity08Posted on 2009-05-13 at 23:17:02ID: 24382104

Good :)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...