Skip to content

Commit

Permalink
Paddle app integration
Browse files Browse the repository at this point in the history
  • Loading branch information
marlkiller committed Aug 31, 2024
1 parent 8cac23b commit 4f28b4c
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 64 deletions.
11 changes: 4 additions & 7 deletions dylib_dobby_hook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
38D1AC2A2B54CA4D00E6CB9E /* Constant.m in Sources */ = {isa = PBXBuildFile; fileRef = 38D1AC292B54CA4D00E6CB9E /* Constant.m */; };
38D1AC2C2B54D03B00E6CB9E /* HackProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 38D1AC2B2B54D03B00E6CB9E /* HackProtocol.h */; };
38D1AC322B54D1CC00E6CB9E /* AirBuddyHack.m in Sources */ = {isa = PBXBuildFile; fileRef = 38D1AC312B54D1CC00E6CB9E /* AirBuddyHack.m */; };
B502BD5D2BCFB35200DAD97F /* MovistProHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B502BD5C2BCFB35200DAD97F /* MovistProHack.m */; };
B50E935E2BBD024F0073FEAA /* PaddleBaseHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B50E935D2BBD024F0073FEAA /* PaddleBaseHack.m */; };
B53522462C2FE4D4001CA305 /* MacUpdaterHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B53522452C2FE4D4001CA305 /* MacUpdaterHack.m */; };
B53F9DED2C4AA4EC00A6B32D /* CleanShotXHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B53F9DEC2C4AA4EC00A6B32D /* CleanShotXHack.m */; };
Expand All @@ -29,7 +28,7 @@
B552CA382C54AC450095C9B9 /* CommonRetOC.m in Sources */ = {isa = PBXBuildFile; fileRef = B552CA372C54AC450095C9B9 /* CommonRetOC.m */; };
B55407272B653DCB005C08E6 /* NavicatPremiumHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B55407262B653DCB005C08E6 /* NavicatPremiumHack.m */; };
B554D7BC2B63F2A300B7EFEA /* DevUtilsHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B554D7BB2B63F2A300B7EFEA /* DevUtilsHack.m */; };
B558F9712C676AE700EAAAC3 /* IDAHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B558F9702C676AE700EAAAC3 /* IDAHack.m */; };
B5732BF12C82CD5900EC9E11 /* IDAHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B5732BF02C82CD5900EC9E11 /* IDAHack.m */; };
B57F200E2C5DD6D700C87201 /* MockCKDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = B57F200D2C5DD6D700C87201 /* MockCKDatabase.h */; };
B57F20102C5DD70700C87201 /* MockCKDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = B57F200F2C5DD70700C87201 /* MockCKDatabase.m */; };
B58160172BE88569001DDB9B /* encryp_utils.m in Sources */ = {isa = PBXBuildFile; fileRef = B58160112BE88569001DDB9B /* encryp_utils.m */; };
Expand Down Expand Up @@ -80,7 +79,6 @@
38D1AC312B54D1CC00E6CB9E /* AirBuddyHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AirBuddyHack.m; sourceTree = "<group>"; };
38E793632B6C7AB8005677AA /* all_in_one.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = all_in_one.sh; sourceTree = "<group>"; };
38E793642B6C7FB6005677AA /* auto_hack.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = auto_hack.sh; sourceTree = "<group>"; };
B502BD5C2BCFB35200DAD97F /* MovistProHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MovistProHack.m; sourceTree = "<group>"; };
B50E935D2BBD024F0073FEAA /* PaddleBaseHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PaddleBaseHack.m; sourceTree = "<group>"; };
B53522452C2FE4D4001CA305 /* MacUpdaterHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MacUpdaterHack.m; sourceTree = "<group>"; };
B53F9DEC2C4AA4EC00A6B32D /* CleanShotXHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CleanShotXHack.m; sourceTree = "<group>"; };
Expand All @@ -91,6 +89,7 @@
B554D7BB2B63F2A300B7EFEA /* DevUtilsHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DevUtilsHack.m; sourceTree = "<group>"; };
B56968C62BEA4E2A0022FAC6 /* libdylib_dobby_hook.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libdylib_dobby_hook.dylib; sourceTree = "<group>"; };
B56968C72BEA4E4D0022FAC6 /* cmake_debugger.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = cmake_debugger.sh; sourceTree = "<group>"; };
B5732BF02C82CD5900EC9E11 /* IDAHack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IDAHack.m; sourceTree = "<group>"; };
B57AEDBA2C5009E400B9C5FB /* forklift_hack.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = forklift_hack.sh; sourceTree = "<group>"; };
B57AEDBB2C5009F200B9C5FB /* dtrace_kill.d */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.dtrace; path = dtrace_kill.d; sourceTree = "<group>"; };
B57AEDBC2C5009F200B9C5FB /* SMJobBlessUtil-python3.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = "SMJobBlessUtil-python3.py"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -221,6 +220,7 @@
B581601C2BE8949B001DDB9B /* apps */ = {
isa = PBXGroup;
children = (
B5732BF02C82CD5900EC9E11 /* IDAHack.m */,
B5D0C0BA2C4B553500881398 /* ForkLiftHack.m */,
B5F06B1C2BEF591E0079E68D /* InfuseHack.m */,
38D1AC312B54D1CC00E6CB9E /* AirBuddyHack.m */,
Expand All @@ -233,12 +233,10 @@
B50E935D2BBD024F0073FEAA /* PaddleBaseHack.m */,
B5D2ED3E2BC0252D0030CBCA /* DevHack.m */,
B546A6572BC4F0CD0012338D /* ProxyManHack.m */,
B502BD5C2BCFB35200DAD97F /* MovistProHack.m */,
B53522452C2FE4D4001CA305 /* MacUpdaterHack.m */,
B53F9DEC2C4AA4EC00A6B32D /* CleanShotXHack.m */,
B5A7D30E2C548B71003D4C7F /* HackProtocolDefault.h */,
B5A7D3102C548BAB003D4C7F /* HackProtocolDefault.m */,
B558F9702C676AE700EAAAC3 /* IDAHack.m */,
);
path = apps;
sourceTree = "<group>";
Expand Down Expand Up @@ -408,9 +406,8 @@
B552CA382C54AC450095C9B9 /* CommonRetOC.m in Sources */,
B5FECEAE2BC4FC29008916D6 /* common_ret.m in Sources */,
38D1AC2A2B54CA4D00E6CB9E /* Constant.m in Sources */,
B502BD5D2BCFB35200DAD97F /* MovistProHack.m in Sources */,
B5FE3B862BA2A571001AE437 /* TransmitHack.m in Sources */,
B558F9712C676AE700EAAAC3 /* IDAHack.m in Sources */,
B5732BF12C82CD5900EC9E11 /* IDAHack.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
7 changes: 7 additions & 0 deletions dylib_dobby_hook/apps/HackProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

- (NSString *)getAppName;
- (NSString *)getSupportAppVersion;

/**
* 判断当前应用是否需要注入。
* 默认根据 AppName 前缀匹配,如果需要自定义,请在实现类中自行实现。
*/
- (BOOL)shouldInject:(NSString *)target;

- (BOOL)hack;
@end

44 changes: 0 additions & 44 deletions dylib_dobby_hook/apps/MovistProHack.m

This file was deleted.

25 changes: 18 additions & 7 deletions dylib_dobby_hook/apps/PaddleBaseHack.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,26 @@ @interface PaddleBaseHack : HackProtocolDefault

@implementation PaddleBaseHack

- (NSString *)getAppName {
return @"com.charliemonroe.";
- (BOOL)shouldInject:(NSString *)target {

// Movist Pro
// Downie 4
// Fork
// BetterMouse
// Permute 3

int paddleIndex = [MemoryUtils indexForImageWithName:@"Paddle"];
if (paddleIndex > 0) {
return true;
}
return false;
}

- (NSString *)getSupportAppVersion {
// downie 4.7.8
// permute 3.11.8
return @"";
}
//- (NSString *)getAppName {
// return @"com.charliemonroe.";
//}
//

- (NSNumber *) hook_trialDaysRemaining {
NSLog(@">>>>>> called hook_trialDaysRemaining");
return @9;
Expand Down
13 changes: 11 additions & 2 deletions dylib_dobby_hook/utils/CommonRetOC.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,22 @@ + (void)ret {


- (NSString *)getAppName {
return @"EMPTY";
return @"";
}

- (NSString *)getSupportAppVersion {
return @"EMPTY";
return @"";
}



- (BOOL)shouldInject:(NSString *)target {
NSString *appName = [self getAppName];
return [target hasPrefix:appName];
}



- (BOOL)hack {
return NO;
}
Expand Down
3 changes: 2 additions & 1 deletion dylib_dobby_hook/utils/Constant.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ + (void)doHack {
for (Class class in personClasses) {

id<HackProtocol> it = [[class alloc] init];
if ([currentAppName hasPrefix:[it getAppName]]) {

if ([it shouldInject:currentAppName]) {
NSString *supportAppVersion = [it getSupportAppVersion];
if (supportAppVersion!=nil && supportAppVersion.length>0 && ![currentAppVersion hasPrefix:supportAppVersion]){
NSAlert *alert = [[NSAlert alloc] init];
Expand Down
47 changes: 47 additions & 0 deletions script/apps/paddle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Set the framework name
FRAMEWORK_NAME="Paddle.framework"

# Array to store unique app names
APP_NAMES=()

# Function to search for the framework in an app
search_framework() {
local APP_PATH="$1"
local APP_NAME=$(basename "$APP_PATH" .app)

if [ -d "$APP_PATH/Contents/Frameworks/$FRAMEWORK_NAME" ]; then
# Check if the app name already exists in the array
if [[ ! " ${APP_NAMES[@]} " =~ " ${APP_NAME} " ]]; then
APP_NAMES+=("$APP_NAME")
fi
fi
}

# Common folders to search within
COMMON_FOLDERS=(
"/Applications"
"/Users/$(whoami)/Applications"
# Add more directories as needed
)

# Search for apps containing the framework in common folders
for FOLDER in "${COMMON_FOLDERS[@]}"; do
echo "Searching in: $FOLDER"
while IFS= read -r -d '' FILE; do
if [[ "$FILE" == *.app ]]; then
search_framework "$FILE"
fi
done < <(find "$FOLDER" -name "*.app" -print0 2>/dev/null)
done

# Check if any apps containing the framework were found
if [ ${#APP_NAMES[@]} -eq 0 ]; then
echo "No apps containing the framework $FRAMEWORK_NAME were found in the specified folders."
else
echo "Apps containing the framework $FRAMEWORK_NAME in the specified folders:"
for APP_NAME in "${APP_NAMES[@]}"; do
echo "$APP_NAME"
done
fi
9 changes: 6 additions & 3 deletions script/auto_hack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,18 @@ hack_app "Paste"
hack_app "Navicat Premium" "/Applications/Navicat Premium.app/Contents/Frameworks/EE.framework/Versions/A/EE"
hack_app "Transmit"
# hack_app "AnyGo"
hack_app "Downie 4" "/Applications/Downie 4.app/Contents/Frameworks/Licensing.framework/Versions/A/Licensing"
hack_app "Permute 3" "/Applications/Permute 3.app/Contents/Frameworks/Licensing.framework/Versions/A/Licensing"
hack_app "Proxyman" "/Applications/Proxyman.app/Contents/Frameworks/HexFiend.framework/Versions/A/HexFiend"
hack_app "Movist Pro" "/Applications/Movist Pro.app/Contents/Frameworks/MediaKeyTap.framework/Versions/A/MediaKeyTap"
hack_app "AirBuddy" "/Applications/AirBuddy.app/Contents/Frameworks/LetsMove.framework/Versions/A/LetsMove"
hack_app "Infuse" "/Applications/Infuse.app/Contents/Frameworks/Differentiator.framework/Versions/A/Differentiator"
hack_app "MacUpdater" "/Applications/MacUpdater.app/Contents/Frameworks/Sparkle.framework/Versions/B/Sparkle"
hack_app "CleanShot X" "/Applications/CleanShot X.app/Contents/Frameworks/LetsMove.framework/Versions/A/LetsMove"

# paddle
hack_app "Downie 4" "/Applications/Downie 4.app/Contents/Frameworks/Paddle.framework/Versions/A/Paddle"
hack_app "Permute 3" "/Applications/Permute 3.app/Contents/Frameworks/Paddle.framework/Versions/A/Paddle"
hack_app "Movist Pro" "/Applications/Movist Pro.app/Contents/Frameworks/Paddle.framework/Versions/A/Paddle"



# fixed with helper
hack_app "IDA Professional 9.0" "/Applications/IDA Professional 9.0.app/Contents/Frameworks/QtDBus.framework/Versions/5/QtDBus" "apps/ida_hack.sh"
Expand Down

0 comments on commit 4f28b4c

Please sign in to comment.