the Binary Bomb Phase 5

0

I'm currently working on the binary bomb lab and I'm very confused. I tried asking my friends and searching online but it seems like that my bomb is different.

Dump of assembler code for function phase_5:
   0x08048d7e <+0>:	push   %ebp
   0x08048d7f <+1>:	mov    %esp,%ebp
   0x08048d81 <+3>:	push   %edi
   0x08048d82 <+4>:	push   %esi
   0x08048d83 <+5>:	push   %ebx
=> 0x08048d84 <+6>:	sub    $0x1c,%esp
   0x08048d87 <+9>:	mov    0x8(%ebp),%ebx
   0x08048d8a <+12>:	mov    %ebx,(%esp)
   0x08048d8d <+15>:	call   0x8048f10 <string_length>
   0x08048d92 <+20>:	cmp    $0x6,%eax
   0x08048d95 <+23>:	je     0x8048d9c <phase_5+30>
   0x08048d97 <+25>:	call   0x8049016 <explode_bomb>
   0x08048d9c <+30>:	mov    $0x0,%edx
   0x08048da1 <+35>:	mov    $0x0,%eax
   0x08048da6 <+40>:	mov    $0x8049f80,%ecx
   0x08048dab <+45>:	movsbl (%ebx,%eax,1),%esi
   0x08048daf <+49>:	and    $0xf,%esi
   0x08048db2 <+52>:	add    (%ecx,%esi,4),%edx
   0x08048db5 <+55>:	add    $0x1,%eax
   0x08048db8 <+58>:	cmp    $0x6,%eax
   0x08048dbb <+61>:	jne    0x8048dab <phase_5+45>
   0x08048dbd <+63>:	cmp    $0x37,%edx
   0x08048dc0 <+66>:	je     0x8048dc7 <phase_5+73>
   0x08048dc2 <+68>:	call   0x8049016 <explode_bomb>
   0x08048dc7 <+73>:	add    $0x1c,%esp
   0x08048dca <+76>:	pop    %ebx
   0x08048dcb <+77>:	pop    %esi
   0x08048dcc <+78>:	pop    %edi
   0x08048dcd <+79>:	pop    %ebp
   0x08048dce <+80>:	ret    
I believe that my result should be six numbers that sum up to be 37.This is what I got from gdb

(gdb) x/15wx 0x8049f80
0x8049f80 <array.2963>:	0x00000002	0x0000000a	0x00000006	0x00000001
0x8049f90 <array.2963+16>:	0x0000000c	0x00000010	0x00000009	0x00000003
0x8049fa0 <array.2963+32>:	0x00000004	0x00000007	0x0000000e	0x00000005
0x8049fb0 <array.2963+48>:	0x0000000b	0x00000008	0x0000000f

Can someone please explain this to me? I'll really appreciate it.

assembly
x86
asked on Stack Overflow Nov 18, 2015 by CiciLau

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0