美文网首页
BombLab 上

BombLab 上

作者: 早睡使人快乐 | 来源:发表于2022-05-12 18:59 被阅读0次

    实验目的

    使用特定的输入来解除炸弹

    实验准备

    gdb bomb

    尝试使用gdb调试,报错

    一直报错没有权限,查看了一下似乎是使用dokcer建立的问题,试了很多网上的解决方法都没有成功,于是直接在本机上运行算了
    issue地址

    开始实验

    phase 1

    简单的看一下main函数


    main

    应该是要输入特定的数字然后运行phase_defused第一阶段就拆除了,在反汇编代码中找到phase_1的代码段

    0000000000400ee0 <phase_1>:
      400ee0:   48 83 ec 08             sub    $0x8,%rsp
      400ee4:   be 00 24 40 00          mov    $0x402400,%esi
      400ee9:   e8 4a 04 00 00          callq  401338 <strings_not_equal>
      400eee:   85 c0                   test   %eax,%eax
      400ef0:   74 05                   je     400ef7 <phase_1+0x17>
      400ef2:   e8 43 05 00 00          callq  40143a <explode_bomb>
      400ef7:   48 83 c4 08             add    $0x8,%rsp
      400efb:   c3                      retq   
    

    上寄存器图


    寄存器
    寄存器用例#1 寄存器用例#2
    
    (gdb) run
    //开始执行bomb
    Starting program: /home/going/workspace/csappLab/bomb/bomb
    Welcome to my fiendish little bomb. You have 6 phases with
    which to blow yourself up. Have a nice day!
    ^C
    Program received signal SIGINT, Interrupt.
    0x00007ffff7afcb40 in __read_nocancel () from /lib64/libc.so.6
    Missing separate debuginfos, use: debuginfo-install glibc-2.17-325.el7_9.x86_64
    //查看$esi的值
    (gdb) x /s 0x402400
    0x402400:       "Border relations with Canada have never been better."
    (gdb) continue
    Continuing.
    //输入答案
    Border relations with Canada have never been better.
    
    Breakpoint 1, 0x0000000000400ee0 in phase_1 ()
    //输入值
    (gdb) x /s $rdi
    0x603780 <input_strings>:       "Border relations with Canada have never been better."
    (gdb) x /s $rsi
    0x603780 <input_strings>:       "Border relations with Canada have never been better."
    //调用strings_no_equal前打个断点
    (gdb) b *0x400ee9
    Breakpoint 2 at 0x400ee9
    (gdb) continue
    Continuing.
    
    Breakpoint 2, 0x0000000000400ee9 in phase_1 ()
    (gdb) info program
            Using the running image of child process 2929.
    Program stopped at 0x400ee9.
    It stopped at breakpoint 2.
    (gdb) x /s $esi
    //传过去的值
    0x402400:       "Border relations with Canada have never been better."
    (gdb) continue
    Continuing.
    //炸弹解除
    Phase 1 defused. How about the next one?
    

    Phase2

    GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-redhat-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from /home/going/workspace/csappLab/bomb/bomb...done.
    (gdb) br phase_2
    //断点
    Breakpoint 1 at 0x400efc
    (gdb) r answers.txt
    //传入参数(上一阶段的答案)
    Starting program: /home/going/workspace/csappLab/bomb/bomb answers.txt
    Welcome to my fiendish little bomb. You have 6 phases with
    which to blow yourself up. Have a nice day!
    Phase 1 defused. How about the next one?
    //不知道答案是什么所以随便输一个
    hello
    
    Breakpoint 1, 0x0000000000400efc in phase_2 ()
    Missing separate debuginfos, use: debuginfo-install glibc-2.17-325.el7_9.x86_64
    (gdb) disas
    Dump of assembler code for function phase_2:
    //进入到断点
    => 0x0000000000400efc <+0>:     push   %rbp
       0x0000000000400efd <+1>:     push   %rbx
       0x0000000000400efe <+2>:     sub    $0x28,%rsp
       0x0000000000400f02 <+6>:     mov    %rsp,%rsi
       0x0000000000400f05 <+9>:     callq  0x40145c <read_six_numbers>
       0x0000000000400f0a <+14>:    cmpl   $0x1,(%rsp)
       0x0000000000400f0e <+18>:    je     0x400f30 <phase_2+52>
       0x0000000000400f10 <+20>:    callq  0x40143a <explode_bomb>
       0x0000000000400f15 <+25>:    jmp    0x400f30 <phase_2+52>
       0x0000000000400f17 <+27>:    mov    -0x4(%rbx),%eax
       0x0000000000400f1a <+30>:    add    %eax,%eax
       0x0000000000400f1c <+32>:    cmp    %eax,(%rbx)
       0x0000000000400f1e <+34>:    je     0x400f25 <phase_2+41>
       0x0000000000400f20 <+36>:    callq  0x40143a <explode_bomb>
       0x0000000000400f25 <+41>:    add    $0x4,%rbx
       0x0000000000400f29 <+45>:    cmp    %rbp,%rbx
       0x0000000000400f2c <+48>:    jne    0x400f17 <phase_2+27>
       0x0000000000400f2e <+50>:    jmp    0x400f3c <phase_2+64>
       0x0000000000400f30 <+52>:    lea    0x4(%rsp),%rbx
       0x0000000000400f35 <+57>:    lea    0x18(%rsp),%rbp
       0x0000000000400f3a <+62>:    jmp    0x400f17 <phase_2+27>
       0x0000000000400f3c <+64>:    add    $0x28,%rsp
       0x0000000000400f40 <+68>:    pop    %rbx
       0x0000000000400f41 <+69>:    pop    %rbp
       0x0000000000400f42 <+70>:    retq
    End of assembler dump.
    (gdb) ni
    0x0000000000400efd in phase_2 ()
    (gdb) ni
    0x0000000000400efe in phase_2 ()
    (gdb) ni
    0x0000000000400f02 in phase_2 ()
    (gdb) disas
    Dump of assembler code for function phase_2:
       0x0000000000400efc <+0>:     push   %rbp
       0x0000000000400efd <+1>:     push   %rbx
       0x0000000000400efe <+2>:     sub    $0x28,%rsp
    => 0x0000000000400f02 <+6>:     mov    %rsp,%rsi
       0x0000000000400f05 <+9>:     callq  0x40145c <read_six_numbers>
       0x0000000000400f0a <+14>:    cmpl   $0x1,(%rsp)
       0x0000000000400f0e <+18>:    je     0x400f30 <phase_2+52>
       0x0000000000400f10 <+20>:    callq  0x40143a <explode_bomb>
       0x0000000000400f15 <+25>:    jmp    0x400f30 <phase_2+52>
       0x0000000000400f17 <+27>:    mov    -0x4(%rbx),%eax
       0x0000000000400f1a <+30>:    add    %eax,%eax
       0x0000000000400f1c <+32>:    cmp    %eax,(%rbx)
       0x0000000000400f1e <+34>:    je     0x400f25 <phase_2+41>
       0x0000000000400f20 <+36>:    callq  0x40143a <explode_bomb>
       0x0000000000400f25 <+41>:    add    $0x4,%rbx
       0x0000000000400f29 <+45>:    cmp    %rbp,%rbx
       0x0000000000400f2c <+48>:    jne    0x400f17 <phase_2+27>
       0x0000000000400f2e <+50>:    jmp    0x400f3c <phase_2+64>
       0x0000000000400f30 <+52>:    lea    0x4(%rsp),%rbx
       0x0000000000400f35 <+57>:    lea    0x18(%rsp),%rbp
       0x0000000000400f3a <+62>:    jmp    0x400f17 <phase_2+27>
       0x0000000000400f3c <+64>:    add    $0x28,%rsp
       0x0000000000400f40 <+68>:    pop    %rbx
       0x0000000000400f41 <+69>:    pop    %rbp
       0x0000000000400f42 <+70>:    retq
    End of assembler dump.
    (gdb) ni
    0x0000000000400f05 in phase_2 ()
    (gdb) disas
    //开始进入到read_six_numbers这个函数
    Dump of assembler code for function phase_2:
       0x0000000000400efc <+0>:     push   %rbp
       0x0000000000400efd <+1>:     push   %rbx
       0x0000000000400efe <+2>:     sub    $0x28,%rsp
       0x0000000000400f02 <+6>:     mov    %rsp,%rsi
    => 0x0000000000400f05 <+9>:     callq  0x40145c <read_six_numbers>
       0x0000000000400f0a <+14>:    cmpl   $0x1,(%rsp)
       0x0000000000400f0e <+18>:    je     0x400f30 <phase_2+52>
       0x0000000000400f10 <+20>:    callq  0x40143a <explode_bomb>
       0x0000000000400f15 <+25>:    jmp    0x400f30 <phase_2+52>
       0x0000000000400f17 <+27>:    mov    -0x4(%rbx),%eax
       0x0000000000400f1a <+30>:    add    %eax,%eax
       0x0000000000400f1c <+32>:    cmp    %eax,(%rbx)
       0x0000000000400f1e <+34>:    je     0x400f25 <phase_2+41>
       0x0000000000400f20 <+36>:    callq  0x40143a <explode_bomb>
       0x0000000000400f25 <+41>:    add    $0x4,%rbx
       0x0000000000400f29 <+45>:    cmp    %rbp,%rbx
       0x0000000000400f2c <+48>:    jne    0x400f17 <phase_2+27>
       0x0000000000400f2e <+50>:    jmp    0x400f3c <phase_2+64>
       0x0000000000400f30 <+52>:    lea    0x4(%rsp),%rbx
       0x0000000000400f35 <+57>:    lea    0x18(%rsp),%rbp
       0x0000000000400f3a <+62>:    jmp    0x400f17 <phase_2+27>
       0x0000000000400f3c <+64>:    add    $0x28,%rsp
       0x0000000000400f40 <+68>:    pop    %rbx
       0x0000000000400f41 <+69>:    pop    %rbp
       0x0000000000400f42 <+70>:    retq
    End of assembler dump.
    (gdb) si
    0x000000000040145c in read_six_numbers ()
    (gdb) disas
    Dump of assembler code for function read_six_numbers:
    => 0x000000000040145c <+0>:     sub    $0x18,%rsp
       0x0000000000401460 <+4>:     mov    %rsi,%rdx
       0x0000000000401463 <+7>:     lea    0x4(%rsi),%rcx
       0x0000000000401467 <+11>:    lea    0x14(%rsi),%rax
       0x000000000040146b <+15>:    mov    %rax,0x8(%rsp)
       0x0000000000401470 <+20>:    lea    0x10(%rsi),%rax
       0x0000000000401474 <+24>:    mov    %rax,(%rsp)
       0x0000000000401478 <+28>:    lea    0xc(%rsi),%r9
       0x000000000040147c <+32>:    lea    0x8(%rsi),%r8
       0x0000000000401480 <+36>:    mov    $0x4025c3,%esi
       0x0000000000401485 <+41>:    mov    $0x0,%eax
       0x000000000040148a <+46>:    callq  0x400bf0 <__isoc99_sscanf@plt>
       0x000000000040148f <+51>:    cmp    $0x5,%eax
       0x0000000000401492 <+54>:    jg     0x401499 <read_six_numbers+61>
       0x0000000000401494 <+56>:    callq  0x40143a <explode_bomb>
       0x0000000000401499 <+61>:    add    $0x18,%rsp
       0x000000000040149d <+65>:    retq
    End of assembler dump.
    (gdb) i r
    rax            0x6037d0 6305744
    rbx            0x7fffffffe398   140737488348056
    rcx            0x5      5
    rdx            0x2      2
    rsi            0x7fffffffe270   140737488347760
    rdi            0x6037d0 6305744
    rbp            0x0      0x0
    rsp            0x7fffffffe268   0x7fffffffe268
    r8             0x7ffff7ff6006   140737354096646
    r9             0x0      0
    r10            0x5      5
    r11            0x246    582
    r12            0x400c90 4197520
    r13            0x7fffffffe390   140737488348048
    r14            0x0      0
    r15            0x0      0
    rip            0x40145c 0x40145c <read_six_numbers>
    eflags         0x202    [ IF ]
    cs             0x33     51
    ss             0x2b     43
    ds             0x0      0
    es             0x0      0
    fs             0x0      0
    gs             0x0      0
    (gdb) disas
    Dump of assembler code for function read_six_numbers:
    => 0x000000000040145c <+0>:     sub    $0x18,%rsp
       0x0000000000401460 <+4>:     mov    %rsi,%rdx
       0x0000000000401463 <+7>:     lea    0x4(%rsi),%rcx
       0x0000000000401467 <+11>:    lea    0x14(%rsi),%rax
       0x000000000040146b <+15>:    mov    %rax,0x8(%rsp)
       0x0000000000401470 <+20>:    lea    0x10(%rsi),%rax
       0x0000000000401474 <+24>:    mov    %rax,(%rsp)
       0x0000000000401478 <+28>:    lea    0xc(%rsi),%r9
       0x000000000040147c <+32>:    lea    0x8(%rsi),%r8
       //调用sscanf之前%esi里面传了一个指针
       0x0000000000401480 <+36>:    mov    $0x4025c3,%esi
       0x0000000000401485 <+41>:    mov    $0x0,%eax
       0x000000000040148a <+46>:    callq  0x400bf0 <__isoc99_sscanf@plt>
       0x000000000040148f <+51>:    cmp    $0x5,%eax
       0x0000000000401492 <+54>:    jg     0x401499 <read_six_numbers+61>
       0x0000000000401494 <+56>:    callq  0x40143a <explode_bomb>
       0x0000000000401499 <+61>:    add    $0x18,%rsp
       0x000000000040149d <+65>:    retq
    End of assembler dump.
    (gdb) x /s 0x4025c3
    //可以看到指针里面的内容,非常像标准输入里面的格式,是六个数字,中间用空格隔开
    //但是我们传入的是字符串,所以这里应该会直接爆炸
    0x4025c3:       "%d %d %d %d %d %d"
    (gdb) until *0x000000000040148f
    0x000000000040148f in read_six_numbers ()
    (gdb) disas
    Dump of assembler code for function read_six_numbers:
       0x000000000040145c <+0>:     sub    $0x18,%rsp
       0x0000000000401460 <+4>:     mov    %rsi,%rdx
       0x0000000000401463 <+7>:     lea    0x4(%rsi),%rcx
       0x0000000000401467 <+11>:    lea    0x14(%rsi),%rax
       0x000000000040146b <+15>:    mov    %rax,0x8(%rsp)
       0x0000000000401470 <+20>:    lea    0x10(%rsi),%rax
       0x0000000000401474 <+24>:    mov    %rax,(%rsp)
       0x0000000000401478 <+28>:    lea    0xc(%rsi),%r9
       0x000000000040147c <+32>:    lea    0x8(%rsi),%r8
       0x0000000000401480 <+36>:    mov    $0x4025c3,%esi
       0x0000000000401485 <+41>:    mov    $0x0,%eax
       0x000000000040148a <+46>:    callq  0x400bf0 <__isoc99_sscanf@plt>
    => 0x000000000040148f <+51>:    cmp    $0x5,%eax
       0x0000000000401492 <+54>:    jg     0x401499 <read_six_numbers+61>
       0x0000000000401494 <+56>:    callq  0x40143a <explode_bomb>
       0x0000000000401499 <+61>:    add    $0x18,%rsp
       0x000000000040149d <+65>:    retq
    End of assembler dump.
    (gdb) p $eax
    $1 = 0
    (gdb) ni
    0x0000000000401492 in read_six_numbers ()
    (gdb) ni
    0x0000000000401494 in read_six_numbers ()
    (gdb) disas
    Dump of assembler code for function read_six_numbers:
       0x000000000040145c <+0>:     sub    $0x18,%rsp
       0x0000000000401460 <+4>:     mov    %rsi,%rdx
       0x0000000000401463 <+7>:     lea    0x4(%rsi),%rcx
       0x0000000000401467 <+11>:    lea    0x14(%rsi),%rax
       0x000000000040146b <+15>:    mov    %rax,0x8(%rsp)
       0x0000000000401470 <+20>:    lea    0x10(%rsi),%rax
       0x0000000000401474 <+24>:    mov    %rax,(%rsp)
       0x0000000000401478 <+28>:    lea    0xc(%rsi),%r9
       0x000000000040147c <+32>:    lea    0x8(%rsi),%r8
       0x0000000000401480 <+36>:    mov    $0x4025c3,%esi
       0x0000000000401485 <+41>:    mov    $0x0,%eax
       0x000000000040148a <+46>:    callq  0x400bf0 <__isoc99_sscanf@plt>
       0x000000000040148f <+51>:    cmp    $0x5,%eax
       0x0000000000401492 <+54>:    jg     0x401499 <read_six_numbers+61>
       //果然爆炸了
    => 0x0000000000401494 <+56>:    callq  0x40143a <explode_bomb>
       0x0000000000401499 <+61>:    add    $0x18,%rsp
       0x000000000040149d <+65>:    retq
    End of assembler dump.
    (gdb) ni
    
    BOOM!!!
    The bomb has blown up.
    [Inferior 1 (process 3292) exited with code 010]
    (gdb) r answers.txt
    Starting program: /home/going/workspace/csappLab/bomb/bomb answers.txt
    Welcome to my fiendish little bomb. You have 6 phases with
    which to blow yourself up. Have a nice day!
    Phase 1 defused. How about the next one?
    //这次传入6个数字试试
    1 2 3 4 5 6
    
    Breakpoint 1, 0x0000000000400efc in phase_2 ()
    (gdb) disas
    Dump of assembler code for function phase_2:
    => 0x0000000000400efc <+0>:     push   %rbp
       0x0000000000400efd <+1>:     push   %rbx
       0x0000000000400efe <+2>:     sub    $0x28,%rsp
       0x0000000000400f02 <+6>:     mov    %rsp,%rsi
       0x0000000000400f05 <+9>:     callq  0x40145c <read_six_numbers>
       0x0000000000400f0a <+14>:    cmpl   $0x1,(%rsp)
       0x0000000000400f0e <+18>:    je     0x400f30 <phase_2+52>
       0x0000000000400f10 <+20>:    callq  0x40143a <explode_bomb>
       0x0000000000400f15 <+25>:    jmp    0x400f30 <phase_2+52>
       0x0000000000400f17 <+27>:    mov    -0x4(%rbx),%eax
       0x0000000000400f1a <+30>:    add    %eax,%eax
       0x0000000000400f1c <+32>:    cmp    %eax,(%rbx)
       0x0000000000400f1e <+34>:    je     0x400f25 <phase_2+41>
       0x0000000000400f20 <+36>:    callq  0x40143a <explode_bomb>
       0x0000000000400f25 <+41>:    add    $0x4,%rbx
       0x0000000000400f29 <+45>:    cmp    %rbp,%rbx
       0x0000000000400f2c <+48>:    jne    0x400f17 <phase_2+27>
       0x0000000000400f2e <+50>:    jmp    0x400f3c <phase_2+64>
       0x0000000000400f30 <+52>:    lea    0x4(%rsp),%rbx
       0x0000000000400f35 <+57>:    lea    0x18(%rsp),%rbp
       0x0000000000400f3a <+62>:    jmp    0x400f17 <phase_2+27>
       0x0000000000400f3c <+64>:    add    $0x28,%rsp
       0x0000000000400f40 <+68>:    pop    %rbx
       0x0000000000400f41 <+69>:    pop    %rbp
       0x0000000000400f42 <+70>:    retq
    End of assembler dump.
    (gdb) ni
    0x0000000000400efd in phase_2 ()
    (gdb) ni
    0x0000000000400efe in phase_2 ()
    (gdb) ni
    0x0000000000400f02 in phase_2 ()
    (gdb) ni
    0x0000000000400f05 in phase_2 ()
    //在read_six_numbers之后停下
    (gdb) until *0x0000000000400f0a
    0x0000000000400f0a in phase_2 ()
    (gdb) disas
    Dump of assembler code for function phase_2:
       0x0000000000400efc <+0>:     push   %rbp
       0x0000000000400efd <+1>:     push   %rbx
       0x0000000000400efe <+2>:     sub    $0x28,%rsp
       0x0000000000400f02 <+6>:     mov    %rsp,%rsi
       0x0000000000400f05 <+9>:     callq  0x40145c <read_six_numbers>
       //没有爆炸,这里检查m[%rsp]的值是否等于1,否则就爆炸
       //所以我们第一个数字必须是1
    => 0x0000000000400f0a <+14>:    cmpl   $0x1,(%rsp)
       0x0000000000400f0e <+18>:    je     0x400f30 <phase_2+52>
       0x0000000000400f10 <+20>:    callq  0x40143a <explode_bomb>
       
       //下面开始循环
       0x0000000000400f15 <+25>:    jmp    0x400f30 <phase_2+52>
       0x0000000000400f17 <+27>:    mov    -0x4(%rbx),%eax
       //每次把rax * 2
       //和rbx比较,即下一个数字要比第一个数字大两倍
       0x0000000000400f1a <+30>:    add    %eax,%eax
       0x0000000000400f1c <+32>:    cmp    %eax,(%rbx)
       0x0000000000400f1e <+34>:    je     0x400f25 <phase_2+41>
       0x0000000000400f20 <+36>:    callq  0x40143a <explode_bomb>
       0x0000000000400f25 <+41>:    add    $0x4,%rbx
       0x0000000000400f29 <+45>:    cmp    %rbp,%rbx
       0x0000000000400f2c <+48>:    jne    0x400f17 <phase_2+27>
       0x0000000000400f2e <+50>:    jmp    0x400f3c <phase_2+64>
       0x0000000000400f30 <+52>:    lea    0x4(%rsp),%rbx
       0x0000000000400f35 <+57>:    lea    0x18(%rsp),%rbp
       0x0000000000400f3a <+62>:    jmp    0x400f17 <phase_2+27>
       
       0x0000000000400f3c <+64>:    add    $0x28,%rsp
       0x0000000000400f40 <+68>:    pop    %rbx
       0x0000000000400f41 <+69>:    pop    %rbp
       0x0000000000400f42 <+70>:    retq
    End of assembler dump.
    (gdb) i r
    rax            0x6      6
    rbx            0x7fffffffe398   140737488348056
    rcx            0x7fffffffe260   140737488347744
    rdx            0x0      0
    rsi            0x0      0
    rdi            0x7fffffffdc50   140737488346192
    rbp            0x0      0x0
    rsp            0x7fffffffe270   0x7fffffffe270
    r8             0x7ffff7dd5060   140737351864416
    r9             0x0      0
    r10            0x0      0
    r11            0x0      0
    r12            0x400c90 4197520
    r13            0x7fffffffe390   140737488348048
    r14            0x0      0
    r15            0x0      0
    rip            0x400f0a 0x400f0a <phase_2+14>
    eflags         0x202    [ IF ]
    cs             0x33     51
    ss             0x2b     43
    ds             0x0      0
    es             0x0      0
    fs             0x0      0
    gs             0x0      0
    ---------------------
    BOOM!!!
    The bomb has blown up.
    [Inferior 1 (process 3306) exited with code 010]
    (gdb) r answers.txt
    Starting program: /home/going/workspace/csappLab/bomb/bomb answers.txt
    Welcome to my fiendish little bomb. You have 6 phases with
    which to blow yourself up. Have a nice day!
    Phase 1 defused. How about the next one?
    //正确答案
    1 2 4 8 16 32
    
    Breakpoint 1, 0x0000000000400efc in phase_2 ()
    (gdb) until 0x0000000000400f3c
    Function "0x0000000000400f3c" not defined.
    (gdb) until *0x0000000000400f3c
    0x0000000000400f3c in phase_2 ()
    (gdb) disas
    Dump of assembler code for function phase_2:
       0x0000000000400efc <+0>:     push   %rbp
       0x0000000000400efd <+1>:     push   %rbx
       0x0000000000400efe <+2>:     sub    $0x28,%rsp
       0x0000000000400f02 <+6>:     mov    %rsp,%rsi
       0x0000000000400f05 <+9>:     callq  0x40145c <read_six_numbers>
       0x0000000000400f0a <+14>:    cmpl   $0x1,(%rsp)
       0x0000000000400f0e <+18>:    je     0x400f30 <phase_2+52>
       0x0000000000400f10 <+20>:    callq  0x40143a <explode_bomb>
       0x0000000000400f15 <+25>:    jmp    0x400f30 <phase_2+52>
       0x0000000000400f17 <+27>:    mov    -0x4(%rbx),%eax
       0x0000000000400f1a <+30>:    add    %eax,%eax
       0x0000000000400f1c <+32>:    cmp    %eax,(%rbx)
       0x0000000000400f1e <+34>:    je     0x400f25 <phase_2+41>
       0x0000000000400f20 <+36>:    callq  0x40143a <explode_bomb>
       0x0000000000400f25 <+41>:    add    $0x4,%rbx
       0x0000000000400f29 <+45>:    cmp    %rbp,%rbx
       0x0000000000400f2c <+48>:    jne    0x400f17 <phase_2+27>
       0x0000000000400f2e <+50>:    jmp    0x400f3c <phase_2+64>
       0x0000000000400f30 <+52>:    lea    0x4(%rsp),%rbx
       0x0000000000400f35 <+57>:    lea    0x18(%rsp),%rbp
       0x0000000000400f3a <+62>:    jmp    0x400f17 <phase_2+27>
    => 0x0000000000400f3c <+64>:    add    $0x28,%rsp
       0x0000000000400f40 <+68>:    pop    %rbx
       0x0000000000400f41 <+69>:    pop    %rbp
       0x0000000000400f42 <+70>:    retq
    End of assembler dump.
    (gdb) i r
    rax            0x20     32
    rbx            0x7fffffffe288   140737488347784
    rcx            0x7fffffffe260   140737488347744
    rdx            0x0      0
    rsi            0x0      0
    rdi            0x7fffffffdc50   140737488346192
    rbp            0x7fffffffe288   0x7fffffffe288
    rsp            0x7fffffffe270   0x7fffffffe270
    r8             0x7ffff7dd5060   140737351864416
    r9             0x0      0
    r10            0x0      0
    r11            0x0      0
    r12            0x400c90 4197520
    r13            0x7fffffffe390   140737488348048
    r14            0x0      0
    r15            0x0      0
    rip            0x400f3c 0x400f3c <phase_2+64>
    eflags         0x246    [ PF ZF IF ]
    cs             0x33     51
    ss             0x2b     43
    ds             0x0      0
    es             0x0      0
    fs             0x0      0
    gs             0x0      0
    (gdb) x /d rbx
    No symbol "rbx" in current context.
    (gdb) x /d $rbx
    0x7fffffffe288: 49
    (gdb) ni
    0x0000000000400f40 in phase_2 ()
    (gdb) ni
    0x0000000000400f41 in phase_2 ()
    (gdb) continue
    Continuing.
    That's number 2.  Keep going!
    

    相关文章

      网友评论

          本文标题:BombLab 上

          本文链接:https://www.haomeiwen.com/subject/bcunyrtx.html