一个简单的例子,它使用三个 lldb 命令image dump sections, memory find,memory read在一个剥离的发布应用程序中查找一个字符串。
(lldb) image dump sections MyAppBinary
[0x0000010462c000-0x00000107744000] 0x0003118000 MyApp`__TEXT
[0x00000107744000-0x00000107d48000] 0x0000604000 MyApp`__DATA
/* removed sections for brevity */
(lldb) mem find -s "youtube" -- 0x00000107744000 0x00000107d48000
data found at location: 0x10793362c
0x10793362c: 79 6f 75 74 75 62 65 2e 63 6f 6d 2f 65 6d 62 65 youtube.com/embe
(lldb) memory read -c100 0x10793362c
0x10793362c: 79 6f 75 74 75 62 65 2e 63 6f 6d 2f 65 6d 62 65 youtube.com/embe
0x10793363c: 64 2f 58 46 67 45 59 75 35 71 66 36 38 3f 61 75 d/XFgccu5qf68?a
Run Code Online (Sandbox Code Playgroud)
如果您需要一些有用的别名和脚本,lldb可以访问https://github.com/DerekSelander/LLDB。例如,我更喜欢 Derek 的脚本sections而不是image dump sections MyAppBinary.
| 归档时间: |
|
| 查看次数: |
2911 次 |
| 最近记录: |