Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <objc/runtime.h>
- #import <Foundation/Foundation.h>
- @interface Encryption
- - (id) myEncrypt: (NSString *) _secret;
- @end
- @implementation Encryption
- +(void)load
- {
- printf("Inside load function\n");
- if (self == [Encryption class]) {
- printf("inside if\n");
- // self = [Encryption class];
- Method origMethod = class_getInstanceMethod(self,@selector(Encrypt:));
- Method newMethod = class_getInstanceMethod(self,@selector(myEncrypt:));
- method_exchangeImplementations(origMethod,newMethod);
- }
- else
- printf("swizzling failed\n");
- }
- - (id) myEncrypt: (NSString *) _secret {
- printf("inside the new encryption\n");
- // printf("Your Secrect was %s\n", [ _secret UTF8String ]);
- //*_secret = @"HELLO I AM MODIFIED";
- // printf("The next text sent is %s",[ _secret UTF8String ]);
- return [self myEncrypt:_secret];
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement