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