zoukankan      html  css  js  c++  java
  • gdb cheat sheet

    0x00 misc

    命令行参数:

    gdb --args executablename arg1 arg2 arg3

    0x01 控制流

    r        run,运行程序。

    r < a.txt      run,重定向输入

    si         step instruction 进入函数

    ni           next instruction 下一条指令

    finish       执行到函数结束

    0x02 断点

    b        block,下断点

    b *0x0000xx     在指定位置下断点

    b main         在函数入口下断点

    watch *0x00xx    当修改指定内存时中断

    rwatch *0x00xx     当读取指定内存时中断

    info b           查看当前断点

    en 1 2 3       允许中断

    dis 1 2 3         不允许中断

    0x03 内存

    x

    x [Address expression]
    x /[Format] [Address expression]
    x /[Length][Format] [Address expression]

    Address expression
    Specifies the memory address which contents will be displayed. This can be the address itself or any C/C++ expression evaluating to address. The expression can include registers (e.g. $eip) and pseudoregisters (e.g. $pc). If the address expression is not specified, the command will continue displaying memory contents from the address where the previous instance of this command has finished.
    Format
    If specified, allows overriding the output format used by the command. Valid format specifiers are:
    • o - octal
    • x - hexadecimal
    • d - decimal
    • u - unsigned decimal
    • t - binary
    • f - floating point
    • a - address
    • c - char
    • s - string
    • i - instruction

    The following size modifiers are supported:

    • b - byte
    • h - halfword (16-bit value)
    • w - word (32-bit value)
    • g - giant word (64-bit value)

    x /16xb 0x123123

    x /s  0x123123123

    0x04 LOAD信息

    查看加载的段信息

    info files

  • 相关阅读:
    博客园.netCore+阿里云服务器升级中会报的一个错误
    框架资料整理
    免费在线作图,实时协作-工具
    ubuntu14.04 配置网络
    vagrant的学习 之 基础学习
    mysql 定时任务
    linux 命令练习 2018-08-27
    一点一滴(一)
    Thinkphp5.0 的实践一
    Thinkphp5.0 的使用模型Model的获取器与修改器
  • 原文地址:https://www.cnblogs.com/helica/p/10791638.html
Copyright © 2011-2022 走看看