这样的函数如何hook?

HOOK之后始终闪退,哪里有错了呢?

%hookf(DIR * , opendir, const char *path)
{
return %orig;
}

fishhook试试。估计是函数太短或者奇形怪状的。标准库里很多都是syscall的封装所以确实有可能太短