Skip to main content
Bomb Lab: Phase 1

Assembly

0000000000401440 <phase_1>:
b0:
  401440:	48 83 ec 08          	sub    $0x8,%rsp
  401444:	48 8d 35 05 1d 00 00 	lea    0x1d05(%rip),%rsi        # 403150 <_IO_stdin_used+0x150>
  40144b:	e8 43 04 00 00       	callq  401893 <strings_not_equal>
  401450:	85 c0                	test   %eax,%eax
  401452:	74 05                	je     401459 <phase_1+0x19>
  401454:	e8 03 07 00 00       	callq  401b5c <explode_bomb>
b1:
  401459:	48 83 c4 08          	add    $0x8,%rsp
  40145d:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureLess than 1 minuteAbout 163 words
Bomb Lab: Phase 2

Assembly

000000000040145e <phase_2>:
b0:
  40145e:	55                   	push   %rbp
  40145f:	53                   	push   %rbx
  401460:	48 83 ec 28          	sub    $0x28,%rsp
  401464:	48 89 e6             	mov    %rsp,%rsi
  401467:	e8 2c 07 00 00       	callq  401b98 <read_six_numbers>
  40146c:	83 3c 24 00          	cmpl   $0x0,(%rsp)
  401470:	75 07                	jne    401479 <phase_2+0x1b>
  401472:	83 7c 24 04 01       	cmpl   $0x1,0x4(%rsp)
  401477:	74 23                	je     40149c <phase_2+0x3e>
b1:
  401479:	e8 de 06 00 00       	callq  401b5c <explode_bomb>
  40147e:	66 90                	xchg   %ax,%ax
  401480:	eb 1a                	jmp    40149c <phase_2+0x3e>
b2:
  401482:	8b 43 f8             	mov    -0x8(%rbx),%eax
  401485:	03 43 fc             	add    -0x4(%rbx),%eax
  401488:	39 03                	cmp    %eax,(%rbx)
  40148a:	74 05                	je     401491 <phase_2+0x33>
  40148c:	e8 cb 06 00 00       	callq  401b5c <explode_bomb>
b3:
  401491:	48 83 c3 04          	add    $0x4,%rbx
  401495:	48 39 eb             	cmp    %rbp,%rbx
  401498:	75 e8                	jne    401482 <phase_2+0x24>
  40149a:	eb 0e                	jmp    4014aa <phase_2+0x4c>
b4:
  40149c:	48 89 e5             	mov    %rsp,%rbp
  40149f:	48 8d 5c 24 08       	lea    0x8(%rsp),%rbx
  4014a4:	48 83 c5 18          	add    $0x18,%rbp
  4014a8:	eb d8                	jmp    401482 <phase_2+0x24>
b5:
  4014aa:	48 83 c4 28          	add    $0x28,%rsp
  4014ae:	5b                   	pop    %rbx
  4014af:	5d                   	pop    %rbp
  4014b0:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureAbout 1 minAbout 376 words
Bomb Lab: Phase 3

Assembly

00000000004014b1 <phase_3>:
b0:
  4014b1:	48 83 ec 18          	sub    $0x18,%rsp
  4014b5:	48 8d 4c 24 0c       	lea    0xc(%rsp),%rcx
  4014ba:	48 8d 54 24 08       	lea    0x8(%rsp),%rdx
  4014bf:	48 8d 35 6f 1f 00 00 	lea    0x1f6f(%rip),%rsi        # 403435 <array.3354+0x255>
  4014c6:	b8 00 00 00 00       	mov    $0x0,%eax
  4014cb:	e8 60 fc ff ff       	callq  401130 <__isoc99_sscanf@plt>
  4014d0:	83 f8 01             	cmp    $0x1,%eax
  4014d3:	7f 05                	jg     4014da <phase_3+0x29>
  4014d5:	e8 82 06 00 00       	callq  401b5c <explode_bomb>
b1:
  4014da:	83 7c 24 08 07       	cmpl   $0x7,0x8(%rsp)
  4014df:	77 6f                	ja     401550 <phase_3+0x9f>
  4014e1:	8b 54 24 08          	mov    0x8(%rsp),%edx
  4014e5:	48 8d 05 d4 1c 00 00 	lea    0x1cd4(%rip),%rax        # 4031c0 <_IO_stdin_used+0x1c0>
  4014ec:	48 63 14 90          	movslq (%rax,%rdx,4),%rdx
  4014f0:	48 01 d0             	add    %rdx,%rax
  4014f3:	ff e0                	jmpq   *%rax
  4014f5:	b8 00 00 00 00       	mov    $0x0,%eax
  4014fa:	eb 05                	jmp    401501 <phase_3+0x50>
  4014fc:	b8 cb 02 00 00       	mov    $0x2cb,%eax
