- UID
- 55012
注册时间2008-9-1
阅读权限90
最后登录1970-1-1
版主
  
TA的每日心情 | 奋斗 2015-10-29 08:08 |
---|
签到天数: 3 天 [LV.2]偶尔看看I
|
- int (*orig_sysctlbyname)(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
- int mysysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen){
-
- if (strcmp(name,"hw.machine") == 0) {
-
- if (oldp != NULL) {
- int ret = orig_sysctlbyname(name,oldp,oldlenp,newp,newlen);
- const char* mechine = "iPhone100";
- strncpy((char *)oldp,mechine,strlen(mechine));
- return ret;
- }else{
- int ret = orig_sysctlbyname(name,oldp,oldlenp,newp,newlen);
- return ret;
- }
- }else{
- return orig_sysctlbyname(name,oldp,oldlenp,newp,newlen);
- }
-
-
- }
- %ctor {
-
- MSHookFunction((void *)MSFindSymbol(NULL,"_sysctlbyname"), (void *)mysysctlbyname, (void **)&orig_sysctlbyname);
- }
复制代码
|
|