├── .gitignore ├── LICENSE ├── Other ├── Products │ └── Debug │ │ └── libThunderPlugin.framework │ │ ├── Headers │ │ └── libThunderPlugin.h │ │ ├── Modules │ │ └── module.modulemap │ │ ├── Resources │ │ └── Info.plist │ │ ├── Versions │ │ ├── A │ │ │ ├── Headers │ │ │ │ └── libThunderPlugin.h │ │ │ ├── Modules │ │ │ │ └── module.modulemap │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── libThunderPlugin │ │ └── Current │ │ │ ├── Headers │ │ │ └── libThunderPlugin.h │ │ │ ├── Modules │ │ │ └── module.modulemap │ │ │ ├── Resources │ │ │ └── Info.plist │ │ │ └── libThunderPlugin │ │ └── libThunderPlugin └── insert_dylib ├── README.md ├── Sources ├── CTSwizzledHelper.h ├── CTSwizzledHelper.m ├── Thunder+Hook.h └── Thunder+Hook.m ├── libThunderPlugin.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── lemon.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcshareddata │ └── xcschemes │ │ └── libThunderPlugin.xcscheme └── xcuserdata │ └── lemon.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist └── libThunderPlugin ├── libThunderPlugin.h └── libThunderPlugin.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Loveletter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Headers/libThunderPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // libThunderPlugin.h 3 | // libThunderPlugin 4 | // 5 | // Created by LEMON on 2022/7/20. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for libThunderPlugin. 11 | FOUNDATION_EXPORT double libThunderPluginVersionNumber; 12 | 13 | //! Project version string for libThunderPlugin. 14 | FOUNDATION_EXPORT const unsigned char libThunderPluginVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | @interface XLUserInformation : NSObject 19 | - (void)updateUserInfo:(id)arg1; 20 | - (id)initWithUserInfo:(id)arg1; 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module libThunderPlugin { 2 | umbrella header "libThunderPlugin.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 21F79 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | libThunderPlugin 11 | CFBundleIdentifier 12 | com.lemonlie.libThunderPlugin 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | libThunderPlugin 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 13F100 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 12.3 35 | DTSDKBuild 36 | 21E226 37 | DTSDKName 38 | macosx12.3 39 | DTXcode 40 | 1341 41 | DTXcodeBuild 42 | 13F100 43 | LSMinimumSystemVersion 44 | 12.3 45 | NSHumanReadableCopyright 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/A/Headers/libThunderPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // libThunderPlugin.h 3 | // libThunderPlugin 4 | // 5 | // Created by LEMON on 2022/7/20. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for libThunderPlugin. 11 | FOUNDATION_EXPORT double libThunderPluginVersionNumber; 12 | 13 | //! Project version string for libThunderPlugin. 14 | FOUNDATION_EXPORT const unsigned char libThunderPluginVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | @interface XLUserInformation : NSObject 19 | - (void)updateUserInfo:(id)arg1; 20 | - (id)initWithUserInfo:(id)arg1; 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module libThunderPlugin { 2 | umbrella header "libThunderPlugin.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 21F79 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | libThunderPlugin 11 | CFBundleIdentifier 12 | com.lemonlie.libThunderPlugin 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | libThunderPlugin 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 13F100 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 12.3 35 | DTSDKBuild 36 | 21E226 37 | DTSDKName 38 | macosx12.3 39 | DTXcode 40 | 1341 41 | DTXcodeBuild 42 | 13F100 43 | LSMinimumSystemVersion 44 | 12.3 45 | NSHumanReadableCopyright 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/A/libThunderPlugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeTips/ThunderPlugin-macOS/4f4dd08bc8b2d94c54d147c31af6ef8cbfa5f609/Other/Products/Debug/libThunderPlugin.framework/Versions/A/libThunderPlugin -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/Current/Headers/libThunderPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // libThunderPlugin.h 3 | // libThunderPlugin 4 | // 5 | // Created by LEMON on 2022/7/20. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for libThunderPlugin. 11 | FOUNDATION_EXPORT double libThunderPluginVersionNumber; 12 | 13 | //! Project version string for libThunderPlugin. 14 | FOUNDATION_EXPORT const unsigned char libThunderPluginVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | @interface XLUserInformation : NSObject 19 | - (void)updateUserInfo:(id)arg1; 20 | - (id)initWithUserInfo:(id)arg1; 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/Current/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module libThunderPlugin { 2 | umbrella header "libThunderPlugin.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 21F79 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | libThunderPlugin 11 | CFBundleIdentifier 12 | com.lemonlie.libThunderPlugin 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | libThunderPlugin 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 13F100 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 12.3 35 | DTSDKBuild 36 | 21E226 37 | DTSDKName 38 | macosx12.3 39 | DTXcode 40 | 1341 41 | DTXcodeBuild 42 | 13F100 43 | LSMinimumSystemVersion 44 | 12.3 45 | NSHumanReadableCopyright 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/Versions/Current/libThunderPlugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeTips/ThunderPlugin-macOS/4f4dd08bc8b2d94c54d147c31af6ef8cbfa5f609/Other/Products/Debug/libThunderPlugin.framework/Versions/Current/libThunderPlugin -------------------------------------------------------------------------------- /Other/Products/Debug/libThunderPlugin.framework/libThunderPlugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeTips/ThunderPlugin-macOS/4f4dd08bc8b2d94c54d147c31af6ef8cbfa5f609/Other/Products/Debug/libThunderPlugin.framework/libThunderPlugin -------------------------------------------------------------------------------- /Other/insert_dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeTips/ThunderPlugin-macOS/4f4dd08bc8b2d94c54d147c31af6ef8cbfa5f609/Other/insert_dylib -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ThunderPlugin-macOS 2 | 3 | ### 说明 4 | * 免责声明:本项目旨在学习macOS 逆向的一点实践,不可使用于商业和个人其他意图。若使用不当,均由个人承担。 5 | * 包含功能:Mac版迅雷SVIP显示。 6 | * 相关教程:请关注公众号 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sources/CTSwizzledHelper.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface CTSwizzledHelper : NSObject 5 | 6 | void ct_hookMethod(Class originalClass, SEL originalSelector, Class swizzledClass, SEL swizzledSelector); 7 | void ct_hookClassMethod(Class originalClass, SEL originalSelector, Class swizzledClass, SEL swizzledSelector); 8 | void ct_addMethod(Class originalClass,Class swizzledClass, SEL swizzledSelector); 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Sources/CTSwizzledHelper.m: -------------------------------------------------------------------------------- 1 | #import "CTSwizzledHelper.h" 2 | 3 | @implementation CTSwizzledHelper 4 | 5 | void ct_hookMethod(Class originalClass, SEL originalSelector, Class swizzledClass, SEL swizzledSelector) { 6 | Method originalMethod = class_getInstanceMethod(originalClass, originalSelector); 7 | Method swizzledMethod = class_getInstanceMethod(swizzledClass, swizzledSelector); 8 | if(originalMethod && swizzledMethod) { 9 | method_exchangeImplementations(originalMethod, swizzledMethod); 10 | } 11 | } 12 | 13 | void ct_hookClassMethod(Class originalClass, SEL originalSelector, Class swizzledClass, SEL swizzledSelector) { 14 | Method originalMethod = class_getClassMethod(originalClass, originalSelector); 15 | Method swizzledMethod = class_getClassMethod(swizzledClass, swizzledSelector); 16 | if(originalMethod && swizzledMethod) { 17 | method_exchangeImplementations(originalMethod, swizzledMethod); 18 | } 19 | } 20 | 21 | void ct_addMethod(Class originalClass,Class swizzledClass, SEL swizzledSelector) 22 | { 23 | Method swizzledMethod = class_getInstanceMethod(swizzledClass, swizzledSelector); 24 | class_addMethod(originalClass,swizzledSelector,method_getImplementation(swizzledMethod),method_getTypeEncoding(swizzledMethod)); 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Sources/Thunder+Hook.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Thunder_Hook.h 3 | // libThunderPlugin 4 | // 5 | // Copyright © 2018 CodeTips. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface NSObject (Thunder) 11 | 12 | + (void)hookThunder; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Sources/Thunder+Hook.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Thunder_Hook.m 3 | // libThunderPlugin 4 | // 5 | // Copyright © 2018 CodeTips. All rights reserved. 6 | // 7 | 8 | #import "Thunder+Hook.h" 9 | #import "libThunderPlugin.h" 10 | #import "CTSwizzledHelper.h" 11 | 12 | @implementation NSObject (Thunder) 13 | 14 | + (void)hookThunder 15 | { 16 | ct_hookMethod(objc_getClass("XLUserInformation"), @selector(initWithUserInfo:), [self class], @selector(hook_initWithUserInfo:)); 17 | ct_hookMethod(objc_getClass("XLUserInformation"), @selector(updateUserInfo:), [self class], @selector(hook_updateUserInfo:)); 18 | } 19 | 20 | - (id)hook_initWithUserInfo:(id)arg1 21 | { 22 | NSDictionary *vipInfo = [[arg1 objectForKey:@"vipList"] firstObject]; 23 | NSMutableDictionary *mutableVipInfo = [vipInfo mutableCopy]; 24 | [mutableVipInfo setValue:@"1" forKey:@"isVip"]; 25 | [mutableVipInfo setValue:@"20990131" forKey:@"expireDate"]; 26 | [mutableVipInfo setValue:@"4" forKey:@"vasType"]; 27 | NSMutableDictionary *userInfo = [arg1 mutableCopy]; 28 | [userInfo setObject:@[mutableVipInfo] forKey:@"vipList"]; 29 | return [self hook_initWithUserInfo:userInfo]; 30 | } 31 | - (void)hook_updateUserInfo:(id)arg1{ 32 | NSDictionary *vipInfo = [[arg1 objectForKey:@"vipList"] firstObject]; 33 | NSMutableDictionary *mutableVipInfo = [vipInfo mutableCopy]; 34 | [mutableVipInfo setValue:@"1" forKey:@"isVip"]; 35 | [mutableVipInfo setValue:@"20990131" forKey:@"expireDate"]; 36 | [mutableVipInfo setValue:@"4" forKey:@"vasType"]; 37 | NSMutableDictionary *userInfo = [arg1 mutableCopy]; 38 | [userInfo setObject:@[mutableVipInfo] forKey:@"vipList"]; 39 | [self hook_updateUserInfo:userInfo]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /libThunderPlugin.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6CB20EFD28884EC2002E148B /* libThunderPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CB20EFC28884EC2002E148B /* libThunderPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 6CB20F0428884F8D002E148B /* libThunderPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CB20F0328884F8D002E148B /* libThunderPlugin.m */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXFileReference section */ 15 | 6CB20EF928884EC2002E148B /* libThunderPlugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libThunderPlugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 16 | 6CB20EFC28884EC2002E148B /* libThunderPlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libThunderPlugin.h; sourceTree = ""; }; 17 | 6CB20F0328884F8D002E148B /* libThunderPlugin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libThunderPlugin.m; sourceTree = ""; }; 18 | /* End PBXFileReference section */ 19 | 20 | /* Begin PBXFrameworksBuildPhase section */ 21 | 6CB20EF628884EC2002E148B /* Frameworks */ = { 22 | isa = PBXFrameworksBuildPhase; 23 | buildActionMask = 2147483647; 24 | files = ( 25 | ); 26 | runOnlyForDeploymentPostprocessing = 0; 27 | }; 28 | /* End PBXFrameworksBuildPhase section */ 29 | 30 | /* Begin PBXGroup section */ 31 | 6CB20EEF28884EC2002E148B = { 32 | isa = PBXGroup; 33 | children = ( 34 | 6CB20EFB28884EC2002E148B /* libThunderPlugin */, 35 | 6CB20EFA28884EC2002E148B /* Products */, 36 | ); 37 | sourceTree = ""; 38 | }; 39 | 6CB20EFA28884EC2002E148B /* Products */ = { 40 | isa = PBXGroup; 41 | children = ( 42 | 6CB20EF928884EC2002E148B /* libThunderPlugin.framework */, 43 | ); 44 | name = Products; 45 | sourceTree = ""; 46 | }; 47 | 6CB20EFB28884EC2002E148B /* libThunderPlugin */ = { 48 | isa = PBXGroup; 49 | children = ( 50 | 6CB20EFC28884EC2002E148B /* libThunderPlugin.h */, 51 | 6CB20F0328884F8D002E148B /* libThunderPlugin.m */, 52 | ); 53 | path = libThunderPlugin; 54 | sourceTree = ""; 55 | }; 56 | /* End PBXGroup section */ 57 | 58 | /* Begin PBXHeadersBuildPhase section */ 59 | 6CB20EF428884EC2002E148B /* Headers */ = { 60 | isa = PBXHeadersBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 6CB20EFD28884EC2002E148B /* libThunderPlugin.h in Headers */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXHeadersBuildPhase section */ 68 | 69 | /* Begin PBXNativeTarget section */ 70 | 6CB20EF828884EC2002E148B /* libThunderPlugin */ = { 71 | isa = PBXNativeTarget; 72 | buildConfigurationList = 6CB20F0028884EC2002E148B /* Build configuration list for PBXNativeTarget "libThunderPlugin" */; 73 | buildPhases = ( 74 | 6CB20EF428884EC2002E148B /* Headers */, 75 | 6CB20EF528884EC2002E148B /* Sources */, 76 | 6CB20EF628884EC2002E148B /* Frameworks */, 77 | 6CB20EF728884EC2002E148B /* Resources */, 78 | 6CB20F05288852BB002E148B /* ShellScript */, 79 | ); 80 | buildRules = ( 81 | ); 82 | dependencies = ( 83 | ); 84 | name = libThunderPlugin; 85 | productName = libThunderPlugin; 86 | productReference = 6CB20EF928884EC2002E148B /* libThunderPlugin.framework */; 87 | productType = "com.apple.product-type.framework"; 88 | }; 89 | /* End PBXNativeTarget section */ 90 | 91 | /* Begin PBXProject section */ 92 | 6CB20EF028884EC2002E148B /* Project object */ = { 93 | isa = PBXProject; 94 | attributes = { 95 | BuildIndependentTargetsInParallel = 1; 96 | LastUpgradeCheck = 1340; 97 | TargetAttributes = { 98 | 6CB20EF828884EC2002E148B = { 99 | CreatedOnToolsVersion = 13.4.1; 100 | }; 101 | }; 102 | }; 103 | buildConfigurationList = 6CB20EF328884EC2002E148B /* Build configuration list for PBXProject "libThunderPlugin" */; 104 | compatibilityVersion = "Xcode 13.0"; 105 | developmentRegion = en; 106 | hasScannedForEncodings = 0; 107 | knownRegions = ( 108 | en, 109 | Base, 110 | ); 111 | mainGroup = 6CB20EEF28884EC2002E148B; 112 | productRefGroup = 6CB20EEF28884EC2002E148B; 113 | projectDirPath = ""; 114 | projectRoot = ""; 115 | targets = ( 116 | 6CB20EF828884EC2002E148B /* libThunderPlugin */, 117 | ); 118 | }; 119 | /* End PBXProject section */ 120 | 121 | /* Begin PBXResourcesBuildPhase section */ 122 | 6CB20EF728884EC2002E148B /* Resources */ = { 123 | isa = PBXResourcesBuildPhase; 124 | buildActionMask = 2147483647; 125 | files = ( 126 | ); 127 | runOnlyForDeploymentPostprocessing = 0; 128 | }; 129 | /* End PBXResourcesBuildPhase section */ 130 | 131 | /* Begin PBXShellScriptBuildPhase section */ 132 | 6CB20F05288852BB002E148B /* ShellScript */ = { 133 | isa = PBXShellScriptBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | ); 137 | inputFileListPaths = ( 138 | ); 139 | inputPaths = ( 140 | ); 141 | outputFileListPaths = ( 142 | ); 143 | outputPaths = ( 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | shellPath = /bin/sh; 147 | shellScript = "app_name=\"Thunder\"\nframework_name=\"libThunderPlugin\"\napp_bundle_path=\"/Applications/${app_name}.app/Contents/MacOS\"\napp_executable_path=\"${app_bundle_path}/${app_name}\"\napp_executable_backup_path=\"${app_executable_path}_backup\"\nframework_path=\"${app_bundle_path}/${framework_name}.framework\"\n# 备份原始可执行文件\nif [ ! -f \"$app_executable_backup_path\" ]\nthen\ncp \"$app_executable_path\" \"$app_executable_backup_path\"\nfi\n\nrm -rf \"./Other/Products/Debug/${framework_name}.framework\"\ncp -r \"${BUILT_PRODUCTS_DIR}/${framework_name}.framework\" \"./Other/Products/Debug/${framework_name}.framework\"\ncp -r \"${BUILT_PRODUCTS_DIR}/${framework_name}.framework\" ${app_bundle_path}\n./Other/insert_dylib --all-yes \"${framework_path}/${framework_name}\" \"$app_executable_backup_path\" \"$app_executable_path\"\n"; 148 | }; 149 | /* End PBXShellScriptBuildPhase section */ 150 | 151 | /* Begin PBXSourcesBuildPhase section */ 152 | 6CB20EF528884EC2002E148B /* Sources */ = { 153 | isa = PBXSourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | 6CB20F0428884F8D002E148B /* libThunderPlugin.m in Sources */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXSourcesBuildPhase section */ 161 | 162 | /* Begin XCBuildConfiguration section */ 163 | 6CB20EFE28884EC2002E148B /* Debug */ = { 164 | isa = XCBuildConfiguration; 165 | buildSettings = { 166 | ALWAYS_SEARCH_USER_PATHS = NO; 167 | CLANG_ANALYZER_NONNULL = YES; 168 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 169 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 170 | CLANG_ENABLE_MODULES = YES; 171 | CLANG_ENABLE_OBJC_ARC = YES; 172 | CLANG_ENABLE_OBJC_WEAK = YES; 173 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 174 | CLANG_WARN_BOOL_CONVERSION = YES; 175 | CLANG_WARN_COMMA = YES; 176 | CLANG_WARN_CONSTANT_CONVERSION = YES; 177 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 178 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 179 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 180 | CLANG_WARN_EMPTY_BODY = YES; 181 | CLANG_WARN_ENUM_CONVERSION = YES; 182 | CLANG_WARN_INFINITE_RECURSION = YES; 183 | CLANG_WARN_INT_CONVERSION = YES; 184 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 185 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 186 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 187 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 188 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 189 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 190 | CLANG_WARN_STRICT_PROTOTYPES = YES; 191 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 192 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 193 | CLANG_WARN_UNREACHABLE_CODE = YES; 194 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 195 | COPY_PHASE_STRIP = NO; 196 | CURRENT_PROJECT_VERSION = 1; 197 | DEBUG_INFORMATION_FORMAT = dwarf; 198 | ENABLE_STRICT_OBJC_MSGSEND = YES; 199 | ENABLE_TESTABILITY = YES; 200 | GCC_C_LANGUAGE_STANDARD = gnu11; 201 | GCC_DYNAMIC_NO_PIC = NO; 202 | GCC_NO_COMMON_BLOCKS = YES; 203 | GCC_OPTIMIZATION_LEVEL = 0; 204 | GCC_PREPROCESSOR_DEFINITIONS = ( 205 | "DEBUG=1", 206 | "$(inherited)", 207 | ); 208 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 209 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 210 | GCC_WARN_UNDECLARED_SELECTOR = YES; 211 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 212 | GCC_WARN_UNUSED_FUNCTION = YES; 213 | GCC_WARN_UNUSED_VARIABLE = YES; 214 | MACOSX_DEPLOYMENT_TARGET = 12.3; 215 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 216 | MTL_FAST_MATH = YES; 217 | ONLY_ACTIVE_ARCH = YES; 218 | SDKROOT = macosx; 219 | VERSIONING_SYSTEM = "apple-generic"; 220 | VERSION_INFO_PREFIX = ""; 221 | }; 222 | name = Debug; 223 | }; 224 | 6CB20EFF28884EC2002E148B /* Release */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | ALWAYS_SEARCH_USER_PATHS = NO; 228 | CLANG_ANALYZER_NONNULL = YES; 229 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 230 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 231 | CLANG_ENABLE_MODULES = YES; 232 | CLANG_ENABLE_OBJC_ARC = YES; 233 | CLANG_ENABLE_OBJC_WEAK = YES; 234 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 235 | CLANG_WARN_BOOL_CONVERSION = YES; 236 | CLANG_WARN_COMMA = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 239 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 240 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 241 | CLANG_WARN_EMPTY_BODY = YES; 242 | CLANG_WARN_ENUM_CONVERSION = YES; 243 | CLANG_WARN_INFINITE_RECURSION = YES; 244 | CLANG_WARN_INT_CONVERSION = YES; 245 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 246 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 247 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 248 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 249 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 250 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 251 | CLANG_WARN_STRICT_PROTOTYPES = YES; 252 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 253 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 254 | CLANG_WARN_UNREACHABLE_CODE = YES; 255 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 256 | COPY_PHASE_STRIP = NO; 257 | CURRENT_PROJECT_VERSION = 1; 258 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 259 | ENABLE_NS_ASSERTIONS = NO; 260 | ENABLE_STRICT_OBJC_MSGSEND = YES; 261 | GCC_C_LANGUAGE_STANDARD = gnu11; 262 | GCC_NO_COMMON_BLOCKS = YES; 263 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 264 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 265 | GCC_WARN_UNDECLARED_SELECTOR = YES; 266 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 267 | GCC_WARN_UNUSED_FUNCTION = YES; 268 | GCC_WARN_UNUSED_VARIABLE = YES; 269 | MACOSX_DEPLOYMENT_TARGET = 12.3; 270 | MTL_ENABLE_DEBUG_INFO = NO; 271 | MTL_FAST_MATH = YES; 272 | SDKROOT = macosx; 273 | VERSIONING_SYSTEM = "apple-generic"; 274 | VERSION_INFO_PREFIX = ""; 275 | }; 276 | name = Release; 277 | }; 278 | 6CB20F0128884EC2002E148B /* Debug */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | CODE_SIGN_STYLE = Automatic; 282 | COMBINE_HIDPI_IMAGES = YES; 283 | CURRENT_PROJECT_VERSION = 1; 284 | DEFINES_MODULE = YES; 285 | DEVELOPMENT_TEAM = CHN87BU624; 286 | DYLIB_COMPATIBILITY_VERSION = 1; 287 | DYLIB_CURRENT_VERSION = 1; 288 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 289 | GENERATE_INFOPLIST_FILE = YES; 290 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 291 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 292 | LD_RUNPATH_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "@executable_path/../Frameworks", 295 | "@loader_path/Frameworks", 296 | ); 297 | MARKETING_VERSION = 1.0; 298 | PRODUCT_BUNDLE_IDENTIFIER = com.lemonlie.libThunderPlugin; 299 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 300 | SKIP_INSTALL = YES; 301 | SWIFT_EMIT_LOC_STRINGS = YES; 302 | }; 303 | name = Debug; 304 | }; 305 | 6CB20F0228884EC2002E148B /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | CODE_SIGN_STYLE = Automatic; 309 | COMBINE_HIDPI_IMAGES = YES; 310 | CURRENT_PROJECT_VERSION = 1; 311 | DEFINES_MODULE = YES; 312 | DEVELOPMENT_TEAM = CHN87BU624; 313 | DYLIB_COMPATIBILITY_VERSION = 1; 314 | DYLIB_CURRENT_VERSION = 1; 315 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 316 | GENERATE_INFOPLIST_FILE = YES; 317 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 318 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 319 | LD_RUNPATH_SEARCH_PATHS = ( 320 | "$(inherited)", 321 | "@executable_path/../Frameworks", 322 | "@loader_path/Frameworks", 323 | ); 324 | MARKETING_VERSION = 1.0; 325 | PRODUCT_BUNDLE_IDENTIFIER = com.lemonlie.libThunderPlugin; 326 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 327 | SKIP_INSTALL = YES; 328 | SWIFT_EMIT_LOC_STRINGS = YES; 329 | }; 330 | name = Release; 331 | }; 332 | /* End XCBuildConfiguration section */ 333 | 334 | /* Begin XCConfigurationList section */ 335 | 6CB20EF328884EC2002E148B /* Build configuration list for PBXProject "libThunderPlugin" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | 6CB20EFE28884EC2002E148B /* Debug */, 339 | 6CB20EFF28884EC2002E148B /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | 6CB20F0028884EC2002E148B /* Build configuration list for PBXNativeTarget "libThunderPlugin" */ = { 345 | isa = XCConfigurationList; 346 | buildConfigurations = ( 347 | 6CB20F0128884EC2002E148B /* Debug */, 348 | 6CB20F0228884EC2002E148B /* Release */, 349 | ); 350 | defaultConfigurationIsVisible = 0; 351 | defaultConfigurationName = Release; 352 | }; 353 | /* End XCConfigurationList section */ 354 | }; 355 | rootObject = 6CB20EF028884EC2002E148B /* Project object */; 356 | } 357 | -------------------------------------------------------------------------------- /libThunderPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /libThunderPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /libThunderPlugin.xcodeproj/project.xcworkspace/xcuserdata/lemon.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeTips/ThunderPlugin-macOS/4f4dd08bc8b2d94c54d147c31af6ef8cbfa5f609/libThunderPlugin.xcodeproj/project.xcworkspace/xcuserdata/lemon.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /libThunderPlugin.xcodeproj/xcshareddata/xcschemes/libThunderPlugin.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 46 | 47 | 48 | 54 | 55 | 61 | 62 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /libThunderPlugin.xcodeproj/xcuserdata/lemon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /libThunderPlugin.xcodeproj/xcuserdata/lemon.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | libThunderPlugin.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6CB20EF828884EC2002E148B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /libThunderPlugin/libThunderPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // libThunderPlugin.h 3 | // libThunderPlugin 4 | // 5 | // Created by LEMON on 2022/7/20. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for libThunderPlugin. 11 | FOUNDATION_EXPORT double libThunderPluginVersionNumber; 12 | 13 | //! Project version string for libThunderPlugin. 14 | FOUNDATION_EXPORT const unsigned char libThunderPluginVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | @interface XLUserInformation : NSObject 19 | - (void)updateUserInfo:(id)arg1; 20 | - (id)initWithUserInfo:(id)arg1; 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /libThunderPlugin/libThunderPlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // libThunderPlugin.m 3 | // libThunderPlugin 4 | // 5 | // Created by LEMON on 2022/7/20. 6 | // 7 | 8 | #import "libThunderPlugin.h" 9 | #import "objc/runtime.h" 10 | 11 | void lm_hookMethod(Class originalClass, SEL originalSelector, Class swizzledClass, SEL swizzledSelector) { 12 | Method originalMethod = class_getInstanceMethod(originalClass, originalSelector); 13 | Method swizzledMethod = class_getInstanceMethod(swizzledClass, swizzledSelector); 14 | if(originalMethod && swizzledMethod) { 15 | method_exchangeImplementations(originalMethod, swizzledMethod); 16 | } 17 | } 18 | 19 | @implementation NSObject (Thunder) 20 | + (void)hookThunder{ 21 | lm_hookMethod(objc_getClass("XLUserInformation"), @selector(initWithUserInfo:), [self class], @selector(hook_initWithUserInfo:)); 22 | lm_hookMethod(objc_getClass("XLUserInformation"), @selector(updateUserInfo:), [self class], @selector(hook_updateUserInfo:)); 23 | } 24 | - (id)hook_initWithUserInfo:(id)arg1{ 25 | return [self hook_initWithUserInfo:[self modify:arg1]]; 26 | } 27 | - (void)hook_updateUserInfo:(id)arg1{ 28 | [self hook_updateUserInfo:[self modify:arg1]]; 29 | } 30 | - (NSDictionary *)modify:(NSDictionary *)user{ 31 | NSDictionary *vipInfo = [[user objectForKey:@"vipList"] firstObject]; 32 | NSMutableDictionary *mutableVipInfo = [vipInfo mutableCopy]; 33 | [mutableVipInfo setValue:@"1" forKey:@"isVip"]; 34 | [mutableVipInfo setValue:@"20990131" forKey:@"expireDate"]; 35 | [mutableVipInfo setValue:@"4" forKey:@"vasType"]; 36 | NSMutableDictionary *userInfo = [user mutableCopy]; 37 | [userInfo setObject:@[mutableVipInfo] forKey:@"vipList"]; 38 | return userInfo; 39 | } 40 | @end 41 | 42 | 43 | static void __attribute__((constructor)) initialize(void) { 44 | [NSObject hookThunder]; 45 | } 46 | --------------------------------------------------------------------------------