gpt4 book ai didi

tweak - Theos 调整 MSHookFunction

转载 作者:行者123 更新时间:2023-12-01 16:51:12 45 4
gpt4 key购买 nike

我关注了http://brandontreb.com/beginning-jailbroken-ios-development-building-and-deployment进行调整。但在我成功完成 helloworld 调整后。
我使用 MSHookFunction Hook fopen
然后我遇到链接错误

Making all for tweak hw...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
Linking tweak hw...
Undefined symbols for architecture armv7:
"_MSHookFunction", referenced from:
global constructors keyed to Tweak.xm.mmin Tweak.xm.51941273.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
make[2]: *** [.theos/obj/hw.dylib.ba964c90.unsigned] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [hw.all.tweak.variables] Error 2

这是 Tweak.xm

#import "substrate.h"

static FILE * (*s_orig_fopen) ( const char * filename, const char * mode );
static FILE * my_fopen ( const char * filename, const char * mode ){
return s_orig_fopen(filename, mode);
}

static void entry(void) __attribute__ ((constructor));
static void entry(void) {
MSHookFunction(fopen, my_fopen, &s_orig_fopen);
}

有谁知道怎么解决吗?

最佳答案

你可以试试这个:

#import "substrate.h"

static FILE * (*s_orig_fopen) ( const char * filename, const char * mode );
static FILE * my_fopen ( const char * filename, const char * mode ){
return s_orig_fopen(filename, mode);
}

%ctor {
MSHookFunction(fopen, my_fopen, &s_orig_fopen);
}

关于tweak - Theos 调整 MSHookFunction,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18169341/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com