ios - gdb 调用 malloc 失败 (iOS)

标签 ios gdb call

我在 iOS 6.0.1 上使用 gdb(来自radare.org 的 1708 版)来调试未知应用程序。出于某种原因,我想分配内存,这应该通过“调用(char *)malloc(size)”来工作。我已经浏览了很多使用此类调用的示例(例如 here ),但是所有这些调用都失败了。

(gdb) call (char*)malloc(4)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000004
0x37af2060 in strcpy ()
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (malloc) will be abandoned.

或者
(gdb) 打印 ( float ) 晶圆厂 (3.0)
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x40080000
0x37b18040 in T_CString_int64ToString ()
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (T_CString_int64ToString) will be abandoned.

为什么 malloc 会以参数“size”访问内存? Anly 想法如何解决这个问题?还是 gdb 版本根本不适合 iOS 6.X?实际调用似乎有效,但内部函数导致失败(T_CString_int64ToString)。

最佳答案

GDB 似乎正在尝试访问未映射的内存区域,这是 malloc 调用返回的地址。尝试附加到已知的应用程序/进程并查看 malloc 调用是否有效。

您是否尝试过发布 1821?
可从 CrackLords Repository 获得, 添加到 cydia 以获取此版本
或者您也可以按照这些说明自行签名 A working GNU Debugger on iOS >= 4.3

关于ios - gdb 调用 malloc 失败 (iOS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14074288/

相关文章:

javascript - 动态调用 jQuery 函数

ios - 使用 Trigger.io 检测 iOS 状态栏上的点击

ios - Azure 离线数据同步性能

ios - PageViewController 和 Orientation 改变

c++ - NetBeans 在外部终端运行

java - 如何让paintComponent方法出现在屏幕上

javascript - 在其他页面调用函数

android - 单击文本框时防止 iPhone 放大?

gdb - 如何让 gdb 在反汇编模型上显示原始的非重整函数名称?

debugging - 是否可以根据函数即将返回的内容在函数末尾设置条件断点?