b2:
  401501:	2d 4c 02 00 00       	sub    $0x24c,%eax
  401506:	eb 05                	jmp    40150d <phase_3+0x5c>
  401508:	b8 00 00 00 00       	mov    $0x0,%eax
b3:
  40150d:	05 ba 03 00 00       	add    $0x3ba,%eax
  401512:	eb 05                	jmp    401519 <phase_3+0x68>
  401514:	b8 00 00 00 00       	mov    $0x0,%eax
b4:
  401519:	2d 79 03 00 00       	sub    $0x379,%eax
  40151e:	eb 05                	jmp    401525 <phase_3+0x74>
  401520:	b8 00 00 00 00       	mov    $0x0,%eax
b5:
  401525:	05 79 03 00 00       	add    $0x379,%eax
  40152a:	eb 05                	jmp    401531 <phase_3+0x80>
  40152c:	b8 00 00 00 00       	mov    $0x0,%eax
b6:
  401531:	2d 79 03 00 00       	sub    $0x379,%eax
  401536:	eb 05                	jmp    40153d <phase_3+0x8c>
  401538:	b8 00 00 00 00       	mov    $0x0,%eax
b7:
  40153d:	05 79 03 00 00       	add    $0x379,%eax
  401542:	eb 05                	jmp    401549 <phase_3+0x98>
  401544:	b8 00 00 00 00       	mov    $0x0,%eax
b8:
  401549:	2d 79 03 00 00       	sub    $0x379,%eax
  40154e:	eb 0a                	jmp    40155a <phase_3+0xa9>
b9:
  401550:	e8 07 06 00 00       	callq  401b5c <explode_bomb>
  401555:	b8 00 00 00 00       	mov    $0x0,%eax
b10:
  40155a:	83 7c 24 08 05       	cmpl   $0x5,0x8(%rsp)
  40155f:	7f 06                	jg     401567 <phase_3+0xb6>
  401561:	3b 44 24 0c          	cmp    0xc(%rsp),%eax
  401565:	74 05                	je     40156c <phase_3+0xbb>
b11:
  401567:	e8 f0 05 00 00       	callq  401b5c <explode_bomb>
b12:
  40156c:	48 83 c4 18          	add    $0x18,%rsp
  401570:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureAbout 6 minAbout 1853 words
Bomb Lab: Phase 4

Assembly

00000000004015a9 <phase_4>:
b0:
  4015a9:	48 83 ec 18          	sub    $0x18,%rsp
  4015ad:	48 8d 4c 24 08       	lea    0x8(%rsp),%rcx
  4015b2:	48 8d 54 24 0c       	lea    0xc(%rsp),%rdx
  4015b7:	48 8d 35 77 1e 00 00 	lea    0x1e77(%rip),%rsi        # 403435 <array.3354+0x255>
  4015be:	b8 00 00 00 00       	mov    $0x0,%eax
  4015c3:	e8 68 fb ff ff       	callq  401130 <__isoc99_sscanf@plt>
  4015c8:	83 f8 02             	cmp    $0x2,%eax
  4015cb:	75 0c                	jne    4015d9 <phase_4+0x30>
  4015cd:	8b 44 24 08          	mov    0x8(%rsp),%eax
  4015d1:	83 e8 02             	sub    $0x2,%eax
  4015d4:	83 f8 02             	cmp    $0x2,%eax
  4015d7:	76 05                	jbe    4015de <phase_4+0x35>
b1:
  4015d9:	e8 7e 05 00 00       	callq  401b5c <explode_bomb>
b2:
  4015de:	8b 74 24 08          	mov    0x8(%rsp),%esi
  4015e2:	bf 09 00 00 00       	mov    $0x9,%edi
  4015e7:	e8 85 ff ff ff       	callq  401571 <func4>
  4015ec:	3b 44 24 0c          	cmp    0xc(%rsp),%eax
  4015f0:	74 05                	je     4015f7 <phase_4+0x4e>
  4015f2:	e8 65 05 00 00       	callq  401b5c <explode_bomb>
b3:
  4015f7:	48 83 c4 18          	add    $0x18,%rsp
  4015fb:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureAbout 2 minAbout 529 words
