Binary-Bomb-Phase 3-Montage

Ja, das ist Hausaufgaben, und Nein, ich verlange nicht, Sie zu tun, meine Hausaufgaben zu machen. Ich brauche Hilfe mit phase 3 von dieser binären Bombe. Ich habe keine Probleme mit den Phasen 1 und 2 aber phase 3 ist einfach zu viel für mich. Ich verstehe, dass es 3 Eingänge. Ich bin mir ziemlich sicher, dass einer von Ihnen ist ein Charakter-Eingang und zwei von Ihnen sind ganze zahlen, aber ich bin mir nicht sicher in welcher Reihenfolge.
Erstens, hier ist das zerlegte code:

0x0000000000401163 <phase_3+0>: sub    $0x18,%rsp
0x0000000000401167 <phase_3+4>: lea    0xf(%rsp),%rcx
0x000000000040116c <phase_3+9>: lea    0x14(%rsp),%rdx
0x0000000000401171 <phase_3+14>:        lea    0x10(%rsp),%r8
0x0000000000401176 <phase_3+19>:        mov    $0x402650,%esi
0x000000000040117b <phase_3+24>:        mov    $0x0,%eax
0x0000000000401180 <phase_3+29>:        callq  0x400b80 <sscanf@plt>
0x0000000000401185 <phase_3+34>:        cmp    $0x2,%eax
0x0000000000401188 <phase_3+37>:        jg     0x40118f <phase_3+44>
0x000000000040118a <phase_3+39>:        callq  0x4014b1 <explode_bomb>
0x000000000040118f <phase_3+44>:        cmpl   $0x7,0x14(%rsp)
0x0000000000401194 <phase_3+49>:        ja     0x401294 <phase_3+305>
0x000000000040119a <phase_3+55>:        mov    0x14(%rsp),%eax
0x000000000040119e <phase_3+59>:        xchg   %ax,%ax
0x00000000004011a0 <phase_3+61>:        jmpq   *0x402660(,%rax,8)
0x00000000004011a7 <phase_3+68>:        cmpl   $0x2c4,0x10(%rsp)
0x00000000004011af <phase_3+76>:        nop
0x00000000004011b0 <phase_3+77>:        je     0x4012a2 <phase_3+319>
0x00000000004011b6 <phase_3+83>:        callq  0x4014b1 <explode_bomb>
0x00000000004011bb <phase_3+88>:        mov    $0x7a,%eax
0x00000000004011c0 <phase_3+93>:        jmpq   0x4012a7 <phase_3+324>
0x00000000004011c5 <phase_3+98>:        mov    $0x6a,%eax
---Type <return> to continue, or q <return> to quit---
0x00000000004011ca <phase_3+103>:       cmpl   $0x327,0x10(%rsp)
0x00000000004011d2 <phase_3+111>:       je     0x4012a7 <phase_3+324>
0x00000000004011d8 <phase_3+117>:       callq  0x4014b1 <explode_bomb>
0x00000000004011dd <phase_3+122>:       mov    $0x6a,%eax
0x00000000004011e2 <phase_3+127>:       jmpq   0x4012a7 <phase_3+324>
0x00000000004011e7 <phase_3+132>:       mov    $0x66,%eax
0x00000000004011ec <phase_3+137>:       cmpl   $0x136,0x10(%rsp)
0x00000000004011f4 <phase_3+145>:       je     0x4012a7 <phase_3+324>
0x00000000004011fa <phase_3+151>:       callq  0x4014b1 <explode_bomb>
0x00000000004011ff <phase_3+156>:       mov    $0x66,%eax
0x0000000000401204 <phase_3+161>:       jmpq   0x4012a7 <phase_3+324>
0x0000000000401209 <phase_3+166>:       mov    $0x75,%eax
0x000000000040120e <phase_3+171>:       cmpl   $0x252,0x10(%rsp)
0x0000000000401216 <phase_3+179>:       je     0x4012a7 <phase_3+324>
0x000000000040121c <phase_3+185>:       callq  0x4014b1 <explode_bomb>
0x0000000000401221 <phase_3+190>:       mov    $0x75,%eax
0x0000000000401226 <phase_3+195>:       jmpq   0x4012a7 <phase_3+324>
0x000000000040122b <phase_3+200>:       mov    $0x70,%eax
0x0000000000401230 <phase_3+205>:       cmpl   $0x240,0x10(%rsp)
0x0000000000401238 <phase_3+213>:       je     0x4012a7 <phase_3+324>
0x000000000040123a <phase_3+215>:       callq  0x4014b1 <explode_bomb>
0x000000000040123f <phase_3+220>:       mov    $0x70,%eax
0x0000000000401244 <phase_3+225>:       jmp    0x4012a7 <phase_3+324>
---Type <return> to continue, or q <return> to quit---
0x0000000000401246 <phase_3+227>:       cmpl   $0x269,0x10(%rsp)
0x000000000040124e <phase_3+235>:       xchg   %ax,%ax
0x0000000000401250 <phase_3+237>:       je     0x4012a2 <phase_3+319>
0x0000000000401252 <phase_3+239>:       callq  0x4014b1 <explode_bomb>
0x0000000000401257 <phase_3+244>:       mov    $0x7a,%eax
0x000000000040125c <phase_3+249>:       jmp    0x4012a7 <phase_3+324>
0x000000000040125e <phase_3+251>:       mov    $0x6b,%eax
0x0000000000401263 <phase_3+256>:       cmpl   $0x201,0x10(%rsp)
0x000000000040126b <phase_3+264>:       je     0x4012a7 <phase_3+324>
0x000000000040126d <phase_3+266>:       callq  0x4014b1 <explode_bomb>
0x0000000000401272 <phase_3+271>:       mov    $0x6b,%eax
0x0000000000401277 <phase_3+276>:       jmp    0x4012a7 <phase_3+324>
0x0000000000401279 <phase_3+278>:       mov    $0x74,%eax
0x000000000040127e <phase_3+283>:       cmpl   $0x358,0x10(%rsp)
0x0000000000401286 <phase_3+291>:       je     0x4012a7 <phase_3+324>
0x0000000000401288 <phase_3+293>:       callq  0x4014b1 <explode_bomb>
0x000000000040128d <phase_3+298>:       mov    $0x74,%eax
0x0000000000401292 <phase_3+303>:       jmp    0x4012a7 <phase_3+324>
0x0000000000401294 <phase_3+305>:       callq  0x4014b1 <explode_bomb>
0x0000000000401299 <phase_3+310>:       mov    $0x75,%eax
0x000000000040129e <phase_3+315>:       xchg   %ax,%ax
0x00000000004012a0 <phase_3+317>:       jmp    0x4012a7 <phase_3+324>
0x00000000004012a2 <phase_3+319>:       mov    $0x7a,%eax
---Type <return> to continue, or q <return> to quit---
0x00000000004012a7 <phase_3+324>:       cmp    0xf(%rsp),%al
0x00000000004012ab <phase_3+328>:       je     0x4012b2 <phase_3+335>
0x00000000004012ad <phase_3+330>:       callq  0x4014b1 <explode_bomb>
0x00000000004012b2 <phase_3+335>:       add    $0x18,%rsp
0x00000000004012b6 <phase_3+339>:       retq

Ich eingegeben so etwas wie 4 112 z, nur um es auszuprobieren, und führen Sie durch die einzelnen Schritte.

Der code läuft bis zu 0x0000000000401230 <phase_3+205>: cmpl $0x240,0x10(%rsp)

Was mich wirklich verwirrt ist, was 0x10(%rsp) zeigt. Ich schaute auf die dezimale Wert in rsp und es ist in der negativen.
Wie es scheint, der erste Eingang 4 hat Super geklappt, und der code lief, aber ich Frage mich, warum es den Vergleich rsp 576, und was das 0x10 vor es gibt.
Jede Art von Einsicht wäre hilfreich.

  • Es ist nicht zu vergleichen rsp mit 576, es ist der Vergleich der 32-bit-Wert gespeichert (rsp + 0x10) mit 576.
InformationsquelleAutor Man Person | 2013-09-23
Schreibe einen Kommentar