|
// |
|
// AlDente_LicenseHook.m |
|
// AlDente License Verification Hook |
|
// |
|
// Created by piracybound. |
|
// Β© 2025 piracybound. Licensed under the DWTFYW License. |
|
// |
|
// This file is distributed in the hope that it will be useful, |
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
// |
|
// In short: Do What The F*** You Want. |
|
// |
|
|
|
#import <Foundation/Foundation.h> |
|
#import <objc/runtime.h> |
|
#import <dispatch/dispatch.h> |
|
|
|
BOOL hooked_activated(id self, SEL _cmd) { |
|
NSLog(@"[piracybound: AlDente LicenseHook] β
[CALLED] -(BOOL)activated. Returning YES."); |
|
return YES; |
|
} |
|
|
|
NSString* hooked_licenseCode(id self, SEL _cmd) { |
|
NSLog(@"[piracybound: AlDente LicenseHook] β
[CALLED] -(NSString *)licenseCode. Returning fake key."); |
|
return @"piracybound-type-shit"; |
|
} |
|
|
|
NSDate* hooked_licenseExpiryDate(id self, SEL _d) { |
|
NSLog(@"[piracybound: AlDente LicenseHook] β
[CALLED] -(NSDate *)licenseExpiryDate. Returning future date."); |
|
return [NSDate distantFuture]; |
|
} |
|
|
|
void hooked_verifyActivationWithCompletion(id self, SEL _cmd, void (^completion)(BOOL)) { |
|
NSLog(@"[piracybound: AlDente LicenseHook] β
[CALLED] -(void)verifyActivationWithCompletion:. Forcing success."); |
|
if (completion) { |
|
dispatch_async(dispatch_get_main_queue(), ^{ |
|
completion(YES); |
|
}); |
|
} |
|
} |
|
|
|
void hooked_verifyActivationDetailsWithCompletion(id self, SEL _cmd, void (^completion)(NSDictionary *, NSError *)) { |
|
NSLog(@"[piracybound: AlDente LicenseHook] β
[CALLED] -(void)verifyActivationDetailsWithCompletion:. Forcing success with fake details."); |
|
if (completion) { |
|
NSDictionary *fakeDetails = @{ |
|
@"activated": @(YES), |
|
@"activation_id": @"piracybound-type-shit", |
|
@"email": @"[email protected]", |
|
@"license_code": @"piracybound-type-shit", |
|
@"plan": @"AlDente Pro", |
|
@"expires": @(NO) |
|
}; |
|
dispatch_async(dispatch_get_main_queue(), ^{ |
|
completion(fakeDetails, nil); |
|
}); |
|
} |
|
} |
|
|
|
@implementation NSObject (AlDenteHook) |
|
|
|
+ (void)load { |
|
if ([[[NSProcessInfo processInfo] processName] isEqualToString:@"AlDente"]) { |
|
|
|
NSLog(@"[piracybound: AlDente LicenseHook] +load method invoked in AlDente process. Installing hooks..."); |
|
|
|
Class padProductClass = NSClassFromString(@"PADProduct"); |
|
if (!padProductClass) { |
|
NSLog(@"[piracybound: AlDente LicenseHook] β ERROR: Could not find PADProduct class in +load. Aborting hook installation."); |
|
return; |
|
} |
|
|
|
struct { SEL selector; IMP replacement; } hooks[] = { |
|
{ @selector(activated), (IMP)hooked_activated }, |
|
{ @selector(licenseCode), (IMP)hooked_licenseCode }, |
|
{ @selector(licenseExpiryDate), (IMP)hooked_licenseExpiryDate }, |
|
{ @selector(verifyActivationWithCompletion:), (IMP)hooked_verifyActivationWithCompletion }, |
|
{ @selector(verifyActivationDetailsWithCompletion:), (IMP)hooked_verifyActivationDetailsWithCompletion } |
|
}; |
|
|
|
for (int i = 0; i < sizeof(hooks)/sizeof(hooks[0]); i++) { |
|
Method method = class_getInstanceMethod(padProductClass, hooks[i].selector); |
|
if (method) { |
|
method_setImplementation(method, hooks[i].replacement); |
|
NSLog(@"[piracybound: AlDente LicenseHook] π Successfully hooked: %@", NSStringFromSelector(hooks[i].selector)); |
|
} else { |
|
NSLog(@"[piracybound: AlDente LicenseHook] β οΈ WARNING: Could not find method to hook: %@", NSStringFromSelector(hooks[i].selector)); |
|
} |
|
} |
|
NSLog(@"[piracybound: AlDente LicenseHook] Hook installation from +load is complete. Monitoring for calls..."); |
|
} |
|
} |
|
|
|
@end |