Bomb Lab: Phase 5

Assembly

00000000004015fc <phase_5>:
b0:
  4015fc:	53                   	push   %rbx
  4015fd:	48 89 fb             	mov    %rdi,%rbx
  401600:	e8 71 02 00 00       	callq  401876 <string_length>
  401605:	83 f8 06             	cmp    $0x6,%eax
  401608:	74 05                	je     40160f <phase_5+0x13>
  40160a:	e8 4d 05 00 00       	callq  401b5c <explode_bomb>
b1:
  40160f:	b8 00 00 00 00       	mov    $0x0,%eax
  401614:	ba 00 00 00 00       	mov    $0x0,%edx
b2:
  401619:	0f b6 34 03          	movzbl (%rbx,%rax,1),%esi
  40161d:	83 e6 0f             	and    $0xf,%esi
  401620:	48 8d 0d b9 1b 00 00 	lea    0x1bb9(%rip),%rcx        # 4031e0 <array.3354>
  401627:	03 14 b1             	add    (%rcx,%rsi,4),%edx
  40162a:	48 83 c0 01          	add    $0x1,%rax
  40162e:	48 83 f8 06          	cmp    $0x6,%rax
  401632:	75 e5                	jne    401619 <phase_5+0x1d>
  401634:	83 fa 40             	cmp    $0x40,%edx
  401637:	74 05                	je     40163e <phase_5+0x42>
  401639:	e8 1e 05 00 00       	callq  401b5c <explode_bomb>
b3:
  40163e:	5b                   	pop    %rbx
  40163f:	90                   	nop
  401640:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureAbout 1 minAbout 415 words
Bomb Lab: Phase 6

Assembly

0000000000401641 <phase_6>:
b0:
  401641:	41 56                	push   %r14
  401643:	41 55                	push   %r13
  401645:	41 54                	push   %r12
  401647:	55                   	push   %rbp
  401648:	53                   	push   %rbx
  401649:	48 83 ec 50          	sub    $0x50,%rsp
  40164d:	49 89 e5             	mov    %rsp,%r13
  401650:	48 89 e6             	mov    %rsp,%rsi
  401653:	e8 40 05 00 00       	callq  401b98 <read_six_numbers>
  401658:	49 89 e6             	mov    %rsp,%r14
  40165b:	41 bc 00 00 00 00    	mov    $0x0,%r12d
b1:
  401661:	4c 89 ed             	mov    %r13,%rbp
  401664:	41 8b 45 00          	mov    0x0(%r13),%eax
  401668:	83 e8 01             	sub    $0x1,%eax
  40166b:	83 f8 05             	cmp    $0x5,%eax
  40166e:	76 05                	jbe    401675 <phase_6+0x34>
b2:
  401670:	e8 e7 04 00 00       	callq  401b5c <explode_bomb>
b3:
  401675:	41 83 c4 01          	add    $0x1,%r12d
  401679:	41 83 fc 06          	cmp    $0x6,%r12d
  40167d:	74 21                	je     4016a0 <phase_6+0x5f>
b4:
  40167f:	44 89 e3             	mov    %r12d,%ebx
b5:
  401682:	48 63 c3             	movslq %ebx,%rax
  401685:	8b 04 84             	mov    (%rsp,%rax,4),%eax
  401688:	39 45 00             	cmp    %eax,0x0(%rbp)
  40168b:	75 05                	jne    401692 <phase_6+0x51>
b6:
  40168d:	e8 ca 04 00 00       	callq  401b5c <explode_bomb>
b7:
  401692:	83 c3 01             	add    $0x1,%ebx
  401695:	83 fb 05             	cmp    $0x5,%ebx
  401698:	7e e8                	jle    401682 <phase_6+0x41>
b8:
  40169a:	49 83 c5 04          	add    $0x4,%r13
  40169e:	eb c1                	jmp    401661 <phase_6+0x20>
b9:
  4016a0:	48 8d 74 24 18       	lea    0x18(%rsp),%rsi
  4016a5:	4c 89 f0             	mov    %r14,%rax
  4016a8:	b9 07 00 00 00       	mov    $0x7,%ecx
b10:
  4016ad:	89 ca                	mov    %ecx,%edx
  4016af:	2b 10                	sub    (%rax),%edx
  4016b1:	89 10                	mov    %edx,(%rax)
  4016b3:	48 83 c0 04          	add    $0x4,%rax
  4016b7:	48 39 f0             	cmp    %rsi,%rax
  4016ba:	75 f1                	jne    4016ad <phase_6+0x6c>
b11:
  4016bc:	be 00 00 00 00       	mov    $0x0,%esi
  4016c1:	eb 23                	jmp    4016e6 <phase_6+0xa5>
b12:
  4016c3:	48 8b 52 08          	mov    0x8(%rdx),%rdx
  4016c7:	83 c0 01             	add    $0x1,%eax
  4016ca:	39 c8                	cmp    %ecx,%eax
  4016cc:	75 f5                	jne    4016c3 <phase_6+0x82>
b13:
  4016ce:	eb 07                	jmp    4016d7 <phase_6+0x96>
b14:
  4016d0:	48 c7 c2 20 53 40 00 	mov    $0x405320,%rdx
b15:
  4016d7:	48 89 54 74 20       	mov    %rdx,0x20(%rsp,%rsi,2)
  4016dc:	48 83 c6 04          	add    $0x4,%rsi
  4016e0:	48 83 fe 18          	cmp    $0x18,%rsi
  4016e4:	74 16                	je     4016fc <phase_6+0xbb>
b16:
  4016e6:	8b 0c 34             	mov    (%rsp,%rsi,1),%ecx
  4016e9:	83 f9 01             	cmp    $0x1,%ecx
  4016ec:	7e e2                	jle    4016d0 <phase_6+0x8f>
b17:
  4016ee:	b8 01 00 00 00       	mov    $0x1,%eax
  4016f3:	48 c7 c2 20 53 40 00 	mov    $0x405320,%rdx
  4016fa:	eb c7                	jmp    4016c3 <phase_6+0x82>
b18:
  4016fc:	48 8b 5c 24 20       	mov    0x20(%rsp),%rbx
  401701:	48 8d 44 24 28       	lea    0x28(%rsp),%rax
  401706:	48 8d 74 24 50       	lea    0x50(%rsp),%rsi
  40170b:	48 89 d9             	mov    %rbx,%rcx
b19:
  40170e:	48 8b 10             	mov    (%rax),%rdx
  401711:	48 89 51 08          	mov    %rdx,0x8(%rcx)
  401715:	48 83 c0 08          	add    $0x8,%rax
  401719:	48 39 f0             	cmp    %rsi,%rax
  40171c:	74 05                	je     401723 <phase_6+0xe2>
b20:
  40171e:	48 89 d1             	mov    %rdx,%rcx
  401721:	eb eb                	jmp    40170e <phase_6+0xcd>
b21:
  401723:	48 c7 42 08 00 00 00 	movq   $0x0,0x8(%rdx)
  40172a:	00
  40172b:	bd 05 00 00 00       	mov    $0x5,%ebp
b22:
  401730:	48 8b 43 08          	mov    0x8(%rbx),%rax
  401734:	8b 00                	mov    (%rax),%eax
  401736:	39 03                	cmp    %eax,(%rbx)
  401738:	7d 05                	jge    40173f <phase_6+0xfe>
b23:
  40173a:	e8 1d 04 00 00       	callq  401b5c <explode_bomb>
b24:
  40173f:	48 8b 5b 08          	mov    0x8(%rbx),%rbx
  401743:	83 ed 01             	sub    $0x1,%ebp
  401746:	75 e8                	jne    401730 <phase_6+0xef>
b25:
  401748:	48 83 c4 50          	add    $0x50,%rsp
  40174c:	5b                   	pop    %rbx
  40174d:	5d                   	pop    %rbp
  40174e:	41 5c                	pop    %r12
  401750:	41 5d                	pop    %r13
  401752:	41 5e                	pop    %r14
  401754:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureAbout 6 minAbout 1882 words
Bomb Lab: read six numbers

Assembly

