Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

what would be the input values for this assembly code? bomb should not explode.

ID: 3740290 • Letter: W

Question

what would be the input values for this assembly code? bomb should not explode.


08048c38 <phase_3>:
8048c38: 83 ec 1c             sub    $0x1c,%esp
8048c3b: c7 04 24 73 a3 04 08 movl   $0x804a373,(%esp)
8048c42: e8 84 04 00 00       call   80490cb <string_length>
8048c47: 83 c0 01             add    $0x1,%eax
8048c4a: 89 04 24             mov    %eax,(%esp)
8048c4d: e8 ae fb ff ff       call   8048800 <malloc@plt>
8048c52: c7 00 43 72 69 6b    movl   $0x6b697243,(%eax)
8048c58: c7 40 04 65 79 21 20 movl   $0x20217965,0x4(%eax)
8048c5f: c7 40 08 49 20 68 61 movl   $0x61682049,0x8(%eax)
8048c66: c7 40 0c 76 65 20 6c movl   $0x6c206576,0xc(%eax)
8048c6d: c7 40 10 6f 73 74 20 movl   $0x2074736f,0x10(%eax)
8048c74: c7 40 14 6d 79 20 6d movl   $0x6d20796d,0x14(%eax)
8048c7b: c7 40 18 6f 6a 6f 21 movl   $0x216f6a6f,0x18(%eax)
8048c82: c6 40 1c 00          movb   $0x0,0x1c(%eax)
8048c86: c6 40 11 78          movb   $0x78,0x11(%eax)
8048c8a: 89 44 24 04          mov    %eax,0x4(%esp)
8048c8e: 8b 44 24 20          mov    0x20(%esp),%eax
8048c92: 89 04 24             mov    %eax,(%esp)
8048c95: e8 50 04 00 00       call   80490ea <strings_not_equal>
8048c9a: 85 c0                test   %eax,%eax
8048c9c: 74 05                je     8048ca3 <phase_3+0x6b>
8048c9e: e8 e2 06 00 00       call   8049385 <explode_bomb>
8048ca3: 83 c4 1c             add    $0x1c,%esp
8048ca6: c3                   ret   

Explanation / Answer

Explanation: •

Set a breakpoint at the phase_3.

Observation:

Breakpoint 1, oxo8048f9a in phase_3 () (gdb) disas Dump of assembler code for function phase_3:

ox88048f94 (+0): push Sebp

oxo8048f95 (+1): mov xesp,%ebp

oxo8048f97 (+3): sub $ox28,%esp

oxo8048f9a (+6): lea -ox10(%ebp),%eax

oxo8048f9d (+9): mov %eax,oxc(%esp)

oxo8048fa1 (+13): lea -oxc(%ebp),%eax

ox88048fa4 (+16): mov Seax,ox8(%esp)

oxo8048f68 (+20): movl $ox804658c,ox4(%esp)

oxo8048fbo (+28): mov ox8(%ebp),%eax

oxo8048fb3 (+31): mov Seax,(%esp)

oxo8048fb6 (+34): call

ox8048894 (__isoc99_sscanf@plt>

oxo8048fbb (+39): cmp 5ox1,%eax

oxo8048fbe (+42): jg

ox8048fc5 (phase_3+49)

oxo8048fco (+44): call

ox8049321 (explode_bomb)

ox98048fc5 (+49): cmpl $ox7,-9xc(%ebp)

oxo8048fc9 (+53): ja

ox8049032 (phase_3+158)

oxo8048fcb (+55): mov -oxc(%ebp),%eax

oxo8048fce (+58): xchg %ax,%ax

oxo8048fdo (+60): jmp

*ox804a4co (,%eax,4)

oxo8048fd7 (+67): mov 5oxo,%eax

oxo8048fdc (+72): lea oxo(%esi,%eiz,1),%esi

oxo8048feo (+76): jmp

ox804902d (phase_3+153)

oxo8048fe2 (+78): mov 5oxo,%eax

oxo8048fe7 (+83): jmp

ox804902a (phase_3+150)

oxo8048fe9 (+85): mov 5oxo,%eax

oxo8048fee (+90): xchg %ax,%ax

oxo8048ffo (+92): jmp

ox8049027 (phase_3+147>

oxo8048ff2 (+94): mov $oxo,%eax

oxo8048ff7 (+99): jmp

ox8049024 (phase_3+144>

oxo8048ff9 <+1o1>= mov wxo,xeax l

oxo8048ffe (+106): xchg $ax,%ax

oxo8049000 (+108): jmp

ox8049021 (phase_3+141>

oxo8049002 (+110): mov $oxo,%eax

oxo8049007 (+115): jmp

ox804901c (phase_3+136>

oxo8049009 (+117): mov $ox3od,%eax

oxo80490oe (+122): xchg xax,%ax

oxo8049010 (+124): jmp

ox8049017 (phase_3+131)

oxo8049012 (+126): mov $oxo,%eax

oxo8049017 (+131): sub $ox264,%eax

oxo804901c (+136): add $ox3b8,%eax

oxo8049021 (+141): sub $ox49,%eax

oxo8049024 (+144): add $ox49,%eax

oxo8049027 (+147): sub $ox49,%eax

oxo8049023 (+150): add $ox49,%eax

oxo804902d (+153): sub $ox49,%eax

oxo8049030 (+156): jmp

ox804903c (phase_3+168)

oxo8049032 (+158): call

ox8049321 (explode_bomb)

oxo8049037 (+163): mov $oxo,%eax

oxo804903c (+168): cmpl $ox5,-oxc(%ebp)

oxo8049040 (+172): jg

ox8049047 (phase_3+179)

oxo8049042 (+174): cmp -ox10(%ebp),%eax

oxo8049045 (+177): je

ox804904c (phase_3+184)

oxo8049047 (+179): call

ox8049321 (explode_bomb)

oxo804904c (+184): leave

oxo804904d (+185): lea oxo(%esi),%esi

oxo8049050 (+188): ret

End of assembler dump. (gdb)