iOS逆向,微信步数修改
hook住WCDeviceStepObject和SportDeviceInfo的两个方法就可以了
代码如下
@interface WCDeviceStepObject : NSObject
-(unsigned int)hkStepCount;
-(unsigned int)m7StepCount;
@end
@class WCDeviceStepObject;
CHDeclareClass(WCDeviceStepObject);
CHOptimizedMethod(0, self, unsigned long, WCDeviceStepObject, m7StepCount) {
return 66666;
}
CHOptimizedMethod(0, self, unsigned long, WCDeviceStepObject, hkStepCount) {
return 66666;
}
@interface SportDeviceInfo : NSObject
-(unsigned int)stepCount;
@end
CHDeclareClass(SportDeviceInfo);
CHOptimizedMethod(0, self, unsigned long, SportDeviceInfo, stepCount) {
return 66666;
}
@interface UploadDeviceStepReq : NSObject
-(unsigned int)stepCount;
@end
CHDeclareClass(UploadDeviceStepReq);
CHOptimizedMethod(0, self, unsigned long, UploadDeviceStepReq, stepCount) {
return 66666;
}
CHConstructor{
CHLoadLateClass(WCDeviceStepObject);
CHHook(0, WCDeviceStepObject, m7StepCount);
CHHook(0, WCDeviceStepObject, hkStepCount);
CHLoadLateClass(SportDeviceInfo);
CHHook(0, SportDeviceInfo, stepCount);
CHLoadLateClass(UploadDeviceStepReq);
CHHook(0, UploadDeviceStepReq, stepCount);
}
修改之后进入微信运动,步数成功显示66666