mirror of
https://github.com/NohamR/Tweaks.git
synced 2026-05-24 19:59:59 +00:00
Lint :)
This commit is contained in:
@@ -7,9 +7,10 @@
|
|||||||
#define IDA_BASE 0x100000000
|
#define IDA_BASE 0x100000000
|
||||||
#define ADDR_IS_PREMIUM 0x10009CD24 // Address of "isPremiumActive" in IDA (adjust if needed)
|
#define ADDR_IS_PREMIUM 0x10009CD24 // Address of "isPremiumActive" in IDA (adjust if needed)
|
||||||
|
|
||||||
static int (*orig_isPremiumActive)();
|
static int (*orig_isPremiumActive)(void);
|
||||||
static int hook_isPremiumActive() {
|
|
||||||
return 1;
|
static int hook_isPremiumActive(void) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
%ctor {
|
%ctor {
|
||||||
@@ -17,9 +18,9 @@ static int hook_isPremiumActive() {
|
|||||||
const char *name = _dyld_get_image_name(i);
|
const char *name = _dyld_get_image_name(i);
|
||||||
if (name && strstr(name, TARGET_MODULE)) {
|
if (name && strstr(name, TARGET_MODULE)) {
|
||||||
uintptr_t base = (uintptr_t)_dyld_get_image_header(i);
|
uintptr_t base = (uintptr_t)_dyld_get_image_header(i);
|
||||||
uintptr_t addr = base + (ADDR_IS_PREMIUM - IDA_BASE);
|
uintptr_t addr = base + (ADDR_IS_PREMIUM - IDA_BASE);
|
||||||
MSHookFunction((void *)addr, (void *)hook_isPremiumActive, (void **)&orig_isPremiumActive);
|
MSHookFunction((void *)addr, (void *)hook_isPremiumActive, (void **)&orig_isPremiumActive);
|
||||||
NSLog(@"[ServerCatPremium] Hooked isPremiumActive at 0x%lx", addr);
|
NSLog(@"[ServerCatPremium] Hooked isPremiumActive at 0x%lx", addr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,13 +28,13 @@ static int hook_isPremiumActive() {
|
|||||||
|
|
||||||
// iOS 16 Crash Fix
|
// iOS 16 Crash Fix
|
||||||
%hook CKContainer
|
%hook CKContainer
|
||||||
|
|
||||||
+ (id)defaultContainer {
|
+ (id)defaultContainer {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id)containerWithIdentifier:(id)arg1 {
|
+ (id)containerWithIdentifier:(id)__unused arg1 {
|
||||||
arg1 = nil;
|
|
||||||
return nil;
|
return nil;
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%end
|
%end
|
||||||
@@ -7,9 +7,10 @@
|
|||||||
#define IDA_BASE 0x100000000
|
#define IDA_BASE 0x100000000
|
||||||
#define ADDR_IS_PREMIUM 0x100454D70 // Address of "isPremiumActive" in IDA (adjust if needed)
|
#define ADDR_IS_PREMIUM 0x100454D70 // Address of "isPremiumActive" in IDA (adjust if needed)
|
||||||
|
|
||||||
static int (*orig_isPremiumActive)();
|
static int (*orig_isPremiumActive)(void);
|
||||||
static int hook_isPremiumActive() {
|
|
||||||
return 1;
|
static int hook_isPremiumActive(void) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
%ctor {
|
%ctor {
|
||||||
@@ -17,9 +18,9 @@ static int hook_isPremiumActive() {
|
|||||||
const char *name = _dyld_get_image_name(i);
|
const char *name = _dyld_get_image_name(i);
|
||||||
if (name && strstr(name, TARGET_MODULE)) {
|
if (name && strstr(name, TARGET_MODULE)) {
|
||||||
uintptr_t base = (uintptr_t)_dyld_get_image_header(i);
|
uintptr_t base = (uintptr_t)_dyld_get_image_header(i);
|
||||||
uintptr_t addr = base + (ADDR_IS_PREMIUM - IDA_BASE);
|
uintptr_t addr = base + (ADDR_IS_PREMIUM - IDA_BASE);
|
||||||
MSHookFunction((void *)addr, (void *)hook_isPremiumActive, (void **)&orig_isPremiumActive);
|
MSHookFunction((void *)addr, (void *)hook_isPremiumActive, (void **)&orig_isPremiumActive);
|
||||||
NSLog(@"[ServerCatPremium] Hooked isPremiumActive at 0x%lx", addr);
|
NSLog(@"[ServerCatPremium] Hooked isPremiumActive at 0x%lx", addr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user