Skip to content

Commit

Permalink
Added: NSLogger and optimize output content
Browse files Browse the repository at this point in the history
Fixed: AirBuddy Helper
  • Loading branch information
marlkiller committed Oct 18, 2024
1 parent 99bdbdb commit 2691852
Show file tree
Hide file tree
Showing 34 changed files with 438 additions and 298 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/Builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ env:
LLVM_VERSION: 15.0.6

jobs:
delete_latest_release:
runs-on: ubuntu-latest
macos:
runs-on: macos-latest
steps:
- name: checkout master
- name: checkout main
uses: actions/checkout@master

- name: delete latest release
uses: dev-drprasad/delete-tag-and-release@v0.2.1
with:
Expand All @@ -24,13 +24,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

macos:
runs-on: macos-latest
needs: delete_latest_release
steps:
- name: checkout dev
uses: actions/checkout@master

- name: compile macos
run: |
bash build.sh
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++20")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++")

# Enable ARC
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -fobjc-arc")
set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} -fobjc-arc")

#关闭编译器优化
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
Expand Down Expand Up @@ -91,7 +95,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
## ----------------------------------
## Architecture
## ----------------------------------
XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[variant=Debug] "YES"
XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[variant=Debug] "NO"
XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[variant=Release] "NO"
## ----------------------------------
## Build Option
Expand Down Expand Up @@ -130,7 +134,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
## Apple Clang - Language - Objective-C
## ----------------------------------
# Enable ARC, cmake default is MRC
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "No"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_WEAK "YES"
## ----------------------------------
## Apple Clang - Language - Code Generation
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Directory Structure:
| ProxyMan | 5. ||| https://proxyman.io/ | ON | |
| Movist Pro | 2.* ||| https://movistprime.com/ | | |
| Surge | 5.8.* ||| https://nssurge.com/ | ON | |
| Infuse | 7.7.* ||| App Store | | |
| Infuse | 8.* ||| App Store | | |
| MacUpdater | 3. ||| https://www.corecode.io/macupdater/#download | | |
| CleanShotX | 4. ||| https://updates.getcleanshot.com/v3/ | | |
| ForkLift | 4. ||| https://binarynights.com/ | ON | |
Expand Down Expand Up @@ -130,11 +130,6 @@ cp -f source_bin source_bin_backup
```


### 0x3 Resigning
```shell
sudo codesign -f -s - --all-architectures --deep "/Applications/xxx.app"
```

## Sponsor

[![JetBrains](jetbrains.svg)](https://www.jetbrains.com/?from=dylib_dobby_hook "JetBrains")
Expand Down
7 changes: 1 addition & 6 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
| ProxyMan | 5. ||| https://proxyman.io/ | ON | |
| Movist Pro | 2.* ||| https://movistprime.com/ | | |
| Surge | 5.8.* ||| https://nssurge.com/ | ON | |
| Infuse | 7.7.* ||| App Store | | |
| Infuse | 8.* ||| App Store | | |
| MacUpdater | 3. ||| https://www.corecode.io/macupdater/#download | | |
| CleanShotX | 4. ||| https://updates.getcleanshot.com/v3/ | | |
| ForkLift | 4. ||| https://binarynights.com/ | ON | |
Expand Down Expand Up @@ -130,11 +130,6 @@ cp -f source_bin source_bin_backup
```


### 0x3 重新签名
```shell
sudo codesign -f -s - --all-architectures --deep "/Applications/xxx.app"
```

## Sponsor

