0

类转储会被 CFObjects/structs 弄糊涂吗?我在应用程序上使用了类转储,方法的一个参数是一个结构 arg1,它是一个 BInstantMessage:

struct BInstantMessage {
    void **_field1;
    struct CFString _field2;
    unsigned short *_field3;
    struct DTextStyle _field4;
    struct BUser *_field5;
    struct BChat *_field6;
};

struct CFString {
    void **_vptr$CFObject;
    struct __CFString *mCFRef;
    _Bool mIsMutable;
};

struct __CFString;

那么,如何从这个 arg1 中获取 CFStringRef 或 NSString* 呢?我猜类转储正在用 CFString 定义替换一些 CFStringRef,但这只是一个猜测......我想要的只是从 arg1 获得一个 CFStringRef,它是一个 BInstantMessage。

谢谢!

4

1 回答 1

0

该应用程序正在为 Core Foundation 对象使用 C++ 包装器。struct CFStringinBInstantMessage是这种类型的对象。你想要(NSString *)(arg1._field2.mCFRef)

void **_vptr$CFObject字段是这里的主要提示——它代表了虚拟超类的 vtable——CFObject结合了常见的 C++m前缀命名约定。

于 2011-03-26T21:07:46.070 回答