0000000000401b98 <read_six_numbers>:
b0:
  401b98:	48 83 ec 18          	sub    $0x18,%rsp
  401b9c:	48 89 f2             	mov    %rsi,%rdx
  401b9f:	48 8d 4e 04          	lea    0x4(%rsi),%rcx
  401ba3:	48 8d 46 14          	lea    0x14(%rsi),%rax
  401ba7:	48 89 44 24 08       	mov    %rax,0x8(%rsp)
  401bac:	48 8d 46 10          	lea    0x10(%rsi),%rax
  401bb0:	48 89 04 24          	mov    %rax,(%rsp)
  401bb4:	4c 8d 4e 0c          	lea    0xc(%rsi),%r9
  401bb8:	4c 8d 46 08          	lea    0x8(%rsi),%r8
  401bbc:	48 8d 35 66 18 00 00 	lea    0x1866(%rip),%rsi        # 403429 <array.3354+0x249>
  401bc3:	b8 00 00 00 00       	mov    $0x0,%eax
  401bc8:	e8 63 f5 ff ff       	callq  401130 <__isoc99_sscanf@plt>
  401bcd:	83 f8 05             	cmp    $0x5,%eax
  401bd0:	7f 05                	jg     401bd7 <read_six_numbers+0x3f>
  401bd2:	e8 85 ff ff ff       	callq  401b5c <explode_bomb>
b1:
  401bd7:	48 83 c4 18          	add    $0x18,%rsp
  401bdb:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureLess than 1 minuteAbout 272 words
Bomb Lab: string length

Assembly

0000000000401876 <string_length>:
b0:
  401876:	80 3f 00             	cmpb   $0x0,(%rdi)
  401879:	74 12                	je     40188d <string_length+0x17>
  40187b:	48 89 fa             	mov    %rdi,%rdx
b1:
  40187e:	48 83 c2 01          	add    $0x1,%rdx
  401882:	89 d0                	mov    %edx,%eax
  401884:	29 f8                	sub    %edi,%eax
  401886:	80 3a 00             	cmpb   $0x0,(%rdx)
  401889:	75 f3                	jne    40187e <string_length+0x8>
  40188b:	f3 c3                	repz retq
b2:
  40188d:	b8 00 00 00 00       	mov    $0x0,%eax
  401892:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureLess than 1 minuteAbout 153 words
Bomb Lab: strings not equal
0000000000401893 <strings_not_equal>:
  401893:	41 54                	push   %r12
  401895:	55                   	push   %rbp
  401896:	53                   	push   %rbx
  401897:	48 89 fb             	mov    %rdi,%rbx
  40189a:	48 89 f5             	mov    %rsi,%rbp
  40189d:	e8 d4 ff ff ff       	callq  401876 <string_length>
  4018a2:	41 89 c4             	mov    %eax,%r12d
  4018a5:	48 89 ef             	mov    %rbp,%rdi
  4018a8:	e8 c9 ff ff ff       	callq  401876 <string_length>
  4018ad:	ba 01 00 00 00       	mov    $0x1,%edx
  4018b2:	41 39 c4             	cmp    %eax,%r12d
  4018b5:	75 3c                	jne    4018f3 <strings_not_equal+0x60>
  4018b7:	0f b6 03             	movzbl (%rbx),%eax
  4018ba:	84 c0                	test   %al,%al
  4018bc:	74 22                	je     4018e0 <strings_not_equal+0x4d>
  4018be:	3a 45 00             	cmp    0x0(%rbp),%al
  4018c1:	74 07                	je     4018ca <strings_not_equal+0x37>
  4018c3:	eb 22                	jmp    4018e7 <strings_not_equal+0x54>
  4018c5:	3a 45 00             	cmp    0x0(%rbp),%al
  4018c8:	75 24                	jne    4018ee <strings_not_equal+0x5b>
  4018ca:	48 83 c3 01          	add    $0x1,%rbx
  4018ce:	48 83 c5 01          	add    $0x1,%rbp
  4018d2:	0f b6 03             	movzbl (%rbx),%eax
  4018d5:	84 c0                	test   %al,%al
  4018d7:	75 ec                	jne    4018c5 <strings_not_equal+0x32>
  4018d9:	ba 00 00 00 00       	mov    $0x0,%edx
  4018de:	eb 13                	jmp    4018f3 <strings_not_equal+0x60>
  4018e0:	ba 00 00 00 00       	mov    $0x0,%edx
  4018e5:	eb 0c                	jmp    4018f3 <strings_not_equal+0x60>
  4018e7:	ba 01 00 00 00       	mov    $0x1,%edx
  4018ec:	eb 05                	jmp    4018f3 <strings_not_equal+0x60>
  4018ee:	ba 01 00 00 00       	mov    $0x1,%edx
  4018f3:	89 d0                	mov    %edx,%eax
  4018f5:	5b                   	pop    %rbx
  4018f6:	5d                   	pop    %rbp
  4018f7:	41 5c                	pop    %r12
  4018f9:	c3                   	retq

Course WorkBomb LabComputer Organization and ArchitectureAbout 2 minAbout 722 words