debugging 使用GDB调用操作员new[]

kq0g1dla  于 2023-01-09  发布在  其他
关注(0)|答案(1)|浏览(174)

我怎么用广发卡打operator new[]
例如,我想分配0x40字节并打印地址:operator new[](0x44u));
我怎样才能用广发银行做到这一点?
当我尝试p (void*)operator new[](0x40)时,我得到了No symbol "operator" in current context.

ct3nt3jp

ct3nt3jp1#

这对我很有效:

(gdb) p 'operator new<TAB>
operator new(unsigned long)
operator new(unsigned long) [clone .cold]
...
operator new[](unsigned long)
operator new[](unsigned long)@got.plt
operator new[](unsigned long)@plt
operator new[](unsigned long, std::align_val_t)
... more choices

(gdb) p 'operator new[](unsigned long)'(0x40)
$1 = (void *) 0x416ee0

相关问题