首页 > 代码库 > Theos tweak MSHookFunction

Theos tweak MSHookFunction

#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);}

OR

#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);}

Theos tweak MSHookFunction