使用 IDA Pro 和 IDAPython 获取 CPP 对象的值

Getting the Value of a CPP Object using IDA Pro and IDAPython

我使用 IDA Pro 在函数上设置了一个断点,returns 一个 cocos2d::Image 对象指针作为响应,如下面的屏幕截图所示。

但是,我完全不知道如何使用 IDAPython 打印出 Object 成员等。有办法吗?文档帮助不大,似乎只有检查类 C 结构的方法。

使用 print Dword(addr) 打印双字大小的成员,使用 print Byte(addr) 打印字节大小的成员。 Result 存储在 eax 中,因此您可以使用 eax 的相对偏移量以获取成员地址。打印屏幕截图中的所有成员:

eaxVal = GetRegValue("eax")
print Dword(eaxVal+45)
print "\n"
print Dword(eaxVal+51)
print "\n"
print Dword(eaxVal+52)
print "\n"
print Byte(eaxVal+184)
print "\n"
print Byte(eaxVal+188)
print "\n"