使用HookZz遇到的一个问题

代码如下,能正确hook _swift_buildDemanglingForMetadata这个函数(不是inline),但是交换回来的origin就是不对,实际执行会crash,想请教大神有没有什么排查思路?

//    void* image = [self findDyldImageWithName: @"libswiftCore"];
//    _log_dyld_all_symbol("libswiftCore");

void* (*_swift_buildDemanglingForMetadata)(const void*, void*&);
//= reinterpret_cast<void*(*)(const void*, void*&)>(0x7fff50b3b140);

void* (fake)(const void* type, void* &Dem) {
    // Do What you Want.
    printf("hook!");
    return _swift_buildDemanglingForMetadata(type, Dem);
}

#define LIBDOBBY_PATH "./libhookzz.dylib"
typedef void* (*DoobyHook)(void *, void *, void **);

@implementation Hook

+ (void)load {
    void* handle = dlopen(LIBDOBBY_PATH, RTLD_LAZY);
    if (!handle) {
        printf("Failed");
        return;
    }
    DoobyHook dobbyHook = NULL;
    *(void **) (&dobbyHook) = dlsym(handle, "ZzReplace");
    void* functionAddress = (void*)0x7fff50b3b140; // 0x00000000002D0140

    (*dobbyHook)(functionAddress, (void*)fake, (void**)&_swift_buildDemanglingForMetadata);
    dlclose(handle);
}
@end

就这个函数吗?

https://github.com/apple/swift/blob/60b4f38660df6104bd947b8cc2c9daafe6ee7b73/stdlib/public/runtime/Private.h#L256

是不是少了个this