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 $0xc,%esp //esp=esp-12
0x08048c32 <phase_4+6>: lea 0xfffffffc(%ebp),%eax //eax=ebp-4
0x08048c35 <phase_4+9>: push %eax
0x08048c36 <phase_4+10>: push $0x8049717 // %d Bad Host (1) / Bad Host (2) / Error ...
0x08048c3b <phase_4+15>: pushl 0x8(%ebp) // address points to gibberish
0x08048c3e <phase_4+18>: call 0x8048870 // unknown function
0x08048c43 <phase_4+23>: add $0x10,%esp // esp=esp+16
0x08048c46 <phase_4+26>: cmp $0x1,%eax // if eax!=1
0x08048c49 <phase_4+29>: jne 0x8048c51 <phase_4+37> //jump to explosion
0x08048c4b <phase_4+31>: cmpl $0x0,0xfffffffc(%ebp) //if $ebp-4>0
0x08048c4f <phase_4+35>: jg 0x8048c56 <phase_4+42> // jump past explosion
0x08048c51 <phase_4+37>: call 0x80493be <explode_bomb>
0x08048c56 <phase_4+42>: pushl 0xfffffffc(%ebp) // push $ebp-4 onto stack
0x08048c59 <phase_4+45>: call 0x8048bf7 <func4> // call func4
0x08048c5e <phase_4+50>: add $0x4,%esp // esp = esp+4
0x08048c61 <phase_4+53>: cmp $0x262,%eax // if eax==x262==106
0x08048c66 <phase_4+58>: je 0x8048c6d <phase_4+65> // jump past explosion
0x08048c68 <phase_4+60>: call 0x80493be <explode_bomb>
0x08048c6d <phase_4+65>: leave
0x08048c6e <phase_4+66>: ret
End of assembler dump.
Dump of assembler code for function func4:
0x08048bf7 <func4+0>: push %ebp
0x08048bf8 <func4+1>: mov %esp,%ebp
0x08048bfa <func4+3>: push %esi
0x08048bfb <func4+4>: push %ebx
0x08048bfc <func4+5>: mov 0x8(%ebp),%esi //esi=ebp+8
0x08048bff <func4+8>: mov $0x1,%eax //eax=1
0x08048c04 <func4+13>: cmp $0x1,%esi //if esi <= 1
0x08048c07 <func4+16>: jle 0x8048c25 <func4+46> // then jump to end
0x08048c09 <func4+18>: sub $0xc,%esp // else esp=esp-12
0x08048c0c <func4+21>: lea 0xffffffff(%esi),%eax //eax=esi-1
0x08048c0f <func4+24>: push %eax
0x08048c10 <func4+25>: call 0x8048bf7 <func4> // call func4 passing in eax
0x08048c15 <func4+30>: mov %eax,%ebx // ebx=eax
0x08048c17 <func4+32>: lea 0xfffffffe(%esi),%eax // eax=esi-2
0x08048c1a <func4+35>: mov %eax,(%esp) // esp=eax
0x08048c1d <func4+38>: call 0x8048bf7 <func4> //call func4 passing eax
0x08048c22 <func4+43>: lea (%ebx,%eax,1),%eax // eax=ebx+eax
0x08048c25 <func4+46>: lea 0xfffffff8(%ebp),%esp // esp=ebp-8
0x08048c28 <func4+49>: pop %ebx
0x08048c29 <func4+50>: pop %esi
0x08048c2a <func4+51>: leave
0x08048c2b <func4+52>: ret
End of assembler dump.
Saw in a previous posting that func4 basically calculates x^y value. Not sure which input is x or y or if there is one, in the input. Was wondering if anyone could help me better understand what this phase is looking for. Thanks for your time.
Start Free Trial