请问Dobby有没有使用说明给小白

会一些简单的OC逆向,但是很菜

在本坛子看到 大佬jmpews的 Dobby,感觉很好用的样子,但是不知道怎么下手,所以来问问有没有使用文档?

@ jmpews

同问 谁有编译好的dobby库,一直编译不了

1 个赞

我给你一个吧,真机的Dobby.framework.zip (20.6 KB)

我现在是编译没问题。
写个项目引用跑 ios 10, 11 , 12 会出现以下两种情况;
1、闪退, 报 sign 问题
2、注入不了

如果方便可否丢一个带framwork 的 monkeydev/theos 工程 参考 :joy:

谢谢

新的构建应该不会存在 sign 问题了

如果方便可否丢一个带framwork 的 monkeydev/theos 工程 参考

谢谢

感谢大哥 :grinning:

1 个赞

大哥可否丢一份 SVC 80 hook 使用Demo ,

1 个赞

抖音就是 svc 80,你试试。

1 个赞
#import <mach-o/dyld.h>
#import <mach-o/getsect.h>
#import <Dobby/Dobby.h>
#include <sys/syscall.h>

void scan_executable_memory(const uint8_t *target, const uint32_t target_len, void (*callback)(uint8_t *)) {
    const struct mach_header_64 *header = (const struct mach_header_64*) _dyld_get_image_header(0);
    const struct section_64 *executable_section = getsectbynamefromheader_64(header, "__TEXT", "__text");
    
    uint8_t *start_address = (uint8_t *) ((intptr_t) header + executable_section->offset);
    uint8_t *end_address = (uint8_t *) (start_address + executable_section->size);
    
    uint8_t *current = start_address;
    uint32_t index = 0;
    
    uint8_t current_target = 0;
    
    while (current < end_address) {
        current_target = target[index];
        
        // Allow 0xFF as wildcard.
        if (current_target == *current++ || current_target == 0xFF) {
            index++;
        } else {
            index = 0;
        }
        
        // Check if match.
        if (index == target_len) {
            index = 0;
            callback(current - target_len);
        }
    }
}

// ====== PATCH CODE ====== //
void SVC80_handler(RegisterContext *reg_ctx, const HookEntryInfo *info) {
#if defined __arm64__ || defined __arm64e__
    int syscall_num = (int)(uint64_t)reg_ctx->general.regs.x16;
    //monitoring ptrace
    if (syscall_num == SYS_ptrace) {
        *(unsigned long *)(&reg_ctx->general.regs.x0) = (unsigned long long)0;
    }
#endif
}

void startHookTarget_SVC80(uint8_t* match) {
#if defined __arm64__ || defined __arm64e__
//    dobby_enable_near_branch_trampoline();
    DobbyInstrument((void *)(match), (DBICallTy)SVC80_handler);
//    dobby_disable_near_branch_trampoline();
#endif
}

%ctor {
    const uint8_t target[] = {
        0x01, 0x10, 0x00, 0xD4  //SVC #0x80
    };
    scan_executable_memory(target, sizeof(target), &startHookTarget_SVC80);
}
5 个赞

好的 我看下 谢谢大哥

Undefined symbols for architecture arm64:
“_DobbyInstrument”, referenced from:
_startHookTarget_SVC80 in SVCViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

大哥请问一下是不是非越狱手机不行

别搞了,紫薯布丁

我在去好好看看,麻烦你了大哥 非常感谢

前辈 我用您这个代码去hooh svc 0x80 , SVC80_handler 也触发了, 但是触发后会闪退 是什么情况呢