Monkey逆向报错 error: memory read failed for 0x0

背景:使用monkey逆向某个App,运行时报“error: memory read failed for 0x0”错误,且看不到任何堆栈信息,用了大神 [SuperChaosM]的代码,还是会报同样的错,应该不是hook exit的问题。

请问大神,还有什么办法么?

static void (*orig_exit)( int );

void fake_exit( int status) {

NSLog(@“fake exit”);

NSLog(@"%@",[NSThread callStackSymbols]); // 这句可以得到和 crash log 一样的调用栈展示

}

static void (*orig_longjmp)( int );

void fake_longjmp( int status) {

NSLog(@“fake orig_longjmp”);

NSLog(@"%@",[NSThread callStackSymbols]); // 这句可以得到和 crash log 一样的调用栈展示

}

static void (*orig_atexit)( int );

void fake_atexit( int status) {

NSLog(@“fake atexit”);

NSLog(@"%@",[NSThread callStackSymbols]); // 这句可以得到和 crash log 一样的调用栈展示

}

//+ (void)load {

// rebind_symbols((struct rebinding[1]){{“exit”, fake_exit, (void)&orig_exit}},1);*

// //

// rebind_symbols((struct rebinding[1]){{“atexit”, fake_atexit, (void)&orig_atexit}},1);*

// //

// rebind_symbols((struct rebinding[1]){{“longjmp”, fake_longjmp, (void)&orig_longjmp}},1);*

//}

attribute ((constructor)) void load_file(){

rebind_symbols(( struct rebinding[1]){{“exit”, fake_exit, ( void *)&orig_exit}},1);

//

rebind_symbols(( struct rebinding[1]){{“atexit”, fake_atexit, ( void *)&orig_atexit}},1);

//

rebind_symbols(( struct rebinding[1]){{“longjmp”, fake_longjmp, ( void *)&orig_longjmp}},1);

}

遇到了同样的问题。不知道为什么。。