【问题标题】:How to take a dump size more than 1024 using LLDB from iOS memory如何使用 LLDB 从 iOS 内存中获取大于 1024 的转储大小
【发布时间】:2015-02-26 06:45:58
【问题描述】:

我正在尝试从我的 iPhone 5s 内存(x64 位)中获取解密的二进制文件,我看到了一些关于 GDB 的教程,但不幸的是我无法使用它,因为我在 arm7 设备上,我尝试过 this solution 但我得到了这个错误:

(lldb) memory read --outfile /tmp/mem.bin --binary 0x1000 0x2000
error: Normally, 'memory read' will not read over 1024 bytes of data.
error: Please use --force to override this restriction just once.
error: or set target.max-memory-read-size if you will often need a larger limit.

当尝试使用 --force 命令时,我收到此错误:

(lldb) memory read --outfile /tmp/mem.bin --binary 0x1000 0x2000 --force
error: memory read failed for 0x1000

然后我尝试更改最大读取大小,但又遇到另一个错误:

(lldb) set set max-memory-read-size 1000000
error: invalid value path 'max-memory-read-size'
(lldb) set append max-memory-read-size 1000000
error: invalid value path 'max-memory-read-size'

还有其他方法可以做到吗,或者我做错了什么?

【问题讨论】:

    标签: ios iphone gdb lldb


    【解决方案1】:

    memory read 需要在地址范围之前有--force 选项。例如

    (lldb) me r -o /tmp/outfile.bin -b --force $pc $pc+0x2000
    8192 bytes written to '/tmp/outfile.bin'
    (lldb)
    

    max-memory-read-size 设置位于 target 部分下,因此您需要对其进行限定:

    (lldb) set set target.max-memory-read-size 0x2000
    (lldb) me r -o /tmp/outfile.bin -b $pc $pc+0x2000
    8192 bytes written to '/private/tmp/outfile.bin'
    (lldb)
    

    【讨论】:

    • 您好 Jason,谢谢您,我能够更改读取大小,但我遇到了相同的第二个错误,即 error: memory read failed for 0x2000,另一个关于 ASLR 的问题是否与 gdb = 0x2000 相同?
    • 在 Mac OS X 上,lldb 禁用 ASLR,因此程序每次都将加载到相同的地址(并且库,如果它们以相同的顺序加载,也将位于相同的地址)。如果您知道在给定的指令地址上发生了“有趣”的事情,这可以使调试更容易一些。如果你在 Mac/iOS 上调试 32 位程序,前 4096 个字节是不可读的;如果是 64 位,则前 4GB 是不可读的。听起来您尝试在 0x1000-0x2000 读取的内存未映射到进程中的任何可读页面。
    • 我正在调试 iphone 5s 这是 64 位设备,ATM 我正在​​测试一个游戏进程我需要获得未加密的应用程序可执行文件,以便我可以在 IDA 中将其反转,我怎么知道如果应用是 32 或 64,如果是 64 位应用,我应该从哪个地址开始?
    猜你喜欢
    • 1970-01-01
    • 2017-12-15
    • 2010-11-08
    • 2020-02-18
    • 1970-01-01
    • 2011-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多