[![JetBrains](jetbrains.svg)](https://www.jetbrains.com/?from=dylib_dobby_hook "JetBrains")
Expand Down
8 changes: 8 additions & 0 deletions dylib_dobby_hook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
B50E935E2BBD024F0073FEAA /* PaddleBaseHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B50E935D2BBD024F0073FEAA /* PaddleBaseHack.m */; };
B513ADD72CB95D0B00F5DC97 /* LocalizationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B513ADD62CB95D0B00F5DC97 /* LocalizationManager.h */; };
B513ADD92CB95D4100F5DC97 /* LocalizationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B513ADD82CB95D4100F5DC97 /* LocalizationManager.m */; };
B52BBA842CBFE1CE00F098A9 /* AirBuddyHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B52BBA832CBFE1CE00F098A9 /* AirBuddyHack.m */; };
B53522462C2FE4D4001CA305 /* MacUpdaterHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B53522452C2FE4D4001CA305 /* MacUpdaterHack.m */; };
B53F9DED2C4AA4EC00A6B32D /* CleanShotXHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B53F9DEC2C4AA4EC00A6B32D /* CleanShotXHack.m */; };
B546A6582BC4F0CD0012338D /* ProxyManHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B546A6572BC4F0CD0012338D /* ProxyManHack.m */; };
Expand All @@ -35,6 +36,7 @@
B57F20102C5DD70700C87201 /* MockCKDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = B57F200F2C5DD70700C87201 /* MockCKDatabase.m */; };
B58160172BE88569001DDB9B /* EncryptionUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = B58160112BE88569001DDB9B /* EncryptionUtils.m */; };
B581601B2BE88569001DDB9B /* EncryptionUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = B58160162BE88569001DDB9B /* EncryptionUtils.h */; };
B5822CA92CBFFC020062383F /* Logger.h in Headers */ = {isa = PBXBuildFile; fileRef = B5822CA82CBFFC020062383F /* Logger.h */; };
B5A7D30F2C548B71003D4C7F /* HackProtocolDefault.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A7D30E2C548B71003D4C7F /* HackProtocolDefault.h */; };
B5A7D3112C548BAB003D4C7F /* HackProtocolDefault.m in Sources */ = {isa = PBXBuildFile; fileRef = B5A7D3102C548BAB003D4C7F /* HackProtocolDefault.m */; };
B5A7D3142C549130003D4C7F /* ForkLiftHelperHack.m in Sources */ = {isa = PBXBuildFile; fileRef = B5A7D3132C549130003D4C7F /* ForkLiftHelperHack.m */; };
Expand Down Expand Up @@ -86,6 +88,7 @@
B50E935D2BBD024F0073FEAA /* PaddleBaseHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PaddleBaseHack.m; sourceTree = "<group>"; };
B513ADD62CB95D0B00F5DC97 /* LocalizationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalizationManager.h; sourceTree = "<group>"; };
B513ADD82CB95D4100F5DC97 /* LocalizationManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocalizationManager.m; sourceTree = "<group>"; };
B52BBA832CBFE1CE00F098A9 /* AirBuddyHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AirBuddyHack.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>"; };
B546A6572BC4F0CD0012338D /* ProxyManHack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProxyManHack.m; sourceTree = "<group>"; };
Expand All @@ -104,6 +107,7 @@
B57F200F2C5DD70700C87201 /* MockCKDatabase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MockCKDatabase.m; sourceTree = "<group>"; };
B58160112BE88569001DDB9B /* EncryptionUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EncryptionUtils.m; sourceTree = "<group>"; };
B58160162BE88569001DDB9B /* EncryptionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncryptionUtils.h; sourceTree = "<group>"; };
B5822CA82CBFFC020062383F /* Logger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = "<group>"; };
B59751F52C9DAF8600617629 /* fix_helper.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = fix_helper.sh; sourceTree = "<group>"; };
B59751F62C9DB54E00617629 /* fix_helper_and_inject.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = fix_helper_and_inject.sh; sourceTree = "<group>"; };
B5A7D30E2C548B71003D4C7F /* HackProtocolDefault.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HackProtocolDefault.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -228,6 +232,7 @@
B581601C2BE8949B001DDB9B /* apps */ = {
isa = PBXGroup;
children = (
B52BBA832CBFE1CE00F098A9 /* AirBuddyHack.m */,
B5EC63D72CBD39C700D92EEC /* AlfredHack.m */,
B5732BF02C82CD5900EC9E11 /* IDAHack.m */,
9C99D64A2CB6CEF100B8A6D7 /* iStat7Hack.m */,
Expand Down Expand Up @@ -271,6 +276,7 @@
B5EAA9E12C8C3FC3008C4089 /* URLSessionHook.m */,
B513ADD62CB95D0B00F5DC97 /* LocalizationManager.h */,
B513ADD82CB95D4100F5DC97 /* LocalizationManager.m */,
B5822CA82CBFFC020062383F /* Logger.h */,
);
path = utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -311,6 +317,7 @@
38350BF62B53F73A00DD52B3 /* dylib_dobby_hook.h in Headers */,
3816BBB72B54FED80051CF39 /* MemoryUtils.h in Headers */,
B5A7D3182C5491A0003D4C7F /* HackHelperProtocolDefault.h in Headers */,
B5822CA92CBFFC020062383F /* Logger.h in Headers */,
38350C022B53F78900DD52B3 /* dobby.h in Headers */,
B552CA362C54AC200095C9B9 /* CommonRetOC.h in Headers */,
38D1AC282B54C9C100E6CB9E /* Constant.h in Headers */,
Expand Down Expand Up @@ -420,6 +427,7 @@
B5F06B1D2BEF591E0079E68D /* InfuseHack.m in Sources */,
B5EAA9E22C8C3FC3008C4089 /* URLSessionHook.m in Sources */,
B513ADD92CB95D4100F5DC97 /* LocalizationManager.m in Sources */,
B52BBA842CBFE1CE00F098A9 /* AirBuddyHack.m in Sources */,
B55407272B653DCB005C08E6 /* NavicatPremiumHack.m in Sources */,
3816BBB92B54FF090051CF39 /* MemoryUtils.m in Sources */,
38B83E312B5505B300919735 /* TablePlusHack.m in Sources */,
Expand Down
107 changes: 107 additions & 0 deletions dylib_dobby_hook/apps/AirBuddyHack.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
//
// air_buddy_hack.m
// dylib_dobby_hook
//
// Created by artemis on 2024/1/15.
//

#import <Foundation/Foundation.h>
#import "Constant.h"
#import "dobby.h"
#import "MemoryUtils.h"
#include "common_ret.h"
#include <sys/ptrace.h>
#import <objc/runtime.h>
#include <mach-o/dyld.h>
#import <Cocoa/Cocoa.h>
#import "HackProtocolDefault.h"

@interface AirBuddyHack : HackProtocolDefault

@end
@implementation AirBuddyHack



- (NSString *)getAppName {
// >>>>>> AppName is [codes.rambo.AirBuddyHelper],Version is [2.7.3], myAppCFBundleVersion is [641].
// >>>>>> AppName is [codes.rambo.AirBuddy],Version is [2.7.3], myAppCFBundleVersion is [641].
return @"codes.rambo.AirBuddy";
}

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


void (*sub_10005ad20_ori)(void);
void hook_sub_10005ad20(void){
NSLogger(@"hook_sub_10005bf30 is called");
//
// // cmp byte [r13+0x99], 0x1
// // (lldb) po 0x00006000008eeda0
// // AirBuddy.LicenseStatusViewModel
// uint64_t registerValue;
//#if defined(__arm64__) || defined(__aarch64__)
// asm("mov %0, x20" : "=r" (registerValue)); // 获取 x20 寄存器的值
//#elif defined(__x86_64__)
//// asm("mov %0, r13" : "=r" (registerValue));// x32 ??
// asm("movq %%r13, %0" : "=r" (registerValue));// 获取 r13 寄存器的值
//#endif
// // 操作 寄存器+0x99 偏移
// uint8_t *addressToCompare = (uint8_t *)(registerValue + 0x99);
// uint8_t byteValue = *addressToCompare;
// NSLogger(@"byteValue :%d",byteValue);
// *addressToCompare = 0;
// byteValue = *addressToCompare;
// NSLogger(@"byteValue :%d",byteValue);
// // 转为 id 类型
// uint8_t *obj = (uint8_t *)(registerValue);
// id objId = (__bridge id)(void *)obj;
// NSLogger(@"objId %@",objId);
// [MemoryUtils inspectObjectWithAddress:(void *)obj];
// [MemoryUtils listAllPropertiesMethodsAndVariables:[objId class]];
//

#if defined(__arm64__) || defined(__aarch64__)
__asm__ __volatile__(
"strb wzr, [x20, #0x99]"
);
#elif defined(__x86_64__)
// __asm
// {
// mov byte ptr[r13+99h], 0
// }
__asm__ (
"movb $0, 0x99(%r13)"
);
#endif
return sub_10005ad20_ori();
}

- (BOOL)hack {

DobbyHook(SecCodeCheckValidityWithErrors, (void *)hk_SecCodeCheckValidityWithErrors, (void *)&SecCodeCheckValidityWithErrors_ori);
if ([[Constant getCurrentAppName] containsString:@"codes.rambo.AirBuddyHelper"]) {
NSLogger(@"this is codes.rambo.AirBuddyHelper");
return YES;
}

// 程序使用ptrace来进行动态调试保护,使得执行lldb的时候出现Process xxxx exited with status = 45 (0x0000002d)错误。
// 使用 DobbyHook 替换 ptrace函数。
DobbyHook((void *)ptrace, (void *)my_ptrace, (void *)&orig_ptrace);

// AMSkipOnboarding
// defaults write codes.rambo.AirBuddy hasCompletedOnboarding -bool YES
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:true forKey:@"AMSkipOnboarding"];
[defaults synchronize];

Class PaddleBaseHackClass = NSClassFromString(@"PaddleBaseHack");
id hackInstance = [[PaddleBaseHackClass alloc] init];
[hackInstance performSelector:@selector(hack)];

return YES;
}

@end
2 changes: 1 addition & 1 deletion dylib_dobby_hook/apps/AlfredHack.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (BOOL)hack {
DobbyHook((void *)ptrace, (void *)my_ptrace, (void *)&orig_ptrace);

void *symbol_address = DobbySymbolResolver("Alfred Framework", "_qrwG9chHdy1498");
NSLog(@">>>>>> [qrwG9chHdy1498] address: 0x%lx",symbol_address);
NSLogger(@"[qrwG9chHdy1498] address: 0x%lx",symbol_address);
DobbyHook(symbol_address ,ret1, NULL);

return YES;
Expand Down
Loading

0 comments on commit 2691852

Please sign in to comment.