bomblab phase 6: can someone help me figure out what order my numbers for phase6?

-1

i know there needs to be 6 integers 1-6, but i can't figure out the order. when i tried the nodes, i got 1 2 3 4 6 5 in increasing order but it didn't work. any suggestions? basically the assembly checks if the 6 numbers are unique in a loop, then within the nodes we are supposed to print the numbers 1 -6 in a certain order but i can't seem to figure out what the order is. can anyone help? i believe the node is at +127 here are the nodes:

    0x804c138 <node1>:      0x00000089      0x00000001      0x0804c144      0x0000016f
0x804c148 <node2+4>:    0x00000002      0x0804c150      0x000001ef      0x00000003
0x804c158 <node3+8>:    0x0804c15c      0x00000251      0x00000004      0x0804c168
0x804c168 <node5>:      0x000002eb      0x00000005      0x0804c174      0x000002c4
0x804c178 <node6+4>:    0x00000006      0x00000000      0x6a73724d      0x65334f53

here's the assembly dump:

Dump of assembler code for function phase_6:
=> 0x08048e2d <+0>:     push   %esi
   0x08048e2e <+1>:     push   %ebx
   0x08048e2f <+2>:     sub    $0x44,%esp
   0x08048e32 <+5>:     lea    0x28(%esp),%eax
   0x08048e36 <+9>:     mov    %eax,0x4(%esp)
   0x08048e3a <+13>:    mov    0x50(%esp),%eax
   0x08048e3e <+17>:    mov    %eax,(%esp)
   0x08048e41 <+20>:    call   0x804934c <read_six_numbers>
   0x08048e46 <+25>:    mov    $0x0,%esi
   0x08048e4b <+30>:    mov    0x28(%esp,%esi,4),%eax
   0x08048e4f <+34>:    sub    $0x1,%eax
   0x08048e52 <+37>:    cmp    $0x5,%eax
   0x08048e55 <+40>:    jbe    0x8048e5c <phase_6+47>
   0x08048e57 <+42>:    call   0x804930d <explode_bomb>
   0x08048e5c <+47>:    add    $0x1,%esi
   0x08048e5f <+50>:    cmp    $0x6,%esi
   0x08048e62 <+53>:    je     0x8048e7f <phase_6+82>
   0x08048e64 <+55>:    mov    %esi,%ebx
   0x08048e66 <+57>:    mov    0x28(%esp,%ebx,4),%eax
   0x08048e6a <+61>:    cmp    %eax,0x24(%esp,%esi,4)
   0x08048e6e <+65>:    jne    0x8048e75 <phase_6+72>
   0x08048e70 <+67>:    call   0x804930d <explode_bomb>
   0x08048e75 <+72>:    add    $0x1,%ebx
   0x08048e78 <+75>:    cmp    $0x5,%ebx
   0x08048e7b <+78>:    jle    0x8048e66 <phase_6+57>
   0x08048e7d <+80>:    jmp    0x8048e4b <phase_6+30>
   0x08048e7f <+82>:    lea    0x28(%esp),%eax
   0x08048e83 <+86>:    lea    0x40(%esp),%ebx
   0x08048e87 <+90>:    mov    $0x7,%ecx
   0x08048e8c <+95>:    mov    %ecx,%edx
   0x08048e8e <+97>:    sub    (%eax),%edx
   0x08048e90 <+99>:    mov    %edx,(%eax)
   0x08048e92 <+101>:   add    $0x4,%eax
   0x08048e95 <+104>:   cmp    %ebx,%eax
   0x08048e97 <+106>:   jne    0x8048e8c <phase_6+95>
   0x08048e99 <+108>:   mov    $0x0,%ebx
   0x08048e9e <+113>:   jmp    0x8048ebd <phase_6+144>
   0x08048ea0 <+115>:   mov    0x8(%edx),%edx
   0x08048ea3 <+118>:   add    $0x1,%eax
   0x08048ea6 <+121>:   cmp    %ecx,%eax
   0x08048ea8 <+123>:   jne    0x8048ea0 <phase_6+115>
   0x08048eaa <+125>:   jmp    0x8048eb1 <phase_6+132>
   0x08048eac <+127>:   mov    $0x804c138,%edx
   0x08048eb1 <+132>:   mov    %edx,0x10(%esp,%esi,4)
   0x08048eb5 <+136>:   add    $0x1,%ebx
   0x08048eb8 <+139>:   cmp    $0x6,%ebx
   0x08048ebb <+142>:   je     0x8048ed4 <phase_6+167>
   0x08048ebd <+144>:   mov    %ebx,%esi
   0x08048ebf <+146>:   mov    0x28(%esp,%ebx,4),%ecx
   0x08048ec3 <+150>:   cmp    $0x1,%ecx
---Type <return> to continue, or q <return> to quit---c
   0x08048ec6 <+153>:   jle    0x8048eac <phase_6+127>
   0x08048ec8 <+155>:   mov    $0x1,%eax
   0x08048ecd <+160>:   mov    $0x804c138,%edx
   0x08048ed2 <+165>:   jmp    0x8048ea0 <phase_6+115>
   0x08048ed4 <+167>:   mov    0x10(%esp),%ebx
   0x08048ed8 <+171>:   lea    0x14(%esp),%eax
   0x08048edc <+175>:   lea    0x28(%esp),%esi
   0x08048ee0 <+179>:   mov    %ebx,%ecx
   0x08048ee2 <+181>:   mov    (%eax),%edx
   0x08048ee4 <+183>:   mov    %edx,0x8(%ecx)
   0x08048ee7 <+186>:   add    $0x4,%eax
   0x08048eea <+189>:   cmp    %esi,%eax
   0x08048eec <+191>:   je     0x8048ef2 <phase_6+197>
   0x08048eee <+193>:   mov    %edx,%ecx
   0x08048ef0 <+195>:   jmp    0x8048ee2 <phase_6+181>
   0x08048ef2 <+197>:   movl   $0x0,0x8(%edx)
   0x08048ef9 <+204>:   mov    $0x5,%esi
   0x08048efe <+209>:   mov    0x8(%ebx),%eax
   0x08048f01 <+212>:   mov    (%eax),%eax
   0x08048f03 <+214>:   cmp    %eax,(%ebx)
   0x08048f05 <+216>:   jge    0x8048f0c <phase_6+223>
   0x08048f07 <+218>:   call   0x804930d <explode_bomb>
   0x08048f0c <+223>:   mov    0x8(%ebx),%ebx
   0x08048f0f <+226>:   sub    $0x1,%esi
   0x08048f12 <+229>:   jne    0x8048efe <phase_6+209>
   0x08048f14 <+231>:   add    $0x44,%esp
   0x08048f17 <+234>:   pop    %ebx
   0x08048f18 <+235>:   pop    %esi
   0x08048f19 <+236>:   ret

  End of assembler dump.
c
assembly
x86
time-bomb
asked on Stack Overflow Nov 13, 2019 by lchester • edited Nov 13, 2019 by lchester

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0