美文网首页iOS逆向开发
<安全攻防之LLDB调试>

<安全攻防之LLDB调试>

作者: 高阿呆 | 来源:发表于2019-11-25 11:18 被阅读0次

断点

  • 设置断点
$breakpoint set -n xxx 
set 是子命令
-n 是选项 是--name的缩写
或者
$b xxx

* 查看断点列表
$breakpoint list 

* 删除
$breakpoint delete 组号

* 禁用/启用
$breakpoint disable 禁用
$breakpoint enable  启用

* 遍历整个项目中满足Hello:这个字符的所有方法
$breakpoint set --selector Hello:
$breakpoint set -r Hello:
$breakpoint set --file xxx文件xxx --selector xxx方法名xxx

E:在某一个文件(ViewController.m)中满足Hello:的所有方法
$breakpoint set --file ViewController.m --selector Hello:
$breakpoint  
// 查看断点命令下所有的命令
     Commands for operating on breakpoints (see 'help b' for shorthand.)

Syntax: breakpoint <subcommand> [<command-options>]

The following subcommands are supported:
      // 清除或者废除匹配的特定的资源文件和哪一行的断点
      clear   -- Delete or disable breakpoints matching the specified source
                 file and line. 
      // 当断点触发时,添加.移除或者监听LLDB控制执行 
      command -- Commands for adding, removing and listing LLDB commands
                 executed when a breakpoint is hit. 
      //  删除特定的断点,如果没匹配到,删除所有断点
      delete  -- Delete the specified breakpoint(s).  If no breakpoints are
                 specified, delete them all. 
      // 使断点失效
      disable -- Disable the specified breakpoint(s) without deleting them.  If
                 none are specified, disable all breakpoints. 
      // 使断点有效
      enable  -- Enable the specified disabled breakpoint(s). If no breakpoints
                 are specified, enable all of them. 
      // 查看所有的断点
      list    -- List some or all breakpoints at configurable levels of detail. 
      // 修改
      modify  -- Modify the options on a breakpoint or set of breakpoints in
                 the executable.  If no breakpoint is specified, acts on the
                 last created breakpoint.  With the exception of -e, -d and -i,
                 passing an empty argument clears the modification. 
      name    -- Commands to manage name tags for breakpoints 
      read    -- Read and set the breakpoints previously saved to a file with
                 "breakpoint write".  
      // 设置
      set     -- Sets a breakpoint or set of breakpoints in the executable. 
      write   -- Write the breakpoints listed to a file that can be read in
                 with "breakpoint read".  If given no arguments, writes all
                 breakpoints.

流程控制

* 继续执行
$continue c 
* 单步运行,将子函数当做整体一步执行
$n next
* 单步运行,遇到子函数会进去
$s 

执行代码

  • help xxx 查看帮助文档 (E: help p)
// 这三个命令是相同的
(lldb) expression self.view.subviews
(__NSArray0 *) $6 = 0x00000001cde73400 @"0 elements"
(lldb) p self.view.subviews
(__NSArray0 *) $7 = 0x00000001cde73400 @"0 elements"
(lldb) e self.view.subviews
(__NSArray0 *) $8 = 0x00000001cde73400 @"0 elements"
(lldb) 

p 插入自己写的代码
p self.view.backgroundColor = [UIColor yellowColor]

查看堆栈信息

$bt
$frame select xx 查看某个Frame的信息
$frame variable 查看某个frame的参数信息

内存断点

// 对某个对象的某个属性设置内存断点(E:对p的name属性设置内存断点)
$watchpoint set variable p->_name
// 通过内存地址设置断点
$watchpoint set expression xxx地址

其他指令

// 崩溃信息中通过地址信息查找崩溃原因
$image lookup -a xxx
$image lookup -t xxx对象 查看对象的成员变量
$image list 查看所有的库列表

常用指令

$x (memory read xxx地址) 查看内存
$register read xxx (寄存器查看)

相关文章

  • <安全攻防之LLDB调试>

    断点 设置断点 流程控制 执行代码 help xxx 查看帮助文档 (E: help p) 查看堆栈信息 内存断点...

  • iOS逆向攻防之LLDB调试

    接下来上今天的干货LLDB调试部分。日常的正向开发,Xcode提供了多种快捷键以及快捷方式方便我们开发者进行LLD...

  • iOS之LLDB常用调试命令

    iOS之LLDB常用调试命令熟练使用 LLDB,让你调试事半功倍使用facebook开源的Chisel调试Home...

  • xcode调试技巧

    Xcode调试技巧之:LLDB Xcode调试技巧之:LLDB 1.输出视图层级关系(这是一个被隐藏的命令):po...

  • [译]用 LLDB 调试 Swift 代码

    [译]用 LLDB 调试 Swift 代码 [译]用 LLDB 调试 Swift 代码

  • iOS逆向之HOOK原理介绍

    上一篇文章地址: iOS逆向之动态调试 (LLDB)介绍 上篇文章讲了如何使用LLDB进行动态调试. 如果你对文...

  • android jni开放中的一些知识点

    lldb调试查看内存 lldb调试更多使用方式问百度

  • iOS调试之LLDB

    iOS调试之LLDB Xcode内嵌了LLDB控制台,在Xcode代码编辑区的下方。shift + cmd + y...

  • iOS LLDB调试

    掌握以下lldb命令,够用. ### LLDB调试总结 eNSString*$str=@"test"...

  • iOS开发之LLDB常用调试技巧

    原文地址iOS开发之LLDB常用调试技巧用好了LLDB,让调试变得轻松愉快,本文会写出并示例讲解一些常用的指令,以...

网友评论

    本文标题:<安全攻防之LLDB调试>

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