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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2021-11-06
  • 2021-08-20
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-11
  • 2021-09-04
  • 2021-08-06
  • 2021-06-13
相关资源
相似解决方案